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 |
---|---|---|---|---|---|---|
No code is needed here | @Override
public void onNothingSelected(AdapterView<?> parent) {
} | {
"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 perish() {\n \n }",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"private void kk12() {\n\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\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"private static void cajas() {\n\t\t\n\t}",
"@Override\n\tprotected void interr() {\n\t}",
"private void strin() {\n\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tpublic void anular() {\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}",
"public void smell() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"public void gored() {\n\t\t\n\t}",
"public final void mo51373a() {\n }",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\r\n \tpublic void process() {\n \t\t\r\n \t}",
"@Override\r\n\tprotected void doF8() {\n\t\t\r\n\t}",
"public void method_4270() {}",
"public void mo38117a() {\n }",
"private void getStatus() {\n\t\t\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"private void test() {\n\n\t}",
"@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}",
"protected void mo6255a() {\n }",
"@Override\r\n\t\t\tpublic void func02() {\n\t\t\t\t\r\n\t\t\t}",
"private void poetries() {\n\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"public void mo4359a() {\n }",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"protected boolean func_70814_o() { return true; }",
"@Override\r\n\tprotected void func03() {\n\t\t\r\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"private void m50366E() {\n }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public abstract void mo70713b();",
"private Rekenhulp()\n\t{\n\t}",
"public void baocun() {\n\t\t\n\t}",
"protected MetadataUGWD() {/* intentionally empty block */}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"private void sub() {\n\n\t}",
"private test5() {\r\n\t\r\n\t}",
"private void init() {\n\n\t}",
"private static void iterator() {\n\t\t\r\n\t}",
"@Override\n\tprotected void prepare() {\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 prepare()\r\n\t{\r\n\r\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo55254a() {\n }",
"public void mo6081a() {\n }",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"private void init() {\n\n\n\n }",
"@Override\n public void memoria() {\n \n }",
"@Override\r\n\t\t\tpublic void test() {\n\t\t\t}",
"@Override\r\n\tprotected void processInit() {\n\r\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tprotected void compute() {\n\t\t\r\n\t}",
"private void level7() {\n }",
"@Override\n\tpublic void jugar() {\n\t\t\n\t}",
"protected OpinionFinding() {/* intentionally empty block */}",
"private void initialize() {\n\t\t\n\t}",
"public void mo21877s() {\n }",
"public abstract void mo56925d();",
"@Override\n public int retroceder() {\n return 0;\n }",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"protected void additionalProcessing() {\n\t}",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"void berechneFlaeche() {\n\t}",
"@Override\n\tprotected void initdata() {\n\n\t}",
"public void mo3376r() {\n }",
"@Override\r\n\tprotected void processInit() {\n\t\t\r\n\t}",
"@Override\n\tpublic void apply() {\n\t\t\n\t}",
"@Override\r\n\tvoid func04() {\n\t\t\r\n\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\n\tpublic void nghe() {\n\n\t}"
] | [
"0.63360983",
"0.6185603",
"0.6170411",
"0.6161416",
"0.60562956",
"0.60558516",
"0.6033801",
"0.59785336",
"0.5971031",
"0.5910027",
"0.59066033",
"0.5904348",
"0.58977604",
"0.58859855",
"0.58859855",
"0.5866238",
"0.58632076",
"0.58480585",
"0.5842323",
"0.58265126",
"0.5781417",
"0.5772032",
"0.57585675",
"0.57572234",
"0.5752515",
"0.5751518",
"0.5745624",
"0.57371813",
"0.5707942",
"0.5703082",
"0.5699618",
"0.56954116",
"0.56795144",
"0.5678132",
"0.5676973",
"0.5675473",
"0.5667375",
"0.5667375",
"0.56542546",
"0.5648884",
"0.5636238",
"0.5620509",
"0.56193465",
"0.5602033",
"0.5602033",
"0.56003046",
"0.56003046",
"0.56003046",
"0.56003046",
"0.56003046",
"0.56003046",
"0.56003046",
"0.5594068",
"0.5583799",
"0.55828655",
"0.5568916",
"0.5566508",
"0.5548124",
"0.5536409",
"0.55353856",
"0.5531256",
"0.5527353",
"0.5516228",
"0.5512617",
"0.55107456",
"0.5510704",
"0.55072",
"0.54978746",
"0.54973644",
"0.5495307",
"0.5494543",
"0.5487856",
"0.5482738",
"0.548175",
"0.548175",
"0.5475925",
"0.54665196",
"0.5464604",
"0.5458485",
"0.54554236",
"0.5454042",
"0.54537076",
"0.54535073",
"0.5452992",
"0.5446027",
"0.5445298",
"0.5438679",
"0.5438679",
"0.5438679",
"0.5438679",
"0.5438679",
"0.5438679",
"0.54384613",
"0.5431763",
"0.5430968",
"0.5430721",
"0.54258174",
"0.54250085",
"0.542197",
"0.5420472",
"0.54175824"
] | 0.0 | -1 |
get the "from" value | public void calculateAndDisplay() {
fromUnitString = fromUnitEditText.getText().toString();
if (fromUnitString.equals("")) {
fromValue = 0;
}
else {
fromValue = Float.parseFloat(fromUnitString);
}
// calculate the "to" value
toValue = fromValue * ratio;
// display the results with formatting
NumberFormat number = NumberFormat.getNumberInstance();
number.setMaximumFractionDigits(2);
number.setMinimumFractionDigits(2);
toUnitTextView.setText(number.format(toValue));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int getFrom() {\n return (from);\n }",
"public int getFrom() {\n return from;\n }",
"public V getFrom()\n\t{\n\t\treturn from;\n\t}",
"public int getFrom() {\n return from_;\n }",
"public String getFrom()\r\n {\r\n return from;\r\n }",
"public Integer getFrom() {\n return from;\n }",
"public int getFrom() {\n return from_;\n }",
"public String getFrom() {\n return from;\n }",
"public String getFrom(){\r\n\t\treturn from;\r\n\t}",
"public long getFrom() {\n return from_;\n }",
"String getFrom();",
"String getFrom();",
"String getFrom();",
"String getFrom();",
"public String getFrom() {\n return from;\n }",
"public long getFrom() {\n return from_;\n }",
"int getFrom();",
"public String getFrom() {\n return from;\n }",
"public int from() {\n return this.from;\n }",
"public String getFrom() {\r\n\t\treturn from;\r\n\t}",
"public String getFrom() {\n\t\treturn from;\n\t}",
"Object getFrom();",
"public int getFromValue() {\n return from_;\n }",
"long getFrom();",
"public String getFrom() {\n\n\t\treturn from;\n\n\t}",
"public int getFromValue() {\n return from_;\n }",
"public int from() {\n return from;\n }",
"public Report.LocationOuterClass.Location.FromType getFrom() {\n Report.LocationOuterClass.Location.FromType result = Report.LocationOuterClass.Location.FromType.valueOf(from_);\n return result == null ? Report.LocationOuterClass.Location.FromType.UNRECOGNIZED : result;\n }",
"public Report.LocationOuterClass.Location.FromType getFrom() {\n Report.LocationOuterClass.Location.FromType result = Report.LocationOuterClass.Location.FromType.valueOf(from_);\n return result == null ? Report.LocationOuterClass.Location.FromType.UNRECOGNIZED : result;\n }",
"@JsonGetter(\"from\")\r\n public String getFrom() {\r\n return from;\r\n }",
"public FromHeader getFrom() {\n return (FromHeader) fromHeader;\n }",
"public Node getFrom() {\n return from;\n }",
"@JsonProperty(\"from\")\n public String getFrom() {\n return from;\n }",
"public String getFromTag() {\n return fromHeader == null? null: fromHeader.getTag();\n }",
"public Vertex getFrom() {\r\n\r\n return from;\r\n }",
"public Integer getFromId() {\n return fromId;\n }",
"int getTo();",
"String getTo();",
"public String getFrom() {\n Object ref = from_;\n if (ref instanceof String) {\n return (String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n String s = bs.toStringUtf8();\n from_ = s;\n return s;\n }\n }",
"@JSProperty(\"from\")\n double getFrom();",
"public XPath getFrom()\n {\n return m_fromMatchPattern;\n }",
"public String getFrom() {\n Object ref = from_;\n if (ref instanceof String) {\n return (String) ref;\n } else {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n String s = bs.toStringUtf8();\n from_ = s;\n return s;\n }\n }",
"long getValidFrom();",
"long getTo();",
"public Vertex<VV> getFrom()\r\n { return from; }",
"public String getFrom() {\n Object ref = from_;\n if (!(ref instanceof String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n String s = bs.toStringUtf8();\n from_ = s;\n return s;\n } else {\n return (String) ref;\n }\n }",
"public String getFrom() {\n Object ref = from_;\n if (!(ref instanceof String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n String s = bs.toStringUtf8();\n from_ = s;\n return s;\n } else {\n return (String) ref;\n }\n }",
"protected Date getFromDate() {\n\t\treturn from;\n\t}",
"public String getFromUser(){\r\n\t\treturn fromUser;\r\n\t}",
"public Square getFrom() {\n return from;\n }",
"private void setFrom (int from) {\n this.from = from;\n }",
"Report.LocationOuterClass.Location.FromType getFrom();",
"protected final int from() {\n if (from >= 0) {\n int result = from;\n from = -1;\n return result;\n }\n assert lastTo >= 0 : \"There hasn't been a last operation so we can't default to its destination!\";\n return lastTo;\n }",
"public String getFromUnit() {\r\n return this.fromUnit;\r\n }",
"public void setFrom(int from) {\n this.from = from;\n }",
"public void setFrom(String from) {\n this.from = from;\n }",
"public void set_from(String from2) {\n\t\tthis.from=from2;\n\t}",
"public long getPhoneFrom() {\r\n return phoneFrom;\r\n }",
"public void setFrom(String from) {\r\n\t\tthis.from= from;\r\n\t}",
"public java.lang.String getFromAddress() {\n\t\treturn fromAddress;\n\t}",
"public String getFromAddress()\n {\n return _fromAddress;\n }",
"public void setFrom(Integer from) {\n this.from = from;\n }",
"public Block getFrom() {\n\t\t\treturn Block.getBlockById(fromId);\n\t\t}",
"public Optional<Tag> capturedFrom() {\n return this.from.get();\n }",
"int getFromValue();",
"public void setFrom(String val) {\n\n\t\tfrom = val;\n\n\t}",
"public String getSnfrom() {\n return snfrom;\n }",
"public Slot getSlotFrom() {\n return slotFrom;\n }",
"public String getcardnumfrom() {\n return (String) getAttributeInternal(CARDNUMFROM);\n }",
"public MailboxList getFrom() {\n return getMailboxList(FieldName.FROM);\n }",
"private String findFrom(String from) {\n\t\tPattern UNIT = Pattern.compile(\"^\\\\w+.\\\\w+(?=\\\\ )\"); // Match two words\n\t\tMatcher m = UNIT.matcher(from);\n\t\twhile (m.find()) {\n\t\t\tfrom = m.group(0);\n\t\t}\n\t\treturn from;\n\t}",
"public Number getQtyFrom() {\n return (Number)getAttributeInternal(QTYFROM);\n }",
"public int getTo() {\n return to;\n }",
"public String getFromStop() {\r\n return fromStop;\r\n }",
"public ScheduleFrom getScheduleFrom()\r\n {\r\n return (m_scheduleFrom);\r\n }",
"public String getFromDate() {\n return fromDate;\n }",
"public int to() {\n return this.to;\n }",
"public String getPortsFrom() {\n return portsFrom.getText();\n }",
"public Node getCameFrom()\n\t{\n\t\treturn cameFrom;\n\t}",
"public int getTo() {\n return to_;\n }",
"public Date getValidFrom();",
"public String getTo()\r\n {\r\n return to;\r\n }",
"public RefLimit getStartFrom() {\n\t\t\treturn startFrom;\n\t\t}",
"public RefLimit getStartFrom() {\n\t\treturn startFrom;\n\t}",
"public Timestamp getValidFrom();",
"public com.callfire.api.data.PhoneNumber xgetFromNumber()\n {\n synchronized (monitor())\n {\n check_orphaned();\n com.callfire.api.data.PhoneNumber target = null;\n target = (com.callfire.api.data.PhoneNumber)get_store().find_element_user(FROMNUMBER$2, 0);\n return target;\n }\n }",
"java.lang.String getFromDate();",
"public long getTo() {\n return to_;\n }",
"public synchronized int getBuildFrom()\n {\n return buildFrom;\n }",
"public V getTo()\n\t{\n\t\treturn to;\n\t}",
"public Date getFromDate()\r\n/* 18: */ {\r\n/* 19:27 */ return this.fromDate;\r\n/* 20: */ }",
"public Date getFromDate() {\n\t\treturn fromDate;\n\t}",
"public String getFromSenderName() {\n return fromSenderName;\n }",
"Object getValueFrom();",
"public int getTo() {\n return to_;\n }",
"ShippingPointStructure getShipFrom();",
"public AbsoluteDate getValidFrom() {\n return validFrom;\n }",
"public long getTo() {\n return to_;\n }",
"@JsonProperty(\"from\")\n public void setFrom(String from) {\n this.from = from;\n }",
"public java.lang.String getIpfrom() {\n return ipfrom;\n }",
"public String getTo() {\n return to;\n }"
] | [
"0.83910704",
"0.8270011",
"0.81545186",
"0.81375086",
"0.8098487",
"0.80856794",
"0.80158365",
"0.7980357",
"0.79638654",
"0.79292566",
"0.7908973",
"0.7908973",
"0.7908973",
"0.7908973",
"0.78929275",
"0.7848456",
"0.78393936",
"0.7799334",
"0.7750333",
"0.772615",
"0.76510125",
"0.76263785",
"0.7613051",
"0.750371",
"0.746754",
"0.7467124",
"0.725238",
"0.7245912",
"0.72356683",
"0.7125867",
"0.7031391",
"0.6985289",
"0.6915458",
"0.6765079",
"0.67623395",
"0.67234147",
"0.665736",
"0.6579271",
"0.65659714",
"0.65640074",
"0.6562039",
"0.6537808",
"0.6523662",
"0.6518529",
"0.65132815",
"0.6502356",
"0.6502356",
"0.64770675",
"0.6469127",
"0.63985187",
"0.6394098",
"0.637375",
"0.6361132",
"0.6330359",
"0.63144034",
"0.63046896",
"0.62817746",
"0.62621146",
"0.62590563",
"0.61908704",
"0.6184235",
"0.61740077",
"0.61628956",
"0.611449",
"0.6068429",
"0.6062912",
"0.60607404",
"0.60297686",
"0.6027921",
"0.6023961",
"0.6018011",
"0.6001121",
"0.5996872",
"0.59936696",
"0.5979201",
"0.59499615",
"0.5913191",
"0.58950967",
"0.5892936",
"0.5873733",
"0.5840986",
"0.583791",
"0.5835695",
"0.5819958",
"0.5815551",
"0.58090144",
"0.580304",
"0.5792488",
"0.5791307",
"0.57725793",
"0.577011",
"0.57161546",
"0.5698205",
"0.56924945",
"0.56893265",
"0.56690663",
"0.5665077",
"0.56626433",
"0.5660161",
"0.5655836",
"0.565316"
] | 0.0 | -1 |
Overloaded constructor which takes in an ItemContainer and immediately populates the inventory TreeSet with Films and TvSeries objects | public Model(ItemContainer i) {//takes from the container
inventory.addAll(i.getFilms());
inventory.addAll(i.getTvseries());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Inventory(){\n this.items = new ArrayList<InventoryItem>(); \n }",
"public Inventory() {\n this.SIZE = DEFAULT_SIZE;\n this.ITEMS = new ArrayList<>();\n }",
"public Inventory() {\n \titems = new ArrayList<Collectable>();\n \tnumTokens = 0;\n }",
"public InventoryItem(String name) { \n\t\tthis(name, 1);\n\t}",
"public SeqItemset(SeqItemset s)\n\t{\n\t\tm_size = s.m_size;\n\t\tm_elems = new short[m_size];\n\t\t//m_itemset = new SeqItem[m_size];\n\t\tfor (int i=0; i<m_size; i++)\n\t\t\tm_elems[i] = s.m_elems[i];\n\t}",
"public ItemCollection()\n\t{\n\t\t/*\n\t\t * master list of all consumable/miscellaneous items in the game\n\t\t * \n\t\t * to add a new item to the game, add the item to the itemCollections, and if it is a consumable,\n\t\t * add the effect to the useItem method in the switch statement. If it has no effect, don't add anything.\n\t\t * \n\t\t * sorted by NAME, VALUE, DESCRIPTION, TYPE\n\t\t */\n\t\t\n\t\t//CONSUMABLES\n\t\titemCollections.add(new Item(\"Polar Pop\", 1, \"Do you ever drink water?\", \"Consumable\"));\n\t\titemCollections.add(new Item(\"Klondike Bar\", 20, \"What would you do for this?\", \"Consumable\"));\n\t\titemCollections.add(new Item(\"Big tiddy goth GF\", 666, \"Vore.\", \"Consumable\"));\n\t\t\n\t\t//MISC, i.e. NO STATUS EFFECT\n\t\titemCollections.add(new Item(\"Sippy Cup\", 9, \"Somebody otta get their child their sippy cup back.\", \"Misc\"));\n\t\t\n\t\t/*\n\t\t * master list of equipment items in the game\n\t\t * \n\t\t * same as above\n\t\t * \n\t\t * sorted by NAME, VALUE, DESCRIPTION, TYPE, DAMAGE, DEFENSE, VITALITY, INTELLIGENCE, STRENGTH, WISDOM\n\t\t */\n\t\t\n\t\t//2H-WEAPONS\n\t\tequipmentCollections.add(new Equipment(\"A Big Boy's Sword\", 69, \"A two- handed sword for a big boy like you... You're growing up so fast!\", \"2H-Weapon\", 10, 0, 0, 0, 0, 0));\n\t\t\n\t\t//1H-WEAPONS\n\t\tequipmentCollections.add(new Equipment(\"Red Copper Pan\", 300, \"Hey there mothafuckas it's ya girl cathy, I got some brand new shit\", \"1H-Weapon\", 250, 0, 25, 3, 25, 3));\n\t\t\n\t\t//HEAD\n\t\tequipmentCollections.add(new Equipment(\"Broken Helmet\", 1, \"Leather helmet broken from thousands of years of war and abuse\", \"Head\", 0, 3, 0, 0, 0, 0));\n\t\t\n\t\t//TORSO\n\t\tequipmentCollections.add(new Equipment(\"Bloodied Tunic\", 1, \"Tunic covered in your own blood, you can see your wounds through its holes\", \"Torso\", 0, 2, 0, 0, 0, 0));\n\t\t\n\t\t//ARMS\n\t\tequipmentCollections.add(new Equipment(\"Torn Gloves\", 1, \"Gloves so torn they hardly protect your hands\", \"Arms\", 0, 1, 0, 0, 0, 0));\n\t\t\n\t\t//LEGS\n\t\tequipmentCollections.add(new Equipment(\"Muddy Pants\", 1, \"Cloth pants soiled in mud\", \"Legs\", 0, 2, 0, 0, 0, 0));\n\t\t\n\t\t//FEET\n\t\tequipmentCollections.add(new Equipment(\"Worn Boot\", 1, \"A boot with a hole in it, but where is the other one?\", \"Feet\", 0, 1, 0, 0, 0, 0));\n\t}",
"public Inventory () {\n weaponsInventory = new ArrayList<>();\n pointInventory = 0;\n lenInventory = 0;\n }",
"public InventoryItem(){\r\n this.itemName = \"TBD\";\r\n this.sku = 0;\r\n this.price = 0.0;\r\n this.quantity = 0;\r\n nItems++;\r\n }",
"Item(){\r\n\t\tthis(0, new Weight(5), new DukatAmount(0));\r\n\t}",
"public static void main (String args[]){\n\t\n\tCargoContainer test1 = new CargoContainer(\"Austin\", 800, 8000);\n\tCargoContainer test2 = new CargoContainer(\"Swathi\", 10000, 10000000);\n\tCargoItem item1 = new CargoItem(\"Toys\", 200, 10, 20, 10); //Volume= 2000\n\tCargoItem item2 = new CargoItem(\"Pens\", 50, 50, 20, 5); //Volume= 5000\n\tCargoItem item3 = new CargoItem(\"Trucks\", 5000, 500, 500, 10); //Volume= 2500000\n\t\n\tSystem.out.println(test1);\n\ttest1.addItem(item1);\n\tSystem.out.println(test1);\n\ttest1.addItem(item2);\n\tSystem.out.println(test1);\n\ttest1.addItem(item3);\n\ttest2.addItem(item3);\n\tSystem.out.println(test2);\n\ttest1.removeItem(item1);\n\tSystem.out.println(test1);\n}",
"public Item(Environment e) {\n\t\tthis(0,0,e);\n }",
"public Inventory() {\r\n invPower = 0;\r\n invDefense = 0;\r\n invSpeed = 0;\r\n invAwareness = 0;\r\n treasures = new ArrayList<>();\r\n }",
"public Item()\n {\n super();\n }",
"public Inventory(int INVENTORY_SLOTS) {\n\t\tsuper();\n\t\tthis.inventoryItems = new Item[INVENTORY_SLOTS];\n\t\tthis.INVENTORY_SLOTS = INVENTORY_SLOTS;\n\t}",
"public Source(String name, String description, String story, double mass, \n String itemtype, String itemname, String itemdescription, String itemstory, \n double itemmass, double itemnutrition) \n {\n super(name, description, story, mass);\n this.itemtype = itemtype;\n \n this.itemname = itemname;\n this.itemdescription = itemdescription;\n this.itemstory = itemstory; \n this.itemmass = itemmass;\n this.itemnutrition = itemnutrition;\n \n //creates item of the type itemtype, which is specified upon creation of the source\n if(itemtype.equals(\"Drink\")) {new Drink(itemname, itemdescription, itemstory, itemmass, itemnutrition);}\n else if(itemtype.equals(\"Food\")) {new Food (itemname, itemdescription, itemstory, itemmass, itemnutrition);}\n else if(itemtype.equals(\"Item\")) {item = new Item (itemname, itemdescription, itemstory, itemmass);} \n }",
"public Inventory(Inventory referenceInventory) {\n \titems = new ArrayList<Collectable>();\n \t//Clone items list.\n \tfor (Collectable item : referenceInventory.getItems()) {\n \t\titems.add(item);\n \t}\n \t//Clone num tokens.\n \tnumTokens =\treferenceInventory.numTokens;\n }",
"public Data(String itemId, String itemDescription, String unitPrice, int inventory) {\n this.itemId = itemId;\n this.itemDescription = itemDescription;\n this.unitPrice = unitPrice;\n this.inventory = inventory;\n }",
"public Recipes()\n {\n\t\titems = new ArrayList<food>();\n }",
"public InteractiveEntity(ArrayList<Item> items) {\n\t\tsuper();\n\t\tthis.inventory.addAll(items);\n\t}",
"public POJOCompteItem() {\n compte = new TreeMap<Date, Integer>();\n items = new ArrayList<Item>();\n }",
"public Inventory() {\r\n initialize();\r\n }",
"public Item(){}",
"public Item() {\r\n this.name = \"\";\r\n this.description = \"\";\r\n this.price = 0F;\r\n this.type = \"\";\r\n this.available = 0;\r\n this.wholesaler = new Wholesaler();\r\n this.wholesalerId = 0;\r\n this.category = new Category();\r\n this.categoryId = 0; \r\n }",
"public InventoryEntry() {\n super();\n }",
"public Item() {\n\t}",
"public Item() {\n\t}",
"public ItemManager() {\n itemMap = new HashMap<>();\n importantItemList = new ArrayList<>();\n\n }",
"public Item()\r\n {\r\n // Initialize instance variables\r\n \r\n }",
"protected PickaxeItem(Tier debug1, int debug2, float debug3, Item.Properties debug4) {\n/* 100 */ super(debug2, debug3, debug1, DIGGABLES, debug4);\n/* */ }",
"public ParsedContainer()\r\n {\r\n container = new ItemContainer();\r\n hidden = false;\r\n }",
"public Item(String itemName, String itemDescription){\n this.itemName = itemName;\n this.itemDescription = itemDescription;\n}",
"public void addItems() {\r\n\t\tproductSet.add(new FoodItems(1000, \"maggi\", 12.0, 100, new Date(), new Date(), \"yes\"));\r\n\t\tproductSet.add(new FoodItems(1001, \"Pulses\", 55.0, 50, new Date(), new Date(), \"yes\"));\r\n\t\tproductSet.add(new FoodItems(1004, \"Meat\", 101.53, 5, new Date(), new Date(), \"no\"));\r\n\t\tproductSet.add(new FoodItems(1006, \"Jelly\", 30.0, 73, new Date(), new Date(), \"no\"));\r\n\t\t\r\n\t\tproductSet.add(new Apparels(1005, \"t-shirt\", 1000.0, 10, \"small\", \"cotton\"));\r\n\t\tproductSet.add(new Apparels(1002, \"sweater\", 2000.0, 5,\"medium\", \"woolen\"));\r\n\t\tproductSet.add(new Apparels(1003, \"cardigan\", 1001.53,22, \"large\", \"cotton\"));\r\n\t\tproductSet.add(new Apparels(1007, \"shirt\", 500.99, 45,\"large\",\"woolen\"));\r\n\t\t\r\n\t\tproductSet.add(new Electronics(1010, \"tv\", 100000.0, 13, 10));\r\n\t\tproductSet.add(new Electronics(1012, \"mobile\", 20000.0, 20,12));\r\n\t\tproductSet.add(new Electronics(1013, \"watch\", 1101.53,50, 5));\r\n\t\tproductSet.add(new Electronics(1009, \"headphones\", 300.0, 60,2));\r\n\t\t\r\n\t}",
"@Override\r\n\tpublic void setInventoryItems() {\n\t\t\r\n\t}",
"public Item() {}",
"public Item() \r\n\t{\r\n\t\tname = \"AbstractItem\";\r\n\t\tdescription = \"Example Item Generated\";\r\n\t\tprice = 0;\r\n\t}",
"public NewItems() {\n super();\n }",
"public Item() {\n }",
"public Item() {\n }",
"private void createItems()\n {\n Item belt, nappies, phone, money, cigarretes, \n jacket, cereal, shoes, keys, comics, bra, \n bread, bowl, computer;\n\n belt = new Item(2,\"Keeps something from falling\",\"Belt\");\n nappies = new Item(7,\"Holds the unspeakable\",\"Nappies\");\n phone = new Item(4, \"A electronic device that holds every answer\",\"Iphone 10\");\n money = new Item(1, \"A form of currency\",\"Money\");\n cigarretes = new Item(2,\"It's bad for health\",\"Cigarretes\");\n jacket = new Item(3,\"Keeps you warm and cozy\", \"Jacket\");\n cereal = new Item(3, \"What you eat for breakfast\",\"Kellog's Rice Kripsies\");\n shoes = new Item(5,\"Used for walking\", \"Sneakers\");\n keys = new Item(2, \"Unlock stuff\", \"Keys\");\n comics = new Item(2, \"A popular comic\",\"Batman Chronicles\");\n bra = new Item(3,\"What is this thing?, Eeeewww\", \"Bra\");\n bread = new Item(6,\"Your best source of carbohydrates\",\"Bread\");\n bowl = new Item(4,\"where food is placed\",\"Plate\");\n computer = new Item(10,\"A computational machine\",\"Computer\");\n\n items.add(belt);\n items.add(nappies);\n items.add(phone);\n items.add(money);\n items.add(cigarretes);\n items.add(jacket);\n items.add(cereal);\n items.add(shoes);\n items.add(keys);\n items.add(comics);\n items.add(bra);\n items.add(bread);\n items.add(bowl);\n items.add(computer);\n }",
"public Item(\n int itemId ,\n int currentQty ,\n int minQty ,\n int maxQty ,\n BufferedImage icon ,\n String label, \n String desc ,\n String attr)\n {\n this.itemId = itemId ;\n this.currentQty=currentQty;\n this.minQty=minQty;\n this.maxQty=maxQty;\n this.icon=icon;\n this.label=label;\n }",
"public Items(String image, int y, int x) {\r\n\t\tsuper(image, y, x);\r\n\t}",
"private Item(){}",
"public Item(Integer itemSlot) {\n this.itemSlot = itemSlot;\n }",
"public Items() {\n equipments = new ArrayList();\n\n SelectItemGroup first = new SelectItemGroup(\"braking\");\n SelectItemGroup second = new SelectItemGroup(\"equipment\");\n \n SelectItem[] array1 = {new SelectItem(\"abs\"), new SelectItem(\"esp\")}; \n SelectItem[] array2 = {new SelectItem(\"radio\"), new SelectItem(\"gps\"), new SelectItem(\"mobil set\")};\n \n first.setSelectItems(array1);\n second.setSelectItems(array2);\n \n equipments.add(first);\n equipments.add(second);\n }",
"public Item()\r\n\t{\r\n\t\tserialNum = 00000;\r\n\t\tweight = 0.0;\r\n\t}",
"public BaseInventory (long id) {\r\n\t\tsuper(id);\r\n\t}",
"public InventoryList() {\n super(\"Inventory List\");\n }",
"public EntityHierarchyItem() {\n }",
"public DessertItem() {\n this(\"\");\n }",
"Items(int quantidade,Produto produto){\n\t\tqntd = quantidade;\n\t\tthis.produto = produto;\n\t\t\n\t}",
"Item(DukatAmount price){\r\n\t\tthis(0, new Weight(5), price);\r\n\t}",
"public ProductContainerImpl()\r\n {\r\n assert(true);\r\n groups = new TreeSet<ChangableProductContainer>();\r\n products = new TreeSet<ProductBarcode>();\r\n ID = BarcodeGenerator.instance().generatePCID();\r\n }",
"public VendingMachine(List<Item> items) {\r\n updateInventory(items);\r\n moneyLog = new Money();\r\n }",
"@SuppressWarnings(\"unused\")\n public Item() {\n }",
"protected StockItem()\r\n \t{\r\n \t\tlimit = new LimitSystem(this);\r\n \t}",
"public Item(){\n description = \"No description avaible for this item\";\n weight = 0;\n }",
"Items(double cost){\n\tthis.cost=cost;\n\titemId++;\n\tcurrentID=itemId;\n}",
"public ItemInfo () {}",
"public Player()\n {\n inventory = new ArrayList<Item>();\n currentRoom=0;\n }",
"public StockItem(T product, Integer quantity) {\n this.product = product;\n this.quantity = quantity;\n }",
"private Item initItem() {\n String name = inputName.getText().toString();\n int quantityToBuy = -1;\n if (!inputQuantityToBuy.getText().toString().equals(\"\"))\n quantityToBuy = Integer.parseInt(inputQuantityToBuy.getText().toString());\n String units = inputUnits.getText().toString();\n double price = 0;\n if (!inputPrice.getText().toString().equals(\"\"))\n price = Double.parseDouble(inputPrice.getText().toString());\n int calories = 0;\n if (!inputCalories.getText().toString().equals(\"\"))\n calories = Integer.parseInt(inputCalories.getText().toString());\n ArrayList<String> allergies = allergyActions.getAllergies();\n return new Item(name, 0, units, quantityToBuy, 0, allergies, calories, price);\n }",
"public Stack() {\r\n\t\tthis.items = new ArrayList<>();\t\r\n\t}",
"public GroceryBSTNode inventoryAdd (TheGroceryStore g);",
"public Inventory(Integer size, ItemStack... items) {\n this.setSize((size == 0) ? 2147483647 : size);\n for (ItemStack stack : items) {\n ITEMS.add(stack);\n }\n }",
"public ItemRecord() {\n super(Item.ITEM);\n }",
"@SuppressWarnings(\"deprecation\")\n public IClass(ConfigurationSection cs)\n {\n this.items = new ArrayList<>();\n\n this.name = cs.getString(\"name\").replace(\"&\", \"§\");\n this.description = cs.getString(\"description\").replace(\"&\", \"§\");\n this.permission = cs.getString(\"permission\");\n\n this.helmet = Material.getMaterial(cs.getInt(\"armor.helmet\"));\n this.chestplate = Material.getMaterial(cs.getInt(\"armor.chestplate\"));\n this.leggings = Material.getMaterial(cs.getInt(\"armor.leggings\"));\n this.boots = Material.getMaterial(cs.getInt(\"armor.boots\"));\n\n for (String s : cs.getStringList(\"items\"))\n {\n String[] ss = s.split(\",\");\n int id = Integer.parseInt(ss[0]);\n int amount = Integer.parseInt(ss[1]);\n short damage = Short.parseShort(ss[2]);\n ItemStack is = new ItemStack(Material.getMaterial(id), amount, damage);\n items.add(is);\n }\n }",
"public Player(Room room)\n {\n Inventory = new HashMap<String, Items>();\n currentRoom = room; //Starting Room Number 1\n itemsHeld = 0; //Start with no items being held\n itemLimit = 2; // can only hold 2 items until a backpack\n Inventory = new HashMap<String, Items>();\n \n roomHistory = new Stack<Room>();\n \n haveBackpack = false; //no backpack at start\n usingFlashlight = false;\n }",
"ProductInventory()\n\t{\n\n\t\t// Initialize the Product Inventory Array List\n\t\tmyProductInventory = new ArrayList<Product>();\n\n\t}",
"public Item(String initName, String itemDesc)\n {\n // initialise instance variables\n name = initName;\n desc = itemDesc;\n }",
"public void setUpInventoryItemViewModel() {\n GameManager mockGameManager = Mockito.mock(GameManager.class);\n ContentViewModelDao mockViewModelDao = Mockito.mock(ContentViewModelDao.class);\n\n // mock item\n Item mockItem = Mockito.mock(Item.class);\n Item mockUpgradeItem = Mockito.mock(Item.class);\n when(mockItem.getDescription()).thenReturn(\"some description\");\n when(mockUpgradeItem.getName()).thenReturn(\"some upgrade item name\");\n when(mockItem.getUpgradeStage()).thenReturn(mockUpgradeItem);\n when(mockItem.getUseTime()).thenReturn(10);\n when(mockItem.getUpgradeTime()).thenReturn(30);\n\n contentViewModel = new InventoryItemViewModel(mockGameManager, mockItem, mockViewModelDao);\n }",
"public SeqItemset createExtendedWith(SeqItem it){\n\t\tSeqItemset newSet = new SeqItemset(m_itemset.length+1);\n\t\tSystem.arraycopy(m_itemset,0,newSet.m_itemset, 0, m_itemset.length);\n\t\tnewSet.m_itemset[m_itemset.length] = it;\n\t\treturn newSet;\n\t}",
"public Inventory()\r\n\t{\r\n\t\t_tiles = new ArrayList<Tile>();\r\n\t\t\r\n\t\tfor(int i = 'A'; i <= 'Z'; i++)\r\n\t\t{\r\n\t\t\tswitch(i)\r\n\t\t\t{\r\n\t\t\tcase 'A':\r\n\t\t\tcase 'E':\r\n\t\t\tcase 'I':\r\n\t\t\tcase 'O':\r\n\t\t\tcase 'U':\r\n\t\t\t\tfor(int j = 0; j < 29; j++)\r\n\t\t\t\t{\r\n\t\t\t\t\t_tiles.add(new Tile((char) i));\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'Y':\r\n\t\t\t\tfor(int j = 0; j < 15; j++)\r\n\t\t\t\t{\r\n\t\t\t\t\t_tiles.add(new Tile((char) i));\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tfor(int j = 0; j < 12; j++)\r\n\t\t\t\t{\r\n\t\t\t\t\t_tiles.add(new Tile((char) i));\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\t\r\n\t\tthis.shuffle();\r\n\t}",
"public TileItem(Game game, Element e) {\n super(game, e);\n }",
"public InventoryTemplate() {\n this.layoutDatabase = null;\n this.layoutItemDatabase = null;\n this.guiButtons = new HashMap<>();\n this.inventoryType = InventoryType.CHEST;\n this.placeholders = new ArrayList<>();\n this.layout = new HashMap<>();\n this.rawLayout = new ArrayList<>();\n }",
"public MinMaxTreeNode(T item)\n\t{\n\t\t_state=item;\n\t\t_sons=new Vector<MinMaxTreeNode<T>>();\n\t}",
"public Item_Record() {\n super(Item_.ITEM_);\n }",
"public OrdinaryTruck(int itemQuantity)\n {\n this.itemQuantity = itemQuantity;\n }",
"public ItemsAdapter() {\n\n\n }",
"private Itemsets() {\n\t\t\tfrequentItemsets = new LinkedHashMap<Itemset, Integer>();\n\t\t\tinfrequentItemsets = new LinkedHashMap<Itemset, Integer>();\n\t\t}",
"public Objects(String item, double baseprice){\r\n this.item = item;\r\n this.baseprice = baseprice;\r\n }",
"public CustomShirt(int itemID, String description, char colorCode, double price, int orders) {\n\n super( itemID, description, colorCode, price, orders);\n\n }",
"public TreeItem() {\n\t\tsuper();\n\t\tdecideNorm = true;\n\t\tisNorm = true;\n\n\t}",
"public GItem(Item i) {\n this.mGItem = i.getId();\n this.title = i.getTitle();\n\n if (!i.getAddress().equals(\"\")){\n this.address = i.getAddress();\n }\n\n if (i instanceof OfficerItem){\n this.type = 1;\n\n } else if (i instanceof CompanyItem){\n this.type = 0;\n }\n\n }",
"@Test\n public void constructorInitializesAllItemsInUnknownState() {\n FirstAidItem firstAidItem = Tests.buildFirstAidItem(Point.pt(2.5, 3.5));\n WeaponItem weaponItem = Tests.buildWeaponItem(Point.pt(1.5, 0.5), Weapon.WeaponType.HANDGUN);\n\n Bot bot = Tests.mockBot();\n ItemMemory itemMemory = new ItemMemory(bot, asList(firstAidItem, weaponItem));\n\n assertThat(itemMemory.get(firstAidItem).getState(), is(ItemMemoryRecord.State.UNKNOWN));\n assertThat(itemMemory.get(weaponItem).getState(), is(ItemMemoryRecord.State.UNKNOWN));\n }",
"public HistoryEntryInventory(String itemName, Integer amount) {\n timestamp = new Date(); //Current time\n this.itemName = itemName;\n this.amount = amount;\n }",
"public Item(final int t, final int i, final int c) {\n\t\ttype = t;\n\t\tid = i;\n\t\tcount = c;\n\t\t//type = ItemType.BLOCK;\n\t}",
"public AbstractMetamodelRepository(Set<T> items) {\n setItems(items);\n }",
"public static Items initialVendingMachine() {\n Items items = new Items();\n Item cola = new Item(R.drawable.cola, \"Cola\", 30, 100, 3000, 0);\n Item chips = new Item(R.drawable.chips, \"Chips\", 30, 50, 3000, 0);\n Item candy = new Item(R.drawable.candy, \"Candy\", 30, 65, 3000, 0);\n items.addItem(cola);\n items.addItem(chips);\n items.addItem(candy);\n items.addMachineCredit(5000);\n return items;\n }",
"Items(){\r\n\t\tname=new String[]{\r\n\t\t\t\t\"\",\r\n\t\t\t\t//Parts to the vaccine[1-3]\r\n\t\t\t\t\"Mysterious Vial\", \"Piece of alien meteorite\",\"Alien X\",\r\n\t\t\t\t//Keys[4-6]\r\n\t\t\t\t\"Mysterious Key\",\"Office Key\",\"Captian's Key\",\r\n\t\t\t\t//suit[7,8]\r\n\t\t\t\t\"Hazmat Suit\",\"Gas Mask\",\r\n\t\t\t\t//vials[9-11]\r\n\t\t\t\t\"Blue Vial\",\"Pink Vial\", \"Gold Vial\",\r\n\t\t\t\t//other[12,13]\r\n\t\t\t\t\"X Files\", \"Demon's Bane Flower\",\"Reinforced Armor\"\r\n\t\t};\r\n\t\tdescription=new String[]{\r\n\t\t\t\t\"\",\r\n\t\t\t\t//vaccine parts[2-4]\r\n\t\t\t\t\"A special vial coated with a mysterious substance\",\r\n\t\t\t\t\"Part of an alien meteorite that the crew excavated\",\r\n\t\t\t\t\"A powerful allergen that instantly kills one’s immune system and their whole well-being, mutating them into something inhuman\",\r\n\t\t\t\t//keys\r\n\t\t\t\t\"A metal key that must open a door\",\r\n\t\t\t\t\"Looks like a normal key\",\r\n\t\t\t\t\"A metal key used to unlock something\",\r\n\t\t\t\t//Suit\r\n\t\t\t\t\"A full-body suit designed to keep harmful toxins away from the wearer. The face mask is missing, however\",\r\n\t\t\t\t\"A mask that goes over the wearer’s head and filters out all harmful substances in the air\",\r\n\t\t\t\t//Vials\r\n\t\t\t\t\"A vial similar to the ones in the DNA Library, it glows light blue\",\r\n\t\t\t\t\"A vial similar to the ones in the DNA Library, it glows bright pink\",\r\n\t\t\t\t\"A vial similar to the ones in the DNA Library, it glows golden yellow\",\r\n\t\t\t\t//other\r\n\t\t\t\t\"Recorded documentation of all experiments and research done while in space. Most importantly it contains reports on events leading up to the virus spreading throughout the ship\",\r\n\t\t\t\t\"A beautiful flower that seems to survive unattached to the ground, the veins running through its petals give a faint glow as a heavenly scent fills the room\",\r\n\t\t\t\t\"A set of fine leather armor with metal plates reinforcing vulnerable areas\"\r\n\t\t};\r\n\t}",
"protected void putItems() {\n\t\tlevelSetup[0][5].putItem(new Dynamite());\n\t\tlevelSetup[6][6].putItem(new Flint());\n\t\tlevelSetup[6][3].putItem(new ManaPotion());\n\t\tlevelSetup[5][0].putItem(new ManaPotion());\n\t\tlevelSetup[2][1].putItem(new HealthPotion());\n\t\tlevelSetup[3][6].putItem(new HealthPotion());\n\t\tlevelSetup[4][2].putItem(new Spinach());\n\t}",
"Item(int i, String n, String c, double p) {\n this.id = i;\n this.name = n;\n this.category = c;\n this.price = p;\n }",
"public TVSets(String productId, String name, double price, int quantity, double displaySize) {\n\t\tsuper(productId, name, price, quantity);\n\t\tthis.displaySize = displaySize;\n\t}",
"public Inventory(int max) {\n items = new Item[max];\n }",
"protected abstract Item createTestItem1();",
"Item(long ID, DukatAmount price){\r\n\t\tthis(ID, new Weight(5), price);\r\n\t}",
"protected Item() {\n }",
"public KeyedItem(Comparable key,\n T item)\n {\n this.key = key;\n this.item = item;\n this.valid = true;\n }",
"public SkillInventory(int capacity) {\n inventory = new Skill[capacity];\n isActive = new boolean[capacity];\n cooldown = new float[capacity];\n weighting = new float[capacity];\n projectiles = new DynamicHitbox[capacity];\n }",
"public DataNode(Item item, ParentNode parent) {\n m_item = item;\n m_parent = parent;\n AnnotatedBase comp = item.getSchemaComponent();\n int comptype = comp.type();\n m_named = (comptype == SchemaBase.ATTRIBUTE_TYPE || comptype == SchemaBase.ELEMENT_TYPE) &&\n ((INamed)comp).getName() != null;\n Item topmost = item.getTopmost();\n boolean optional = topmost.isOptional();\n if (parent != null && ((GroupItem)parent.getItem()).isInline() && !parent.isNamed()) {\n optional = optional || parent.isOptional();\n }\n m_optional = optional;\n m_ignored = item.isIgnored();\n if (m_ignored) {\n m_type = null;\n m_collection = false;\n } else {\n boolean collection = topmost.isCollection();\n if (item instanceof ValueItem) {\n \n // value item will always be a primitive or wrapper value\n JavaType jtype = ((ValueItem)item).getType();\n m_type = jtype.getPrimitiveName();\n if (m_type == null || topmost.isOptional() || topmost.isCollection() || parent.isCollection()) {\n m_type = jtype.getClassName();\n }\n \n } else if (item instanceof ReferenceItem) {\n \n // reference item as value will always be a reference to the definition class\n m_type = ((ReferenceItem)item).getDefinition().getGenerateClass().getFullName();\n \n } else if (item instanceof AnyItem) {\n \n // xs:any handling determines value type\n switch (item.getComponentExtension().getAnyType()) {\n \n case NestingCustomBase.ANY_DISCARD:\n m_type = null;\n collection = false;\n break;\n \n case NestingCustomBase.ANY_DOM:\n m_type = \"org.w3c.dom.Element\";\n break;\n \n case NestingCustomBase.ANY_MAPPED:\n m_type = \"java.lang.Object\";\n break;\n \n default:\n throw new IllegalStateException(\"Internal error - unknown xs:any handling\");\n \n }\n \n } else if (!((GroupItem)item).isInline()) {\n \n // group item as value will always be a reference to the group class\n m_type = ((GroupItem)item).getGenerateClass().getFullName();\n \n }\n m_collection = collection;\n }\n if (parent != null) {\n parent.addChild(this);\n }\n }",
"Items(){\n}"
] | [
"0.62978226",
"0.60061526",
"0.6005471",
"0.594855",
"0.5910906",
"0.59072316",
"0.58442867",
"0.58039486",
"0.575063",
"0.5744364",
"0.5735079",
"0.57006115",
"0.568058",
"0.56562215",
"0.5649755",
"0.56397206",
"0.56152004",
"0.5554898",
"0.55505836",
"0.5548847",
"0.5540709",
"0.5538134",
"0.5534851",
"0.552416",
"0.5513239",
"0.5513239",
"0.55094",
"0.5503684",
"0.55023575",
"0.5500601",
"0.54941696",
"0.54788756",
"0.5475542",
"0.5470454",
"0.5467031",
"0.5450692",
"0.5441567",
"0.5441567",
"0.54377687",
"0.54333556",
"0.5411881",
"0.53991973",
"0.5398957",
"0.53860515",
"0.53583604",
"0.53548765",
"0.5341989",
"0.53257155",
"0.53234756",
"0.5312207",
"0.5308449",
"0.530307",
"0.5292655",
"0.5274552",
"0.5273387",
"0.52529633",
"0.5248251",
"0.5245501",
"0.52432454",
"0.52352047",
"0.52168477",
"0.5209513",
"0.52014685",
"0.5201277",
"0.519022",
"0.5185486",
"0.51679623",
"0.51657283",
"0.51657015",
"0.51596826",
"0.5153727",
"0.5148983",
"0.51405156",
"0.5120281",
"0.51194406",
"0.5111212",
"0.510264",
"0.50818753",
"0.5078828",
"0.5077991",
"0.50725484",
"0.5071825",
"0.50716823",
"0.5064851",
"0.5064806",
"0.50495154",
"0.50435793",
"0.50432336",
"0.50368065",
"0.50304216",
"0.501867",
"0.50117916",
"0.50096357",
"0.5009329",
"0.50045335",
"0.5002922",
"0.5001846",
"0.49982285",
"0.4996789",
"0.49927115"
] | 0.73362327 | 0 |
Method that populates the everyGenre TreeMap from the Genres ArrayList in the ItemContainer | public void populateGenreMap(ItemContainer itemContainer) {
for (Genres genre : itemContainer.getGenres()) {
if (everyGenre.containsKey(genre.getGenre())) {
TreeSet<Genres> genres = everyGenre.get(genre.getGenre());
genres.add(genre);
everyGenre.put(genre.getGenre(), genres);
} else {
TreeSet<Genres> tempSet = new TreeSet<Genres>();
tempSet.add(genre);
everyGenre.put(genre.getGenre(), tempSet);
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void createGenres() {\n ArrayList<String> gen = new ArrayList<>();\n //\n for (Movie mov : moviedb.getAllMovies()) {\n for (String genre : mov.getGenre()) {\n if (!gen.contains(genre.toLowerCase()))\n gen.add(genre.toLowerCase());\n }\n }\n\n Collections.sort(gen);\n\n genres = gen;\n }",
"public void populatePeopleMap(ItemContainer itemContainer) {\n\t\tfor (People person : itemContainer.getPeople()) {\n\t\t\tif (everyPerson.containsKey(person.getName())) {\n\t\t\t\tTreeSet<People> people = everyPerson.get(person.getName());\n\t\t\t\tpeople.add(person);\n\t\t\t\teveryPerson.put(person.getName(), people);\n\t\t\t} else {\n\t\t\t\tTreeSet<People> tempSet = new TreeSet<People>();\n\t\t\t\ttempSet.add(person);\n\t\t\t\teveryPerson.put(person.getName(), tempSet);\n\t\t\t}\n\t\t}\n\t}",
"public void testGenreSort() {\n sorter.inssortGenre();\n list = sorter.getLibrary();\n assertEquals(list.get(0).getGenre(), \"Hip-Hop\");\n assertEquals(list.get(1).getGenre(), \"R&B\");\n assertEquals(list.get(2).getGenre(), \"Rock\");\n }",
"private static void addToGenreTable(BookDetails book, String bookTitle) {\n\t\t//ALL_GENRES representation --> Biology|Mathematics|Chemistry|Physics|Science_Fiction|Fantasy|Action|Drama|Romance|Horror|History|Autobiography|Biography \n\t\tswitch(book.getGenre()){\n\t\t\tcase Biology:\n\t\t\t\tALL_GENRES.get(0).add(bookTitle);\n\t\t\t\tbreak;\n\t\t\tcase Mathematics:\n\t\t\t\tALL_GENRES.get(1).add(bookTitle);\n\t\t\t\tbreak;\n\t\t\tcase Chemistry:\n\t\t\t\tALL_GENRES.get(2).add(bookTitle);\n\t\t\t\tbreak;\n\t\t\tcase Physics:\n\t\t\t\tALL_GENRES.get(3).add(bookTitle);\n\t\t\t\tbreak;\n\t\t\tcase Science_Fiction:\n\t\t\t\tALL_GENRES.get(4).add(bookTitle);\n\t\t\t\tbreak;\n\t\t\tcase Fantasy:\n\t\t\t\tALL_GENRES.get(5).add(bookTitle);\n\t\t\t\tbreak;\n\t\t\tcase Action:\n\t\t\t\tALL_GENRES.get(6).add(bookTitle);\n\t\t\t\tbreak;\n\t\t\tcase Drama:\n\t\t\t\tALL_GENRES.get(7).add(bookTitle);\n\t\t\t\tbreak;\n\t\t\tcase Romance:\n\t\t\t\tALL_GENRES.get(8).add(bookTitle);\n\t\t\t\tbreak;\n\t\t\tcase Horror:\n\t\t\t\tALL_GENRES.get(9).add(bookTitle);\n\t\t\t\tbreak;\n\t\t\tcase History:\n\t\t\t\tALL_GENRES.get(10).add(bookTitle);\n\t\t\t\tbreak;\n\t\t\tcase Autobiography:\n\t\t\t\tALL_GENRES.get(11).add(bookTitle);\n\t\t\t\tbreak;\n\t\t\tcase Biography:\n\t\t\t\tALL_GENRES.get(12).add(bookTitle);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tSystem.out.println(\"ERROR: Invalid Genre Input\");\n\t\t\t\tbreak;\n\t\t}\n\t}",
"private void prepareAlbums() {\n\n Album a;\n\n for(HashMap.Entry<String,ArrayList<String>> entry : Test.subcatList.get(name).entrySet()){\n key = entry.getKey();\n value = entry.getValue();\n a = new Album(key , value.get(2));\n albumList.add(a);\n System.out.println(\"dddd : \" + key + \" \" + value.get(2));\n }\n\n adapter.notifyDataSetChanged();\n\n }",
"private void populateGenres(){\n try{\n Connection conn = DriverManager.getConnection(\n \"jdbc:sqlite:\\\\D:\\\\Programming\\\\Java\\\\Assignments\\\\CIS_452\\\\Music_Library\\\\album_library.sqlite\");\n Statement stmnt = conn.createStatement();\n ResultSet results = stmnt.executeQuery(\"SELECT DISTINCT genre FROM artist ORDER BY genre\");\n\n while(results.next()){\n String genre = results.getString(1);\n genreList.add(genre);\n }\n conn.close();\n } catch(SQLException e) {\n System.out.println(\"Error connecting to database: \" + e.getMessage());\n }\n }",
"public ArrayList<MovieGenreModel> getAllGenres() {\n\t\treturn null;\n\t}",
"private static HashMap<Integer, String> getMovieGenres() {\n String url = \"http://api.themoviedb.org/3/genre/movie/list?api_key=\" + BuildConfig.APPLICATION_ID;\r\n\r\n JSONArray genres = null;\r\n Integer id;\r\n String genre;\r\n\r\n HashMap<Integer, String> movieGenresMap = new HashMap<Integer, String>();\r\n\r\n try {\r\n genres = new JSONArray(\r\n \"[{\\\"id\\\":28,\\\"name\\\":\\\"Action\\\"},{\\\"id\\\":12,\\\"name\\\":\\\"Adventure\\\"},{\\\"id\\\":16,\\\"name\\\":\\\"Animation\\\"},{\\\"id\\\":35,\\\"name\\\":\\\"Comedy\\\"},{\\\"id\\\":80,\\\"name\\\":\\\"Crime\\\"},{\\\"id\\\":99,\\\"name\\\":\\\"Documentary\\\"},{\\\"id\\\":18,\\\"name\\\":\\\"Drama\\\"},{\\\"id\\\":10751,\\\"name\\\":\\\"Family\\\"},{\\\"id\\\":14,\\\"name\\\":\\\"Fantasy\\\"},{\\\"id\\\":10769,\\\"name\\\":\\\"Foreign\\\"},{\\\"id\\\":36,\\\"name\\\":\\\"History\\\"},{\\\"id\\\":27,\\\"name\\\":\\\"Horror\\\"},{\\\"id\\\":10402,\\\"name\\\":\\\"Music\\\"},{\\\"id\\\":9648,\\\"name\\\":\\\"Mystery\\\"},{\\\"id\\\":10749,\\\"name\\\":\\\"Romance\\\"},{\\\"id\\\":878,\\\"name\\\":\\\"Science Fiction\\\"},{\\\"id\\\":10770,\\\"name\\\":\\\"TV Movie\\\"},{\\\"id\\\":53,\\\"name\\\":\\\"Thriller\\\"},{\\\"id\\\":10752,\\\"name\\\":\\\"War\\\"},{\\\"id\\\":37,\\\"name\\\":\\\"Western\\\"}]\");\r\n } catch (JSONException e) {\r\n e.printStackTrace();\r\n }\r\n\r\n if (genres != null && genres.length() > 0) {\r\n try {\r\n for (int i = 0; i < genres.length(); i++) {\r\n JSONObject genrePair = genres.getJSONObject(i);\r\n id = genrePair.getInt(\"id\");\r\n genre = genrePair.getString(\"name\");\r\n movieGenresMap.put(id, genre);\r\n\r\n }\r\n } catch (JSONException e) {\r\n e.printStackTrace();\r\n }\r\n }\r\n\r\n return movieGenresMap;\r\n\r\n }",
"private void generateDataList(List<Genre> genreList) {\n mAdapter = new GenreListAdapter(getContext(),genreList);\n RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(getContext());\n mRecyclerView.setLayoutManager(layoutManager);\n mRecyclerView.setAdapter(mAdapter);\n }",
"public void setGenre(ArrayList<String> genre) {\n this.genre = genre;\n }",
"@Override\n\tpublic List<Genre> displayAllGenres() throws MovieException {\n\t\treturn obj.displayAllGenres();\n\t}",
"private void loadItemsMaps()\n {\n _icons=new HashMap<String,List<Item>>(); \n _names=new HashMap<String,List<Item>>(); \n List<Item> items=ItemsManager.getInstance().getAllItems();\n for(Item item : items)\n {\n String icon=item.getIcon();\n if (icon!=null)\n {\n registerMapping(_icons,icon,item);\n String mainIconId=icon.substring(0,icon.indexOf('-'));\n registerMapping(_icons,mainIconId,item);\n String name=item.getName();\n registerMapping(_names,name,item);\n }\n }\n }",
"private void populateTaxonomyTree() {\n\t\tfor (Node s: serviceMap.values()) {\n\t\t\taddServiceToTaxonomyTree(s);\n\t\t}\n\t}",
"public void printAverageRatingsByGenre(){\n ThirdRatings sr = new ThirdRatings();\n int raters = sr.getRaterSize();\n System.out.println(\"read data for \" + raters + \" raters\");\n System.out.println(\"-------------------------------------\");\n \n //MovieDatabase.initialize(\"ratedmovies_short.csv\");\n MovieDatabase.initialize(\"ratedmoviesfull.csv\");\n System.out.println(\"read data for \" + MovieDatabase.size() + \" movies\");\n System.out.println(\"-------------------------------------\");\n \n Filter f = new GenreFilter(\"Comedy\"); \n int minRatings = 20;\n ArrayList<Rating> aveRat = sr.getAverageRatingsByFilter(minRatings, f);\n System.out.println(\"Found \" + aveRat.size() + \" movies\");\n System.out.println(\"-------------------------------------\");\n // sort arraylist\n Collections.sort(aveRat);\n for(Rating r: aveRat){\n System.out.println(r.getValue() + \"\\t\" + MovieDatabase.getYear(r.getItem()) + \"\\t\" \n + MovieDatabase.getTitle(r.getItem()) + \"\\t\" + MovieDatabase.getGenres(r.getItem()));\n }\n System.out.println(\"-------------------------------------\");\n \n \n }",
"private static void initializeAllGenresList(){\n\t\tfor(int i = 0; i < 13; i ++){\n\t\t\tALL_GENRES.add(new HashSet<String>());\n\t\t}\n\t}",
"public void populate() {\n populate(this.mCurItem);\n }",
"public void printAverageRatingsByGenre(){\n \n String moviefile = \"data/ratedmovies_short.csv\";\n String ratingsfile = \"data/ratings_short.csv\";\n \n \n ThirdRatings tr = new ThirdRatings(ratingsfile);\n \n int rating_size = tr.getRaterSize();\n \n System.out.println(\"The number of raters read is : \"+ rating_size);\n \n MovieDatabase database = new MovieDatabase();\n \n database.initialize(moviefile);\n \n int movie_size = database.size();\n \n System.out.println(\"The number of movies read is : \"+ movie_size); \n \n String genre = \"Crime\";\n \n GenreFilter genre_filter = new GenreFilter(genre);\n \n ArrayList<Rating> ratings_list = tr.getAverageRatingsByFilter(1, genre_filter);\n \n HashMap<String, Double> map = new HashMap<String, Double>();\n \n Collections.sort(ratings_list);\n \n int count = 0; \n \n for(Rating rating : ratings_list){\n \n String title = database.getTitle(rating.getItem());\n \n double val = rating.getValue();\n \n String mov_genre = database.getGenres(rating.getItem());\n \n if(val != 0.0 ){\n \n map.put(title , val);\n \n count += 1;\n\n System.out.println(val + \"\\t\" + mov_genre + \"\\t\" +title );\n }\n\n }\n \n System.out.println(\"The number of movies found with minimal number of ratings is : \"+ count); \n \n \n }",
"public void modifyGenres(ArrayList<String> genreList)// --> Bytter ut Genre-arrayen med en ny array over de nye sjangerene for lokalet.\n\t{\n\t\tgenres = genreList;\n\t}",
"public void createAnimalsCollection() {\n ArrayList<DataSetAnimal> animalsFetched = getDFO().getAnimalData(getFILE_NAME()).getAnimals();\n setAnimals(new ArrayList<>());\n for (DataSetAnimal animal: animalsFetched) {\n String tmpBreed = animal.getBreedOrType().substring(animal.getBreedOrType().lastIndexOf(\" \") + 1);\n switch (tmpBreed) {\n case \"dolphin\":\n getAnimals().add(new AnimalDolphin(animal.getBreedOrType(), animal.getName(), animal.getYearOfBirth()));\n break;\n case \"duck\":\n getAnimals().add(new AnimalDuck(animal.getBreedOrType(), animal.getName(), animal.getYearOfBirth()));\n break;\n case \"cat\":\n getAnimals().add(new AnimalCat(animal.getBreedOrType(), animal.getName(), animal.getYearOfBirth()));\n break;\n case \"chicken\":\n getAnimals().add(new AnimalChicken(animal.getBreedOrType(), animal.getName(), animal.getYearOfBirth()));\n break;\n case \"horse\":\n getAnimals().add(new AnimalHorse(animal.getBreedOrType(), animal.getName(), animal.getYearOfBirth()));\n break;\n case \"shark\":\n getAnimals().add(new AnimalShark(animal.getBreedOrType(), animal.getName(), animal.getYearOfBirth()));\n break;\n case \"parakeet\":\n getAnimals().add(new AnimalParakeet(animal.getBreedOrType(), animal.getName(), animal.getYearOfBirth()));\n break;\n default:\n getAnimals().add(new AnimalDog(animal.getBreedOrType(), animal.getName(), animal.getYearOfBirth()));\n break;\n }\n }\n }",
"private static void readBooksInfo() {\n List<eGenre> arrBook = new ArrayList<>();\n\n // 1 //\n arrBook.add(eGenre.FANTASY);\n arrBook.add(eGenre.ADVENTURE);\n book.add(new Book(1200, arrBook, \"Верн Жюль\", \"Таинственный остров\", 1875));\n arrBook.clear();\n // 2 //\n arrBook.add(eGenre.FANTASY);\n arrBook.add(eGenre.MYSTIC);\n book.add(new Book(425, arrBook, \"Григоренко Виталий\", \"Иван-душитель\", 1953));\n arrBook.clear();\n // 3 //\n arrBook.add(eGenre.DETECTIVE);\n arrBook.add(eGenre.MYSTIC);\n book.add(new Book(360, arrBook, \"Сейгер Райли\", \"Последние Девушки\", 1992));\n arrBook.clear();\n // 4 //\n arrBook.add(eGenre.DETECTIVE);\n book.add(new Book(385, arrBook, \"Ольга Володарская\", \"То ли ангел, то ли бес\", 1995));\n arrBook.clear();\n // 5 //\n arrBook.add(eGenre.NOVEL);\n arrBook.add(eGenre.ACTION);\n book.add(new Book(180, arrBook, \"Лихэйн Деннис\", \"Закон ночи\", 1944));\n arrBook.clear();\n // 6 //\n arrBook.add(eGenre.NOVEL);\n book.add(new Book(224, arrBook, \"Мураками Харуки\", \"Страна Чудес без тормозов и Конец Света\", 1985));\n arrBook.clear();\n // 7 //\n arrBook.add(eGenre.STORY);\n book.add(new Book(1200, arrBook, \"Джон Хейвуд\", \"Люди Севера: История викингов, 793–1241\", 2017));\n arrBook.clear();\n // 8 //\n arrBook.add(eGenre.ACTION);\n arrBook.add(eGenre.MYSTIC);\n arrBook.add(eGenre.DETECTIVE);\n book.add(new Book(415, arrBook, \"Линдквист Юн\", \"Впусти меня\", 2017));\n arrBook.clear();\n // 9 //\n arrBook.add(eGenre.ACTION);\n book.add(new Book(202, arrBook, \"Сухов Евгений\", \"Таежная месть\", 2016));\n arrBook.clear();\n // 10 //\n arrBook.add(eGenre.DETECTIVE);\n arrBook.add(eGenre.MYSTIC);\n book.add(new Book(231, arrBook, \"Винд Кристиан\", \"Призраки глубин\", 2019));\n arrBook.clear();\n }",
"private void prepareListData(Set<String> cartItems, Map<String, List<OrderColourSize.ColourSizeItem>> cartItemMap) {\n // заполняем коллекцию групп из массива с названиями групп\n groupData = new ArrayList<Map<String, String>>();\n childData = new ArrayList<ArrayList<Map<String, String>>>();\n\n int sarea = 0;\n\n\n for (String group : cartItems) {\n // заполняем список аттрибутов для каждой группы\n m = new HashMap<String, String>();\n m.put(\"groupName\", group); // имя компании\n groupData.add(m);\n\n childDataItem = new ArrayList<Map<String, String>>();\n // заполняем список аттрибутов для каждого элемента\n for (OrderColourSize.ColourSizeItem item : cartItemMap.get(group)) {\n String phone = item.content;\n sarea += DatabaseOpenHelper.getInstance(null).getSizeAreaById(item.size_id) * item.quantity / 10000;\n m = new HashMap<String, String>();\n m.put(\"phoneName\", phone); // название телефона\n childDataItem.add(m);\n }\n // добавляем в коллекцию коллекций\n childData.add(childDataItem);\n }\n\n TOTAL_AREA = sarea;\n mTotalAreaView.setText(String.valueOf(TOTAL_AREA));\n // список аттрибутов групп для чтения\n String groupFrom[] = new String[]{\"groupName\"};\n // список ID view-элементов, в которые будет помещены аттрибуты групп\n int groupTo[] = new int[]{android.R.id.text1};\n\n // список аттрибутов элементов для чтения\n String childFrom[] = new String[]{\"phoneName\"};\n // список ID view-элементов, в которые будет помещены аттрибуты элементов\n int childTo[] = new int[]{android.R.id.text1};\n\n seAdapter = new SimpleExpandableListAdapter(\n this,\n groupData,\n android.R.layout.simple_expandable_list_item_1,\n groupFrom,\n groupTo,\n childData,\n android.R.layout.simple_list_item_1,\n childFrom,\n childTo);\n// listDataHeader = new ArrayList<String>();\n// listDataChild = new HashMap<String, List<String>>();\n//\n// // Adding child data\n// listDataHeader.add(\"Top 250\");\n// listDataHeader.add(\"Now Showing\");\n// listDataHeader.add(\"Coming Soon..\");\n//\n// // Adding child data\n// List<String> top250 = new ArrayList<String>();\n// top250.add(\"The Shawshank Redemption\");\n// top250.add(\"The Godfather\");\n// top250.add(\"The Godfather: Part II\");\n// top250.add(\"Pulp Fiction\");\n// top250.add(\"The Good, the Bad and the Ugly\");\n// top250.add(\"The Dark Knight\");\n// top250.add(\"12 Angry Men\");\n//\n// List<String> nowShowing = new ArrayList<String>();\n// nowShowing.add(\"The Conjuring\");\n// nowShowing.add(\"Despicable Me 2\");\n// nowShowing.add(\"Turbo\");\n// nowShowing.add(\"Grown Ups 2\");\n// nowShowing.add(\"Red 2\");\n// nowShowing.add(\"The Wolverine\");\n//\n// List<String> comingSoon = new ArrayList<String>();\n// comingSoon.add(\"2 Guns\");\n// comingSoon.add(\"The Smurfs 2\");\n// comingSoon.add(\"The Spectacular Now\");\n// comingSoon.add(\"The Canyons\");\n// comingSoon.add(\"Europa Report\");\n//\n// listDataChild.put(listDataHeader.get(0), top250); // Header, Child data\n// listDataChild.put(listDataHeader.get(1), nowShowing);\n// listDataChild.put(listDataHeader.get(2), comingSoon);\n }",
"public static void fill_map(){\n\t\tcategory_links_map.put(\"Categories\", \"Movies\");\n\t\tcategory_links_map.put(\"Actors\", \"Movies\");\n\t\tcategory_links_map.put(\"Movies\", \"Actors\");\n\t\tcategory_links_map.put(\"Artists\", \"Creations\");\n\t\tcategory_links_map.put(\"Creations\", \"Artists\");\n\t\tcategory_links_map.put(\"Countries\", \"Locations\");\n\t\tcategory_links_map.put(\"Locations\", \"Countries\");\n\t\tcategory_links_map.put(\"NBA players\", \"NBA teams\");\n\t\tcategory_links_map.put(\"NBA teams\", \"NBA players\");\n\t\tcategory_links_map.put(\"Israeli soccer players\", \"Israeli soccer teams\");\n\t\tcategory_links_map.put(\"Israeli soccer teams\", \"Israeli soccer players\");\n\t\tcategory_links_map.put(\"World soccer players\", \"World soccer teams\");\n\t\tcategory_links_map.put(\"World soccer teams\", \"World soccer players\");\n\t}",
"@SuppressWarnings(\"unchecked\")\n\tpublic static List<HashMap<String, String>> getChoiceGan(String choice) {\n\t\tList<rcmMusicListMain> musicLists = rcmMusicListMain.getAllMusic();\n\t\t\n\t\tList<HashMap<String, String>> aList = new ArrayList<HashMap<String, String>>();\n\t\tHashMap<String, String> aMap = new HashMap<String, String>();\n\t\tHashMap<String, String> bMap = new HashMap<String, String>();\n\t\t\n\t\tmusicLists.stream()\n\t\t\t.filter(musicList -> musicList.getGenre1().equals(choice) \n\t\t\t\t\t|| musicList.getGenre2().equals(choice))\n\t\t\t.sorted((musicList1, musicList2) -> musicList2.getPlayNum() - musicList1.getPlayNum())\n\t\t\t.limit(10).forEach(musicList -> {\n\t\t\t\t\t//System.out.println(musicList.getSeq()+\". \"+musicList.getTitle()+\" : \"+musicList.getSinger());\n\t\t\t\t\taMap.put(\"TITLE\", musicList.getTitle());\n\t\t\t\t\taMap.put(\"ITEM\", musicList.getSinger());\n\t\t\t\t\taList.add((HashMap<String, String>)aMap.clone());\n\t\t\t\t});\n\t\t\n\t\t\n\t\tfor(int i=0; i<aList.size(); i++) {\n\t\t\tbMap = aList.get(i); \n\t\t\tbMap.put(\"SEQ\", i+1+\"\");\n\t\t\tSystem.out.println(bMap.get(\"SEQ\")+\". \"+bMap.get(\"TITLE\")+\" : \"+bMap.get(\"ITEM\"));\n\t\t\t//System.out.println(aList.get(i).get(\"SEQ\")+\". \"+aList.get(i).get(\"TITLE\")+\" : \"+aList.get(i).get(\"ITEM\"));\n\t\t}\n\t\t\n\t\treturn aList; \n\t}",
"public Album setGenres(Set<String> genres) {\r\n this.genres = genres;\r\n return this;\r\n }",
"private static void remakeMap(HashMap<String, ArrayList<Critter>> population)\r\n {\r\n \t//get a copy of the hash map\r\n \tHashMap<String, ArrayList<Critter>> copy = new HashMap<String, ArrayList<Critter>>(population);\r\n \t//clear the original hash map\r\n \tpopulation.clear();\r\n \t\r\n \t//iterates through all of the critters in the copy of the hash map\r\n \tIterator<String> populationIter = copy.keySet().iterator();\r\n \t\r\n \twhile (populationIter.hasNext()) { \r\n \t\t\r\n \t\t//get the String position\r\n String pos = populationIter.next();\r\n \r\n //get the critter list in that position\r\n ArrayList<Critter> critterList = copy.get(pos);\r\n \r\n //Iterate through the critters ArrayList \r\n ListIterator<Critter> currCritter = critterList.listIterator();\r\n while(currCritter.hasNext()) {\r\n \tCritter thisCritter = currCritter.next();\r\n \t//get the new coordinates of the critter\r\n \tString critterKey = thisCritter.getCritterPosition();\r\n \t\r\n \t//if the position is already a key in the hash map\r\n \tif(population.containsKey(critterKey)) {\r\n \t\t//add the critter to the ArrayList at key of coordinates\r\n \t\tArrayList<Critter> list = population.get(critterKey);\r\n \t\tlist.add(thisCritter);\r\n \t\tpopulation.replace(critterKey, list);\r\n \t}\r\n \r\n \t//if position is not already a key in the hash map\r\n \telse {\r\n \t\tArrayList<Critter> newCritters = new ArrayList<Critter>();\r\n \t\tnewCritters.add(thisCritter);\r\n \t\tpopulation.put(critterKey, newCritters);\r\n \t}\r\n }\r\n \t}\r\n }",
"@Override\n public void getMovieContentData() {\n Cursor movieCursor = queryMovieData();\n\n ArrayList<MovieData> movieData = new ArrayList<>();\n\n if(movieCursor != null) {\n //do stuff\n while(movieCursor.moveToNext()) {\n MovieData movie = new MovieData();\n movie.setName(movieCursor.getString(movieCursor.getColumnIndex(MovieUriContract.MovieEntry.COLUMN_NAME)));\n movie.setDate(movieCursor.getString(movieCursor.getColumnIndex(MovieUriContract.MovieEntry.COLUMN_RELEASE_DATE)));\n movie.setGenreId(movieCursor.getInt(movieCursor.getColumnIndex(MovieUriContract.MovieEntry.COLUMN_GENRE)));\n }\n movieCursor.close();\n }\n\n //query genre data next, using the GenreId in Movie Data\n for (MovieData movie : movieData) {\n Cursor genreCursor = queryGenreData(movie.getGenreId());\n\n if(genreCursor != null) {\n //do stuff\n if (genreCursor.moveToFirst()) {\n movie.setGenre(movieCursor.getString(movieCursor.getColumnIndex(MovieUriContract.GenreEntry.COLUMN_NAME)));\n }\n genreCursor.close();\n }\n }\n\n view.updateMovieDataView(movieData);\n }",
"public Set<String> getGenres() {\r\n return this.genres;\r\n }",
"public void setGenre(int genre) {\n this.genre = genre;\n }",
"public void setGenre(Genre genre) {\n this.genre = genre;\n }",
"public void setGenre(Genre genre) {\n this.genre = genre;\n }",
"ImmutableList<SchemaOrgType> getGenreList();",
"public void setGenre() {\r\n this.genre = genre;\r\n }",
"public void showGenre(Genre genre) {\n for (Record r : cataloue) {\n if (r.getGenre() == genre) {\n System.out.println(r);\n }\n }\n\n }",
"private void loadToChoice() {\n\t\tfor(Genre genre : genreList) {\n\t\t\tuploadPanel.getGenreChoice().add(genre.getName());\n\t\t}\n\t}",
"@GET\n public List<JsonGenre> getAll() {\n \tList<Genre> genres = genreDao.getGenres();\n \tLOGGER.info(\"find \"+genres.size()+\" genres in the database\");\n \tArrayList<JsonGenre> ls = new ArrayList<JsonGenre>();\n \tfor (Genre s:genres) {\n \t\tls.add(new JsonGenre(s.getId(), s.getName()));\n \t}\n \treturn ls;\n }",
"public void setGenre(String genre) {\n this.genre = genre;\n }",
"public void addGenre(String newGenre) {\n this.genre.add(newGenre);\n }",
"public ObservableList<String> getAllGenres(){\n return allGenres;\n }",
"private void erstelleListenMap(){\n farbenMap = new TreeMap<>();\n symbolMap = new TreeMap<>();\n\n for(Symbol symbol:Symbol.values()){\n\n switch (symbol) // sortiert ihn in die entsprechende Liste ein\n {\n case ka_blau:\n farbenMap.put(symbol,blaue);\n symbolMap.put(symbol,karos);\n break;\n case ks_blau:\n farbenMap.put(symbol,blaue);\n symbolMap.put(symbol,kreise);\n break;\n case kr_blau:\n farbenMap.put(symbol,blaue);\n symbolMap.put(symbol,kreuze);\n break;\n case st_blau:\n farbenMap.put(symbol,blaue);\n symbolMap.put(symbol,sterne);\n break;\n case qu_blau:\n farbenMap.put(symbol,blaue);\n symbolMap.put(symbol,quadrate);\n break;\n case kb_blau:\n farbenMap.put(symbol,blaue);\n symbolMap.put(symbol,kleeblaetter);\n break;\n\n case ka_gelb:\n farbenMap.put(symbol,gelbe);\n symbolMap.put(symbol,karos);\n break;\n case ks_gelb:\n farbenMap.put(symbol,gelbe);\n symbolMap.put(symbol,kreise);\n break;\n case kr_gelb:\n farbenMap.put(symbol,gelbe);\n symbolMap.put(symbol,kreuze);\n break;\n case st_gelb:\n farbenMap.put(symbol,gelbe);\n symbolMap.put(symbol,sterne);\n break;\n case qu_gelb:\n farbenMap.put(symbol,gelbe);\n symbolMap.put(symbol,quadrate);\n break;\n case kb_gelb:\n farbenMap.put(symbol,gelbe);\n symbolMap.put(symbol,kleeblaetter);\n break;\n case ka_gruen:\n farbenMap.put(symbol,gruene);\n symbolMap.put(symbol,karos);\n break;\n case ks_gruen:\n farbenMap.put(symbol,gruene);\n symbolMap.put(symbol,kreise);\n break;\n case kr_gruen:\n farbenMap.put(symbol,gruene);\n symbolMap.put(symbol,kreuze);\n break;\n case st_gruen:\n farbenMap.put(symbol,gruene);\n symbolMap.put(symbol,sterne);\n break;\n case qu_gruen:\n farbenMap.put(symbol,gruene);\n symbolMap.put(symbol,quadrate);\n break;\n case kb_gruen:\n farbenMap.put(symbol,gruene);\n symbolMap.put(symbol,kleeblaetter);\n break;\n case ka_rot:\n farbenMap.put(symbol,rote);\n symbolMap.put(symbol,karos);\n break;\n case ks_rot:\n farbenMap.put(symbol,rote);\n symbolMap.put(symbol,kreise);\n break;\n case kr_rot:\n farbenMap.put(symbol,rote);\n symbolMap.put(symbol,kreuze);\n break;\n case st_rot:\n farbenMap.put(symbol,rote);\n symbolMap.put(symbol,sterne);\n break;\n case qu_rot:\n farbenMap.put(symbol,rote);\n symbolMap.put(symbol,quadrate);\n break;\n case kb_rot:\n farbenMap.put(symbol,rote);\n symbolMap.put(symbol,kleeblaetter);\n break;\n case ka_violett:\n farbenMap.put(symbol,violette);\n symbolMap.put(symbol,karos);\n break;\n case ks_violett:\n farbenMap.put(symbol,violette);\n symbolMap.put(symbol,kreise);\n break;\n case kr_violett:\n farbenMap.put(symbol,violette);\n symbolMap.put(symbol,kreuze);\n break;\n case st_violett:\n farbenMap.put(symbol,violette);\n symbolMap.put(symbol,sterne);\n break;\n case qu_violett:\n farbenMap.put(symbol,violette);\n symbolMap.put(symbol,quadrate);\n break;\n case kb_violett:\n farbenMap.put(symbol,violette);\n symbolMap.put(symbol,kleeblaetter);\n break;\n case ka_orange:\n farbenMap.put(symbol,orangene);\n symbolMap.put(symbol,karos);\n break;\n case ks_orange:\n farbenMap.put(symbol,orangene);\n symbolMap.put(symbol,kreise);\n break;\n case kr_orange:\n farbenMap.put(symbol,orangene);\n symbolMap.put(symbol,kreuze);\n break;\n case st_orange:\n farbenMap.put(symbol,orangene);\n symbolMap.put(symbol,sterne);\n break;\n case qu_orange:\n farbenMap.put(symbol,orangene);\n symbolMap.put(symbol,quadrate);\n break;\n case kb_orange:\n farbenMap.put(symbol,orangene);\n symbolMap.put(symbol,kleeblaetter);\n break;\n }\n\n }\n }",
"public List<Books> findBooksByGenre(String genre) {\r\n HttpSession session = (HttpSession) FacesContext.getCurrentInstance().getExternalContext().getSession(false);\r\n List<Genre> list = new ArrayList();\r\n Genre g = new Genre();\r\n g.setType(genre);\r\n list.add(g);\r\n session.setAttribute(\"lastGenre\",list);\r\n return bookController.findBooksByGenre(genre);\r\n }",
"@Override\n\tpublic String addGenre(Genre songName, Genre songArtist, Genre songBpm, Genre songGenre) {\n\t\treturn null;\n\t}",
"public void sortGivenArray_popularity() { \n int i, j, k; \n for(i = movieList.size()/2; i > 0; i /= 2) {\n for(j = i; j < movieList.size(); j++) {\n Movie key = movieList.get(j);\n for(k = j; k >= i; k -= i) {\n if(key.rents > movieList.get(k-i).rents) {\n movieList.set(k, movieList.get(k-i));\n } else {\n break; \n }\n }\n movieList.set(k, key);\n }\n } \n }",
"public HashMap<String, Item> getItemCollection(){\n \tHashMap<String, Item> result = new HashMap<String, Item>(itemCollection);\r\n \treturn result;\r\n }",
"public void initialiseGodList() {\n PlayerCreator playerCreator = new PlayerCreator();\n for (int i = 0; i < playerCreator.getArrayGods().size(); i++)\n godListNames.add(playerCreator.getArrayGods().get(i).getGodName());\n }",
"@Test\r\n public void testGetGenreList() throws MovieDbException {\r\n LOG.info(\"getGenreList\");\r\n List<Genre> results = tmdb.getGenreList(LANGUAGE_DEFAULT);\r\n assertTrue(\"No genres found\", !results.isEmpty());\r\n }",
"public String getBasedOnGenre(String genre) {\n String cap = genre.substring(0, 1).toUpperCase() + genre.substring(1);\n StringBuilder json = new StringBuilder();\n for (Node node: books) {\n if (node.getItem().getGenre().equals(cap)) {\n json.append(((Book)node.getItem()).getJSON()).append(\"\\n\");\n }\n }\n for (Node node: music) {\n if (node.getItem().getGenre().equals(cap)) {\n json.append(((Music)node.getItem()).getJSON()).append(\"\\n\");\n }\n }\n for (Node node: movies) {\n if (node.getItem().getGenre().equals(cap)) {\n json.append(((Movie)node.getItem()).getJSON()).append(\"\\n\");\n }\n }\n return json.toString();\n }",
"private void populateData() {\n animals.add(new Animal(\"Bear Arlan\", 10, true, \"Student\",\n \"Watch cartoons\", R.drawable.bear));\n animals.add(new Animal(\"Marten Chrisst\", 15, true, \"McDonald employee\",\n \"Play video games\", R.drawable.marten));\n animals.add(new Animal(\"Octopus Tenta\", 18, false, \"Ink producer\",\n \"Camouflage and attack jellyfish\", R.drawable.octopus));\n animals.add(new Animal(\"Ostrich Mellow\", 19, false, \"Zoo runner\",\n \"Peck other animals\", R.drawable.ostrich));\n animals.add(new Animal(\"Raccoon Garack\", 21, true, \"Office worker\",\n \"Build diagrams for statistics\", R.drawable.racoon));\n animals.add(new Animal(\"Rooster Billo\", 16, true, \"Early waker\",\n \"Fly and chirp in morning\", R.drawable.rooster));\n animals.add(new Animal(\"Seagull Ranch\", 23, false, \"Scout\",\n \"Practice carrying water in mouth\", R.drawable.seagull));\n animals.add(new Animal(\"Seal Arlan\", 25, true, \"Security\",\n \"Work on belly muscles\", R.drawable.seal));\n animals.add(new Animal(\"Tiger Stitch\", 30, false, \"Hunter\",\n \"Make soup\", R.drawable.tiger));\n animals.add(new Animal(\"Zebra Dillian\", 6, true, \"Student\",\n \"Watch movies about zebras\", R.drawable.zebra));\n }",
"protected void putItems() {\n\t\tlevelSetup[0][5].putItem(new Dynamite());\n\t\tlevelSetup[6][6].putItem(new Flint());\n\t\tlevelSetup[6][3].putItem(new ManaPotion());\n\t\tlevelSetup[5][0].putItem(new ManaPotion());\n\t\tlevelSetup[2][1].putItem(new HealthPotion());\n\t\tlevelSetup[3][6].putItem(new HealthPotion());\n\t\tlevelSetup[4][2].putItem(new Spinach());\n\t}",
"public static void createItems(){\n Registry.register(Registry.ITEM, new Identifier(nameSpace, \"breadly\"), BREADLY);\n Registry.register(Registry.ITEM, new Identifier(nameSpace, \"hard_boiled_egg\"), HARD_BOILED_EGG);\n\n\n Registry.register(Registry.ITEM, new Identifier(nameSpace, \"ender_dragon_spawn_egg\"), ENDER_DRAGON_SPAWN_EGG);\n Registry.register(Registry.ITEM, new Identifier(nameSpace, \"wither_spawn_egg\"), WITHER_SPAWN_EGG);\n Registry.register(Registry.ITEM, new Identifier(nameSpace, \"illusioner_spawn_egg\"), ILLUSIONER_SPAWN_EGG);\n Registry.register(Registry.ITEM, new Identifier(nameSpace, \"giant_spawn_egg\"), GIANT_SPAWN_EGG);\n Registry.register(Registry.ITEM, new Identifier(nameSpace, \"spawn_spawn_egg\"), SPAWN_SPAWN_EGG);\n }",
"@Override\n\tpublic void addGenre(Genre genre) throws MovieException {\n obj.addGenre(genre);\n\t}",
"public void sortYear(){\r\n\r\n\t\t// sort magazines by year inside the items array\r\n Magazine temp; // used for swapping magazines in the array\r\n\t for(int i=0; i<items.size(); i++) {\r\n\r\n\t\t// Check to see the item is a magazine. We will only\r\n\t\t//use magazines.\r\n\t if(items.get(i).getItemType() != Item.ItemTypes.MAGAZINE)\r\n\t continue;\r\n\t\t\t\r\n\t for(int j=i+1; j<items.size(); j++) {\r\n\t\t // We consider only magazines\r\n\t if(items.get(j).getItemType() != Item.ItemTypes.MAGAZINE)\r\n\t\t continue;\r\n\t\t // Compare the years of the two magazines\r\n\t if(((Magazine)items.get(i)).getYear() < \r\n\t \t((Magazine)items.get(j)).getYear()) {\r\n\t\t // Swap the items\r\n\t\t temp = (Magazine)items.get(i);\r\n\t\t items.remove(i);\r\n\t\t items.add(i, items.get(j-1));\r\n\t\t items.remove(j);\r\n\t\t items.add(j, temp);\r\n\t }\r\n\t }\r\n\t }\r\n\t\t// Print the magazines\r\n\t\tfor(int i=0; i<items.size(); i++)\r\n\t\t\tif(items.get(i).getItemType() == Item.ItemTypes.MAGAZINE)\r\n\t\t\t\tSystem.out.println(items.get(i).toString());\r\n }",
"@Override\n public int getItemCount() {\n return subgenreList.size();\n }",
"private Map<String,List<Invertedindex>> collecting() //\r\n {\r\n Map<String,List<Invertedindex>> maps = new TreeMap<>();\r\n for (Core pon:pondred){\r\n for(Map.Entry<String,Double> term:pon.allTerms.entrySet()){\r\n if (maps.containsKey(term.getKey())){\r\n List<Invertedindex> index = maps.get(term.getKey());\r\n index.add(new Invertedindex(pon.m_cle,term.getValue(),pon.getBalise(term.getKey())));\r\n maps.put(term.getKey(), index);\r\n }else {\r\n List<Invertedindex> index = new ArrayList<>();\r\n index.add(new Invertedindex(pon.m_cle,term.getValue(),pon.getBalise(term.getKey())));\r\n maps.put(term.getKey(), index);\r\n }\r\n if(cleFreq.containsKey(pon.m_cle))\r\n cleFreq.put(pon.m_cle,cleFreq.get(pon.m_cle)+term.getValue());\r\n else cleFreq.put(pon.m_cle,term.getValue());\r\n\r\n }\r\n }\r\n return maps;\r\n }",
"public void printAverageRatingsByYearAfterAndGenre(){\n \n String moviefile = \"data/ratedmovies_short.csv\";\n String ratingsfile = \"data/ratings_short.csv\";\n \n \n ThirdRatings tr = new ThirdRatings(ratingsfile);\n \n int rating_size = tr.getRaterSize();\n \n System.out.println(\"The number of raters read is : \"+ rating_size);\n \n MovieDatabase database = new MovieDatabase();\n \n database.initialize(moviefile);\n \n int movie_size = database.size();\n \n System.out.println(\"The number of movies read is : \"+ movie_size); \n \n int year = 1980;\n String genre = \"Romance\";\n \n AllFilters all_filter = new AllFilters();\n GenreFilter gf = new GenreFilter(genre);\n YearAfterFilter yf = new YearAfterFilter(year);\n \n all_filter.addFilter(yf);\n all_filter.addFilter(gf);\n \n ArrayList<Rating> ratings_list = tr.getAverageRatingsByFilter(1, all_filter);\n \n HashMap<String, Double> map = new HashMap<String, Double>();\n \n Collections.sort(ratings_list);\n \n int count = 0; \n \n for(Rating rating : ratings_list){\n \n String title = database.getTitle(rating.getItem());\n \n double val = rating.getValue();\n \n String mov_genre = database.getGenres(rating.getItem());\n \n int mov_year = database.getYear(rating.getItem());\n \n if(val != 0.0 ){\n \n map.put(title , val);\n \n count += 1;\n\n System.out.println(val + \"\\t\" + mov_genre + \"\\t\" + mov_year + \"\\t\" + title );\n }\n\n }\n \n System.out.println(\"The number of movies found with minimal number of ratings is : \"+ count); \n \n \n }",
"@NonNull\n public final List<Genres> getGenres() {\n return this.genres;\n }",
"private static void queryBooksByGenre(){\n\t\tSystem.out.println(\"===Query Books By Genre===\");\n\t\tScanner string_input = new Scanner(System.in);\n\t\t\n\t\tSystem.out.println(\"Enter Genre to Query Books by: \");\n\t\tString genre = string_input.next();\n\t\tint genre_index = getGenreIndex(genre); //returns the index of the genre entered, in ALL_GENRES\n\t\t\n\t\tif(genre_index > -1){//valid genre was entered\n\t\t\tIterator<String> iter = ALL_GENRES.get(genre_index).iterator();\n\t\t\tSystem.out.println(\"All \" + genre + \" books are: \");\n\t\t\tprintAllElements(iter);\n\t\t}\n\t}",
"public static JSONArray getGenreCollection(String search){\n\t\tJSONArray genreStations = JSON.getJArray(radioStationCollections, search);\n\t\tif (genreStations != null){\n\t\t\tJSONArray genreStationFirstEntries = new JSONArray();\n\t\t\tfor (Object ao : genreStations){\n\t\t\t\tString normalizedStationName = (String) ao;\n\t\t\t\tJSONArray entry = JSON.getJArray(radioStationsMap, normalizedStationName);\n\t\t\t\tif (Is.notNullOrEmpty(entry)){\n\t\t\t\t\tJSON.add(genreStationFirstEntries, entry.get(0));\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn genreStationFirstEntries;\n\t\t}else{\n\t\t\treturn new JSONArray();\n\t\t}\n\t\t//TODO: we could add some fancy fuzzy search here too ...\n\t}",
"public void setGenre(String genre)\r\n {\r\n this.genre=genre;\r\n }",
"public Genre getGenre() {\n return genre;\n }",
"public Genre getGenre() {\n return genre;\n }",
"private void reinitItemNavigators( )\r\n {\r\n _itemNavigators = new HashMap<>( );\r\n _strSortedAttributeName = StringUtils.EMPTY;\r\n _bIsAscSort = true;\r\n }",
"public Map<String, Gene> getGenes() {\n return genes;\n }",
"public MusicLibrary() {\n\t\tthis.idMap = new HashMap<String, Song>();\n\t\tthis.titleMap = new TreeMap<String, TreeSet<Song>>(new StringComparator());\n\t\tthis.artistMap = new TreeMap<String, TreeSet<Song>>(new StringComparator());\n\t\tthis.tagMap = new TreeMap<String, TreeSet<String>>(new StringComparator());\n\t\t//this.artistList = new ArrayList<>();\n\t}",
"public Genre getGenre() {\n\n return genre;\n }",
"private static ArrayList<String> getGenre(String songID) throws SQLException {\n ArrayList<String> genres = new ArrayList<>();\n genreStatement = conn.createStatement();\n genreResultSet = genreStatement.executeQuery(\"SELECT * FROM genre, trackGenre WHERE trackGenre.track_id = '\" + songID + \"' AND trackGenre.genre = genre.name;\");\n while (genreResultSet.next()){\n genres.add(genreResultSet.getString(\"name\"));\n }\n return genres;\n }",
"private void populateListView() {\n List<String> groupNames = new ArrayList<String>();\n for (Pair<String, Group> pair : savedGroups) {\n groupNames.add(pair.first);\n }\n if (groupsListAdapter != null) {\n groupsListAdapter.clear();\n groupsListAdapter.addAll(groupNames);\n groupsListAdapter.notifyDataSetChanged();\n }\n }",
"private static List<Gene> getGenePool() {\n List<Gene> list = new ArrayList<>();\n\n Item item1 = new Item();\n item1.setName(\"Swiss Army Knife\");\n item1.setWeight(0.08125);\n item1.setVal(15);\n Gene gene1 = new Gene(item1);\n\n Item item2 = new Item();\n item2.setName(\"Duct Tape\");\n item2.setWeight(1.3);\n item2.setVal(3);\n Gene gene2 = new Gene(item2);\n\n Item item3 = new Item();\n item3.setName(\"Rope (50 feet)\");\n item3.setWeight(7);\n item3.setVal(10);\n Gene gene3 = new Gene(item3);\n\n Item item4 = new Item();\n item4.setName(\"Satellite phone\");\n item4.setWeight(2);\n item4.setVal(8);\n Gene gene4 = new Gene(item4);\n\n Item item5 = new Item();\n item5.setName(\"Elmer's Glue\");\n item5.setWeight(0.25);\n item5.setVal(2);\n Gene gene5 = new Gene(item5);\n\n Item item6 = new Item();\n item6.setName(\"Toilet Paper Roll\");\n item6.setWeight(.5);\n item6.setVal(4);\n Gene gene6 = new Gene(item6);\n\n Item item7 = new Item();\n item7.setName(\"Binoculars\");\n item7.setWeight(3);\n item7.setVal(5);\n Gene gene7 = new Gene(item7);\n\n Item item8 = new Item();\n item8.setName(\"Compass\");\n item8.setWeight(0.0573202);\n item8.setVal(15);\n Gene gene8 = new Gene(item8);\n\n Item item9 = new Item();\n item9.setName(\"Jug (pre-filled with water)\");\n item9.setWeight(4);\n item9.setVal(6);\n Gene gene9 = new Gene(item9);\n\n Item item10 = new Item();\n item10.setName(\"Flashlight\");\n item10.setWeight(2);\n item10.setVal(4);\n Gene gene10 = new Gene(item10);\n\n Item item11 = new Item();\n item11.setName(\"Box of paper clips\");\n item11.setWeight(.9);\n item11.setVal(2);\n Gene gene11 = new Gene(item11);\n\n Item item12 = new Item();\n item12.setName(\"Gloves (1 pair)\");\n item12.setWeight(.8125);\n item12.setVal(3);\n Gene gene12 = new Gene(item12);\n\n Item item13 = new Item();\n item13.setName(\"Scissors\");\n item13.setWeight(0.2);\n item13.setVal(2);\n Gene gene13 = new Gene(item13);\n\n Item item14 = new Item();\n item14.setName(\"Signal Flair (4pk)\");\n item14.setWeight(4);\n item14.setVal(5);\n Gene gene14 = new Gene(item14);\n\n Item item15 = new Item();\n item15.setName(\"Water Purifying System\");\n item15.setWeight(0.5125);\n item15.setVal(4);\n Gene gene15 = new Gene(item15);\n\n Item item16 = new Item();\n item16.setName(\"Whistle\");\n item16.setWeight(0.075);\n item16.setVal(2);\n Gene gene16 = new Gene(item16);\n\n Item item17 = new Item();\n item17.setName(\"Sleeping Bag\");\n item17.setWeight(0.38125);\n item17.setVal(4);\n Gene gene17 = new Gene(item17);\n\n Item item18 = new Item();\n item18.setName(\"Insect Repellent\");\n item18.setWeight(1.15);\n item18.setVal(3);\n Gene gene18 = new Gene(item18);\n\n Item item19 = new Item();\n item19.setName(\"Trowel\");\n item19.setWeight(0.31875);\n item19.setVal(3);\n Gene gene19 = new Gene(item19);\n\n Item item20 = new Item();\n item20.setName(\"Lighter\");\n item20.setWeight(.2);\n item20.setVal(4);\n Gene gene20 = new Gene(item20);\n\n Item item21 = new Item();\n item21.setName(\"Safety Horn\");\n item21.setWeight(.21);\n item21.setVal(3);\n Gene gene21 = new Gene(item21);\n\n Item item22 = new Item();\n item22.setName(\"Headlamp\");\n item22.setWeight(.8);\n item22.setVal(4);\n Gene gene22 = new Gene(item22);\n\n Item item23 = new Item();\n item23.setName(\"Freeze Dried Food Kit\");\n item23.setWeight(2);\n item23.setVal(6);\n Gene gene23 = new Gene(item23);\n\n Item item24 = new Item();\n item24.setName(\"Sunscreen\");\n item24.setWeight(.5);\n item24.setVal(4);\n Gene gene24 = new Gene(item24);\n\n Item item25 = new Item();\n item25.setName(\"Trekking Pole (Adjustable)\");\n item25.setWeight(1.3);\n item25.setVal(4);\n Gene gene25 = new Gene(item25);\n\n Item item26 = new Item();\n item26.setName(\"Counter Assault Bear Spray\");\n item26.setWeight(.5);\n item26.setVal(4);\n Gene gene26 = new Gene(item26);\n\n Item item27 = new Item();\n item27.setName(\"Insect Spray\");\n item27.setWeight(.5);\n item27.setVal(3);\n Gene gene27 = new Gene(item27);\n\n Item item28 = new Item();\n item28.setName(\"Hand sanitizer\");\n item28.setWeight(.625);\n item28.setVal(3);\n Gene gene28 = new Gene(item28);\n\n Item item29 = new Item();\n item29.setName(\"Mirror\");\n item29.setWeight(.5);\n item29.setVal(3);\n Gene gene29 = new Gene(item29);\n\n Item item30 = new Item();\n item30.setName(\"First Aid Kit\");\n item30.setWeight(3);\n item30.setVal(6);\n Gene gene30 = new Gene(item30);\n\n list.add(gene1);\n list.add(gene2);\n list.add(gene3);\n list.add(gene4);\n list.add(gene5);\n list.add(gene6);\n list.add(gene7);\n list.add(gene8);\n list.add(gene9);\n list.add(gene10);\n list.add(gene11);\n list.add(gene12);\n list.add(gene13);\n list.add(gene14);\n list.add(gene15);\n list.add(gene16);\n list.add(gene17);\n list.add(gene18);\n list.add(gene19);\n list.add(gene20);\n list.add(gene21);\n list.add(gene22);\n list.add(gene23);\n list.add(gene24);\n list.add(gene25);\n list.add(gene26);\n list.add(gene27);\n list.add(gene28);\n list.add(gene29);\n list.add(gene30);\n\n return list;\n }",
"public int addGenreToPlayList(){\n\t\t\n\t\tint pos =0;\n\t\t\n\t\tboolean out = false;\n\t\t\n\t\tfor(int i=0; (i<genresList.length)&&(out==false);i++){\n\t\t\n\t\tif(genresList[i] == null){\n\t\t\tout = true;\n\t\t\tpos = i;\n\t\t}\n\t\t}\n\t\treturn pos;\n\t}",
"public void addGroceries(List<String> groceryList)\n {\n for(int i=0;i<groceryList.size();i++)\n {\n addGrocery(groceryList.get(i));\n }\n }",
"private void sortSongs(Context context)\n {\n boolean foundArtist;\n for (Song song : songs)\n {\n foundArtist = false;\n for (Artist artist : artists)\n {\n if (song.artistName.equals(artist.name))\n {\n artist.addSong(song);\n foundArtist = true;\n break;\n }\n }\n if (!foundArtist)\n artists.add(new Artist(song));\n }\n\n //sorts all songs\n sortSongs(songs);\n\n //sort artists\n sortArtists(artists);\n\n //sort albums, songs and set cover\n for (Artist artist : artists)\n {\n //albums\n sortAlbums(artist.albums);\n\n for (Album album : artist.albums)\n {\n //sort album songs\n sortSongs(album.songs);\n\n //set cover\n album.cover = ImageLoader.getAlbumart(context, album.songs.get(0).albumId);\n }\n }\n }",
"GenreDao getGenreDao();",
"@Override\n\tpublic List<Record> getRecordsByGenre(Genre genre) {\n\t\tSession session = HibernateSessionFactory.getSession();\n\t\tTransaction tx = session.beginTransaction();\n\t\tList<Record> list = new ArrayList<Record>();\n\t\tRecordDAO recordDAO = new RecordDAO();\n\n\t\ttry {\n\t\t\tlist = recordDAO.getRecordsByGenre(genre);\n\t\t\ttx.commit();\n\t\t} catch (RuntimeException e) {\n\t\t\te.printStackTrace();\n\t\t\ttx.rollback();\n\t\t} finally {\n\t\t\tsession.close();\n\t\t}\n\t\treturn list;\n\t}",
"public HashMap<String, List<String>> getItemMap() {\r\n\r\n\t\thelmet_abilities.add(Game_constants.INTELLIGENCE);\r\n\t\thelmet_abilities.add(Game_constants.WISDOM);\r\n\t\thelmet_abilities.add(Game_constants.ARMOR_CLASS);\r\n\r\n\t\tarmor_abilities.add(Game_constants.ARMOR_CLASS);\r\n\r\n\t\tshield_abilities.add(Game_constants.ARMOR_CLASS);\r\n\r\n\t\tring_abilities.add(Game_constants.ARMOR_CLASS);\r\n\t\tring_abilities.add(Game_constants.STRENGTH);\r\n\t\tring_abilities.add(Game_constants.CONSTITUTION);\r\n\t\tring_abilities.add(Game_constants.WISDOM);\r\n\t\tring_abilities.add(Game_constants.CHARISMA);\r\n\r\n\t\tbelt_abilities.add(Game_constants.CONSTITUTION);\r\n\t\tbelt_abilities.add(Game_constants.STRENGTH);\r\n\r\n\t\tboots_abilities.add(Game_constants.ARMOR_CLASS);\r\n\t\tboots_abilities.add(Game_constants.DEXTERITY);\r\n\r\n\t\tweapon_abilities.add(Game_constants.ATTACK_BONUS);\r\n\t\tweapon_abilities.add(Game_constants.DAMAGE_BONUS);\r\n\r\n\t\titem_map.put(Game_constants.HELMET, helmet_abilities);\r\n\t\titem_map.put(Game_constants.ARMOR, armor_abilities);\r\n\t\titem_map.put(Game_constants.SHIELD, shield_abilities);\r\n\t\titem_map.put(Game_constants.RING, ring_abilities);\r\n\t\titem_map.put(Game_constants.BELT, belt_abilities);\r\n\t\titem_map.put(Game_constants.BOOTS, boots_abilities);\r\n\t\titem_map.put(Game_constants.WEAPON_MELEE, weapon_abilities);\r\n\t\titem_map.put(Game_constants.WEAPON_RANGE, weapon_abilities);\r\n\r\n\t\treturn item_map;\r\n\r\n\t}",
"public void createTreeMap() {\n myList = new TreeMap<>();\n scrabbleList = new TreeMap<>();\n }",
"public void addGenreAction()\n\t{\n\t\tViewNavigator.loadScene(\"Add Genre\", ViewNavigator.ADD_GENRE_SCENE);\n\t}",
"public void addItems() {\r\n\t\tproductSet.add(new FoodItems(1000, \"maggi\", 12.0, 100, new Date(), new Date(), \"yes\"));\r\n\t\tproductSet.add(new FoodItems(1001, \"Pulses\", 55.0, 50, new Date(), new Date(), \"yes\"));\r\n\t\tproductSet.add(new FoodItems(1004, \"Meat\", 101.53, 5, new Date(), new Date(), \"no\"));\r\n\t\tproductSet.add(new FoodItems(1006, \"Jelly\", 30.0, 73, new Date(), new Date(), \"no\"));\r\n\t\t\r\n\t\tproductSet.add(new Apparels(1005, \"t-shirt\", 1000.0, 10, \"small\", \"cotton\"));\r\n\t\tproductSet.add(new Apparels(1002, \"sweater\", 2000.0, 5,\"medium\", \"woolen\"));\r\n\t\tproductSet.add(new Apparels(1003, \"cardigan\", 1001.53,22, \"large\", \"cotton\"));\r\n\t\tproductSet.add(new Apparels(1007, \"shirt\", 500.99, 45,\"large\",\"woolen\"));\r\n\t\t\r\n\t\tproductSet.add(new Electronics(1010, \"tv\", 100000.0, 13, 10));\r\n\t\tproductSet.add(new Electronics(1012, \"mobile\", 20000.0, 20,12));\r\n\t\tproductSet.add(new Electronics(1013, \"watch\", 1101.53,50, 5));\r\n\t\tproductSet.add(new Electronics(1009, \"headphones\", 300.0, 60,2));\r\n\t\t\r\n\t}",
"private void initialize() {\n\t\tplayerMap = new HashMap<>();\n\t\ttypeMap = new HashMap<>();\n\t\tfor (ProductType type : ProductType.values()) {\n\t\t\tMap<ProductState, Map<Integer, Set<Product>>> stateMap = new HashMap<>();\n\t\t\tfor (ProductState state : ProductState.values()) {\n\t\t\t\tMap<Integer, Set<Product>> map = new HashMap<>();\n\t\t\t\tstateMap.put(state, map);\n\t\t\t}\n\t\t\ttypeMap.put(type, stateMap);\n\t\t}\n\t}",
"private void addItems() {\n int random3 = 0;\n for (int i = 0; i < MAP_LENGTH; i++) {\n for (int j = 0; j < MAP_LENGTH; j++) {\n random3 = (int)(Math.round(Math.random()*9));\n if (tileMap[i][j].getTerrain() instanceof Grass) {\n if (adjacentCity(i, j) && tileMap[i][j].getCity() == null) { //Only have an item if possibly within city borders\n if (random3 == 0) {\n tileMap[i][j].setResource(new Fruit(i,j)); //Rep Fruit\n } else if (random3 == 1) {\n tileMap[i][j].setResource(new Animal(i,j)); //Rep Animal\n } else if (random3 == 2) {\n tileMap[i][j].setResource(new Forest(i,j)); //Rep Trees (forest)\n } else if (random3 == 3) {\n tileMap[i][j].setResource(new Crop(i,j)); //Rep Crop\n }\n }\n } else {\n if (adjacentCity(i, j)) {\n if (random3 < 2) {\n tileMap[i][j].setResource(new Fish(i, j)); //Rep fish\n } else if (random3 == 4) {\n if (Math.random() < 0.5) {\n tileMap[i][j].setResource(new Whale(i, j)); //Rep whale\n }\n }\n }\n }\n }\n }\n }",
"@Test\n\tpublic void populate_map() {\n\t\t//Arrange\n\t\t//testSteve.populateProductMap();\n\t\t\n\t\t//Act\n\t\ttestSteve.populateProductMap();\n\t\t\n\t\t//Assert\n\t\tAssert.assertEquals(testSteve.getProductGenerator().size(), (16));\n\t}",
"private static void putArrayLstToMaps(ArrayList<MenuItem> items, Gui gui){\n for (MenuItem item : items){\n String name = item.getName();\n int price = item.getPrice();\n gui.getOrderMap().put(name, new Integer[]{price, NOT_SELECTED, INITIAL_QUANTITY});\n }\n }",
"private void prepareListData() {\n listDataHeader = new ArrayList<String>();\n listDataChild = new HashMap<String, List<String>>();\n listDataChild = new HashMap<String, List<String>>();\n\n // Adding child data\n listDataHeader.add(\"Information Technology Subjects\");\n listDataHeader.add(\"Accounting Subjects\");\n listDataHeader.add(\"Business Subjects\");\n\n\n // Adding child data\n List<String> infoTech = new ArrayList<String>();\n infoTech.add(\"ITC 105 COMMUNICATION INFORMATION MANAGEMENT DATABASE \\nDate: 29 OCTOBER 2011 \\nTime: 09:30 \");\n infoTech.add(\"ITC 114 DATABASE MANAGEMENT SYSTEMS \\nDate: OCTOBER 2011 \\nTime: :\");\n infoTech.add(\"ITC 200 DATABASE ADMINISTRATION \\nDate: OCTOBER 2011 \\nTime: :\");\n infoTech.add(\"ITC 203 OBJECT ORIENTED SYSTEM ANALYSIS and DESIGN \\nDate: OCTOBER 2011 \\nTime: :\");\n infoTech.add(\"ITC 211 SYSTEM ANALYSIS \\nDate: OCTOBER 2011 \\nTime: :\");\n infoTech.add(\"ITC 240 IT INFRASTRUCTURE MANAGEMENT \\nDate: OCTOBER 2011 \\nTime: :\");\n infoTech.add(\"ITC 242 INTRODUCTION TO DATA COMMUNICATIONS \\nDate: OCTOBER 2011 \\nTime: :\");\n infoTech.add(\"ITC 254 WIRELESS NETWORKS \\nDate: OCTOBER 2011 \\nTime: :\");\n infoTech.add(\"ITC 303 SOFTWARE DEVELOPMENT PROJECT 1 \\nDate: OCTOBER 2011 \\nTime: :\");\n infoTech.add(\"ITC 308 IT PROJECT \\nDate: OCTOBER 2011 \\nTime: :\");\n infoTech.add(\"ITC 309 SOFTWARE DEVELOPMENT PROJECT 2 \\nDate: OCTOBER 2011 \\nTime: :\");\n infoTech.add(\"ITC 313 PROGRAMMING IN JAVA 2 \\nDate: OCTOBER 2011 \\nTime: :\");\n infoTech.add(\"ITC 314 VISUALISATION AND CLOUD COMPUTING \\nDate: OCTOBER 2011 \\nTime: :\");\n infoTech.add(\"ITC 354 NETWORK ENGINEERING 2 \\nDate: OCTOBER 2011 \\nTime: :\");\n infoTech.add(\"ITC 356 WEB BASED INFORMATION SYSTEMS \\nDate: OCTOBER 2011 \\nTime: :\");\n infoTech.add(\"ITC 358 MANAGEMENT AND INFORMATION SECURITY \\nDate: OCTOBER 2011 \\nTime: :\");\n infoTech.add(\"ITC 383 STRATEGIC INFORMATION MANAGEMENT \\nDate: OCTOBER 2011 \\nTime: :\");\n infoTech.add(\"ITC 412 SYSTEM ANALYSIS PG\\nDate: OCTOBER 2011 \\nTime: :\");\n infoTech.add(\"ITC 423 DATABASE SYSTEMS\\nDate: OCTOBER 2011 \\nTime: :\");\n infoTech.add(\"ITC 431 COMPUTER NETWORKS\\nDate: OCTOBER 2011 \\nTime: :\");\n infoTech.add(\"ITC \\nDate: OCTOBER 2011 \\nTime: :\");\n infoTech.add(\"ITC \\nDate: OCTOBER 2011 \\nTime: :\");\n infoTech.add(\"ITC \\nDate: OCTOBER 2011 \\nTime: :\");\n infoTech.add(\"ITC \\nDate: OCTOBER 2011 \\nTime: :\");\n\n\n\n\n\n\n List<String> acc = new ArrayList<String>();\n acc.add(\"ACC 100 ACCOUNTING 1 \\nDate: 22 OCTOBER 2013 \\nTime: 02:50\");\n acc.add(\"ACC 110 ACCOUNTING 2 \\nDate: 28 OCTOBER 2013 \\nTime: 09:20\");\n\n List<String> business = new ArrayList<String>();\n business.add(\"BUS 110 PROFESSIONAL PRACTICE \\nDate: OCTOBER 2013 \\nTime: 09:20 \");\n business.add(\"BUS 370 BUSINESS INTERNSHIP \\nDate: OCTOBER 2013 \\nTime: 09:20 \");\n\n\n\n listDataChild.put(listDataHeader.get(0), infoTech); // Header, Child data\n listDataChild.put(listDataHeader.get(1), acc);\n listDataChild.put(listDataHeader.get(2), business);\n }",
"private void initFruits() {\n\t\tthis.fruits.clear();\n\t\tGraphFruit fruit = new GraphFruit();\n\t\tList<String> f = game.getFruits();\n\t\tfor(String s : f) {\n\t\t\tfruit.initFruit(s);\n\t\t\tthis.fruits.add(fruit);\n\t\t}\n\t}",
"public void loadDB(){\n ////////////// Code that builds stores with their items lists and builds carts /////////////////////////////////////////////////////////////\n ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n sampleData = new HashMap<>(); //Make 1 hashmap per store (each has that store's items)\n //storeB_Data = new HashMap<>(); //Hashmap that has items of store B\n\n //Add new item to HashMap of items\n sampleData.put(\"026229211706\", new InventoryItem(1.99, \"Notebook\", \"http://www.ryman.co.uk/media/catalog/product/0/3/0399030007.jpg\", \"Others\",\"026229211706\"));\n sampleData.put(\"096619756803\", new InventoryItem(2.99, \"Water Bottle\", \"http://www.ryman.co.uk/media/catalog/product/0/3/0399030007.jpg\", \"Others\",\"096619756803\"));\n sampleData.put(\"9781491962299\", new InventoryItem(4.99, \"Machine Learning\", \"http://www.ryman.co.uk/media/catalog/product/0/3/0399030007.jpg\", \"Others\",\"9781491962299\"));\n sampleData.put(\"1297432524354\", new InventoryItem(4.99, \"Item\", \"http://www.ryman.co.uk/media/catalog/product/0/3/0399030007.jpg\", \"Others\",\"1297432524354\"));\n sampleData.put(\"857263004111\", new InventoryItem(79.99, \"Trendy Jacket\", \"http://www.ryman.co.uk/media/catalog/product/0/3/0399030007.jpg\", \"Others\",\"857263004111\"));\n\n listOfAllItems.add(new CartItem(3.99,\"Toy\",\"http://www.pngmart.com/files/4/Plush-Toy-PNG-Transparent-Image.png\",\"Others\",\"1\",1));\n listOfAllItems.add(new CartItem(3.99,\"Toy\",\"http://www.pngmart.com/files/4/Plush-Toy-PNG-Transparent-Image.png\",\"Others\",\"1\",1));\n listOfAllItems.add(new CartItem(3.99,\"Toy\",\"http://www.pngmart.com/files/4/Plush-Toy-PNG-Transparent-Image.png\",\"Others\",\"1\",1));\n listOfAllItems.add(new CartItem(3.99,\"Toy\",\"http://www.pngmart.com/files/4/Plush-Toy-PNG-Transparent-Image.png\",\"Others\",\"1\",1));\n listOfAllItems.add(new CartItem(3.99,\"Toy\",\"http://www.pngmart.com/files/4/Plush-Toy-PNG-Transparent-Image.png\",\"Others\",\"1\",1));\n listOfAllItems.add(new CartItem(49.99,\"Hands On Machine Learning\",\"https://m.media-amazon.com/images/S/aplus-media/vc/11714e04-b1a6-439d-9482-87e757822f94.jpg\",\"Others\",\"1\",1));\n\n //This data will be populated into instance objects on each scan and \"add to cart\" /////////////////////////////\n //LAST INPUT (in this case, 1) IS THE QUANTITY. SHOULD BE SET TO WHATEVER IS ASSIGNED FROM THE DIALOGUE BOX\n //CartItem notebook = new CartItem(sampleData.get(\"026229212703\").getPrice(), sampleData.get(\"026229212703\").getName(), sampleData.get(\"026229212703\").getImage(), sampleData.get(\"026229212703\").getSalesTaxGroup(), sampleData.get(\"026229212703\").getItemKey(), 1);\n //CartItem water = new CartItem(sampleData.get(\"096619756803\").getPrice(), sampleData.get(\"096619756803\").getName(), sampleData.get(\"096619756803\").getImage(), sampleData.get(\"096619756803\").getSalesTaxGroup(), sampleData.get(\"096619756803\").getItemKey(), 1);\n //CartItem mints = new CartItem(sampleData.get(\"030242940017\").getPrice(), sampleData.get(\"030242940017\").getName(), sampleData.get(\"030242940017\").getImage(), sampleData.get(\"030242940017\").getSalesTaxGroup(), sampleData.get(\"030242940017\").getItemKey(), 1);\n ////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n //CartListOfItems cart = new CartListOfItems();\n //cart.addToCart(notebook);\n //cart.addToCart(toyCar);\n }",
"private void prepareListData() {\n listDataHeader = new ArrayList<String>();\n listDataChild = new HashMap<String, List<String>>();\n\n // Adding child data\n listDataHeader.add(\"Cloths\");\n listDataHeader.add(\"Tools\");\n listDataHeader.add(\"Booking\");\n\n // Adding child data\n List<String> Cloths = new ArrayList<String>();\n Cloths.add(\"Silk Shit\");\n Cloths.add(\"Godfather Coat\");\n Cloths.add(\"Cow Boy jacket\");\n Cloths.add(\"Polo T-shirt\");\n Cloths.add(\"Ugly Jeans\");\n Cloths.add(\"Dark Jeans\");\n Cloths.add(\"Underwears\");\n\n List<String> Tools = new ArrayList<String>();\n Tools.add(\"Tester\");\n Tools.add(\"Betteries\");\n Tools.add(\"Charger\");\n Tools.add(\"UPS plugs\");\n Tools.add(\"Universal cheager\");\n Tools.add(\"Torch\");\n\n List<String> Booking = new ArrayList<String>();\n Booking.add(\"Hotel Booking\");\n Booking.add(\"Hotel Reservation\");\n Booking.add(\"Air Ticket\");\n Booking.add(\"Air Ticket Reservation\");\n Booking.add(\"Train Ticket\");\n Booking.add(\"Train Ticket Reservation\");\n\n listDataChild.put(listDataHeader.get(0), Cloths); // Header, Child data\n listDataChild.put(listDataHeader.get(1), Tools);\n listDataChild.put(listDataHeader.get(2), Booking);\n }",
"private Itemsets() {\n\t\t\tfrequentItemsets = new LinkedHashMap<Itemset, Integer>();\n\t\t\tinfrequentItemsets = new LinkedHashMap<Itemset, Integer>();\n\t\t}",
"private void buildCategories() {\n List<Category> categories = categoryService.getCategories();\n if (categories == null || categories.size() == 0) {\n throw new UnrecoverableApplicationException(\n \"no item types found in database\");\n }\n\n Map<Category, List<Category>> categoriesMap = new HashMap<Category, List<Category>>();\n for (Category subCategory : categories) {\n Category parent = subCategory.getParentCategory();\n if (categoriesMap.get(parent) == null) {\n categoriesMap.put(parent, new ArrayList<Category>());\n categoriesMap.get(parent).add(subCategory);\n } else {\n categoriesMap.get(parent).add(subCategory);\n }\n }\n\n this.allCategories = categories;\n this.sortedCategories = categoriesMap;\n }",
"private void populateDictionaryBySynonyms() {\n\n Enumeration e = dictionaryTerms.keys();\n while (e.hasMoreElements()) {\n String word = (String) e.nextElement();\n String tag = dictionaryTerms.get(word);\n\n ArrayList<String> synonyms = PyDictionary.findSynonyms(word);\n\n for (int i = 0; i < synonyms.size(); i++) {\n if (!dictionaryTerms.containsKey(synonyms.get(i))) {\n dictionaryTerms.put(synonyms.get(i), tag);\n }\n }\n }\n }",
"private void fillData() {\n\t\tfor(Entry<String, HashMap<String, Double>> entry : m.map.entrySet()) {\n\t\t\tfor(Entry<String, Double> subEntry : entry.getValue().entrySet()) {\n\t\t\t\tMappingData item = new MappingData(entry.getKey(), subEntry.getKey(), subEntry.getValue());\n\t\t\t\tdataList.add(item);\n\t\t\t}\n\t\t}\n\t}",
"public void setGenre(String genre){\n\t\t//FIXME\n\t\tthis.genre = genre;\n\t}",
"private void initializeData() {\n\n /**\n * Food\n */\n mFoodArrayList = new ArrayList<>();\n HashMap<String, String> hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"1\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_1));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"2\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_2));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"3\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_3));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"4\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_4));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"5\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_5));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"6\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_6));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"7\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_7));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"8\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_8));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"9\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_9));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"10\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_10));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"11\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_11));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"12\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_12));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"13\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_13));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"14\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_14));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"15\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_15));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"16\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_16));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"17\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_17));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"18\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_18));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"19\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_19));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"20\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_20));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"21\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_21));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"22\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_22));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"23\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_23));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"24\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_24));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"25\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_25));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"26\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_26));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"27\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_27));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"28\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_28));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"29\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_29));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"30\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_30));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"31\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_31));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"32\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_32));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"33\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_33));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"34\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_34));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"35\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_35));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"36\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_36));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"37\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_37));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"38\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_38));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"39\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_39));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"40\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_40));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"41\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_41));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"42\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_42));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"43\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_43));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"44\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_44));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"45\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_45));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"46\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_46));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"47\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_47));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"48\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_48));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"49\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_49));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"50\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_50));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"51\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_51));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"52\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_52));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"53\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_53));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"54\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_54));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n hashMapac = new HashMap<String, String>();\n\n hashMapac.put(\"id\", \"55\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_55));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"56\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_56));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"57\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_57));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"58\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_58));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"59\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_59));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"60\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_60));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"61\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_61));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"62\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_62));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"63\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_63));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"64\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_64));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"65\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_65));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"66\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_66));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"67\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_67));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"68\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_68));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"69\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_69));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"70\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_70));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"71\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_71));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"72\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_72));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"73\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_73));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"74\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_74));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"75\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_75));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"76\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_76));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"77\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_77));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"78\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_78));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"79\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_79));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"80\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_80));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"81\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_81));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"82\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_82));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"83\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_83));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"84\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_84));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"85\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_85));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"86\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_86));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"87\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_87));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"88\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_88));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"89\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_89));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"90\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_90));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"91\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_91));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"92\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_92));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"93\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_93));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"94\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_94));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"95\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_95));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"96\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_96));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"97\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_97));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"98\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_98));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"99\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_99));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"127\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_food_127));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_food_url));\n mFoodArrayList.add(hashMapac);\n\n\n /**\n * Environment\n */\n mEnvironmentArrayList = new ArrayList<HashMap<String, String>>();\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"109\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_environment_109));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_environment_url));\n mEnvironmentArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"110\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_environment_110));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_environment_url));\n mEnvironmentArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"111\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_environment_111));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_environment_url));\n mEnvironmentArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"112\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_environment_112));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_environment_url));\n mEnvironmentArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"113\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_environment_113));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_environment_url));\n mEnvironmentArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"114\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_environment_114));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_environment_url));\n mEnvironmentArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"115\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_environment_115));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_environment_url));\n mEnvironmentArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"116\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_environment_116));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_environment_url));\n mEnvironmentArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"117\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_environment_117));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_environment_url));\n mEnvironmentArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"118\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_environment_118));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_environment_url));\n mEnvironmentArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"119\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_environment_119));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_environment_url));\n mEnvironmentArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"120\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_environment_120));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_environment_url));\n mEnvironmentArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"121\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_environment_121));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_environment_url));\n mEnvironmentArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"122\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_environment_122));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_environment_url));\n mEnvironmentArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"123\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_environment_123));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_environment_url));\n mEnvironmentArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"124\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_environment_124));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_environment_url));\n mEnvironmentArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"125\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_environment_125));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_environment_url));\n mEnvironmentArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"126\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_environment_126));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_environment_url));\n mEnvironmentArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"128\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_environment_128));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_environment_url));\n mEnvironmentArrayList.add(hashMapac);\n\n\n /**\n * Medication\n */\n mMedicationArrayList = new ArrayList<HashMap<String, String>>();\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"100\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_medication_100));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_medication_url));\n mMedicationArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"101\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_medication_101));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_medication_url));\n mMedicationArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"102\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_medication_102));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_medication_url));\n mMedicationArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"103\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_medication_103));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_medication_url));\n mMedicationArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"104\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_medication_104));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_medication_url));\n mMedicationArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"105\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_medication_105));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_medication_url));\n mMedicationArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"106\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_medication_106));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_medication_url));\n mMedicationArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"107\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_medication_107));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_medication_url));\n mMedicationArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"108\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_medication_108));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_medication_url));\n mMedicationArrayList.add(hashMapac);\n\n hashMapac = new HashMap<String, String>();\n hashMapac.put(\"id\", \"129\");\n hashMapac.put(\"value\", getResources().getString(R.string.allergy_medication_129));\n hashMapac.put(StringConstants.KEY_SEARCH_LIST_HYPERLINK, getResources().getString(R.string.allergy_medication_url));\n mMedicationArrayList.add(hashMapac);\n }",
"public void printAverageRatingsByYearAfterAndGenre(){\n ThirdRatings sr = new ThirdRatings();\n int raters = sr.getRaterSize();\n System.out.println(\"read data for \" + raters + \" raters\");\n System.out.println(\"-------------------------------------\");\n \n //MovieDatabase.initialize(\"ratedmovies_short.csv\");\n MovieDatabase.initialize(\"ratedmoviesfull.csv\");\n System.out.println(\"read data for \" + MovieDatabase.size() + \" movies\");\n System.out.println(\"-------------------------------------\");\n \n AllFilters f = new AllFilters();\n YearAfterFilter y = new YearAfterFilter(1990);\n GenreFilter g = new GenreFilter(\"Drama\");\n f.addFilter(y);\n f.addFilter(g);\n int minRatings = 8;\n ArrayList<Rating> aveRat = sr.getAverageRatingsByFilter(minRatings, f);\n System.out.println(\"Found \" + aveRat.size() + \" movies\");\n System.out.println(\"-------------------------------------\");\n // sort arraylist\n Collections.sort(aveRat);\n for(Rating r: aveRat){\n System.out.println(r.getValue() + \"\\t\" \n + MovieDatabase.getYear(r.getItem()) + \"\\t\"\n + MovieDatabase.getTitle(r.getItem()) + \"\\t\"\n + MovieDatabase.getGenres(r.getItem()));\n }\n System.out.println(\"-------------------------------------\");\n \n \n }",
"static private void loadGame() {\n ArrayList loadData = data.loadGame();\n\n //inventory\n inventory = new Inventory();\n LinkedTreeMap saveMap = (LinkedTreeMap) loadData.get(0);\n if (!saveMap.isEmpty()) {\n LinkedTreeMap inventoryItemWeight = (LinkedTreeMap) saveMap.get(\"itemWeight\");\n LinkedTreeMap inventoryItemQuantity = (LinkedTreeMap) saveMap.get(\"inventory\");\n String inventoryItemQuantityString = inventoryItemQuantity.toString();\n inventoryItemQuantityString = removeCrapCharsFromString(inventoryItemQuantityString);\n String itemListString = inventoryItemWeight.toString();\n itemListString = removeCrapCharsFromString(itemListString);\n\n for (int i = 0; i < inventoryItemWeight.size(); i++) {\n String itemSet;\n double itemQuantity;\n if (itemListString.contains(\",\")) {\n itemQuantity = Double.parseDouble(inventoryItemQuantityString.substring(inventoryItemQuantityString.indexOf(\"=\") + 1, inventoryItemQuantityString.indexOf(\",\")));\n inventoryItemQuantityString = inventoryItemQuantityString.substring(inventoryItemQuantityString.indexOf(\",\") + 1, inventoryItemQuantityString.length());\n itemSet = itemListString.substring(0, itemListString.indexOf(\",\"));\n itemListString = itemListString.substring(itemListString.indexOf(\",\") + 1, itemListString.length());\n } else {\n itemSet = itemListString;\n itemQuantity = Double.parseDouble(inventoryItemQuantityString.substring(inventoryItemQuantityString.indexOf(\"=\") + 1, inventoryItemQuantityString.length()));\n }\n String itemName = itemSet.substring(0, itemSet.indexOf(\"=\"));\n int itemWeight = Double.valueOf(itemSet.substring(itemSet.indexOf(\"=\") + 1, itemSet.length())).intValue();\n while (itemQuantity > 0) {\n Item item = new Item(itemName, \"\", itemWeight, true);\n inventory.addItemInInventory(item);\n itemQuantity--;\n }\n }\n }\n\n //itemList\n itemLocation = new ItemLocation();\n saveMap = (LinkedTreeMap) loadData.get(1);\n if (!saveMap.isEmpty()) {\n System.out.println(saveMap.keySet());\n LinkedTreeMap itemLocationOnMap = (LinkedTreeMap) saveMap;\n String rooms = saveMap.keySet().toString();\n rooms = removeCrapCharsFromString(rooms);\n for (int j = 0; j <= itemLocationOnMap.size() - 1; j++) {\n String itemToAdd;\n\n if (rooms.contains(\",\")) {\n itemToAdd = rooms.substring(0, rooms.indexOf(\",\"));\n } else {\n itemToAdd = rooms;\n }\n\n rooms = rooms.substring(rooms.indexOf(\",\") + 1, rooms.length());\n ArrayList itemInRoom = (ArrayList) itemLocationOnMap.get(itemToAdd);\n for (int i = 0; i < itemInRoom.size(); i++) {\n Item itemLocationToAdd;\n LinkedTreeMap itemT = (LinkedTreeMap) itemInRoom.get(i);\n String itemName = itemT.get(\"name\").toString();\n String itemDesc = \"\";\n int itemWeight = (int) Double.parseDouble(itemT.get(\"weight\").toString());\n boolean itemUseable = Boolean.getBoolean(itemT.get(\"useable\").toString());\n\n itemLocationToAdd = new PickableItem(itemName, itemDesc, itemWeight, itemUseable);\n itemLocation.addItem(itemToAdd, itemLocationToAdd);\n\n }\n }\n //set room\n String spawnRoom = loadData.get(3).toString();\n currentRoom = getRoomFromName(spawnRoom);\n }\n }",
"public void setGenre(TheatreGenre genre) {\n\t\tthis.genre = genre;\n\t}",
"public static void main(String[] args) {\n\t\tMap<String,Integer>grocery=new HashMap<>();\n\t\tgrocery.put(\"milk\",1);\n\t\tgrocery.put(\"cucumber\",3);\n\t\tgrocery.put(\"banana\",12);\n\t\tgrocery.put(\"cheese\",2);\n\t\t\n\t\tSystem.out.println(grocery);\n//create a map of items to buy, we want to save order\n\t\tMap<String,Integer>household=new LinkedHashMap<>();\n\t\thousehold.put(\"lysol\",2);\n\t\thousehold.put(\"sanitizer\",4);\n\t\thousehold.put(\"papertowel\",2);\n\t\thousehold.put(\"facemask\",20);\n\t\tSystem.out.println(household);\n\t\t\n\t\t//create a map in which we store all previous items in ascending order\n\t\tMap<String,Integer>shopping=new TreeMap<>();\n\t\tshopping.putAll(household);\n\t\tSystem.out.println(shopping);\n\t\t\n\t\t//get all keys using loop\n\t\tfor(String key:shopping.keySet()) {\n\t\t\tSystem.out.println(\"Key: \"+key);\t\n\t\t}\n\t\t//get all keys using iterator\n\t\tIterator<String> it=shopping.keySet().iterator();\n\t\twhile(it.hasNext()) {\n\t\tSystem.out.println(\"Key=\"+it.next());\n\t\t\n\t}\n\t\t//get all values using loop\n\t\tfor(int val:shopping.values()) {\n\t\t\tSystem.out.println(\"Values: \"+val);\n\t\t}\n\t\t//get all values using iterator\n\t\tIterator<Integer>iterator=shopping.values().iterator();\n\t\twhile(iterator.hasNext()) {\n\t\t\tSystem.out.println(\"Key=\"+iterator.next());\n\t\t\t\t\n}\n}",
"@GET(\"/v1/genres\")\r\n void getGenres( //\r\n @Query(\"apikey\") String apikey, //\r\n @Query(\"pretty\") boolean pretty, //\r\n @Query(\"catalog\") String catalog, //\r\n Callback<Collection<GenreData>> callBack);",
"@Override\r\n\tpublic Iterator createIterator() {\n\t\treturn bestSongs.values().iterator();\r\n\t}",
"void setGenreDao(final GenreDao genreDao);",
"private void populatepets(){\r\n\t\tpets.add(new Cat(\"UnNamed\"));\r\n\t\tpets.add(new Cow(\"UnNamed\"));\r\n\t\tpets.add(new Dog(\"UnNamed\"));\r\n\t\tpets.add(new Rabbit(\"UnNamed\"));\r\n\t\tpets.add(new Rat(\"UnNamed\"));\r\n\t\tpets.add(new Velociraptor(\"UnNamed\"));\r\n\t}",
"public Map<String, Kingdom> generateAllRulers() {\n Map<String, String> kingdomWithAnimal;\n kingdomWithAnimal = kingdomRepository.getRulersWithAnimal();\n Map<String, Kingdom> kingdoms = new HashMap<>();\n for (String emblem : kingdomWithAnimal.keySet()) {\n Kingdom kingdom = new Kingdom(emblem, kingdomWithAnimal.get(emblem));\n kingdom.makeCipherFromAnimalName();\n kingdoms.put(emblem, kingdom);\n }\n return kingdoms;\n }",
"private Collection<LR1ItemSet> createItemSets( Grammar grammar)\n {\n Map<LR1ItemSet, LR1ItemSet> itemSets = new LinkedHashMap<LR1ItemSet, LR1ItemSet>();\n \n LR1ItemSet itemSet = new LR1ItemSet();\n itemSet.kernel.add( new LR1Item( grammar.rules().get( 0), Grammar.terminus));\n itemSet.closure( grammar);\n itemSets.put( itemSet, itemSet);\n \n List<LR1ItemSet> stack = new ArrayList<LR1ItemSet>();\n stack.add( itemSet);\n while( stack.size() > 0)\n {\n itemSet = stack.remove( 0);\n\n //\n // Compute the kernel of the successors of the LR1ItemSet, but only incur the cost\n // of closure if the LR1ItemSet has not already been created. LR1ItemSets are unique\n // by kernel.\n //\n itemSet.successors( grammar);\n for( LR1ItemSet successor: itemSet.successors.values())\n {\n LR1ItemSet existing = itemSets.get( successor);\n if ( existing != null)\n {\n LR1Item firstItem = existing.kernel.iterator().next();\n String leadSymbol = firstItem.rule.rhs().get( firstItem.dot - 1);\n itemSet.successors.put( leadSymbol, existing);\n }\n else\n {\n successor.closure( grammar);\n itemSets.put( successor, successor);\n stack.add( successor);\n }\n }\n }\n \n return itemSets.values();\n }"
] | [
"0.64548993",
"0.5927457",
"0.5870315",
"0.5798062",
"0.5772562",
"0.5732974",
"0.56592524",
"0.5555003",
"0.5468536",
"0.5444929",
"0.5425336",
"0.53752923",
"0.5321917",
"0.52427083",
"0.52373695",
"0.521166",
"0.519455",
"0.519292",
"0.5185226",
"0.51844454",
"0.5171038",
"0.5163058",
"0.5126707",
"0.5125406",
"0.5108841",
"0.5108509",
"0.5107828",
"0.5099385",
"0.5091031",
"0.5091031",
"0.50793904",
"0.50779444",
"0.5076654",
"0.50658345",
"0.5042696",
"0.5032999",
"0.50226426",
"0.5006752",
"0.50023437",
"0.49947137",
"0.49843982",
"0.49801224",
"0.49687383",
"0.49660972",
"0.49632245",
"0.49599558",
"0.4954943",
"0.49468634",
"0.49346963",
"0.49280298",
"0.49181762",
"0.49023464",
"0.4898998",
"0.4893757",
"0.4873008",
"0.485906",
"0.48584607",
"0.48541334",
"0.48481745",
"0.48481745",
"0.48478472",
"0.48293576",
"0.48286",
"0.48279604",
"0.48262438",
"0.4822554",
"0.4819616",
"0.4803176",
"0.48010117",
"0.47993803",
"0.47934303",
"0.4789418",
"0.477085",
"0.47669375",
"0.47642285",
"0.47575125",
"0.47488827",
"0.47471553",
"0.47428453",
"0.47308245",
"0.47258162",
"0.47219017",
"0.47218522",
"0.47175968",
"0.47164786",
"0.47153312",
"0.4714593",
"0.4713293",
"0.4712594",
"0.470558",
"0.47013927",
"0.46989483",
"0.46949345",
"0.46834588",
"0.46788666",
"0.4678818",
"0.46775782",
"0.4657913",
"0.4647277",
"0.46448854"
] | 0.8224507 | 0 |
Method that populates the everyPerson TreeMap from the People ArrayList in the ItemContainer | public void populatePeopleMap(ItemContainer itemContainer) {
for (People person : itemContainer.getPeople()) {
if (everyPerson.containsKey(person.getName())) {
TreeSet<People> people = everyPerson.get(person.getName());
people.add(person);
everyPerson.put(person.getName(), people);
} else {
TreeSet<People> tempSet = new TreeSet<People>();
tempSet.add(person);
everyPerson.put(person.getName(), tempSet);
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public TreeMap<Integer, Person> getPersons() {\n return _persons;\n }",
"public static void main(String[] args) {\n Person.insertToPeopleMap(new Person(39105153322l,\"Romas\",\"Garkas\"));\n Person.insertToPeopleMap(new Person(38512013245l,\"Arnas\",\"Lionginas\"));\n Person.insertToPeopleMap(new Person(48603142299l,\"Maryte\",\"Melninkaite\"));\n Person.insertToPeopleMap(new Person(49009103377l,\"Dalia\",\"Morka\"));\n Person.insertToPeopleMap(new Person(49009103377l,\"Milda\",\"Morkiene\"));\n\n\n for (Map.Entry<Long, List<Person>> personEntry : Person.getPeople().entrySet()){\n for (Person person : personEntry.getValue()){\n System.out.println(\"A.K.: \" + person.getCitizenCode() + \" Vardas: \" + person.getName() + \" Pavarde: \" + person.getSurname());\n }\n }\n }",
"public static void main(String[] args) {\n TreeSet<Person> personsByName=new TreeSet<>(new NameComparator());\n personsByName.add(new Person(\"Popescu\", 27));\n personsByName.add(new Person(\"Ionescu\", 32));\n personsByName.add(new Person(\"Andrei\", 18));\n\n for (Person p:personsByName){\n System.out.println(\"nume: \"+p.getName()+\", varsta:\"+p.getAge());\n }\n\n //creating a TreeSet with persons sorted by age\n TreeSet<Person> personsByAge=new TreeSet<>(new AgeComparator());\n personsByAge.addAll(personsByName);\n\n for (Person p:personsByAge){\n System.out.println(\"nume: \"+p.getName()+\", varsta:\"+p.getAge());\n }\n\n //creating an HashMap with persons and hobbies\n HashMap<Person, List<Hobby>> personHobbies=new HashMap<>();\n\n Adress a1=new Adress(\"Lacul Morii\", \"Bucuresti\", \"Romania\");\n Adress a2=new Adress(\"Tineretului\", \"Bucuresti\", \"Romania\");\n Adress a3=new Adress(\"Bois de Vincennes\", \"Paris\", \"France\");\n Adress a4=new Adress(\"Via Capella\", \"Nocelle\", \"Italy\");\n\n List<Adress> adressesForHobby1=new ArrayList<>();\n adressesForHobby1.add(a1);\n adressesForHobby1.add(a2);\n adressesForHobby1.add(a4);\n\n List<Adress> adressesForHobby2=new ArrayList<>();\n adressesForHobby2.add(a3);\n adressesForHobby2.add(a4);\n\n Hobby hobby1=new Hobby(\"running\", 4, adressesForHobby1);\n Hobby hobby2=new Hobby(\"cycling\", 3, adressesForHobby2);\n\n List<Hobby> hobbies=new ArrayList<>();\n hobbies.add(hobby1);\n hobbies.add(hobby2);\n\n Person person=new Person(\"Popescu\", 27);\n personHobbies.put(person, hobbies);\n for (Hobby h: personHobbies.get(person)){\n for (Adress adr: h.getAdresses()){\n System.out.println(h.getName()+\" \"+adr.getCountry());\n }\n }\n\n\n\n\n\n }",
"public void populateGenreMap(ItemContainer itemContainer) {\n\t\tfor (Genres genre : itemContainer.getGenres()) {\n\t\t\tif (everyGenre.containsKey(genre.getGenre())) {\n\t\t\t\tTreeSet<Genres> genres = everyGenre.get(genre.getGenre());\n\t\t\t\tgenres.add(genre);\n\t\t\t\teveryGenre.put(genre.getGenre(), genres);\n\t\t\t} else {\n\t\t\t\tTreeSet<Genres> tempSet = new TreeSet<Genres>();\n\t\t\t\ttempSet.add(genre);\n\t\t\t\teveryGenre.put(genre.getGenre(), tempSet);\n\t\t\t}\n\t\t}\n\t}",
"public static Map<String, Person> GetPersons()\n {\n List<Person> persons = dataWraper.getAll(FrekenBok.class);\n Map<String, Person> personMap = new HashMap<>();\n\n persons.forEach( (i)->\n personMap.put(i.GetName(), i)\n );\n\n persons = dataWraper.getAll(LitleBoy.class);\n persons.forEach( (i)->\n personMap.put(i.GetName(), i)\n );\n\n return personMap;\n }",
"public void createTreeMap() {\n myList = new TreeMap<>();\n scrabbleList = new TreeMap<>();\n }",
"private void populatepets(){\r\n\t\tpets.add(new Cat(\"UnNamed\"));\r\n\t\tpets.add(new Cow(\"UnNamed\"));\r\n\t\tpets.add(new Dog(\"UnNamed\"));\r\n\t\tpets.add(new Rabbit(\"UnNamed\"));\r\n\t\tpets.add(new Rat(\"UnNamed\"));\r\n\t\tpets.add(new Velociraptor(\"UnNamed\"));\r\n\t}",
"private static Map<String, ArrayList<String>> getPersonsCityWise() {\n ArrayList<String> cityNames = new ArrayList<String>();\n\n for (String i : bookList.keySet()) {\n contactDetailsCity = bookList.get(i);\n for (int j = 0; j < contactDetailsCity.size(); j++) {\n cityNames.add(contactDetailsCity.get(j).getCity());\n }\n }\n Set<String> duplicateRemoval = new LinkedHashSet<String>();\n duplicateRemoval.addAll(cityNames);\n cityNames.clear();\n cityNames.addAll(duplicateRemoval);\n\n for (int y = 0; y < cityNames.size(); y++) {\n ArrayList<String> personNames = new ArrayList<String>();\n for (String i : bookList.keySet()) {\n contactDetailsCity = bookList.get(i);\n for (int j = 0; j < contactDetailsCity.size(); j++) {\n Contact initial = contactDetailsCity.get(j);\n if (initial.getCity().equals(cityNames.get(y))) {\n personNames.add(initial.getFirstName() + \" \" + initial.getLastName());\n }\n }\n }\n cityList.put(cityNames.get(y), personNames);\n }\n return cityList;\n }",
"private static void treeMapMap(Map<Integer, String> treeMapMap) {\n System.out.println(\"----------------------------- TreeMap ----------------------------\");\n System.out.println(\"To work with \\\"TreeMap\\\" we need to add \\\"Equals and HashCode\\\" and \\\"Comparable\\\" to the Person Class!\");\n System.out.println(\"\\\"TreeMap\\\" is ordered by key\");\n treeMapMap.put(7, \"Cristiano Ronaldo\");\n treeMapMap.put(10, \"Leo Messi\");\n treeMapMap.put(8, \"Avi Nimni\");\n treeMapMap.put(24, \"Kobi Brian\");\n PrintUtils.printMap(treeMapMap);\n System.out.println();\n // STEP 2 - set p3 name to \"Moshe\"\n System.out.println(\"Set the name of player number 8 to be \\\"Moshe\\\":\");\n treeMapMap.replace(8, \"Avi Nimni\", \"Moshe\");\n // if you use \"put\" instead of \"replace\" it will work to!\n PrintUtils.printMap(treeMapMap);\n System.out.println();\n // STEP 3 - add p5 to the end of the list using using ADD method\n System.out.println(\"Add p5 to the end of the list using ADD method:\");\n System.out.println(\"Not an option!\");\n System.out.println();\n // STEP 4 - add p6 to position 3 the end of the list using ADD method\n System.out.println(\"Add p6 to position 3 the end of the list using ADD method:\");\n System.out.println(\"Not an option, you can wright over it!\");\n System.out.println();\n // STEP 5 - remove p2 from the list\n System.out.println(\"Remove p2 from the list and printing the list using a static method in a utility class:\");\n treeMapMap.remove(10, \"Leo Messi\");\n PrintUtils.printMap(treeMapMap);\n System.out.println();\n }",
"private MyPersonModelProvider() {\n\t\t\tpersons = new ArrayList<MyPerson>();\n\t\t\tpersons.add(new MyPerson(\"AFirstName1\", \"ALastName1\", \"female\", true));\n\t\t persons.add(new MyPerson(\"CFirstName1\", \"CLastName1\", \"female\", true));\n\t\t persons.add(new MyPerson(\"DFirstName1\", \"DLastName1\", \"male\", true));\n\t\t persons.add(new MyPerson(\"BFirstName1\", \"BLastName1\", \"female\", true));\n\t\t persons.add(new MyPerson(\"AFirstName3\", \"ALastName3\", \"female\", true));\n\t\t persons.add(new MyPerson(\"CFirstName3\", \"CLastName3\", \"female\", true));\n\t\t persons.add(new MyPerson(\"DFirstName3\", \"DLastName3\", \"male\", true));\n\t\t persons.add(new MyPerson(\"BFirstName3\", \"BLastName3\", \"female\", true));\n\t\t persons.add(new MyPerson(\"AFirstName2\", \"ALastName2\", \"male\", false));\n\t\t persons.add(new MyPerson(\"CFirstName2\", \"CLastName2\", \"female\", true));\n\t\t persons.add(new MyPerson(\"DFirstName2\", \"DLastName2\", \"female\", true));\n\t\t persons.add(new MyPerson(\"BFirstName2\", \"BLastName2\", \"female\", true));\n\t\t}",
"public static List<Person> checkSortLists(List<Person> people){\r\n TreeMap tm = new TreeMap();\r\n for (Person person: people) {\r\n if(person.getAge()>18){\r\n System.out.println(\"checking beyond\");\r\n return null;\r\n }\r\n tm.put(person.getNo(),person);\r\n }\r\n if(people.size()!=tm.size()){\r\n System.out.println(\"checking redundant\");\r\n return null;\r\n }\r\n List<Person> sortPeople = new ArrayList(tm.values());\r\n return sortPeople;\r\n }",
"public List<Person> getAllPerson() {\n \t\n //Collection<Person> c = personMap.values();\n List<Person> list = new ArrayList<Person>();\n //list.addAll(c);*/\n list = queryExecutor.selectAll();\n return list;\n }",
"private void createDOMTree(){\n\t\tElement rootEle = dom.createElement(\"Personnel\");\n\t\tdom.appendChild(rootEle);\n\n\t\t//No enhanced for\n\t\tIterator it = user.iterator();\n\t\twhile(it.hasNext()) {\n\t\t\tUserInformation b = (UserInformation)it.next();\n\t\t\t//For each Book object create element and attach it to root\n\t\t\tElement bookEle = createUserElement(b);\n\t\t\trootEle.appendChild(bookEle);\n\t\t}\n\t}",
"ObservableList<Person> getDisplayedPersonList();",
"@PostConstruct\r\n public void init() {\n List<Person> personList = personRepository.findAll();\r\n for(Person person:personList)\r\n personHashMap.put(person.getId(),person);\r\n }",
"public void setSuggestions(ArrayList<PersonDTO>persons){\n personsMap=new HashMap<>();\n for(PersonDTO person:persons){\n personsMap.put(person.getName()+\" \"+person.getSurname(),person);\n }\n }",
"public void initPeople() {\n this.people = new ArrayList<>();\n this.people.addAll(services.getPeopleList());\n }",
"private void populateTaxonomyTree() {\n\t\tfor (Node s: serviceMap.values()) {\n\t\t\taddServiceToTaxonomyTree(s);\n\t\t}\n\t}",
"public static Map<Integer, List<Person>> filterAndGroupPersons(final List<Person> persons)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}",
"public void createAnimalsCollection() {\n ArrayList<DataSetAnimal> animalsFetched = getDFO().getAnimalData(getFILE_NAME()).getAnimals();\n setAnimals(new ArrayList<>());\n for (DataSetAnimal animal: animalsFetched) {\n String tmpBreed = animal.getBreedOrType().substring(animal.getBreedOrType().lastIndexOf(\" \") + 1);\n switch (tmpBreed) {\n case \"dolphin\":\n getAnimals().add(new AnimalDolphin(animal.getBreedOrType(), animal.getName(), animal.getYearOfBirth()));\n break;\n case \"duck\":\n getAnimals().add(new AnimalDuck(animal.getBreedOrType(), animal.getName(), animal.getYearOfBirth()));\n break;\n case \"cat\":\n getAnimals().add(new AnimalCat(animal.getBreedOrType(), animal.getName(), animal.getYearOfBirth()));\n break;\n case \"chicken\":\n getAnimals().add(new AnimalChicken(animal.getBreedOrType(), animal.getName(), animal.getYearOfBirth()));\n break;\n case \"horse\":\n getAnimals().add(new AnimalHorse(animal.getBreedOrType(), animal.getName(), animal.getYearOfBirth()));\n break;\n case \"shark\":\n getAnimals().add(new AnimalShark(animal.getBreedOrType(), animal.getName(), animal.getYearOfBirth()));\n break;\n case \"parakeet\":\n getAnimals().add(new AnimalParakeet(animal.getBreedOrType(), animal.getName(), animal.getYearOfBirth()));\n break;\n default:\n getAnimals().add(new AnimalDog(animal.getBreedOrType(), animal.getName(), animal.getYearOfBirth()));\n break;\n }\n }\n }",
"public void setPersons(Hashtable<String, Person> persons) {\r\n\t\tthis.persons = persons;\r\n\t}",
"private void fillTeachers() {\n for(Teacher t : MainFrame.etablissement.getTeachers()) {\n principalTeacher.addItem(t);\n }\n }",
"@Test\n public void testListMayors03() {\n System.out.println(\"listMayors\");\n\n Map expResult = new LinkedHashMap();\n\n City city1 = (new City(new Pair(41.237364, -8.846746), \"city1\", 72));\n city1.setMayor(new User(\"nick6\", \"[email protected]\"));\n expResult.put(city1, city1.getMayor());\n\n City city5 = (new City(new Pair(41.337408, -8.291943), \"city5\", 74));\n city5.setMayor(new User(\"nick6\", \"[email protected]\"));\n expResult.put(city5, city5.getMayor());\n\n City city6 = (new City(new Pair(41.314965, -8.423371), \"city6\", 80));\n city6.setMayor(new User(\"nick0\", \"[email protected]\"));\n expResult.put(city6, city6.getMayor());\n\n City city3 = (new City(new Pair(41.118700, -8.589700), \"city3\", 42));\n city3.setMayor(new User(\"nick8\", \"[email protected]\"));\n expResult.put(city3, city3.getMayor());\n\n City city4 = (new City(new Pair(41.467407, -8.964340), \"city4\", 64));\n city4.setMayor(new User(\"nick8\", \"[email protected]\"));\n expResult.put(city4, city4.getMayor());\n\n City city0 = (new City(new Pair(41.243345, -8.674084), \"city0\", 28));\n city0.setMayor(new User(\"nick2\", \"[email protected]\"));\n expResult.put(city0, city0.getMayor());\n\n City city2 = (new City(new Pair(40.519841, -8.085113), \"city2\", 81));\n city2.setMayor(new User(\"nick2\", \"[email protected]\"));\n expResult.put(city2, city2.getMayor());\n\n City city7 = (new City(new Pair(40.822244, -8.794953), \"city7\", 11));\n city7.setMayor(new User(\"nick5\", \"[email protected]\"));\n expResult.put(city7, city7.getMayor());\n\n City city9 = (new City(new Pair(40.851360, -8.136585), \"city9\", 65));\n city9.setMayor(new User(\"nick5\", \"[email protected]\"));\n expResult.put(city9, city9.getMayor());\n\n City city8 = (new City(new Pair(40.781886, -8.697502), \"city8\", 7));\n city8.setMayor(new User(\"nick3\", \"[email protected]\"));\n expResult.put(city8, city8.getMayor());\n\n Map result = new LinkedHashMap(sn10.listMayors());\n\n // To compare Values.\n assertThat(result, is(expResult));\n }",
"private void loadExamplePeople(){\r\n\t\tpeople.add(new Person(\"Quiche\",\"Lorraine\",\"617-253-1000\",\"[email protected]\",Color.RED,this));\r\n\t\tpeople.add(new Person(\"Alice\",\"Whacker\",\"617-253-7788\",\"[email protected]\",Color.RED.darker().darker(),this));\r\n\t\tpeople.add(new Person(\"Zygorthian\",\"Space-Raiders\",\"617-253-1541\",\"[email protected]\",new Color(50,70,90),this));\r\n\t\tpeople.add(new Person(\"Opus\",\"\",\"617-253-1000\",\"[email protected]\",Color.RED.darker(),this));\r\n\t\tpeople.add(new Person(\"Rick\",\"Chang\",\"617-232-3257\",\"[email protected]\",Color.RED.darker().darker().darker(),this));\r\n\t\tpeople.add(new Person(\"Ben\",\"Bitdiddle\",\"303-494-4774\",\"[email protected]\",new Color(56,50,50),this));\r\n\t\t\r\n\t}",
"public Map<String, Person> getPeople() {\n return people;\n }",
"public static void main(String[] args) {\n\n\t\tPerson krishna = new Person(101, \"Krisha\", \"TX\");\n\t\tPerson chani = new Person(111, \"Chani\", \"CA\");\n\t\tPerson boni = new Person(121, \"Boni\", \"FL\");\n\t\tPerson gopi = new Person(91, \"Gopi\", \"NC\");\n\t\tPerson suss = new Person(101, \"Suss\", \"ML\");\n\n\t\t// Add to array\n\n\t\tList<Person> personlist = new ArrayList<Person>();\n\n\t\tpersonlist.add(suss);\n\t\tpersonlist.add(gopi);\n\t\tpersonlist.add(boni);\n\t\tpersonlist.add(chani);\n\t\tpersonlist.add(krishna);\n\n\t\tSystem.out.println(\"Print the person names: \" + personlist);\n\n\t\t// By using for each loop to print person names\n\n\t\tfor (Person person : personlist) {\n\t\t\tSystem.out.println(person);\n\t\t}\n\n\t\tSystem.out.println(\"*******************\");\n\n\t\tMap<Integer, String> personsmap = new HashMap<Integer, String>();\n\n\t\t// put every value list to Map\n\t\tfor (Person person : personlist) {\n\t\t\tpersonsmap.put(person.getId(), person.getName());\n\t\t\tSystem.out.println(person);\n\t\t}\n\n\t\t// Streams\n\t\tSystem.out.println(\" *********** Strems ***********\");\n\t\t Map<Integer, String>\n map = personlist.stream()\n .collect(\n Collectors\n .toMap(\n Person::getId,\n Person::getName,\n (id, name)\n -> id + \", \" + name,\n HashMap::new));\n\t\t \n\t\t// print map\n\t map.forEach(\n\t (id, name) -> System.out.println(id + \"=\" + name));\n\n\t}",
"@Test\n public void testListMayors01() {\n System.out.println(\"listMayors\");\n\n Map expResult = new LinkedHashMap();\n\n City city1 = (new City(new Pair(41.237364, -8.846746), \"city1\", 72));\n city1.setMayor(new User(\"nick6\", \"[email protected]\"));\n expResult.put(city1, city1.getMayor());\n\n City city5 = (new City(new Pair(41.337408, -8.291943), \"city5\", 74));\n city5.setMayor(new User(\"nick6\", \"[email protected]\"));\n expResult.put(city5, city5.getMayor());\n\n City city6 = (new City(new Pair(41.314965, -8.423371), \"city6\", 80));\n city6.setMayor(new User(\"nick0\", \"[email protected]\"));\n expResult.put(city6, city6.getMayor());\n\n City city3 = (new City(new Pair(41.118700, -8.589700), \"city3\", 42));\n city3.setMayor(new User(\"nick8\", \"[email protected]\"));\n expResult.put(city3, city3.getMayor());\n\n City city4 = (new City(new Pair(41.467407, -8.964340), \"city4\", 64));\n city4.setMayor(new User(\"nick8\", \"[email protected]\"));\n expResult.put(city4, city4.getMayor());\n\n City city0 = (new City(new Pair(41.243345, -8.674084), \"city0\", 28));\n city0.setMayor(new User(\"nick2\", \"[email protected]\"));\n expResult.put(city0, city0.getMayor());\n\n City city2 = (new City(new Pair(40.519841, -8.085113), \"city2\", 81));\n city2.setMayor(new User(\"nick2\", \"[email protected]\"));\n expResult.put(city2, city2.getMayor());\n\n City city7 = (new City(new Pair(40.822244, -8.794953), \"city7\", 11));\n city7.setMayor(new User(\"nick5\", \"[email protected]\"));\n expResult.put(city7, city7.getMayor());\n\n City city9 = (new City(new Pair(40.851360, -8.136585), \"city9\", 65));\n city9.setMayor(new User(\"nick5\", \"[email protected]\"));\n expResult.put(city9, city9.getMayor());\n\n City city8 = (new City(new Pair(40.781886, -8.697502), \"city8\", 7));\n city8.setMayor(new User(\"nick3\", \"[email protected]\"));\n expResult.put(city8, city8.getMayor());\n\n Map result = sn10.listMayors();\n\n // To compare Keys.\n assertArrayEquals(expResult.keySet().toArray(), result.keySet().toArray());\n }",
"private static void remakeMap(HashMap<String, ArrayList<Critter>> population)\r\n {\r\n \t//get a copy of the hash map\r\n \tHashMap<String, ArrayList<Critter>> copy = new HashMap<String, ArrayList<Critter>>(population);\r\n \t//clear the original hash map\r\n \tpopulation.clear();\r\n \t\r\n \t//iterates through all of the critters in the copy of the hash map\r\n \tIterator<String> populationIter = copy.keySet().iterator();\r\n \t\r\n \twhile (populationIter.hasNext()) { \r\n \t\t\r\n \t\t//get the String position\r\n String pos = populationIter.next();\r\n \r\n //get the critter list in that position\r\n ArrayList<Critter> critterList = copy.get(pos);\r\n \r\n //Iterate through the critters ArrayList \r\n ListIterator<Critter> currCritter = critterList.listIterator();\r\n while(currCritter.hasNext()) {\r\n \tCritter thisCritter = currCritter.next();\r\n \t//get the new coordinates of the critter\r\n \tString critterKey = thisCritter.getCritterPosition();\r\n \t\r\n \t//if the position is already a key in the hash map\r\n \tif(population.containsKey(critterKey)) {\r\n \t\t//add the critter to the ArrayList at key of coordinates\r\n \t\tArrayList<Critter> list = population.get(critterKey);\r\n \t\tlist.add(thisCritter);\r\n \t\tpopulation.replace(critterKey, list);\r\n \t}\r\n \r\n \t//if position is not already a key in the hash map\r\n \telse {\r\n \t\tArrayList<Critter> newCritters = new ArrayList<Critter>();\r\n \t\tnewCritters.add(thisCritter);\r\n \t\tpopulation.put(critterKey, newCritters);\r\n \t}\r\n }\r\n \t}\r\n }",
"public static List<Person> getExamplePeople() {\n return Arrays.asList(\n new Person(\"1230\", \"John\", \"Smith\", LocalDate.of(1965, 1, 20), \"Some Street 3, Some City, Some Country\", \n Arrays.asList(\n new PersonContact(PersonContactType.PHONE, \"Home number\", \"+123 4567890\"),\n new PersonContact(PersonContactType.EMAIL, \"Personal e-mail\", \"[email protected]\")\n )\n ),\n new Person(\"1231\", \"Jack\", \"Tree\", LocalDate.of(1971, 3, 20), \"Some Street 9, Some City, Some Country\", \n Arrays.asList(\n new PersonContact(PersonContactType.MOBILE, \"Personal number\", \"+123 456789011\")\n )\n ),\n new Person(\"1232\", \"Mary\", \"Jones\", LocalDate.of(1980, 2, 20), \"Some Street 7, Some City, Some Country\", \n null\n ),\n new Person(\"1233\", \"Maria\", \"Johnson\", LocalDate.of(1991, 9, 12), \"Some Street 30, Some City, Some Country\", \n Arrays.asList(\n new PersonContact(PersonContactType.PHONE, \"Work number\", \"+123 4634563\")\n )\n ),\n new Person(\"1234\", \"Luke\", \"Miller\", LocalDate.of(1986, 12, 3), \"Some Street 87, Some City, Some Country\", \n Arrays.asList(\n new PersonContact(PersonContactType.PHONE, \"Home number\", \"+123 13433653\"),\n new PersonContact(PersonContactType.EMAIL, \"Personal e-mail\", \"[email protected]\"),\n new PersonContact(PersonContactType.MOBILE, \"Preferred contact\", \"+123 365346456\")\n )\n ),\n new Person(\"1235\", \"Michelle\", \"Smith\", LocalDate.of(1966, 6, 30), \"Some Street 3, Some City, Some Country\", \n Arrays.asList(\n new PersonContact(PersonContactType.PHONE, \"Home number\", \"+123 4567890\"),\n new PersonContact(PersonContactType.EMAIL, \"Personal e-mail\", \"[email protected]\")\n )\n )\n );\n }",
"public PersonList() {\r\n this.personList = new ArrayList<Person>();\r\n }",
"@Test\n public void testListMayors02() {\n System.out.println(\"listMayors\");\n\n Map expResult = new LinkedHashMap();\n\n City city1 = (new City(new Pair(41.237364, -8.846746), \"city1\", 72));\n city1.setMayor(new User(\"nick6\", \"[email protected]\"));\n expResult.put(city1, city1.getMayor());\n\n City city5 = (new City(new Pair(41.337408, -8.291943), \"city5\", 74));\n city5.setMayor(new User(\"nick6\", \"[email protected]\"));\n expResult.put(city5, city5.getMayor());\n\n City city6 = (new City(new Pair(41.314965, -8.423371), \"city6\", 80));\n city6.setMayor(new User(\"nick0\", \"[email protected]\"));\n expResult.put(city6, city6.getMayor());\n\n City city3 = (new City(new Pair(41.118700, -8.589700), \"city3\", 42));\n city3.setMayor(new User(\"nick8\", \"[email protected]\"));\n expResult.put(city3, city3.getMayor());\n\n City city4 = (new City(new Pair(41.467407, -8.964340), \"city4\", 64));\n city4.setMayor(new User(\"nick8\", \"[email protected]\"));\n expResult.put(city4, city4.getMayor());\n\n City city0 = (new City(new Pair(41.243345, -8.674084), \"city0\", 28));\n city0.setMayor(new User(\"nick2\", \"[email protected]\"));\n expResult.put(city0, city0.getMayor());\n\n City city2 = (new City(new Pair(40.519841, -8.085113), \"city2\", 81));\n city2.setMayor(new User(\"nick2\", \"[email protected]\"));\n expResult.put(city2, city2.getMayor());\n\n City city7 = (new City(new Pair(40.822244, -8.794953), \"city7\", 11));\n city7.setMayor(new User(\"nick5\", \"[email protected]\"));\n expResult.put(city7, city7.getMayor());\n\n City city9 = (new City(new Pair(40.851360, -8.136585), \"city9\", 65));\n city9.setMayor(new User(\"nick5\", \"[email protected]\"));\n expResult.put(city9, city9.getMayor());\n\n City city8 = (new City(new Pair(40.781886, -8.697502), \"city8\", 7));\n city8.setMayor(new User(\"nick3\", \"[email protected]\"));\n expResult.put(city8, city8.getMayor());\n\n Map result = sn10.listMayors();\n\n // To compare Values.\n assertArrayEquals(expResult.values().toArray(), result.values().toArray());\n }",
"public DefaultListModel<Person> getAllPeopleDLM()\r\n\t{\r\n\t\tDefaultListModel<Person> list = new DefaultListModel<Person>();\r\n\t\t\r\n\t\tfor(Person person : this.getAllPeople())\r\n\t\t\tlist.addElement(person);\r\n\t\t\r\n\t\treturn list;\r\n\t}",
"private void startFamilyTree(Persons rootPerson, int numOfGenerations)\n {\n familyTree = new ArrayList<Persons>();\n familyTree.add(rootPerson);\n int currYear = 2000;\n\n eventGenerator.createBirth(rootPerson, currYear);\n\n generateMomAndDad(rootPerson, numOfGenerations - 1, currYear);\n }",
"private void prepareListData() {\n listDataHeader = new ArrayList<String>();\n listDataChild = new HashMap<String, List<String>>();\n listDataChild = new HashMap<String, List<String>>();\n\n // Adding child data\n listDataHeader.add(\"Information Technology Subjects\");\n listDataHeader.add(\"Accounting Subjects\");\n listDataHeader.add(\"Business Subjects\");\n\n\n // Adding child data\n List<String> infoTech = new ArrayList<String>();\n infoTech.add(\"ITC 105 COMMUNICATION INFORMATION MANAGEMENT DATABASE \\nDate: 29 OCTOBER 2011 \\nTime: 09:30 \");\n infoTech.add(\"ITC 114 DATABASE MANAGEMENT SYSTEMS \\nDate: OCTOBER 2011 \\nTime: :\");\n infoTech.add(\"ITC 200 DATABASE ADMINISTRATION \\nDate: OCTOBER 2011 \\nTime: :\");\n infoTech.add(\"ITC 203 OBJECT ORIENTED SYSTEM ANALYSIS and DESIGN \\nDate: OCTOBER 2011 \\nTime: :\");\n infoTech.add(\"ITC 211 SYSTEM ANALYSIS \\nDate: OCTOBER 2011 \\nTime: :\");\n infoTech.add(\"ITC 240 IT INFRASTRUCTURE MANAGEMENT \\nDate: OCTOBER 2011 \\nTime: :\");\n infoTech.add(\"ITC 242 INTRODUCTION TO DATA COMMUNICATIONS \\nDate: OCTOBER 2011 \\nTime: :\");\n infoTech.add(\"ITC 254 WIRELESS NETWORKS \\nDate: OCTOBER 2011 \\nTime: :\");\n infoTech.add(\"ITC 303 SOFTWARE DEVELOPMENT PROJECT 1 \\nDate: OCTOBER 2011 \\nTime: :\");\n infoTech.add(\"ITC 308 IT PROJECT \\nDate: OCTOBER 2011 \\nTime: :\");\n infoTech.add(\"ITC 309 SOFTWARE DEVELOPMENT PROJECT 2 \\nDate: OCTOBER 2011 \\nTime: :\");\n infoTech.add(\"ITC 313 PROGRAMMING IN JAVA 2 \\nDate: OCTOBER 2011 \\nTime: :\");\n infoTech.add(\"ITC 314 VISUALISATION AND CLOUD COMPUTING \\nDate: OCTOBER 2011 \\nTime: :\");\n infoTech.add(\"ITC 354 NETWORK ENGINEERING 2 \\nDate: OCTOBER 2011 \\nTime: :\");\n infoTech.add(\"ITC 356 WEB BASED INFORMATION SYSTEMS \\nDate: OCTOBER 2011 \\nTime: :\");\n infoTech.add(\"ITC 358 MANAGEMENT AND INFORMATION SECURITY \\nDate: OCTOBER 2011 \\nTime: :\");\n infoTech.add(\"ITC 383 STRATEGIC INFORMATION MANAGEMENT \\nDate: OCTOBER 2011 \\nTime: :\");\n infoTech.add(\"ITC 412 SYSTEM ANALYSIS PG\\nDate: OCTOBER 2011 \\nTime: :\");\n infoTech.add(\"ITC 423 DATABASE SYSTEMS\\nDate: OCTOBER 2011 \\nTime: :\");\n infoTech.add(\"ITC 431 COMPUTER NETWORKS\\nDate: OCTOBER 2011 \\nTime: :\");\n infoTech.add(\"ITC \\nDate: OCTOBER 2011 \\nTime: :\");\n infoTech.add(\"ITC \\nDate: OCTOBER 2011 \\nTime: :\");\n infoTech.add(\"ITC \\nDate: OCTOBER 2011 \\nTime: :\");\n infoTech.add(\"ITC \\nDate: OCTOBER 2011 \\nTime: :\");\n\n\n\n\n\n\n List<String> acc = new ArrayList<String>();\n acc.add(\"ACC 100 ACCOUNTING 1 \\nDate: 22 OCTOBER 2013 \\nTime: 02:50\");\n acc.add(\"ACC 110 ACCOUNTING 2 \\nDate: 28 OCTOBER 2013 \\nTime: 09:20\");\n\n List<String> business = new ArrayList<String>();\n business.add(\"BUS 110 PROFESSIONAL PRACTICE \\nDate: OCTOBER 2013 \\nTime: 09:20 \");\n business.add(\"BUS 370 BUSINESS INTERNSHIP \\nDate: OCTOBER 2013 \\nTime: 09:20 \");\n\n\n\n listDataChild.put(listDataHeader.get(0), infoTech); // Header, Child data\n listDataChild.put(listDataHeader.get(1), acc);\n listDataChild.put(listDataHeader.get(2), business);\n }",
"@Override\r\n\tpublic ArrayList<ShoppingList> getAllShoppingListsByPerson(Person p) {\r\n\t\t// TODO Auto-generated method stub\r\n\t\treturn null;\r\n\t}",
"public ArrayList<Person> getAllPeople()\r\n\t{\r\n\t\treturn dataService.getAllPeople();\r\n\t}",
"private void addItemsToClusterManager() {\n if (mClusterManager != null) {\n mClusterManager.clearItems();\n for (Restaurant restaurant : restaurantProvider.getRestaurants()) {\n mClusterManager.addItem(new RestaurantMapItem(restaurant));\n }\n mClusterManager.cluster();\n }\n }",
"public void setUpPlayers(){\n\t\tTreeMap<String,Integer> turnsDetails = new TreeMap<>();\n\t\tint e = 0;\n\t\tfor(Player i : allplayers) {\n\t\t\ti.fillHand();\n\t\t\tturnsDetails.put(i.getFirstLetter()+String.valueOf(e),e);\n\t\t\te++;\n\t\t}\n\t\t// populate the turn list\n //entryset returns a set view of mappings contained\n\t\tfor(Map.Entry<String,Integer> i : turnsDetails.entrySet())\n\t\t\tturns.add(i.getValue());\n\t}",
"public static Map<Integer, List<Person>> filterAndGroupPersons(final List<Person> persons)\n\t\t\t{\n\t\t\t\t// filter programmers\n\t\t\t\tfinal List<Person> programmers = new ArrayList<>();\n\t\t\t\tfor (final Person p : persons)\n\t\t\t\t{\n\t\t\t\t\tif (p.getRole() == PROGRAMMER)\n\t\t\t\t\t{\n\t\t\t\t\t\tprogrammers.add(p);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// sort\n\t\t\t\tCollections.sort(programmers, new Comparator<Person>()\n\t\t\t\t{\n\t\t\t\t\tpublic int compare(final Person p1, final Person p2)\n\t\t\t\t\t{\n\t\t\t\t\t\treturn p1.getName().compareTo(p2.getName());\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\t// group by age group\n\t\t\t\tfinal Map<Integer, List<Person>> programmersPerAgeGroup = new HashMap<>();\n\t\t\t\tfor (final Person programmer : programmers)\n\t\t\t\t{\n\t\t\t\t\tfinal int ageGroup = programmer.getAge() / 10 * 10;\n\t\t\t\t\tfinal List<Person> ageGroupProgrammers =\n\t\t\t\t\t\t\tprogrammersPerAgeGroup.getOrDefault(ageGroup, new ArrayList<>());\n\t\t\t\t\tageGroupProgrammers.add(programmer);\n\t\t\t\t\tprogrammersPerAgeGroup.put(ageGroup, ageGroupProgrammers);\n\t\t\t\t}\n\t\t\t\treturn programmersPerAgeGroup;\n\t\t\t}",
"private void treeMapDemo() {\n TreeMap intMap = new TreeMap();\n TreeMap abcMap = new TreeMap();\n \n // Add values to tMap\n intMap.put(1, \"Jonathan\");\n intMap.put(3, \"Kevin\");\n intMap.put(4, \"Craig\");\n \n abcMap.put(\"Name\", \"Jonathan\");\n abcMap.put(\"Age\", 26);\n abcMap.put(\"Hometown\", \"Denham Springs\");\n \n System.out.println(intMap.toString());\n \n System.out.println(abcMap.toString());\n \n // Add new value to fill the 2 position\n intMap.put(2, \"Jasmine\");\n \n // Add new value to abcMap\n abcMap.put(\"Acrobatic Skill\", \"Bad\");\n abcMap.put(\"Zoology Skill\", \"Decent\");\n \n System.out.println(intMap.toString());\n \n System.out.println(abcMap.toString());\n \n }",
"private HashMap<String, IacucProtocolPerson> getProtocolPersons(IacucProtocol iacucProtocol) {\n HashMap<String, IacucProtocolPerson> protocolPersons = new HashMap<String, IacucProtocolPerson>();\n for(ProtocolPersonBase protocolPersonBase : iacucProtocol.getProtocolPersons()) {\n IacucProtocolPerson iacucProtocolPerson = (IacucProtocolPerson)protocolPersonBase;\n protocolPersons.put(iacucProtocolPerson.getPersonId(), iacucProtocolPerson);\n }\n return protocolPersons;\n }",
"public static void oldTest1()\r\n\t{\n\t\tArrayList personlist = new ArrayList();\r\n\t\tpersonlist.add(new Person(\"one\"));\r\n\t\tpersonlist.add(new Person(\"two\"));\r\n\t\tpersonlist.add(new Person(\"three\"));\r\n\t\tpersonlist.add(new Worker(\"oneA\", \"job1\"));\r\n\t\tpersonlist.add(new Worker(\"oneA\", \"job2\"));\r\n\t\tPrintCollection1(personlist);\r\n\t\tPrintCollection(personlist);\r\n\t}",
"private TreeMap<Double, String> createRandomTreeMap(TreeMap<Double, String> userlist) \r\n \t{\r\n \t\ttotalPoints = calcTotalPoints(userlist);\r\n \t\tTreeMap<Double, String> ret = new TreeMap<Double, String>();\r\n \t\tfillMap(userlist, ret);\r\n \r\n \t\treturn ret;\r\n \t}",
"private void fillData() {\n\t\tfor(Entry<String, HashMap<String, Double>> entry : m.map.entrySet()) {\n\t\t\tfor(Entry<String, Double> subEntry : entry.getValue().entrySet()) {\n\t\t\t\tMappingData item = new MappingData(entry.getKey(), subEntry.getKey(), subEntry.getValue());\n\t\t\t\tdataList.add(item);\n\t\t\t}\n\t\t}\n\t}",
"ArrayList<PersonModel> getPersonListFromSnapshot(DataSnapshot snapshot) {\n PersonModel personInList;\n\n mPersonList.clear();\n mPersonMap.clear();\n\n ArrayList<PersonModel> list = new ArrayList<>((int) snapshot.getChildrenCount());\n\n for (DataSnapshot postSnapshot : snapshot.getChildren()) {\n personInList = postSnapshot.getValue(PersonModel.class);\n personInList.setID(postSnapshot.getKey());\n list.add(personInList);\n mPersonList.add(personInList);\n mPersonMap.put(personInList.getID(), personInList);\n }\n\n return list;\n }",
"private void populateData() {\n animals.add(new Animal(\"Bear Arlan\", 10, true, \"Student\",\n \"Watch cartoons\", R.drawable.bear));\n animals.add(new Animal(\"Marten Chrisst\", 15, true, \"McDonald employee\",\n \"Play video games\", R.drawable.marten));\n animals.add(new Animal(\"Octopus Tenta\", 18, false, \"Ink producer\",\n \"Camouflage and attack jellyfish\", R.drawable.octopus));\n animals.add(new Animal(\"Ostrich Mellow\", 19, false, \"Zoo runner\",\n \"Peck other animals\", R.drawable.ostrich));\n animals.add(new Animal(\"Raccoon Garack\", 21, true, \"Office worker\",\n \"Build diagrams for statistics\", R.drawable.racoon));\n animals.add(new Animal(\"Rooster Billo\", 16, true, \"Early waker\",\n \"Fly and chirp in morning\", R.drawable.rooster));\n animals.add(new Animal(\"Seagull Ranch\", 23, false, \"Scout\",\n \"Practice carrying water in mouth\", R.drawable.seagull));\n animals.add(new Animal(\"Seal Arlan\", 25, true, \"Security\",\n \"Work on belly muscles\", R.drawable.seal));\n animals.add(new Animal(\"Tiger Stitch\", 30, false, \"Hunter\",\n \"Make soup\", R.drawable.tiger));\n animals.add(new Animal(\"Zebra Dillian\", 6, true, \"Student\",\n \"Watch movies about zebras\", R.drawable.zebra));\n }",
"public PancakeHouseIterator(ArrayList items)\n {\n this.items = items;\n }",
"@Override\r\n\tpublic ArrayList<Person> getAllPersons() {\n\t\treturn null;\r\n\t}",
"private void reinitItemNavigators( )\r\n {\r\n _itemNavigators = new HashMap<>( );\r\n _strSortedAttributeName = StringUtils.EMPTY;\r\n _bIsAscSort = true;\r\n }",
"private void processNameToObjectMap() {\r\n for (int i = 0; i < this.getObjectGroupCount(); i++) {\r\n ObjectGroup g = this.objectGroups.get(i);\r\n this.objectGroupNameToOffset.put(g.name, i);\r\n HashMap<String, Integer> nameToObjectMap = new HashMap<String, Integer>();\r\n for (int ib = 0; ib < this.getObjectCount(i); ib++) {\r\n nameToObjectMap.put(this.getObjectName(i, ib), ib);\r\n }\r\n g.setObjectNameMapping(nameToObjectMap);\r\n }\r\n }",
"private void processData()\n\t{\n\t\tfor(String people :guestList)\n\t\t{\n\t\t\t\n\t\t\tString[] guestInfo = people.split(\",\");\n\t\t\tif(guestInfo[inviterIndex].equals(\"Adam\"))\n\t\t\t{\n\t\t\t\t//Adam invited friends list\n\t\t\t\tGuest guest = new Guest(guestInfo[guestIndex],Integer.valueOf(guestInfo[candyBroughtIndex]),Integer.valueOf(guestInfo[candyConsumedIndex]));\n\t\t\t\tint result =Integer.valueOf(guestInfo[candyBroughtIndex]) - Integer.valueOf(guestInfo[candyConsumedIndex]);\n\t\t\t\tguest.setInviter(\"Adam\");\n\t\t\t\tguest.setLeftOver(result);\n\t\t\t\tboolean isInvited = (result >= 0)? true : false;\n\t\t\t\tguest.setInvited(isInvited);\n\t\t\t\tguestMapList.put(guestInfo[guestIndex], guest);\n\t\t\t}else if(!guestMapList.isEmpty())\n\t\t\t{\n\t\t\t\tif(guestMapList.containsKey(guestInfo[inviterIndex]))\n\t\t\t\t{\n\t\t\t\t\tGuest inviter = guestMapList.get(guestInfo[inviterIndex]);\n\t\t\t\t\tif(Integer.valueOf(guestInfo[candyBroughtIndex])+inviter.getLeftOver()>0)\n\t\t\t\t\t{\n\t\t\t\t\t\tGuest guest = new Guest(guestInfo[guestIndex],Integer.valueOf(guestInfo[candyBroughtIndex]),Integer.valueOf(guestInfo[candyConsumedIndex]));\n\t\t\t\t\t\tint result =inviter.getLeftOver() + Integer.valueOf(guestInfo[candyBroughtIndex]) - Integer.valueOf(guestInfo[candyConsumedIndex]);\n\t\t\t\t\t\tguest.setLeftOver(result);\n\t\t\t\t\t\tguest.setInviter(inviter.getName());\n\t\t\t\t\t\t\n\t\t\t\t\t\tboolean isInvited = (result >= 0)? true : false;\n\t\t\t\t\t\tguest.setInvited(isInvited);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(inviter.getInviter().equals(\"Adam\")){\n\t\t\t\t\t\t//update inviter information\n\t\t\t\t\t\t\tinviter.setLeftOver(result);\n\t\t\t\t\t\t\tinviter.setInvited(isInvited);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tinviter.setNextGuest(guest);\n\t\t\t\t\t\tguestMapList.put(inviter.getName(), inviter);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//add new guest to hashmap\n\t\t\t\t\t\tguestMapList.put(guestInfo[guestIndex], guest);\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}\n\t}",
"private void prepareListData(Set<String> cartItems, Map<String, List<OrderColourSize.ColourSizeItem>> cartItemMap) {\n // заполняем коллекцию групп из массива с названиями групп\n groupData = new ArrayList<Map<String, String>>();\n childData = new ArrayList<ArrayList<Map<String, String>>>();\n\n int sarea = 0;\n\n\n for (String group : cartItems) {\n // заполняем список аттрибутов для каждой группы\n m = new HashMap<String, String>();\n m.put(\"groupName\", group); // имя компании\n groupData.add(m);\n\n childDataItem = new ArrayList<Map<String, String>>();\n // заполняем список аттрибутов для каждого элемента\n for (OrderColourSize.ColourSizeItem item : cartItemMap.get(group)) {\n String phone = item.content;\n sarea += DatabaseOpenHelper.getInstance(null).getSizeAreaById(item.size_id) * item.quantity / 10000;\n m = new HashMap<String, String>();\n m.put(\"phoneName\", phone); // название телефона\n childDataItem.add(m);\n }\n // добавляем в коллекцию коллекций\n childData.add(childDataItem);\n }\n\n TOTAL_AREA = sarea;\n mTotalAreaView.setText(String.valueOf(TOTAL_AREA));\n // список аттрибутов групп для чтения\n String groupFrom[] = new String[]{\"groupName\"};\n // список ID view-элементов, в которые будет помещены аттрибуты групп\n int groupTo[] = new int[]{android.R.id.text1};\n\n // список аттрибутов элементов для чтения\n String childFrom[] = new String[]{\"phoneName\"};\n // список ID view-элементов, в которые будет помещены аттрибуты элементов\n int childTo[] = new int[]{android.R.id.text1};\n\n seAdapter = new SimpleExpandableListAdapter(\n this,\n groupData,\n android.R.layout.simple_expandable_list_item_1,\n groupFrom,\n groupTo,\n childData,\n android.R.layout.simple_list_item_1,\n childFrom,\n childTo);\n// listDataHeader = new ArrayList<String>();\n// listDataChild = new HashMap<String, List<String>>();\n//\n// // Adding child data\n// listDataHeader.add(\"Top 250\");\n// listDataHeader.add(\"Now Showing\");\n// listDataHeader.add(\"Coming Soon..\");\n//\n// // Adding child data\n// List<String> top250 = new ArrayList<String>();\n// top250.add(\"The Shawshank Redemption\");\n// top250.add(\"The Godfather\");\n// top250.add(\"The Godfather: Part II\");\n// top250.add(\"Pulp Fiction\");\n// top250.add(\"The Good, the Bad and the Ugly\");\n// top250.add(\"The Dark Knight\");\n// top250.add(\"12 Angry Men\");\n//\n// List<String> nowShowing = new ArrayList<String>();\n// nowShowing.add(\"The Conjuring\");\n// nowShowing.add(\"Despicable Me 2\");\n// nowShowing.add(\"Turbo\");\n// nowShowing.add(\"Grown Ups 2\");\n// nowShowing.add(\"Red 2\");\n// nowShowing.add(\"The Wolverine\");\n//\n// List<String> comingSoon = new ArrayList<String>();\n// comingSoon.add(\"2 Guns\");\n// comingSoon.add(\"The Smurfs 2\");\n// comingSoon.add(\"The Spectacular Now\");\n// comingSoon.add(\"The Canyons\");\n// comingSoon.add(\"Europa Report\");\n//\n// listDataChild.put(listDataHeader.get(0), top250); // Header, Child data\n// listDataChild.put(listDataHeader.get(1), nowShowing);\n// listDataChild.put(listDataHeader.get(2), comingSoon);\n }",
"public List<SamplePerson> getAllPeople() {\n //TODO\n throw new NotImplementedException();\n }",
"public static Map<String, Person> getPersonMap(Gedcomx doc) {\n Map<String, Person> map = new HashMap<String, Person>();\n if (doc.getPersons() != null) {\n for (Person person : doc.getPersons()) {\n if (person.getId() != null) {\n map.put(person.getId(), person);\n map.put(\"#\" + person.getId(), person);\n }\n if (person.getIdentifiers() != null) {\n for (Identifier identifier : person.getIdentifiers()) {\n if (identifier.getValue() != null) {\n map.put(identifier.getValue().toString(), person);\n }\n }\n }\n }\n }\n return map;\n }",
"@Override\r\n\tpublic List<Person> getPeople() {\n\t\tList<Person> personList = new ArrayList<Person>();\r\n\t\tpersonList.add(getPerson(234L));\r\n\t\tpersonList.add(getPerson(123L));\r\n\t\tpersonList.add(getPerson(345L));\r\n\t\tpersonList.add(getPerson(42L));\r\n\t\treturn personList ;\r\n\t}",
"public void makeMap(){\r\n\t\tint m =1;\r\n\t\t//EnvironObj temp = new EnvironObj(null, 0, 0);\r\n\t\tfor(int i=0; i<map.size(); i++){\r\n\t\t\tfor(int j =0; j<map.get(i).size(); j++){\r\n\t\t\t\tString o = map.get(i).get(j);\r\n\t\t\t\t//System.out.println(\"grabbing o from map, o = \" + o);\r\n\t\t\t\tif(o.equals(\"t\")){\r\n\t\t\t\t\ttemp = new EnvironObj(\"treee.png\", j+m, i*20);\r\n\t\t\t\t\tobjectList.add(temp);\r\n\t\t\t\t\tm+=10;\r\n\t\t\t\t\t//System.out.println(\"objectList: \" + objectList);\r\n\t\t\t\t}else if(o.equals(\"p\")){\r\n\t\t\t\t\ttemp = new EnvironObj(\"path.png\", j+m, i*20, true);\r\n\t\t\t\t\t//dont need to add to obj list bc its always in back\r\n\t\t\t\t\twalkables.add(temp);\r\n\r\n\t\t\t\t}else if(o.equals(\"h\")){\r\n\t\t\t\t\ttemp = new EnvironObj(\"house.png\", j+m, i*20);\r\n\t\t\t\t\tobjectList.add(temp);\r\n\t\t\t\t}else if(o.equals(\"g\")){\r\n\t\t\t\t\tm+=10;\r\n\t\t\t\t}\r\n\t\t\t\telse if(!o.equals(\"g\")){\r\n\t\t\t\t\tString fn = o +\".txt\";\r\n\t\t\t\t\tSystem.out.println(\"filename for NPC: \" + fn);\r\n\t\t\t\t\tnp = new NPC(o, fn, j+m, i*20);\r\n\t\t\t\t\tm+=10;\r\n\t\t\t\t\tcharacters.add(np);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tm=0;\r\n\t\t}\r\n\t}",
"public void groupingByMappingExample(){\n Map<String, List<Integer>> result = createPeople()\n .stream()\n .collect(groupingBy(Person::getName, mapping(Person::getAge,toList())));\n print.accept(result);\n }",
"private void loadItemsMaps()\n {\n _icons=new HashMap<String,List<Item>>(); \n _names=new HashMap<String,List<Item>>(); \n List<Item> items=ItemsManager.getInstance().getAllItems();\n for(Item item : items)\n {\n String icon=item.getIcon();\n if (icon!=null)\n {\n registerMapping(_icons,icon,item);\n String mainIconId=icon.substring(0,icon.indexOf('-'));\n registerMapping(_icons,mainIconId,item);\n String name=item.getName();\n registerMapping(_names,name,item);\n }\n }\n }",
"public static void personTest(){\n ArrayList<Person> people = new ArrayList<>();\n //people[0] = new Person(\"Fer\", \"Mendoza\", true);\n people.add(new Person(\"Fer\", \"Mendoza\", true));\n people.add(new Person(\"Stacy\", \"Malibu\", false));\n people.add(new Person(\"Ana\", \"Morton\", true));\n\n for (Person person : people) {\n System.out.println(\"person.getFullName() = \" + person.getFullName());\n }\n\n }",
"public static Map<String, Map<String, List<Person>>> getPersonsGroupedByPlanetAndGender(List<Person> personsList)\n\t{\n\t\t\n\t\tMap<String, Map<String, List<Person>>> map = personsList.stream().collect(Collectors.groupingBy(Person::getPlanetOfResidence,Collectors.groupingBy(Person::getGender)));\n\n\t\treturn map;\n\t\t\n\t}",
"private void addItems() {\n int random3 = 0;\n for (int i = 0; i < MAP_LENGTH; i++) {\n for (int j = 0; j < MAP_LENGTH; j++) {\n random3 = (int)(Math.round(Math.random()*9));\n if (tileMap[i][j].getTerrain() instanceof Grass) {\n if (adjacentCity(i, j) && tileMap[i][j].getCity() == null) { //Only have an item if possibly within city borders\n if (random3 == 0) {\n tileMap[i][j].setResource(new Fruit(i,j)); //Rep Fruit\n } else if (random3 == 1) {\n tileMap[i][j].setResource(new Animal(i,j)); //Rep Animal\n } else if (random3 == 2) {\n tileMap[i][j].setResource(new Forest(i,j)); //Rep Trees (forest)\n } else if (random3 == 3) {\n tileMap[i][j].setResource(new Crop(i,j)); //Rep Crop\n }\n }\n } else {\n if (adjacentCity(i, j)) {\n if (random3 < 2) {\n tileMap[i][j].setResource(new Fish(i, j)); //Rep fish\n } else if (random3 == 4) {\n if (Math.random() < 0.5) {\n tileMap[i][j].setResource(new Whale(i, j)); //Rep whale\n }\n }\n }\n }\n }\n }\n }",
"public List<Person> copyPersons() {\n\t\tList<Person> copyPersons = new ArrayList<Person>(personsOrig.size());\t// NOTE this is still an empty List with initial capacity of personsOrig size\r\n\t\t// unfortunately there isn't a clone or factory method in Collections. So have to create \"target\" collection with some garbage\r\n\t\tPerson p;\r\n\t\tfor (int i = 0; i < personsOrig.size(); i++) {\r\n\t\t\tp = new Person(\"\", 0);\r\n\t\t\tcopyPersons.add(p);\r\n\t\t}\r\n\t\tCollections.copy(copyPersons, personsOrig);\r\n\t\tSystem.out.println(\"persons copy:\" + copyPersons);\r\n\r\n\t\tCollections.sort(copyPersons);\r\n\t\tSystem.out.println(\"Sorted copy:\" + copyPersons);\r\n\r\n\t\tSystem.out.println(\"Original persons:\" + personsOrig);\r\n\t\treturn copyPersons;\r\n\t}",
"private void prepareListData() {\n listDataHeader = new ArrayList<String>();\n listDataChild = new HashMap<String, List<String>>();\n\n // Adding child data\n listDataHeader.add(\"Cloths\");\n listDataHeader.add(\"Tools\");\n listDataHeader.add(\"Booking\");\n\n // Adding child data\n List<String> Cloths = new ArrayList<String>();\n Cloths.add(\"Silk Shit\");\n Cloths.add(\"Godfather Coat\");\n Cloths.add(\"Cow Boy jacket\");\n Cloths.add(\"Polo T-shirt\");\n Cloths.add(\"Ugly Jeans\");\n Cloths.add(\"Dark Jeans\");\n Cloths.add(\"Underwears\");\n\n List<String> Tools = new ArrayList<String>();\n Tools.add(\"Tester\");\n Tools.add(\"Betteries\");\n Tools.add(\"Charger\");\n Tools.add(\"UPS plugs\");\n Tools.add(\"Universal cheager\");\n Tools.add(\"Torch\");\n\n List<String> Booking = new ArrayList<String>();\n Booking.add(\"Hotel Booking\");\n Booking.add(\"Hotel Reservation\");\n Booking.add(\"Air Ticket\");\n Booking.add(\"Air Ticket Reservation\");\n Booking.add(\"Train Ticket\");\n Booking.add(\"Train Ticket Reservation\");\n\n listDataChild.put(listDataHeader.get(0), Cloths); // Header, Child data\n listDataChild.put(listDataHeader.get(1), Tools);\n listDataChild.put(listDataHeader.get(2), Booking);\n }",
"private void addItems() {\n for (int i = 0; i < 10; i++) {\n double offset = i/60d;\n mClusterManager.addItem(new CrumbClusterItem(new Crumb(new LatLng(5,-5 + offset))));\n }\n Log.d(TAG, \"All items added to map\");\n }",
"PersonGroupListAdapter() {\n personGroupIdList = new ArrayList<>();\n\n Set<String> personGroupIds\n = StorageHelper.getAllPersonGroupIds(MainActivity.this);\n\n for (String personGroupId: personGroupIds) {\n personGroupIdList.add(personGroupId);\n if (mPersonGroupId != null && personGroupId.equals(mPersonGroupId)) {\n personGroupIdList.set(\n personGroupIdList.size() - 1,\n mPersonGroupListAdapter.personGroupIdList.get(0));\n mPersonGroupListAdapter.personGroupIdList.set(0, personGroupId);\n }\n }\n }",
"public void mDeptLocationMembers() {\n \n PersistenceManager pm = PMF.get().getPersistenceManager();\n // dept iterator\n System.out.println(\"111 mDeptLocations inside mDeptLocationMembers: \" + mDeptLocations.size());\n Iterator iterDept = mDeptLocations.entrySet().iterator();\n while (iterDept.hasNext()) {\n Entry<Long, List<Location>> pairsDept = (Entry<Long, List<Location>>)iterDept.next();\n if (!pairsDept.getValue().isEmpty()) {\n // location iterator\n for (Location l : pairsDept.getValue()) {\n // member iterator\n List<Member> mLocationMembers = new ArrayList<Member>(); \n Iterator iterMember = mMemberCurrentLocation.entrySet().iterator();\n while (iterMember.hasNext()) {\n Entry<Long, Tracking> pairsMember = (Entry<Long, Tracking>)iterMember.next(); \n // determine members, regardless of dept, at this location\n if (l.getid().equals(pairsMember.getValue().getlocationId())) {\n Member m = pm.getObjectById(Member.class, pairsMember.getKey());\n mLocationMembers.add(m);\n System.out.println(\"m: \" + m.getlastName());\n System.out.println(\"mLocationMembers qty: \" + mLocationMembers.size());\n } \n }\n mDeptLocationMembers.put(l.getid(), mLocationMembers); \n }\n }\n }\n System.out.println(\"mDeptLocationMembers TOTAL qty: \" + mDeptLocationMembers.size());\n System.out.println(\"Exit: mDeptLocationMembers\");\n\n }",
"public static HashMap<Integer, ArrayList<Ice>> sortedDataMap(ArrayList<Ice> iceData) throws IOException{\r\n\t\tHashMap<Integer,ArrayList<Ice>> iceMap = new HashMap<>();//creates new empty hashmap \r\n\r\n\t\t//loops over the entire arraylist\r\n\t\tfor (Ice iceDatapoint : iceData) {\r\n\t\t\tint month = iceDatapoint.getMonth();//extracts the month from the Ice object datapoint\r\n\t\t\tArrayList<Ice> thisIceList = iceMap.get(month);\t//gets all the values of a specific month in the hashmap\r\n\t\t\tif(thisIceList == null) {//checks if this arraylist is null\r\n\t\t\t\ticeMap.put(month,new ArrayList<Ice>());//creates a new entry in the hashmap\r\n\t\t\t}\r\n\t\t\ticeMap.get(month).add(iceDatapoint);//adds the Ice datapoint to its corresponding month\r\n\t\t}\r\n\r\n\t\treturn iceMap;//returns a hashmap containing the sorted data\r\n\t}",
"public static void main(String[] args) {\n\t\t\tList<String> hrLeaders = new ArrayList<>();\n\t\t\thrLeaders.add(\"762 - Barry Bonds\");\n\t\t\thrLeaders.add(\"755 - Hank Aaron\");\n\t\t\thrLeaders.add(\"714 - Babe Ruth\");\n\t\t\thrLeaders.add(\"687 - Alex Rodriquez\");\n\t\t\thrLeaders.add(\"686 - Brandon Davis\");\n\t\t\thrLeaders.add(\"686 - Brandon Davis\");\n\t\t\thrLeaders.add(\"660 - Willie Mays\");\n\t\t\t\n\t\t\tSystem.out.println(\"*****LIST EXAMPLE*****\");\n\t\t\tSystem.out.println(\"Here are the top \" + hrLeaders.size() + \" homerun leaders of all time!\");\n\t\t\tSystem.out.print(hrLeaders);\n\t\t\t\n\t\t\tSystem.out.print( \"\\n\\n\" );\n\t\t\thrLeaders.set(0, \"763 - Mike Trout\");\n\t\t\tSystem.out.println(\"Updated Home Run List \\n\" + hrLeaders);\n\t\t\t\n\t\t\tSystem.out.print( \"\\n\\n\" );\t\t\t\n\t\t\tSystem.out.print(\"Sorted Set after passing into TreeSet: \\n\"); \n\t Set<String> tree_Set1 = new TreeSet<String>(hrLeaders); \n\t System.out.println(tree_Set1);\n\t \n\t System.out.print( \"\\n\\n\" );\t\n\t\t\t\n\t\t\tSystem.out.print( \"_______________________________________________________________________\" );\n\t\t\tSystem.out.print( \"\\n\\n\" );\n\t\t\t\n\n//Map EXAMPLE//\t\t\n\t\t\tSystem.out.println(\"*****Map EXAMPLE*****\");\n\t\t\tMap<Integer, String> AhrLeaders = new HashMap<>();\n\t\t\tAhrLeaders.put(762, \"Barry Bonds\");\n\t\t\tAhrLeaders.put(755, \"Hank Aaron\");\n\t\t\tAhrLeaders.put(714, \"Babe Ruth\");\n\t\t\tAhrLeaders.put(687, \"Alex Rodriquez\");\n\t\t\tAhrLeaders.put(686, \"Brandon Davis\");\n\t\t\tAhrLeaders.put(686, \"Brandon Davis\");\n\t\t\tAhrLeaders.put(660, \"Willie Mays\");\n\t\t\t\n\t\t\t\n\t\t\tSystem.out.println(\"Here are the top \" + AhrLeaders.size() + \" homerun leaders of all time!\");\n\t\t\tSystem.out.print(AhrLeaders);\n\t\t\t\n\t\t\tSystem.out.print( \"\\n\\n\" );\n\t\t\t\n\t\t\tArrayList<Integer> keyList = new ArrayList<Integer>(AhrLeaders.keySet());\n\t\t ArrayList<String> valueList = new ArrayList<String>(AhrLeaders.values());\n\n\t\t System.out.println(\"Top Homerun Leaders by number of Homeruns ::\"+keyList);\n\t\t System.out.println(\"Top Homerun Leaders by Name ::\"+valueList);\n\t\t\t\n\t\t System.out.print( \"_______________________________________________________________________\" );\n\t\t\tSystem.out.print( \"\\n\\n\" );\n\t\t\t\n//Set EXAMPLE and Treeset//\t\t\n\t\t\tSystem.out.println(\"*****Set EXAMPLE*****\");\n\t\t\tSet<String> BhrLeaders = new HashSet<String>();\n\t\t\tBhrLeaders.add(\"762 - Barry Bonds\");\n\t\t\tBhrLeaders.add(\"755 - Hank Aaron\");\n\t\t\tBhrLeaders.add(\"714 - Babe Ruth\");\n\t\t\tBhrLeaders.add(\"687 - Alex Rodriquez\");\n\t\t\tBhrLeaders.add(\"686 - Brandon Davis\");\n\t\t\tBhrLeaders.add(\"686 - Brandon Davis\");\n\t\t\tBhrLeaders.add(\"660 - Willie Mays\");\n\t\t\t\n\t\t\t\n\t\t\tSystem.out.println(\"Here are the top \" + BhrLeaders.size() + \" homerun leaders of all time!\");\n\t\t\tSystem.out.print(BhrLeaders);\n\t\t\t\n\t\t\tSystem.out.print( \"\\n\\n\" );\n\t\n\t\t\tBhrLeaders.add(\"661 - Mike Trout\"); \n\t\t\tSystem.out.println(\"Updated Home Run List: \\n\" + BhrLeaders);\n\t\t\t\n\t\t\tSystem.out.print( \"\\n\\n\" );\n\t\t\t\n\t\t\tSystem.out.print(\"Sorted Set after passing into TreeSet: \\n\"); \n\t Set<String> tree_Set = new TreeSet<String>(BhrLeaders); \n\t System.out.println(tree_Set);\n\t\t\t\n\t System.out.print( \"_______________________________________________________________________\" );\n\t\t\tSystem.out.print( \"\\n\\n\" );\n\n//Queue EXAMPLE//\t\t\n\t\t\tSystem.out.println(\"*****QUEUE EXAMPLE*****\");\n\t\t\t\n\t\t\tList<String> listhrLeaders = Arrays.asList(\"Barry Bond - 762\", \"Hank Aaron - 755\", \"Babe Ruth - 714\", \"Alex Rodriequez - 687\", \"Brandon Davis - 686\", \"Brandon Davis - 686\", \"Willie Mays - 660\");\n\t\t\tQueue<String> queueNames = new LinkedList<>(listhrLeaders);\n\t\t\tSystem.out.println(queueNames);\n\t\t\t\n\t\t\tqueueNames.add(\"661 - Mike Trout\");\n\t\t\tqueueNames.add(\"660 - Bryce Harper\");\n\t\t\tSystem.out.println(queueNames);\n\t\t\t\n\t\t\t\t\t\n\t\n\t}",
"private void prepareAlbums() {\n\n Album a;\n\n for(HashMap.Entry<String,ArrayList<String>> entry : Test.subcatList.get(name).entrySet()){\n key = entry.getKey();\n value = entry.getValue();\n a = new Album(key , value.get(2));\n albumList.add(a);\n System.out.println(\"dddd : \" + key + \" \" + value.get(2));\n }\n\n adapter.notifyDataSetChanged();\n\n }",
"private void populate(Node father, TreeMap<Integer, TreeMap<Integer, Category>> categoriesMap){\n \t\tif (categoriesMap.containsKey(father.getCategory().getId())) {\n \t\t\tList<Category> temp = new ArrayList<Category>(categoriesMap.get(father.getCategory().getId()).values());\n \t\t\tfor (Category c : temp) {\n \t\t\t\tNode t = new Node(c);\n \t\t\t\tString index = father.getCategory().getIndex();\n \t\t\t\tif (father.getCategory() != null) {\n \t\t\t\t\tindex += \".\" + c.getIndex();\n \t\t\t\t}\n \t\t\t\tt.getCategory().setIndex(index);\n \t\t\t\tfather.addChild(t);\n \t\t\t}\n \t\t\tcategoriesMap.remove(father.getCategory().getId());\n \t\t\tfor (Node n : father.getChildren()) {\n \t\t\t\tpopulate(n, categoriesMap);\n \t\t\t}\n \t\t}\n \t}",
"public void initialiseGodList() {\n PlayerCreator playerCreator = new PlayerCreator();\n for (int i = 0; i < playerCreator.getArrayGods().size(); i++)\n godListNames.add(playerCreator.getArrayGods().get(i).getGodName());\n }",
"private SortedMap searchByPID(Person person, IcsTrace trace) {\n\t\tProfile.begin(\"PersonIdServiceBean.searchByPID\");\n\n\t\tTreeMap ret = new TreeMap();\n\t\tDatabaseServices dbServices = DatabaseServicesFactory.getInstance();\n\n\t\ttry {\n\t\t\tList matches = null;\n\n\t\t\tIterator ids = person.getPersonIdentifiers().iterator();\n\n\t\t\tQueryParamList params = new QueryParamList(QueryParamList.OR_LIST);\n\t\t\twhile (ids.hasNext()) {\n\t\t\t\tQueryParamList inner = new QueryParamList(\n\t\t\t\t\t\tQueryParamList.AND_LIST);\n\t\t\t\tPersonIdentifier pid = (PersonIdentifier) ids.next();\n\t\t\t\tinner.add(AttributeType.PERSON_IDENTIFIER, pid.getId());\n\t\t\t\tinner.add(AttributeType.AA_NAMESPACE_ID, pid\n\t\t\t\t\t\t.getAssigningAuthority().getNameSpaceID());\n\t\t\t\tinner.add(AttributeType.AF_NAMESPACE_ID, pid\n\t\t\t\t\t\t.getAssigningFacility().getNameSpaceID());\n\t\t\t\tparams.add(inner);\n\t\t\t}\n\t\t\tmatches = dbServices.query(params);\n\n\t\t\tif (trace.isEnabled()) {\n\t\t\t\ttrace.add(\"Persons that match PIDS:\");\n\t\t\t\tIterator i = matches.iterator();\n\t\t\t\twhile (i.hasNext())\n\t\t\t\t\ttrace.add((Person) i.next());\n\t\t\t}\n\n\t\t\tIterator i = matches.iterator();\n\t\t\twhile (i.hasNext()) {\n\t\t\t\tPerson match = (Person) i.next();\n\t\t\t\tret.put(new Double(1.0), match);\n\t\t\t}\n\t\t} catch (DatabaseException dbEx) {\n\t\t\tlog.error(dbEx, dbEx);\n\t\t} finally {\n\t\t\tProfile.end(\"PersonIdServiceBean.searchByPID\");\n\t\t}\n\n\t\treturn ret;\n\t}",
"public void populateVehicleList() {\n\t\tfor (int i = 0; i < VEHICLE_LIST_SIZE; i++) {\n\t\t\tvehicleList[i] = createNewVehicle();\n\t\t}\n\t}",
"public ObservableList<peopleModel> returnPeople() {\n ObservableList<peopleModel> people = FXCollections.observableArrayList();\n people.add(new peopleModel(\"Jim\", \"Falcon\", 32));\n people.add(new peopleModel(\"Bob\", \"Thimson\", 65));\n people.add(new peopleModel(\"Carl\", \"Acusto\", 47));\n people.add(new peopleModel(\"Steven\", \"Ban\", 34));\n people.add(new peopleModel(\"Derp\", \"Derpina\", 72));\n return people;\n }",
"public void collectPhoneNumbers1(Map<String,Object> VerifiedParents) {\n for (Map.Entry<String, Object> entry : VerifiedParents.entrySet()){\n\n //Get user map\n Map singleUser = (Map) entry.getValue();\n //Get phone field and append to list\n phoneNumbers.add((String) singleUser.get(\"email\"));\n }\n// Toast.makeText(getApplicationContext(), \"It is running\",\n// Toast.LENGTH_SHORT).show();\n\n }",
"protected Map<String,List<PageViewVO>> initializePageMap() {\n\t\tMap<String,List<PageViewVO>> pm = new HashMap<>();\n\t\tfor (Section sect : Section.values()) {\n\t\t\tpm.put(sect.name(), new ArrayList<>());\n\t\t}\n\t\treturn pm;\n\t}",
"private item[][] newMap() \r\n\t{\n\t\tinitialItems=50;\r\n\t\t\r\n\t\titem cReg = new item(\"cash register\");\r\n\t\titem door = new item(\"door\");\r\n\t\t\r\n\t\titem[][] array = new item[][] {\r\n\t\t {wall(), wall(), wall(), wall(), wall(), wall(), wall(), wall(), wall(), wall()},\r\n\t\t {wall(), path(), path(), path(), path(), path(), path(), path(), path(), wall()},\r\n\t\t {wall(), path(), hPhn(), hPhn(), hPhn(), hPhn(), hPhn(), hPhn(), path(), wall()},\r\n\t\t {wall(), path(), path(), path(), path(), path(), path(), path(), path(), wall()},\r\n\t\t {wall(), path(), hPhn(), hPhn(), hPhn(), hPhn(), hPhn(), hPhn(), path(), wall()},\r\n\t\t {wall(), path(), path(), path(), path(), path(), path(), path(), path(), wall()},\r\n\t\t {wall(), path(), path(), path(), hPhn(), path(), hPhn(), path(), hPhn(), wall()},\r\n\t\t {wall(), path(), path(), path(), hPhn(), path(), hPhn(), path(), hPhn(), wall()},\r\n\t\t {wall(), cReg, cReg, path(), path(), path(), hPhn(), path(), hPhn(), wall()},\r\n\t\t {wall(), wall(), wall(), wall(), wall(), wall(), wall(), door, wall(), wall()},\r\n\t\t {wall(), wall(), wall(), wall(), wall(), wall(), wall(), wall(), wall(), wall()},\r\n\t\t};\r\n\t\t\r\n\t\tdoorX=7;\r\n\t\tdoorY=9;\r\n\t\t\r\n\t\treturn array;\r\n\t}",
"private void populateItems (ObservableList<Item> itemList) throws ClassNotFoundException {\n\t\ttblResult.setItems(itemList);\n\t}",
"@Test\n\tpublic void testVirtualPetShelterHasACollectionOfVirtualPets() {\n\t\tVirtualPetShelter testPetShelter = new VirtualPetShelter(); \n\n\t\tMap<String, VirtualPet> virtualPets = new HashMap<String, VirtualPet>(); // I want a map of VP's\n\t\t// Map<Key, Value (instances of virtualPet)> - the key will be the name of pet, the key is assigned to the pets instance\n\t\tString pet1 = \"Tui\"; //this is my first key called \"Tui\"\n\t\tVirtualPet tui = new VirtualPet(\"Tui\", \"Is a cute little calico\", 30, 30, 30);\n\t\tvirtualPets.put(pet1, tui);\n\n\t\tString pet2 = \"Ditch\";\n\t\tVirtualPet ditch = new VirtualPet(\"Ditch\", \"Is as cunning as a shithouse rat\", 10, 40, 15);\n\t\tvirtualPets.put(pet2, ditch);\n\n\t\tString pet3 = \"Blusey\";\n\t\tVirtualPet bluesy = new VirtualPet(\"Bluesy\", \"A black and tan Main coon who is a mushy cat who loves snuggles\",\n\t\t\t\t5, 5, 5);\n\t\tvirtualPets.put(pet3, bluesy);\n\n\t\tString pet4 = \"Jazzy\";\n\t\tVirtualPet jazzy = new VirtualPet(\"Jazzy\", \"Grey tiger who hunter who who be great in the barn\", 15, 20, 25);\n\t\tvirtualPets.put(pet4, jazzy);\n\n\t\tString pet5 = \"Nigel\";\n\t\tVirtualPet nigel = new VirtualPet(\"Nigel\", \"A big old ginger cat\", 10, 10, 50);\n\t\tvirtualPets.put(pet5, nigel);\n\n\t\t// Moved the Map/HashMap below to the VirtualPetShelter\n\t\t// Map<String, VirtualPet> virtualPets = new HashMap<String, VirtualPet>();\n\t\t// Then I created a method in VirtualPetShelter which returned the VirtualPets\n\t\t// \"Values\"\n\n\t\tCollection<VirtualPet> virtualPetCollection = testPetShelter.getVirtualPets(); //Initially got error, eclipse\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// asked me to create collection in VPS\n\n\t\tAssert.assertNotNull(testPetShelter.virtualPets);//I got error, eclipse asked me to create a HashMap in VPS\n\t\tAssert.assertEquals(virtualPetCollection, testPetShelter.virtualPets.values()); //\".values() is a Maps \n\t\t //way to return a \"Collection\"\n\t\tAssert.assertEquals(\"Nigel\", virtualPets.get(pet5).name); //test value of local HashMap (moved later to VPS)\n\t\tAssert.assertEquals(30, virtualPets.get(pet1).hunger); //test value of local HashMap (moved later to VPS)\n\t\tAssert.assertEquals(40, virtualPets.get(pet2).boredom); //test value of local HashMap (moved later to VPS)\n\t\tAssert.assertEquals(5, virtualPets.get(pet3).thirst); //test value of local HashMap (moved later to VPS)\n\t\tAssert.assertEquals(\"Grey tiger who hunter who who be great in the barn\", virtualPets.get(pet4).description);\n\t}",
"public void updateList() {\n\t\tthis.myList.clear();\n\t\tIterator<String> item = this.myHashMap.keySet().iterator();\n\n\t\twhile (item.hasNext())\n\t\t{\n\t\t\tString name = (String)item.next();\n\t\t\tthis.myList.add(name);\n\t\t}\n\t\tthis.nameId = -1;\n\t\t\n\t}",
"@Override\n\tpublic List<Person> getAllPersons() {\n\t\treturn (List<Person>) personDao.findAll();\n\t}",
"private void initView(List<PersonWrapper> listOfPersons) {\n adapter = new PersonAdapter(context, listOfPersons);\n mPersonsView.setAdapter(adapter);\n adapter.notifyDataSetChanged();\n }",
"public void populate() {\n populate(this.mCurItem);\n }",
"public static void ProcessListOfItems(Attributes atts,HashMap<Integer, HashMap<String,String > > Container)\n { \n \tHashMap<String,String> ObjectData = new HashMap<String,String>();\n \tInteger ObjectID = ParseIntStringOrMinusOne(atts.getValue(ID_ATTR));\n \tFCOrderManagerXMLHelper.DoConvertAttrsToStringMap(atts,ObjectData);\n \tContainer.put(ObjectID,ObjectData);\n }",
"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 List<String> extractMockTaxonNameFromMap(Iterator<Map<String,Object>> it){\n\t\tList<String> mockTaxonNameList = new ArrayList<String>();\n\t\tString calNameAuthor;\n\t\twhile(it.hasNext()){\n\t\t\tcalNameAuthor = (String)it.next().get(TaxonDAO.DD_CALNAME_AUTHOR);\n\t\t\tif(calNameAuthor.startsWith(MOCK_TAXON_NAME)){\n\t\t\t\tmockTaxonNameList.add(calNameAuthor);\n\t\t\t}\n\t\t}\n\t\treturn mockTaxonNameList;\n\t}",
"private void updateTrackingList(HashMap<String, ArrayList<Passenger>> pasGroupList, ArrayList<Passenger> individualList) {\n Iterator<String> iter = pasGroupList.keySet().iterator();\n while (iter.hasNext()) {\n String gName = iter.next();\n ArrayList<Passenger> group = pasGroupList.get(gName);\n groupReservedList.put(gName, new GroupOfPassenger(group, gName, group.get(1).isEconomy()));\n }\n\n for (Passenger k : individualList) {\n individualReservedList.put(k.getName(), k);\n }\n }",
"List<Person> persons(final PersonStringAware person,final AddressStringAware address, final Contact contact, final Circle distance, final Paging paging);",
"private void populatePlantList(){\n\n for (Document doc : getPlantList()) {\n String picture = doc.getString(\"picture_url\");\n String name = doc.getString(\"plant_name\");\n String description = doc.getString(\"description\");\n ArrayList sunlightArray = doc.get(\"sunlight\", ArrayList.class);\n String min_sun = sunlightArray.get(0).toString();\n String max_sun = sunlightArray.get(1).toString();\n ArrayList temperatureArray = doc.get(\"temperature\", ArrayList.class);\n String min_temp = temperatureArray.get(0).toString();\n String max_temp = temperatureArray.get(1).toString();\n ArrayList humidityArray = doc.get(\"humidity\", ArrayList.class);\n String min_humidity = humidityArray.get(0).toString();\n String max_humidity = humidityArray.get(1).toString();\n\n listOfPlants.add(new RecyclerViewPlantItem(picture, name, description, min_sun, max_sun, min_temp, max_temp, min_humidity, max_humidity));\n }\n }",
"public Dealership() {\n cars = new TreeMap<>();\n }",
"public POJOCompteItem() {\n compte = new TreeMap<Date, Integer>();\n items = new ArrayList<Item>();\n }",
"protected void prepareEntityToNodeMap()\r\n\t{\n\t}",
"public void updatePersonList(String deadPerson) {\n for (int i = 0; i < config.personList.size(); i++) {\n if (config.personList.get(i).getName().equals(deadPerson)) {\n config.personList.remove(i--);\n if (i < 0) {\n i = 0;\n }\n alivePerson--;\n }\n }\n\n }",
"@Override\n\tpublic int compare(TreeSetPerson o1, TreeSetPerson o2) {\n\t\treturn o1.pname.compareTo(o2.pname);\n\t}",
"private static void putArrayLstToMaps(ArrayList<MenuItem> items, Gui gui){\n for (MenuItem item : items){\n String name = item.getName();\n int price = item.getPrice();\n gui.getOrderMap().put(name, new Integer[]{price, NOT_SELECTED, INITIAL_QUANTITY});\n }\n }",
"public COSArrayList( E actualObject, COSBase item, COSDictionary dictionary, COSName dictionaryKey )\n {\n array = new COSArray();\n array.add( item );\n actual = new ArrayList<>();\n actual.add( actualObject );\n\n parentDict = dictionary;\n dictKey = dictionaryKey;\n }",
"public void parseData(JSONObject jsonObject, String title) { \n JSONArray value = jsonObject.getJSONArray(\"docs\"); \n\n //println(\"Size: \" + value.size());\n\n //-----Goes through all entries-----// \n if (value.size() != 0) {\n //MyEntries newEntry = new MyEntries(title);\n //AnimalList newList = new AnimalList(title);\n for (int i = 0; i < value.size (); i++) {\n //println(i);\n JSONObject entry = value.getJSONObject(i); \n DplaItem item = new DplaItem(entry);\n //newList.add(item);\n\n String country = item.getCountry();\n if (!country.equals(\"NA\")) { //if has a country info\n println(\"[\" + item.getCountry() + \"]\");\n AnimalList tempList;\n try {\n HashMap<String, AnimalList> animals = directory.get(country); //get the map by country name key\n try {\n tempList = animals.get(title); //get the list of one kind of animal by animal name key\n tempList.add(item);\n //println(\"Added \" + title + \" in \" + country);\n }\n catch (Exception f) {\n tempList = new AnimalList(title);\n tempList.add(item);\n animals.put(title, tempList);\n //println(\"Created \" + title + \" for \" + country);\n println(\"Loading images, please be patient\");\n tempList.getImageCSV();\n// if (tempList.getImageUrl().equals(\"NA\") ) { //search weird images on DPLA\n// tempList.searchImage(country);\n// }\n }\n } \n catch (Exception e) {\n HashMap<String, AnimalList> newMap = new HashMap();\n tempList = new AnimalList(title);\n tempList.add(item);\n newMap.put(title, tempList);\n directory.put(country, newMap);\n //println(\"Created \" + country + \" with \" + title );\n println(\"Loading images, please be patient\");\n tempList.getImageCSV();\n// if (tempList.getImageUrl().equals(\"NA\") ) {\n// tempList.searchImage(country);\n// } \n }\n }//if\n }//end outer for loop\n }//if\n }",
"public static void main(String[] args) {\n TreeMap<student, String> treeMap = new TreeMap<>();\n treeMap.put(new student(\"张三\", 21), \"北京\");\n treeMap.put(new student(\"王五\", 21), \"上海\");\n treeMap.put(new student(\"李四\", 18), \"南京\");\n treeMap.put(new student(\"小明\", 21), \"荷兰\");\n\n Set<Map.Entry<student, String>> entrySet = treeMap.entrySet();\n Iterator<Map.Entry<student, String>> it = entrySet.iterator();\n while (it.hasNext()) {\n Map.Entry me = it.next();\n student stu = (student) me.getKey();\n System.out.print(stu.getName() + \" \" + stu.getAge() + \" \");\n System.out.println(me.getValue());\n\n }\n\n }",
"public static void countingSort(Person[] persons) {\n Map<Integer, Integer> keyCounts = Arrays.stream(persons)\n .collect(Collectors.groupingBy(person -> person.key, Collectors.reducing(0, e -> 1, Integer::sum)));\n\n int baseOffset = 0;\n Map<Integer, Integer> keyOffsets = new HashMap<>();\n for (int key : keyCounts.keySet()) {\n keyOffsets.put(key, baseOffset);\n baseOffset += keyCounts.get(key);\n }\n\n Stream.iterate(persons[0], (Person person) -> {\n int offset = keyOffsets.get(person.key);\n Person tmpPerson = persons[offset];\n persons[offset] = person;\n keyOffsets.put(person.key, keyOffsets.get(person.key) + 1);\n return tmpPerson;\n }).limit(persons.length).count();\n\n// Person person = persons[0];\n// for (int i = 0; i < persons.length - 1; i++) {\n// int offset = keyOffsets.get(person.key);\n// Person tmpPerson = persons[offset];\n// persons[offset] = person;\n// keyOffsets.put(person.key, keyOffsets.get(person.key) + 1);\n// person = tmpPerson;\n// }\n }",
"public void setPersonData(List<Person> persons)\n\t{\n\t\t//Count number of people having their birthday in the same month.\n\t\tint[] monthCounter = new int[12];\n\t\tfor(Person p: persons)\n\t\t{\n\t\t\tint month = p.getBirthday().getMonthValue() - 1;\n\t\t\tmonthCounter[month]++;\n\t\t}\n\t\t\n\t\tXYChart.Series<String, Integer> series = new XYChart.Series<>();\n\t\t\n\t\t//Creates xy chart object for each month and adds to the series.\n\t\tfor(int i = 0; i< monthCounter.length; i++)\n\t\t\t{\n\t\t\tseries.getData().add(new XYChart.Data<>(monthNames.get(i), monthCounter[i]));\n\t\t\t}\n\t\tbarChart.getData().add(series);\n\t}"
] | [
"0.5905783",
"0.58932567",
"0.5861477",
"0.5805604",
"0.5439784",
"0.53722775",
"0.52422917",
"0.52252257",
"0.519063",
"0.5162948",
"0.51491827",
"0.5116369",
"0.511309",
"0.51076615",
"0.5103114",
"0.5099623",
"0.50928396",
"0.504597",
"0.49920315",
"0.49654534",
"0.4957696",
"0.4940222",
"0.49372014",
"0.49353626",
"0.49257463",
"0.49221712",
"0.49211457",
"0.4919938",
"0.49172702",
"0.4916994",
"0.4914024",
"0.4911837",
"0.49024674",
"0.48939186",
"0.4888981",
"0.48520327",
"0.48341238",
"0.48312196",
"0.48268726",
"0.4816242",
"0.48079562",
"0.48054358",
"0.48034585",
"0.47839323",
"0.4761468",
"0.4758651",
"0.47567245",
"0.47565565",
"0.4743052",
"0.47402206",
"0.47341615",
"0.47251555",
"0.47220406",
"0.4721288",
"0.47134504",
"0.4682207",
"0.46780407",
"0.46759173",
"0.4672277",
"0.46696907",
"0.4669121",
"0.46672237",
"0.46663886",
"0.4662641",
"0.46620587",
"0.46603307",
"0.46585423",
"0.46572998",
"0.4654937",
"0.4654163",
"0.46514583",
"0.46463463",
"0.4642838",
"0.46355608",
"0.46342137",
"0.4631179",
"0.46087775",
"0.46028152",
"0.45962638",
"0.45960966",
"0.45958823",
"0.45922753",
"0.45891482",
"0.4569342",
"0.45693037",
"0.4562436",
"0.45603254",
"0.45579824",
"0.4555238",
"0.45518306",
"0.4550619",
"0.45482662",
"0.45312753",
"0.4530897",
"0.4525909",
"0.4518301",
"0.4516407",
"0.45155355",
"0.45153227",
"0.45125058"
] | 0.80501395 | 0 |
First, we validate the input. | private void sendNameToServer() {
String textToServer = nameField.getText();
// Then, we send the input to the server.
greetingService.greetServer(nameField.getValue(),
new AsyncCallback<String>() {
public void onFailure(Throwable caught) {
resultField.setValue(caught.getMessage());
}
public void onSuccess(String result) {
resultField.setValue(result);
}
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private boolean isValidInput() {\n\t\treturn true;\n\t}",
"private void validateInputParameters(){\n\n }",
"private boolean isInputValid() {\n return true;\n }",
"@Override\n\tpublic boolean checkInput() {\n\t\treturn true;\n\t}",
"private void validateData() {\n }",
"private void checkUserInput() {\n }",
"protected abstract boolean isInputValid();",
"protected abstract boolean checkInput();",
"public abstract boolean verifyInput();",
"protected void validate() {\n // no op\n }",
"@Override\r\n\tpublic void validate() {\n\t\t\r\n\t}",
"protected void validate() {\n // no implementation.\n }",
"@Override\n\tpublic void validate()\n\t{\n\n\t}",
"@Override\n\tprotected void isValid(String input) throws DataInputException\n\t{\n\t}",
"@Override\r\n\tprotected void validate() {\n\t}",
"protected abstract int isValidInput();",
"@Override\r\n public void validate() {\r\n }",
"public void validate() {}",
"protected void validate()\r\n\t{\r\n\t\tif( this.mapper==null )\r\n\t\t\tthrow new IllegalStateException(\"Please specify the Mapper of this dataset.\");\r\n\t\tif( this.input_format==null )\r\n\t\t\tthrow new IllegalStateException(\"Please specify the InputFormat of this dataset.\");\r\n\t\tif( this.inputs==null || this.inputs.size()==0 )\r\n\t\t\tthrow new IllegalStateException(\"Please specify the input path(s) of this dataset\");\r\n\t\tif ( this.getSchema()==null || this.getSchema().size()==0 )\r\n\t\t\tthrow new IllegalStateException(\"Please specify the schema of this dataset first\");\r\n\t}",
"private void inputValidation(String[] args) {\r\n\t\t// Must have two argument inputs - grammar and sample input\r\n\t\tif (args.length != 2) {\r\n\t\t\tSystem.out.println(\"Invalid parameters. Try:\\njava Main <path/to/grammar> <path/to/input>\");\r\n\t\t\tSystem.exit(-1);\r\n\t\t}\r\n\t}",
"@Override\n\tpublic void validate() {\n\t}",
"@Override\r\n public boolean validate() {\n return true;\r\n }",
"protected abstract boolean isInputValid(@NotNull ConversationContext context, @NotNull String input);",
"void validate();",
"void validate();",
"private void validateInput () throws IOException, Exception {\n\t\t\n\t\t// Check that the properties file exists\n\t\tFile propFile = new File(propertiesFile);\n\t\tif (!propFile.exists()) { \n\t\t\tthrow new IOException(\"Unable to open properties file \" + propertiesFile);\t\n\t\t}\n\t\t\n\t\t// Check that the list of register files is not empty\n\t\tif (inputFiles == null || inputFiles.isEmpty()) {\n\t\t\tthrow new Exception(\"No files to process\");\n\t\t}\n\t}",
"protected void validateInput()\r\n\t{\r\n\t\tString errorMessage = null;\r\n\t\tif ( validator != null ) {\r\n\t\t\terrorMessage = validator.isValid(text.getText());\r\n\t\t}\r\n\t\t// Bug 16256: important not to treat \"\" (blank error) the same as null\r\n\t\t// (no error)\r\n\t\tsetErrorMessage(errorMessage);\r\n\t}",
"@Override\n\t\tpublic void checkPreconditions() {\n\t\t}",
"private void validate() {\n\n if (this.clsname == null)\n throw new IllegalArgumentException();\n if (this.dimension < 0)\n throw new IllegalArgumentException();\n if (this.generics == null)\n throw new IllegalArgumentException();\n }",
"private void validarCampos() {\n }",
"@Override\n\tpublic void validate() {\n\t\tsuper.validate();\n\t}",
"@Override\n\tprotected void checkNumberOfInputs(int length) {\n\n\t}",
"@Override\r\n\tpublic boolean validate() {\n\t\treturn true;\r\n\t}",
"@Override\r\n\tpublic boolean validate() {\n\t\treturn true;\r\n\t}",
"private static String validateInputStr() {\n String str = \"\";\n Scanner genericString = new Scanner(System.in);\n if (!genericString.hasNextInt()) {\n str = genericString.nextLine();\n return str;\n }\n else {\n validateInputStr();\n }\n return str;\n }",
"protected void check() throws IOException, ServletException {\n if(value.length()==0)\n error(\"please specify at least one component\");\n else {\n \t\t//TODO add more checks\n \t\tok();\n }\n }",
"public boolean validateInput() {\n/* 158 */ throw new RuntimeException(\"Stub!\");\n/* */ }",
"private static void verifyArgs()\r\n\t{\r\n\t\tif(goFile == null)\r\n\t\t{\r\n\t\t\tSystem.err.println(\"Error: you must specify an input GO file.\");\r\n\t\t\texitError();\r\n\t\t}\r\n\t\tif(annotFile == null)\r\n\t\t{\r\n\t\t\tSystem.err.println(\"Error: you must specify an input annotation file.\");\r\n\t\t\texitError();\r\n\t\t}\r\n\t\tif(goSlimFile == null)\r\n\t\t{\r\n\t\t\tSystem.err.println(\"Error: you must specify an input GOslim file.\");\r\n\t\t\texitError();\r\n\t\t}\r\n\t\tif(slimAnnotFile == null)\r\n\t\t{\r\n\t\t\tSystem.err.println(\"Error: you must specify an output file.\");\r\n\t\t\texitError();\r\n\t\t}\r\n\t}",
"public void validateInput(Information information) {\n information.validateFirstName();\n information.validateLastName();\n information.validateZipcode();\n information.validateEmployeeID();\n }",
"public boolean checkInput();",
"@Override\n\tprotected void processInput() {\n\t}",
"private static String[] checkInput(String input) throws Exception{\n String[] in = input.trim().split(\" \");\n\n if(in.length == 0){\n throw new CommandException(ExceptionEnum.INCORRECT_COMMAND_EXCEPTION);\n }\n\n if(CommandEnum.getCommandEnumFrom(in[0]) == null){\n throw new CommandException(ExceptionEnum.INCORRECT_COMMAND_EXCEPTION);\n }\n\n if(isSpecificCommandENum(in[0],BYE)){\n return in;\n }\n if(isSpecificCommandENum(in[0],TERMINATE)){\n return in;\n }\n\n if(in.length < MIN_PARAM){\n throw new CommandException(ExceptionEnum.LESS_INPUT_EXCEPTION);\n }\n\n if(in.length > MAX_PARAM){\n throw new CommandException(ExceptionEnum.EXTRA_INPUT_EXCEPTION);\n }\n\n //check input value\n for(int i = 1; i < in.length; i++){\n try{\n Integer.parseInt(in[i]);\n }catch(NumberFormatException e){\n throw new CommandException(ExceptionEnum.INVALID_INPUT_EXCEPTION);\n }\n }\n\n return in;\n }",
"public void validate () { throw new RuntimeException(); }",
"private void validateInitialParams() throws IllegalArgumentException {\n if (StringUtils.isBlank(this.apiKey)) {\n throw new IllegalArgumentException(\"API key is not specified!\");\n }\n if (StringUtils.isBlank(this.baseUrl)) {\n throw new IllegalArgumentException(\"The Comet base URL is not specified!\");\n }\n }",
"private void validateConnection() throws IOException {\n ensureOpen();\n\n // to sure only one privateInput object exist.\n if (privateInput == null) {\n startProcessing();\n }\n }",
"private static boolean validateInput1(String[] input) {\n\t\tif (input.length != 1) {\n\t\t\tSystem.out.println(ErrorType.UNKNOWN_COMMAND);\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}",
"private boolean validateInput(EditText titleInput, EditText descriptionInput, EditText priceInput) {\n String title = titleInput.getText().toString();\n String description = descriptionInput.getText().toString();\n int price = (TextUtils.isEmpty(priceInput.getText().toString()))? -1 : Integer.parseInt(priceInput.getText().toString());\n if (TextUtils.isEmpty(title) || TextUtils.isEmpty(description) || price < 0) {\n Toast.makeText(this.getActivity(),\n \"Please, fill in all fields.\",\n Toast.LENGTH_LONG).show();\n return false;\n }\n if (photoURI == null) {\n Toast.makeText(this.getActivity(),\n \"Please, add a picture to this item before submitting it.\",\n Toast.LENGTH_LONG).show();\n return false;\n }\n return true;\n }",
"protected void check() throws IOException, ServletException {\n if(value.length()==0)\n error(\"please type in the License Server\");\n else {\n \t//TODO add more checks\n \tok();\n }\n }",
"private void validate() {\n Validate.notNull(uriLocatorFactory);\n Validate.notNull(preProcessorExecutor);\n }",
"@Override\r\n\tpublic boolean checkValidity() {\n\t\treturn false;\r\n\t}",
"private boolean checkInputFields(){\r\n\t\tString allertMsg = \"Invalid input: \" + System.getProperty(\"line.separator\");\r\n\t\t\r\n\t\t//Check input for MCS text field\r\n\t\ttry{\r\n\t\t\tFloat testValue = Float.parseFloat(m_MCSTf.getText());\r\n\t\t\tif(testValue < 0 || testValue > 1)\r\n\t\t\t\tthrow new NumberFormatException();\r\n\t\t}catch (NumberFormatException e){\r\n\t\t\tallertMsg += \"Please enter a number between 0 and 1 as a MCS score.\" + System.getProperty(\"line.separator\");\r\n\t\t}\r\n\t\t//Check input for relevance score weight and coherence score weight text fields\r\n\t\ttry{\r\n\t\t\tFloat relScoreW = Float.parseFloat(m_RelScoreTf.getText());\r\n\t\t\tFloat cohScoreW = Float.parseFloat(m_CohScoreTf.getText());\r\n\t\t\tif(relScoreW < 0 || relScoreW > 1)\r\n\t\t\t\tthrow new NumberFormatException();\r\n\t\t\tif(cohScoreW < 0 || cohScoreW > 1)\r\n\t\t\t\tthrow new NumberFormatException();\r\n\t\t\tif((relScoreW + cohScoreW) != 1)\r\n\t\t\t\tthrow new NumberFormatException();\r\n\t\t}catch (NumberFormatException e){\r\n\t\t\tallertMsg += \"Please enter a number between 0 and 1 as a weight for relevance and coherence score.\" + System.getProperty(\"line.separator\");\r\n\t\t\tallertMsg += \"Sum of the weights for relevance and coherence score must be 1.\" + System.getProperty(\"line.separator\");\r\n\t\t}\r\n\t\t//Check input for MCS text field\r\n\t\ttry{\r\n\t\t\tFloat testValue = Float.parseFloat(m_KeyTf.getText());\r\n\t\t\tif(testValue < 0)\r\n\t\t\t\tthrow new NumberFormatException();\r\n\t\t}catch (NumberFormatException e){\r\n\t\t\tallertMsg += \"Please enter a positive number as multiplier for keyword concepts.\" + System.getProperty(\"line.separator\");\r\n\t\t}\r\n\t\t//Check input for category confidence weight\r\n\t\ttry{\r\n\t\t\tFloat testValue = Float.parseFloat(m_CatConfTf.getText());\r\n\t\t\tif(testValue < 0)\r\n\t\t\t\tthrow new NumberFormatException();\r\n\t\t}catch (NumberFormatException e){\r\n\t\t\tallertMsg += \"Please enter a positive number as a weight for the weight of the category confidence of concepts.\" + System.getProperty(\"line.separator\");\r\n\t\t}\r\n\t\t//Check input for weight of repeated concepts\r\n\t\ttry{\r\n\t\t\tFloat testValue = Float.parseFloat(m_RepeatTf.getText());\r\n\t\t\tif(testValue < 0)\r\n\t\t\t\tthrow new NumberFormatException();\r\n\t\t}catch (NumberFormatException e){\r\n\t\t\tallertMsg += \"Please enter a positive number as a weight for repeated concepts.\" + System.getProperty(\"line.separator\");\r\n\t\t}\r\n\t\t//Check input for number of output categories\r\n\t\ttry{\r\n\t\t\tInteger testValue = Integer.parseInt(m_MaxCatsTf.getText());\r\n\t\t\tif(testValue < 1)\r\n\t\t\t\tthrow new NumberFormatException();\r\n\t\t}catch (NumberFormatException e){\r\n\t\t\tallertMsg += \"Please enter a positive number for the maximum number of output categories.\" + System.getProperty(\"line.separator\");\r\n\t\t}\r\n\t\ttry{\r\n\t\t\tInteger testValue = Integer.parseInt(m_MinCatsTf.getText());\r\n\t\t\tif(testValue < 1)\r\n\t\t\t\tthrow new NumberFormatException();\r\n\t\t}catch (NumberFormatException e){\r\n\t\t\tallertMsg += \"Please enter a positive number for the minimum number of output categories.\" + System.getProperty(\"line.separator\");\r\n\t\t}\r\n\t\ttry{\r\n\t\t\tFloat testValue = Float.parseFloat(m_MinCatScoreTf.getText());\r\n\t\t\tif(testValue < 0.0f || testValue > 1.0f)\r\n\t\t\t\tthrow new NumberFormatException();\r\n\t\t}catch (NumberFormatException e){\r\n\t\t\tallertMsg += \"Please enter a positive number between 0 and 1 as minimum category score.\" + System.getProperty(\"line.separator\");\r\n\t\t}\r\n\t\tif(allertMsg.length() > 18){\r\n\t\t\tAlert alert = new Alert(AlertType.ERROR);\r\n\t\t\talert.setContentText(allertMsg);\r\n\t\t\talert.showAndWait();\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}",
"private void checkValid() {\n getSimType();\n getInitialConfig();\n getIsOutlined();\n getEdgePolicy();\n getNeighborPolicy();\n getCellShape();\n }",
"@Test\r\n public void Test004TakeUserInputValid()\r\n {\r\n gol.input = new Scanner(new ByteArrayInputStream(\"1 1 2 2 2 3 2 4 -1\".getBytes()));\r\n gol.takeUserInput();\r\n assertTrue(gol.grid[1][1] == 1 && gol.grid[2][2] == 1 && gol.grid[2][3] == 1 && gol.grid[2][4] == 1);\r\n }",
"void checkValid();",
"public void validate() throws org.apache.thrift.TException {\n if (!is_set_inputs()) {\n throw new org.apache.thrift.protocol.TProtocolException(\"Required field 'inputs' is unset! Struct:\" + toString());\n }\n\n if (!is_set_streams()) {\n throw new org.apache.thrift.protocol.TProtocolException(\"Required field 'streams' is unset! Struct:\" + toString());\n }\n\n // check for sub-struct validity\n }",
"private void processInput() {\r\n\t\ttry {\r\n\t\t\thandleInput(readLine());\r\n\t\t} catch (WrongFormatException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}",
"@Override\n\tpublic boolean validate() {\n\t\treturn false;\n\t}",
"@Override\n\tpublic boolean validate() {\n\t\treturn false;\n\t}",
"public void validate(){\r\n\t\ttry{\r\n\t\t\t//First name, last name, date of birth and email are compulsory.\r\n\t\tif(FirstName==null||LastName==null||Dob==null||Email==null) \r\n\t\t\tthrow new Exception(\"One of the field is Empty :\\n(First name / last name / dob / email )\");\r\n\t\tif(TelephoneNumber!=0||MobileNumber!=0)\r\n\t\t\tthrow new Exception(\"Enter Contact Number\");\r\n\t\t\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tSystem.out.println(e);\r\n\t\t}\r\n\t\t\r\n\t\t/*finally{\r\n\t\t\tSystem.out.println(\"Program Executed\");\r\n\t\t}*/\r\n\t}",
"@Override\n public boolean validate(final String param) {\n return false;\n }",
"@Override\n public void ensureValid() throws IOException {\n }",
"private void performSanityCheck()\n\t{\n\t\tif (variableNames != null && domainSizes != null\n\t\t\t\t&& propositionNames != null)\n\t\t{\n\t\t\tcheckStateSizes();\n\t\t\tcheckDomainSizes();\n\t\t}\n\t}",
"private static void validateInputArguments(String args[]) {\n\n\t\tif (args == null || args.length != 2) {\n\t\t\tthrow new InvalidParameterException(\"invalid Parameters\");\n\t\t}\n\n\t\tString dfaFileName = args[DFA_FILE_ARGS_INDEX];\n\t\tif (dfaFileName == null || dfaFileName.trim().isEmpty()) {\n\t\t\tthrow new InvalidParameterException(\"Invalid file name\");\n\t\t}\n\n\t\tString delimiter = args[DELIMITER_SYMBOL_ARGS_INDEX];\n\t\tif (delimiter == null || delimiter.trim().isEmpty()) {\n\t\t\tthrow new InvalidParameterException(\"Invalid delimiter symbol\");\n\t\t}\n\t}",
"private void validateFirstNameInput(String firstName) {\n\t\t\n\t\tif(Objects.isNull(firstName) || firstName.length() < 3) {\n\t\t\tthrow new FirstNameIsNotInExpectedFormat(firstName);\n\t\t}\n\t\t\n\t}",
"protected void validate() {\n Preconditions.checkArgument(\n dim > 0,\n \"Cannot compute scale along dim = 0 (batch dimension), please provide dim > 0\");\n }",
"private void validate() throws BaseException\n {\n boolean okay = true;\n\n //TODO: check the bases in seq for validity\n // If the type is RNA, the base T is not allowed\n // If the type is DNA, the base U is not allowed\n // If a disallowed type is present, set okay to false.\n \n if (!okay)\n {\n throw new BaseException();\n }\n }",
"private void validate() {\n\t\t// just in case;\n\t\tfor (int i=0;i<NR_OF_FIELDS; i++) {\n\t\t\tvalid[i] = \"0\";\n\t\t}\n\t\t//\n\t\t// Validate name and surname:\n\t\t//\n\t\tif ( ! this.isUpperAlpha(nume)) {\n\t\t\tfields[0] = \"1\";\n\t\t}\n\t\t\n\t\tif ( ! this.isUpperAlphaWithSpace(nume)) {\n\t\t\tfields[1] = \"1\";\n\t\t}\n\t\t//\n\t\t// validate seria\n\t\t//\n\t\tvalid[2] = \"1\";\t\t\t\t\t\t\t// presupun ca seria este invalida, si incerc sa o validez\n\t\tfor (int i=0; i<seriiBuletin.length; i++) {\n\t\t\tif (seriiBuletin[i].equals(seria)) {\n\t\t\t\tvalid[2] = \"0\";\n\t\t\t}\n\t\t}\n\t\t//\n\t\t// validate numarul\n\t\t//\n\t\ttry {\n\t\t\tvalid[3] = \"1\";\n\t\t\tint nr = Integer.valueOf(numarul);\n\t\t\tif ( nr >= 100000 && nr <= 999999 ) {\n\t\t\t\tvalid[3] = \"0\";\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tLog.d(TAG, \"Error validating seria.\");\n\t\t}\n\n\t\t//\n\t\t// validate sex\n\t\t//\n\t\tif ( ! (sex == 'M' || sex == 'F')) {\n\t\t\tvalid[6] = \"1\";\n\t\t}\n\t\t//\n\t\t// Validate valabilitate\n\t\t//\n\t\tif ( ! isNumber(this.valabilitate)) {\n\t\t\tvalid[7] = \"1\";\n\t\t}\n\t\t//\n\t\t// validate CNP\n\t\t//\n\t\tif ( ! (isNumber(CNP) && isValidCNP(CNP))) {\n\t\t\tvalid[8] = \"1\";\n\t\t}\n\t\t\n\t}",
"private static boolean validateInput2(String[] input) {\n\t\tif (input.length != 2) {\n\t\t\tSystem.out.println(ErrorType.UNKNOWN_COMMAND);\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}",
"public void validateInput( JobConf job ) throws IOException\n {\n for( JobConf jobConf : getJobConfs( job, getConfigs( job ) ) )\n jobConf.getInputFormat().validateInput( jobConf );\n }",
"private void checkInput(String input)throws Exception{\n\n if (input.getBytes(\"UTF-8\").length > 255){\n throw new IOException(\"Message too long\");\n\n }\n try {\n if (Integer.parseInt(input) < 0 || Integer.parseInt(input) > 65535) {\n throw new IOException(\"Port not valid\");\n }\n }catch (NumberFormatException e){\n //nothing should happen\n }\n }",
"private void verifyInput(){\n String firstName = mFirstNameField.getText().toString();\n String lastName = mLastNameField.getText().toString();\n\n mNameFieldsFilled = !TextUtils.isEmpty(firstName) && !TextUtils.isEmpty(lastName);\n\n }",
"private boolean isValidInput() {\n if (null == mUsername || mUsername.length() <= 0) {\n return false;\n } else if (null == mPassword || mPassword.length() <= 0) {\n return false;\n }\n return true;\n }",
"private static int validateInput() {\n Scanner genericInt = new Scanner(System.in);\n int number = 0;\n if (genericInt.hasNextInt()) {\n number = genericInt.nextInt();\n return number;\n }\n else {\n validateInput();\n }\n return number;\n }",
"@Override\n\tpublic void selfValidate() {\n\t\t\n\t}",
"protected void check() throws IOException, ServletException {\n if(value.length()==0)\n error(\"please specify a configuration\");\n else {\n \t\t//TODO add more checks\n \t\tok();\n }\n }",
"protected boolean isValidData() {\n return true;\n }",
"@Value.Check\n default void checkPreconditions()\n {\n RangeCheck.checkIncludedInInteger(\n this.feedback(),\n \"Feedback\",\n RangeInclusiveI.of(0, 7),\n \"Valid feedback values\");\n\n RangeCheck.checkIncludedInInteger(\n this.transpose(),\n \"Transpose\",\n RangeInclusiveI.of(-24, 24),\n \"Valid transpose values\");\n\n RangeCheck.checkIncludedInInteger(\n this.pitchEnvelopeR1Level(),\n \"Pitch R1 Level\",\n RangeInclusiveI.of(0, 99),\n \"Valid levels\");\n\n RangeCheck.checkIncludedInInteger(\n this.pitchEnvelopeR1Rate(),\n \"Pitch R1 Rate\",\n RangeInclusiveI.of(0, 99),\n \"Valid rates\");\n\n RangeCheck.checkIncludedInInteger(\n this.pitchEnvelopeR2Level(),\n \"Pitch R2 Level\",\n RangeInclusiveI.of(0, 99),\n \"Valid levels\");\n\n RangeCheck.checkIncludedInInteger(\n this.pitchEnvelopeR2Rate(),\n \"Pitch R2 Rate\",\n RangeInclusiveI.of(0, 99),\n \"Valid rates\");\n\n RangeCheck.checkIncludedInInteger(\n this.pitchEnvelopeR3Level(),\n \"Pitch R3 Level\",\n RangeInclusiveI.of(0, 99),\n \"Valid levels\");\n\n RangeCheck.checkIncludedInInteger(\n this.pitchEnvelopeR3Rate(),\n \"Pitch R3 Rate\",\n RangeInclusiveI.of(0, 99),\n \"Valid rates\");\n\n RangeCheck.checkIncludedInInteger(\n this.pitchEnvelopeR4Level(),\n \"Pitch R4 Level\",\n RangeInclusiveI.of(0, 99),\n \"Valid levels\");\n\n RangeCheck.checkIncludedInInteger(\n this.pitchEnvelopeR4Rate(),\n \"Pitch R4 Rate\",\n RangeInclusiveI.of(0, 99),\n \"Valid rates\");\n\n RangeCheck.checkIncludedInInteger(\n this.lfoPitchModulationDepth(),\n \"LFO Pitch Modulation Depth\",\n RangeInclusiveI.of(0, 99),\n \"Valid pitch modulation depth values\");\n\n RangeCheck.checkIncludedInInteger(\n this.lfoPitchModulationSensitivity(),\n \"LFO Pitch Modulation Sensitivity\",\n RangeInclusiveI.of(0, 7),\n \"Valid pitch modulation sensitivity values\");\n\n RangeCheck.checkIncludedInInteger(\n this.lfoAmplitudeModulationDepth(),\n \"LFO Amplitude Modulation Depth\",\n RangeInclusiveI.of(0, 99),\n \"Valid amplitude modulation depth values\");\n\n RangeCheck.checkIncludedInInteger(\n this.lfoSpeed(),\n \"LFO Speed\",\n RangeInclusiveI.of(0, 99),\n \"Valid LFO speed values\");\n\n RangeCheck.checkIncludedInInteger(\n this.lfoDelay(),\n \"LFO Delay\",\n RangeInclusiveI.of(0, 99),\n \"Valid LFO delay values\");\n }",
"private void check()\n {\n Preconditions.checkArgument(name != null, \"Property name missing\");\n Preconditions.checkArgument(valueOptions != null || valueMethod != null, \"Value method missing\");\n Preconditions.checkArgument(\n !(this.validationRegex != null && this.valueOptions != null && this.valueOptionsMustMatch),\n \"Cant have regexp validator and matching options at the same time\");\n\n if (required == null)\n {\n /*\n If a property has a default value, the common case is that it's required.\n However, we need to allow for redundant calls of required(): defaultOf(x).required();\n and for unusual cases where a property has a default value but it's optional: defaultOf(x).required(false).\n */\n required = this.defaultValue != null;\n }\n\n if (description == null)\n description = \"Property name: \" + name + \", required = \" + required;\n\n if (valueOptions != null && defaultValue != null)\n {\n for (PropertySpec.Value v : valueOptions)\n {\n if (v.value.equals(defaultValue.value))\n v.isDefault = true;\n }\n }\n\n if (dependsOn != null)\n {\n if (category == null)\n throw new IllegalArgumentException(\"category required when dependsOn is set \" + name);\n\n if (!dependsOn.isOptionsOnly())\n throw new IllegalArgumentException(\n \"Invalid dependsOn propertySpec (must be optionsOnly) \" + dependsOn.name());\n }\n }",
"private void doInputValidation(String from, String subject, String content) {\n if (from == null) {\n throw new IllegalArgumentException(ERR_MSG_FROM_IS_NULL);\n } else if (\"\".equalsIgnoreCase(from.trim())) {\n throw new IllegalArgumentException(ERR_MSG_FROM_IS_EMPTY);\n } else if (subject == null) {\n throw new IllegalArgumentException(ERR_MSG_SUBJECT_IS_NULL);\n } else if (\"\".equalsIgnoreCase(subject.trim())) {\n throw new IllegalArgumentException(ERR_MSG_SUBJECT_IS_EMPTY);\n } else if (content == null) {\n throw new IllegalArgumentException(ERR_MSG_CONTENT_IS_NULL);\n } else if (\"\".equalsIgnoreCase(content.trim())) {\n throw new IllegalArgumentException(ERR_MSG_CONTENT_IS_EMPTY);\n }\n String tokens[] = subject.trim().split(\" \");\n if (tokens.length != 2) {\n throw new IllegalArgumentException(ERR_MSG_SUBJECT_MUST_HAVE_TWO_ARGUMENTS);\n }\n }",
"private boolean isInValidInput(String input) {\n\n\t\tif (input == null || input.isEmpty())\n\t\t\treturn true;\n\n\t\tint firstPipeIndex = input.indexOf(PARAM_DELIMITER);\n\t\tint secondPipeIndex = input.indexOf(PARAM_DELIMITER, firstPipeIndex + 1);\n\n\t\t/*\n\t\t * if there are no PARAM_DELIMITERs or starts with a PARAM_DELIMITER\n\t\t * (Meaning command is missing) or only single PARAM_DELIMITER input is\n\t\t * not valid\n\t\t */\n\t\tif (firstPipeIndex == -1 || firstPipeIndex == 0 || secondPipeIndex == -1)\n\t\t\treturn true;\n\n\t\t// Means package name is empty\n\t\tif (secondPipeIndex - firstPipeIndex < 2)\n\t\t\treturn true;\n\n\t\treturn false;\n\t}",
"public void input() throws ParseException {\r\n\t\tScanner scn = new Scanner(System.in);\r\n\t\tSystem.out.println(\"Please enter id: \");\r\n\t\tString idSt = scn.nextLine();\r\n\t\tid = Integer.parseInt(idSt);\r\n\t\tSystem.out.println(\"Please enter title: \");\r\n\t\ttitle = scn.nextLine();\r\n\t\tSystem.out.println(\"Please enter authors name: \");\r\n\t\tauthor = scn.nextLine();\r\n\t\tSystem.out.println(\"Please enter date (dd.MM.yyyy): \");\r\n\t\tString scnDate = scn.nextLine();\r\n\t\tdateOfPublication = stringToDate(scnDate);\r\n\t}",
"private void validateParameters() {\r\n if (command == null) {\r\n throw new BuildException(\r\n \"'command' parameter should not be null for coverity task.\");\r\n }\r\n\r\n }",
"@Override\n protected void validate()\n throws CommandException, CommandValidationException {\n super.validate();\n String pp = getOption(\"printprompt\");\n if (pp != null)\n printPrompt = Boolean.parseBoolean(pp);\n else\n printPrompt = programOpts.isInteractive();\n encoding = getOption(\"encoding\");\n String fname = getOption(\"file\");\n if (fname != null)\n file = new File(fname);\n }",
"public abstract boolean validate();",
"private void validateData(String input) {\n String[] inputStringArray = input.split(\" \");\n\n for (String s : inputStringArray) {\n try {\n Integer.parseInt(s);\n } catch (NumberFormatException e) {\n throw new NumberFormatException(\n \"Looks like your input - \" + s + \", is not a number. Try again\");\n }\n }\n }",
"@Override\r\n public void validate() {\n\r\n }",
"public boolean validate() {\n return true;\n }",
"public boolean validate() {\n return true;\n }",
"private void validateBuildParameters() {\n if (TextUtils.isEmpty(consumerKey)) {\n throw new IllegalArgumentException(\"CONSUMER_KEY not set\");\n }\n if (TextUtils.isEmpty(consumerSecret)) {\n throw new IllegalArgumentException(\"CONSUMER_SECRET not set\");\n }\n if (TextUtils.isEmpty(token)) {\n throw new IllegalArgumentException(\"TOKEN not set, the user must be logged it\");\n }\n if (TextUtils.isEmpty(tokenSecret)) {\n throw new IllegalArgumentException(\"TOKEN_SECRET not set, the user must be logged it\");\n }\n }",
"private boolean validateInputs() {\n if (Constants.NULL.equals(review)) {\n reviewET.setError(\"Must type a review!\");\n reviewET.requestFocus();\n return false;\n }\n if (Constants.NULL.equals(heading)) {\n headingET.setError(\"Heading cannot be empty\");\n headingET.requestFocus();\n return false;\n }\n return true;\n }",
"public void execute() {\n String input;\n boolean isInputValid;\n\n do {\n isInputValid = true;\n\n System.out.print(\"Please send me the numbers using space between them like \\\"1 2 3\\\": \");\n input = sc.nextLine();\n\n try {\n validateData(input);\n } catch (NumberFormatException e) {\n System.err.println(\"NumberFormatException \" + e.getMessage());\n isInputValid = false;\n }\n\n } while (!isInputValid);\n\n System.out.println(\"Result: \" + find(input));\n }",
"public static String getValidation(String message) { // Example of using Method Overloading\r\n\r\n Scanner reader = new Scanner(System.in); // Create a Scanner object\r\n String input = null;\r\n int charIsNotSpace = 0;\r\n\r\n do {\r\n System.out.print(message);\r\n\r\n while (!reader.hasNextLine()) { // I think that the program never enters this while because .hasNextLine identifies\r\n System.out.print(\"Please enter a valid name with at least 3 characters\"); // any type of input as a valid\r\n reader.next(); // value, including \"enter\" and space, but it is like this in the \"PPT Input Validation\"\r\n }\r\n\r\n input = reader.nextLine();\r\n\r\n for (int i=0; i < input.length(); i++) { // checks if at least three characters are not space\r\n if (input.charAt(i) != ' ') {\r\n charIsNotSpace ++;\r\n }\r\n }\r\n\r\n } while (input == null || input.equals(\"\") || input.length() < 3 || charIsNotSpace < 3); //While the input value is not a null value or empty string or least 3 characters.\r\n\r\n // Loop used to capitalize the first letter of the name and without using any other auxiliary class, such as the StringBuilder\r\n String letter = \"\";\r\n String capitalizedName = \"\";\r\n boolean isFirstLetter;\r\n for (int i=0; i < input.length(); i++) {\r\n\r\n isFirstLetter = false;\r\n\r\n if (i == 0) {\r\n while (input.charAt(i) == ' ') { // Ignores spaces that the user typed before the first letter of the name\r\n i++;\r\n }\r\n isFirstLetter = true;\r\n }\r\n\r\n if (input.charAt(i) == ' ' && (i+1) < input.length()) {\r\n if (input.charAt(i) == ' ' && input.charAt(i + 1) == ' ') {\r\n letter = \"\";\r\n } else {\r\n letter += \" \" + input.charAt(i + 1);\r\n capitalizedName += letter.toUpperCase();\r\n i++;\r\n letter = \"\";\r\n }\r\n }\r\n else if (isFirstLetter == true) {\r\n letter += input.charAt(i);\r\n capitalizedName += letter.toUpperCase();\r\n letter = \"\";\r\n }\r\n else if (input.charAt(i) != ' ') {\r\n letter += input.charAt(i);\r\n capitalizedName += letter.toLowerCase();\r\n letter = \"\";\r\n }\r\n }\r\n\r\n return capitalizedName;\r\n }",
"private boolean validateData() {\r\n TASKAggInfo agg = null;\r\n int index = aggList.getSelectedIndex();\r\n if (index != 0) {\r\n agg = (TASKAggInfo)aggregators.elementAt(aggList.getSelectedIndex()-1);\r\n }\r\n\r\n if (getArgument1() == BAD_ARGUMENT) {\r\n JOptionPane.showMessageDialog(this, \"Argument 1 must be of type: \"+TASKTypes.TypeName[agg.getArgType()], \"Error\", JOptionPane.ERROR_MESSAGE);\r\n return false;\r\n }\r\n else if (getArgument2() == BAD_ARGUMENT) {\r\n JOptionPane.showMessageDialog(this, \"Argument 2 must be of type: \"+TASKTypes.TypeName[agg.getArgType()], \"Error\", JOptionPane.ERROR_MESSAGE);\r\n return false;\r\n }\r\n else if (getOperand() == BAD_ARGUMENT) {\r\n JOptionPane.showMessageDialog(this, \"Filter value must be of type integer\", \"Error\", JOptionPane.ERROR_MESSAGE);\r\n return false;\r\n }\r\n return true;\r\n }",
"public void validate() throws Exception {\n }",
"@Override\r\n\tpublic void acceptInput(String input) {\n\t\t\r\n\t}",
"protected boolean validateData(String [] data) {\n return true;\n }",
"@Test public void gracefullyEndsForEmptyInputs() {\n\t\tAssert.assertNotNull(parser.parse(new String[0], new CliOptions()));\n\t}",
"private boolean validateUserInputs() {\n ArrayList<String> errors = new ArrayList();\n \n if (this.view.getContent().equals(\"\")) {\n errors.add(\"\\t - Enter a comment\");\n }\n \n if (errors.size() > 0) {\n String errorMsg = \"Unable to save new Asset.\\nDetails:\";\n for (String error : errors) {\n errorMsg += \"\\n\" + error;\n }\n JOptionPane.showMessageDialog(this.view, errorMsg, \"Unable to Save\", JOptionPane.INFORMATION_MESSAGE);\n return false;\n }\n return true;\n }",
"private void valida(String str)throws Exception{\n\t\t\t\n\t\t\tif(str == null || str.trim().isEmpty()){\n\t\t\t\tthrow new Exception(\"Nao eh possivel trabalhar com valores vazios ou null.\");\n\t\t\t}\n\t\t\n\t\t}",
"@Override\n\tprotected boolean validateRequiredParameters() throws Exception {\n\t\treturn true;\n\t}",
"private boolean checkInputValidity() {\n // if any of the input field is empty, return false directly\n if (name.getText().equals(\"\") || id.getText().equals(\"\") || fiber.getText().equals(\"\")\n || protein.getText().equals(\"\") || fat.getText().equals(\"\") || calories.getText().equals(\"\")\n || carbohydrate.getText().equals(\"\")) {\n String message = \"Make sure enter the value of all nutrient components, please try again!\";\n // display the warning windows with the assigned warning message\n Alert alert = new Alert(AlertType.INFORMATION, message);\n alert.getDialogPane().setMinHeight(Region.USE_PREF_SIZE);\n this.close();// close the add food stage\n alert.showAndWait().filter(response -> response == ButtonType.OK);\n return false;\n }\n // if any nutrition info input is not a number value or is negative, return false directly\n try {\n Double fibervalue = null;\n Double proteinvalue = null;\n Double fatvalue = null;\n Double caloriesvalue = null;\n Double carbohydratevalue = null;\n // trim the input to exact numeric value\n fibervalue = Double.valueOf(fiber.getText().trim());\n proteinvalue = Double.valueOf(protein.getText().trim());\n fatvalue = Double.valueOf(fat.getText().trim());\n caloriesvalue = Double.valueOf(calories.getText().trim());\n carbohydratevalue = Double.valueOf(carbohydrate.getText().trim());\n // nutrition input is suppose to be positive numbers\n // if any of the numbers is negative, return false diretcly\n if (fibervalue < 0.0 || proteinvalue < 0.0 || fatvalue < 0.0 || caloriesvalue < 0.0\n || carbohydratevalue < 0.0) {\n String message = \"The input of the nutrient can not be negative, please try again!\";\n Alert alert = new Alert(AlertType.INFORMATION, message);\n alert.getDialogPane().setMinHeight(Region.USE_PREF_SIZE);\n this.close();\n alert.showAndWait().filter(response -> response == ButtonType.OK);\n return false;\n }\n // if any input of the nutrition info is not a double value, catch the exception and return\n // false\n } catch (Exception e) {\n String message =\n \"At least one nutrition value input is invalid, please type a number in nutrient textbox!\";\n // display the warning windows with the assigned warning message\n Alert alert = new Alert(AlertType.INFORMATION, message);\n alert.getDialogPane().setMinHeight(Region.USE_PREF_SIZE);\n this.close(); // close the addfood stage\n // wait for response from ok button\n alert.showAndWait().filter(response -> response == ButtonType.OK);\n return false;\n }\n return true;\n }"
] | [
"0.7903999",
"0.78623784",
"0.76367563",
"0.75214016",
"0.70909256",
"0.70442504",
"0.7040915",
"0.69367623",
"0.6864361",
"0.68586713",
"0.684041",
"0.68382114",
"0.6820942",
"0.680359",
"0.6775256",
"0.6741673",
"0.6740276",
"0.6727131",
"0.6714976",
"0.6681463",
"0.6622328",
"0.66164374",
"0.6584812",
"0.65793616",
"0.65793616",
"0.65401715",
"0.65389055",
"0.6523045",
"0.65073127",
"0.65048105",
"0.64554685",
"0.6451755",
"0.6429041",
"0.6429041",
"0.64163685",
"0.6404997",
"0.640449",
"0.6389252",
"0.63589597",
"0.63323814",
"0.63096964",
"0.62933457",
"0.6282477",
"0.6281862",
"0.62541884",
"0.62453663",
"0.6240225",
"0.62378514",
"0.6215616",
"0.6190853",
"0.6183953",
"0.6166603",
"0.615831",
"0.6151118",
"0.6121029",
"0.61122316",
"0.61121815",
"0.61121815",
"0.61116123",
"0.6106007",
"0.60995996",
"0.608939",
"0.6086348",
"0.60823804",
"0.6068058",
"0.6067212",
"0.6061726",
"0.606013",
"0.6060089",
"0.6059987",
"0.60545146",
"0.60527676",
"0.60524553",
"0.6052385",
"0.6051907",
"0.6043061",
"0.60358155",
"0.6028662",
"0.60008115",
"0.5998503",
"0.59949577",
"0.59935886",
"0.59920985",
"0.5981115",
"0.59808946",
"0.59800124",
"0.5975394",
"0.5975394",
"0.5953304",
"0.59500057",
"0.59488326",
"0.5947588",
"0.59455526",
"0.59448695",
"0.594261",
"0.593849",
"0.59372836",
"0.59342515",
"0.5930951",
"0.5916153",
"0.5910476"
] | 0.0 | -1 |
This test depends on looping many times to determine that a random selection has changed. If this test fails, simply run it again it should not fail more than once in a blue moon. | @Test
public void testPlayer_setRandomStrategy_2() {
player2 = new Player("", true);
player2.setRandomStrategy();
String firstStrategy = player2.getStrategy();
boolean strategyReplaced = false;
// generate 20 random strategies and assert at least one of them comes back different.
for(int i = 0; i < 20; i++) {
player2.setRandomStrategy();
if (!player2.getStrategy().equalsIgnoreCase(firstStrategy)) {
strategyReplaced = true;
}
}
assertTrue(strategyReplaced);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\n \tpublic void testTargetRandomSelection() {\n \tComputerPlayer player = new ComputerPlayer();\n \t// Pick a location with no rooms in target, just three targets\n \tboard.calcTargets(23, 7, 2);\n \tint loc_24_8Tot = 0;\n \tint loc_22_8Tot = 0;\n \tint loc_21_7Tot = 0;\n \t// Run the test 100 times\n \tfor (int i=0; i<100; i++) {\n \t\tBoardCell selected = player.pickLocation(board.getTargets());\n \t\tif (selected == board.getRoomCellAt(24, 8))\n \t\t\tloc_24_8Tot++;\n \t\telse if (selected == board.getRoomCellAt(22, 8))\n \t\t\tloc_22_8Tot++;\n \t\telse if (selected == board.getRoomCellAt(21, 7))\n \t\t\tloc_21_7Tot++;\n \t\telse\n \t\t\tfail(\"Invalid target selected\");\n \t}\n \t// Ensure we have 100 total selections (fail should also ensure)\n \tassertEquals(100, loc_24_8Tot + loc_22_8Tot + loc_21_7Tot);\n \t// Ensure each target was selected more than once\n \tassertTrue(loc_24_8Tot > 10);\n \tassertTrue(loc_22_8Tot > 10);\n \tassertTrue(loc_21_7Tot > 10);\t\t\t\t\t\t\t\n }",
"@Test\n\tpublic void furtherSelectionTest() {\n\t\tSelectionController selectionController = new SelectionController();\n\t\tint[] selection = { 1, 2, 3, 4, 5, 6 };\n\t\tint[] unSelecion = { 1, 2, 3 };\n\t\tint[] resultSelection = { 4, 5, 6 };\n\t\tint[] negativeSelection = { -1 };\n\n\t\t// select something and unselect parts of it\n\t\tselectionController.select(selection);\n\t\tassertArrayEquals(\"Selection was different\", selection, selectionController.getSelection());\n\t\tselectionController.unselect(unSelecion);\n\t\tassertArrayEquals(\"Selection was different after unselection\", resultSelection,\n\t\t\t\tselectionController.getSelection());\n\n\t\t// do a reselection\n\t\tselectionController.reselect(unSelecion);\n\t\tassertArrayEquals(\"Selection was different after reselection\", unSelecion, selectionController.getSelection());\n\n\t\tassertTrue(\"Item 1 is selected\", selectionController.isSelected(1));\n\t\tassertTrue(\"Item 2 is selected\", selectionController.isSelected(2));\n\t\tassertTrue(\"Item 3 is selected\", selectionController.isSelected(3));\n\t\tassertFalse(\"Item 4 is not selected\", selectionController.isSelected(4));\n\t\tassertFalse(\"Item 5 is not selected\", selectionController.isSelected(5));\n\t\tassertFalse(\"Item 6 is not selected\", selectionController.isSelected(6));\n\n\t\t// unselect all elements\n\t\tselectionController.unselect(unSelecion);\n\t\tassertFalse(\"Nothing was selected\", selectionController.isSomethingSelected());\n\t\tassertEquals(\"The array should have length zero\", 0, selectionController.getSelection().length);\n\n\t\t// select something negative\n\t\tselectionController.select(negativeSelection);\n\t\tassertFalse(\"Nothing should be selected\", selectionController.isSomethingSelected());\n\t\tassertEquals(\"The array should have length zero after selection\", 0, selectionController.getSelection().length);\n\n\t\t// reselect something negative\n\t\tselectionController.select(selection);\n\t\tselectionController.reselect(negativeSelection);\n\t\tassertFalse(\"Nothing should be reselected\", selectionController.isSomethingSelected());\n\t\tassertEquals(\"The array should have length zero after reselection\", 0,\n\t\t\t\tselectionController.getSelection().length);\n\n\t}",
"@Test\r\n public void testPlayer_selectNewColor_dumb() {\r\n player2 = new Player(\"\", true);\r\n player2.setStrategy(Player.STRATEGY_DUMB);\r\n player2.setHand(strategyHand.getAllCards());\r\n player2.setLastPlayedCard(wild);\r\n String firstRandomColor = player2.selectNewColor();\r\n boolean differentColorFound = false;\r\n for(int i = 0; i < 25; i++) {\r\n String nextRandomColor = player2.selectNewColor();\r\n if(!nextRandomColor.equalsIgnoreCase(firstRandomColor)) {\r\n differentColorFound = true;\r\n }\r\n }\r\n assertTrue(differentColorFound);\r\n }",
"@Test\n\tpublic void myRandomTest() throws IllegalArgumentException, IllegalAccessException {\n\t\t\n\t\tif (Configuration.featureamp &&\n\t\t\t\tConfiguration.playengine &&\n\t\t\t\tConfiguration.choosefile &&\n\t\t\t\tConfiguration.mp3 &&\n\t\t\t\tConfiguration.gui &&\n\t\t\t\tConfiguration.skins &&\n\t\t\t\tConfiguration.light &&\n\t\t\t\tConfiguration.filesupport &&\n\t\t\t\tConfiguration.showtime &&\n\t\t\t\tConfiguration.tracktime) {\n\t\t\n\t\tstart();\n\t\tint n = gui.myRandom(1, 1);\n\t\tassertTrue(n == 1);\n\n\t\tn = gui.myRandom(2, 2);\n\t\tassertTrue(n == 2);\n\n\t\tn = gui.myRandom(0, 0);\n\t\tassertTrue(n == 0);\n\t\t\n\t\tn = gui.myRandom(4, 4);\n\t\tassertTrue(n == 4);\n\n\t\tn = gui.myRandom(1000, 1001);\n\t\tassertTrue(n == 1000 || n == 1001);\n\t\t\n\t\t}\n\t}",
"@Test\r\n\tpublic void randomTest() {\r\n\t\tItem item = new Item();\r\n\t\ttry {\r\n\t\t\tItem tempSet[] = item.getRandom(0);\r\n\t\t\tassertNotSame(tempSet.length, 0);\r\n\t\t} catch (SQLException e) {\r\n\t\t\tfail(\"Failed to execute search of random items: SQLException\");\r\n\t\t}\r\n\t}",
"@Test //loop test 2 passes\n\tpublic void testLoop2pass() {\n\t\t//create an inn, add two items, and simulate one day\n\t\tGildedRose inn = new GildedRose();\n\t\tinn.setItem(new Item(\"+5 Dexterity Vest\", 10, 20));\n\t\tinn.setItem(new Item(\"Sulfuras, Hand of Ragnaros\", 0, 80));\n\t\tinn.oneDay();\n\t\t\n\t\t//access a list of items, get the quality of the second set\n\t\tList<Item> items = inn.getItems();\n\t\tint quality = items.get(1).getQuality();\n\t\t\n\t\t//assert quality remains the same\n\t\tassertEquals(\"Failed quality for Sulfuras\", 80, quality);\n\t}",
"public static void runRandom() throws Exception {\r\n\t\ti = (int) (Math.random()*10)+1;\r\n\t\tfor (int a = 1;a <= i;a++) {\r\n\t\t\ttestRun(a);\r\n\t\t\tSystem.out.println(\"\\n\\n\");\r\n\t\t}\r\n\t\t\r\n\t}",
"@Test\n\tpublic void initialSelectionTest() {\n\t\tSelectionController selectionController = new SelectionController();\n\t\tint[] selection = { 1, 2, 3, 4, 5, 6 };\n\t\tint[] emptySelecion = {};\n\n\t\t// do a selection\n\t\tselectionController.select(selection);\n\t\tassertArrayEquals(\"Selection was different\", selectionController.getSelection(), selection);\n\t\tassertTrue(\"There was something selected\", selectionController.isSomethingSelected());\n\t\tassertEquals(\"Incorrect count of elements\", 6, selectionController.getSelectedCount());\n\n\t\t// reset the selection\n\t\tselectionController.reset();\n\t\tassertArrayEquals(\"Selection was different\", selectionController.getSelection(), emptySelecion);\n\t\tassertFalse(\"There was nothing selected\", selectionController.isSomethingSelected());\n\t\tassertEquals(\"Incorrect count of elements\", 0, selectionController.getSelectedCount());\n\t}",
"public void run() {\n RandomizedContext current = RandomizedContext.current();\n try {\n current.push(c.randomness);\n runSingleTest(notifier, c);\n } catch (Throwable t) {\n Rethrow.rethrow(augmentStackTrace(t)); \n } finally {\n current.pop();\n }\n }",
"@Test\n public void iterate0() {\n runAndWait(() -> {\n int err = 0;\n RBTree<Integer> tree = new RBTree<>();\n List<Integer> list = new ArrayList<>(List.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10));\n Collections.shuffle(list);\n tree.addAll(list);\n Collections.sort(list);\n int i = 0;\n for (int val : tree) {\n if (i >= list.size()) {\n fail(\"The tree iterated over more elements than the initial list!\");\n }\n if (val != list.get(i)) {\n System.err.println(\"Expected the value \" + list.get(i) + \", but found \" + val);\n err++;\n }\n i++;\n }\n assertEquals(\"There were \" + err + \" errors!\", 0, err);\n }, 64, 1000);\n \n }",
"public void set_random_choice()\r\n\t{\r\n\t\tfor (int i=0 ; i<size ; i++)\r\n\t\t{\r\n\t\t\tnumbers.add(get_not_selected_random_digit());\r\n\t\t}\r\n\t}",
"@Test\n public void radioTest() throws InterruptedException {\n driver.get(\"http://practice.cybertekschool.com/radio_buttons\");\n List<WebElement> list = driver.findElements(By.name(\"sport\"));\n\n System.out.println(\"verify none of them selected by default\");\n System.out.println(list.size());\n //checking all the sport checkboxes are not checked\n for (int i = 0; i < list.size(); i++) {\n Assert.assertFalse(list.get(i).isSelected());\n }\n\n System.out.println(\"Start randomly selecting radio buttons\");\n\n //randomly clicking and verifying\n\n for (int q = 0; q < 5; q++) {\n\n Thread.sleep(5000);\n Random ran = new Random();\n int num = ran.nextInt(4);\n list.get(num).click();\n System.out.println(\"Selecting button number: \" + (num + 1));\n\n for (int i = 0; i < list.size(); i++) {\n if (i == num) {\n Assert.assertTrue(list.get(num).isSelected());\n } else {\n Assert.assertFalse(list.get(i).isSelected());\n }\n }\n\n }\n }",
"public void doTestRun(int finalState) {\n\t\tint initialState = (int) (Math.random() * this.rows);\n\t\tint nextState = -1;\n\t\t\n\t\tif(initialState == finalState) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tSystem.out.println(\"Spawning at: \" + initialState);\n\t\t\n\t\twhile(initialState != finalState) {\n\t\t\tint maxReward = -100000;\n\t\t\tnextState = initialState;\n\t\t\t\n\t\t\tfor(int j = 0; j < this.columns; j++) {\n\t\t\t\tif(this.qGrid[initialState][j] > maxReward) {\n\t\t\t\t\tmaxReward = this.qGrid[initialState][j];\n\t\t\t\t\tnextState = getStateActionMap(initialState, j);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tint tState = initialState;\n\t\t\tinitialState = nextState;\n\t\t\tnextState = tState;\n\t\t\t\n\t\t\tSystem.out.println(\"Taking next step from \" + nextState + \" to \" + initialState + \"! For reward: \" + this.grid[nextState][initialState]);\n\t\t}\n\t\t\n\n\t}",
"public void testGame1EmulateIncorrectAnswers() {\n int[] indicators;\n MainPage mainPage = getMainPage();\n GameObjectImpl game1 = mainPage.gameOpen(1);\n game1.waitIndicatorsLoad();\n indicators = game1.getIndicators();\n int qtyTasksBeforeCycle = indicators[3];\n int tasksFailedBeforeCycle = indicators[1];\n for(int iter = 0; iter < qtyTasksBeforeCycle - 1; iter++) {\n game1.waitTaskBegin();\n try {\n Thread.sleep(500);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n indicators = game1.getIndicators();\n int varTasksPassedBegin = indicators[0];\n int varTasksFailedBegin = indicators[1];\n int varTasksRemainBegin = indicators[2];\n int qtyTasksInLoopBegin = indicators[3];\n\n String[] partsOfTask = game1.getPartsOfTask();\n String firstNumberVar = partsOfTask[0];\n String secondNumberVar = partsOfTask[1];\n String operationVar = partsOfTask[2];\n int actualResult = game1.getResultWithKeys(firstNumberVar, secondNumberVar, operationVar);\n // press wrong button\n String strActualResult = Integer.toString(actualResult + 1);\n for (int i = 0; i < strActualResult.length(); i++) {\n String subStr = strActualResult.substring(i, i + 1);\n game1.pressButton((subStr));\n }\n //press correct button\n strActualResult = Integer.toString(actualResult);\n for (int i = 0; i < strActualResult.length(); i++) {\n String subStr = strActualResult.substring(i, i + 1);\n game1.pressButton((subStr));\n }\n indicators = game1.getIndicators();\n int varTasksPassedEnd = indicators[0];\n int varTasksFailedEnd = indicators[1];\n int varTasksRemainEnd = indicators[2];\n int qtyTasksInLoopEnd = indicators[3];\n\n assert varTasksRemainEnd == varTasksRemainBegin : \"positiveTestCorrectAnswers: tasks remain\";//\n assert varTasksFailedEnd == (varTasksFailedBegin + 1) : \"positiveTestCorrectAnswers: tasks failed\";\n assert varTasksPassedEnd == varTasksPassedBegin : \"positiveTestCorrectAnswers: tasks passed\";\n assert qtyTasksInLoopEnd == qtyTasksInLoopBegin + 1 : \"negativeTestWrongAnswers: tasks all\";\n }\n indicators = game1.getIndicators();\n int varTasksFailedAfterCycle = indicators[1];\n int qtyTasksAfterCycle = indicators[3];\n assert varTasksFailedAfterCycle - tasksFailedBeforeCycle == qtyTasksAfterCycle - qtyTasksBeforeCycle\n : \"positiveTestCorrectAnswers: tasks summ\" ;//\n game1.clickCloseGame();\n\n }",
"@Test\r\n\tpublic void testChooseResultWithChange() {\r\n\t\tMontyHall monty = new MontyHall();\r\n\t\tmonty.setTheDoorWithCar(0);\r\n\t\tmonty.setChanged(true);\r\n\r\n\t\tmonty.setUserChoosedDoor(0);\r\n\t\tassertNotEquals(0, monty.getTheDoorChoosedBycompere());\r\n\t\tassertEquals(false, monty.winThePrize());\r\n\r\n\t\tmonty.setUserChoosedDoor(1);\r\n\t\tassertEquals(2, monty.getTheDoorChoosedBycompere());\r\n\t\tassertEquals(true, monty.winThePrize());\r\n\r\n\t\tmonty.setUserChoosedDoor(2);\r\n\t\tassertEquals(1, monty.getTheDoorChoosedBycompere());\r\n\t\tassertEquals(true, monty.winThePrize());\r\n\t}",
"@Test //covers loop test with one pass through the loop\n\tpublic void exampleTest() {\n\t\tGildedRose inn = new GildedRose();\n\t\tinn.setItem(new Item(\"+5 Dexterity Vest\", 10, 20));\n\t\tinn.oneDay();\n\t\t\n\t\t//access a list of items, get the quality of the one set\n\t\tList<Item> items = inn.getItems();\n\t\tint quality = items.get(0).getQuality();\n\t\t\n\t\t//assert quality has decreased by one\n\t\tassertEquals(\"Failed quality for Dexterity Vest\", 19, quality);\n\t}",
"@Test\r\n\tpublic void testChangeTheOriginalChooseIsBetterThanNotChange() {\r\n\t\tMontyHall monty = new MontyHall();\r\n\t\tmonty.setChanged(true);\r\n\t\tfloat rateOfChange = monty.rateOfWinThePrizeWithChangeTheOriginalChoose(10);\r\n\t\tmonty.setChanged(false);\r\n\t\tfloat rateOfNotChange = monty.rateOfWinThePrizeWithoutChangeTheOriginalChoose(10);\r\n\t\tassertTrue(rateOfChange > rateOfNotChange);\r\n\r\n\t\t/* count is 100 */\r\n\t\tmonty.setChanged(true);\r\n\t\trateOfChange = monty.rateOfWinThePrizeWithChangeTheOriginalChoose(100);\r\n\t\tmonty.setChanged(false);\r\n\t\trateOfNotChange = monty.rateOfWinThePrizeWithoutChangeTheOriginalChoose(100);\r\n\t\tassertTrue(rateOfChange > rateOfNotChange);\r\n\r\n\t\t/* count is 10000 */\r\n\t\tmonty.setChanged(true);\r\n\t\trateOfChange = monty.rateOfWinThePrizeWithChangeTheOriginalChoose(10000);\r\n\t\tmonty.setChanged(false);\r\n\t\trateOfNotChange = monty.rateOfWinThePrizeWithoutChangeTheOriginalChoose(10000);\r\n\t\tassertTrue(rateOfChange > rateOfNotChange);\r\n\r\n\t\t/* count is 1000000 */\r\n\t\tmonty.setChanged(true);\r\n\t\trateOfChange = monty.rateOfWinThePrizeWithChangeTheOriginalChoose(1000000);\r\n\t\tmonty.setChanged(false);\r\n\t\trateOfNotChange = monty.rateOfWinThePrizeWithoutChangeTheOriginalChoose(1000000);\r\n\t\tassertTrue(rateOfChange > rateOfNotChange);\r\n\t}",
"@Test\n public void testDiceThrown() {\n testDie(game.diceThrown(), 1, 2);\n game.nextTurn();\n testDie(game.diceThrown(), 1, 2);\n game.nextTurn();\n testDie(game.diceThrown(), 3, 4);\n game.nextTurn();\n testDie(game.diceThrown(), 3, 4);\n game.nextTurn();\n testDie(game.diceThrown(), 5, 6);\n game.nextTurn();\n testDie(game.diceThrown(), 1, 2);\n game.nextTurn();\n\n }",
"private void findResourcesFake() {\r\n\t\t\r\n\t\tRandom random = new Random();\t\r\n\t\t\r\n\t\t\t\t\t\t\r\n\t\tif (random.nextInt() % 10 == 0) {PoCOnline.setSelected(true); loadContainerOnline.setSelected(true);}\t\r\n\t\tif (random.nextInt() % 10 == 0) {fillRedOnline.setSelected(true);}\r\n\t\tif (random.nextInt() % 10 == 0) {fillYellowOnline.setSelected(true);}\r\n\t\tif (random.nextInt() % 10 == 0) {fillBlueOnline.setSelected(true);}\r\n\t\tif (random.nextInt() % 10 == 0) {testOnline.setSelected(true);}\r\n\t\tif (random.nextInt() % 10 == 0) {lidOnline.setSelected(true);}\r\n\t\tif (random.nextInt() % 10 == 0) {dispatchOnline.setSelected(true);}\t\t\r\n\t\t\r\n\t\t\r\n\t}",
"@Override\n\tpublic void randomChanged(boolean random) {\n\t\t\n\t}",
"@Test\r\n\t public void feelingLucky() {\r\n\t \t Assert.fail();\r\n\t Assert.fail();\r\n\t }",
"@Override\r\n\tpublic void doTimeStep() {\n\t\tthis.run(Critter.getRandomInt(8));\r\n\t}",
"@Test\n\t public void randomItem() throws InterruptedException\n\t {\n\t\t \n\t\t productpage = new ProductPage(driver);\n\t\t productpage.clickOnSomePrompt();\n\t\t productdetails = productpage.clickOnRandomItem();\n\t\t\tboolean status = productdetails.isProductDEtailsPageDisplayed();\n\t\t\tAssertionHelper.updateTestStatus(status);\n\t\t\tTestBaseRunner.result = TestBaseRunner.passOrFail(status);\n\t\t\tExcelReadWrtite.updateResult(\"testData.xlsx\", \"TestScripts\", \"randomItem\", result);\n\t }",
"public void testSelectIndex() {\n showFrame(box);\n for (int i=0;i < MAX_ENTRIES;i += MAX_ENTRIES / 10) {\n selectedIndex = -1;\n tester.actionSelectIndex(box, i);\n assertEquals(\"Wrong index selected\", i, selectedIndex);\n }\n }",
"private void simulateFailOrSleep() throws Exception {\n if ((failProbability != null) && (sleepProbability != null) && (sleepMilisec != null)) {\n int number = new Random().nextInt(100);\n if (number < failProbability) throw new Exception(\"Simulated Exception in Customer Service\");\n else {\n number = new Random().nextInt(100);\n if (number < sleepProbability) Thread.sleep(sleepMilisec);\n }\n }\n }",
"private void random() {\n\n\t}",
"@Test\n public void genRandom() {\n runAndWait(() -> genRandom(10_000, 500, 1), 32, 2000);\n runAndWait(() -> genRandom(10_000, 500, 100), 32, 2000);\n runAndWait(() -> genRandom(250_000, 4000, 50), 4, 5_000);\n }",
"@Test\n public void test4_multiple_value_select_dropdown() throws InterruptedException{\n\n //3. Select all the options from multiple select dropdown.\n // Locate the dropdown\n\n Select multipleSelectDropdown = new Select(driver.findElement(By.xpath(\"//select[@name='Languages']\")));\n\n //Creating a list of web elements to store all of the options inside of this dropdown\n\n List<WebElement> allOptions = multipleSelectDropdown.getOptions();\n\n //Loop through the options to select all of them\n\n for(WebElement eachOption : allOptions){\n Thread.sleep(500);\n eachOption.click(); // this will click each option with every iteration\n\n //4. Print out all selected values.\n System.out.println(\"Selected: \" + eachOption.getText());\n\n //Asserting the option is actually selected or not\n Assert.assertTrue(eachOption.isSelected(), \"The option: \"+eachOption.getText()+\" is not selected!\");\n\n }\n //5. Deselect all values.\n multipleSelectDropdown.deselectAll();\n\n for(WebElement eachOption : allOptions){\n //Assert.assertTrue(!eachOption.isSelected()); //it will be false boolean value, with ! we make it \"true\"\n\n // assertFalse method looks for \"false\" boolean value to pass the test.\n Assert.assertFalse(eachOption.isSelected());\n }\n }",
"@Test\r\n\tpublic void testChooseResultWithUnChangeCarPositionSecond() {\r\n\t\tMontyHall monty = new MontyHall();\r\n\t\tmonty.setTheDoorWithCar(1);\r\n\t\tmonty.setChanged(false);\r\n\t\tmonty.setUserChoosedDoor(0);\r\n\t\tassertEquals(2, monty.getTheDoorChoosedBycompere());\r\n\t\tassertEquals(false, monty.winThePrize());\r\n\r\n\t\tmonty.setUserChoosedDoor(1);\r\n\t\tassertNotEquals(1, monty.getTheDoorChoosedBycompere());\r\n\t\tassertEquals(true, monty.winThePrize());\r\n\r\n\t\tmonty.setUserChoosedDoor(2);\r\n\t\tassertEquals(0, monty.getTheDoorChoosedBycompere());\r\n\t\tassertEquals(false, monty.winThePrize());\r\n\t}",
"private void random() {\n GameState gs = cc.getGameState();\n ArrayList<int[]> moves = cc.getPlayerMoves(player);\n ArrayList<GameState> states = nextStates(moves, gs);\n for (int[] m : moves) {\n GameState next = checkMove(m, cc);\n states.add(next);\n }\n Random rand = new Random(System.nanoTime());\n int i = rand.nextInt(states.size());\n cc.setAIMove(states.get(i));\n }",
"@Test\n void test() {\n Game g = init(\"gen_2p_02\");\n List<Player> players = g.getData().getPlayers();\n wrappedIllegalCommand(g, players.get(0), \"tool 6\");\n wrappedLegalCommand(g, players.get(0), \"pick 1\");\n assertTrue(g.isUndoAvailable());\n wrappedLegalCommand(g, players.get(0), \"tool 6\");\n assertFalse(g.isUndoAvailable());\n lightestShade(g, players);\n notLightestShade(g, players);\n }",
"@Test\n public void radnomtest() throws Throwable {\n\n long startTime = Calendar.getInstance().getTimeInMillis();\n long elapsed = Calendar.getInstance().getTimeInMillis() - startTime;\n\n\n System.out.println(\"Start testing...\");\n\n\n for (int iteration = 0; elapsed < TestTimeout; iteration++) {\n long randomseed =10;//System.currentTimeMillis();\n //\t\t\tSystem.out.println(\" Seed:\"+randomseed );\n Random random = new Random(randomseed);\n\n int startHour=13;\n int startMinute=30;\n int startDay=10;\n int startMonth=4;\n int startYear=2017;\n String title=\"Birthday Party\";\n String description=ValuesGenerator.getString(random);\n //Construct a new Appointment object with the initial data\t \n Appt appt = new Appt(startHour,\n startMinute ,\n startDay ,\n startMonth ,\n startYear ,\n title,\n description);\n if ((iteration % 50) == 0){\n appt.setDescription(null);\n }\n for (int i = 0; i < NUM_TESTS; i++) {\n String methodName = ApptRandomTest.RandomSelectMethod(random);\n if (methodName.equals(\"isValid\")){\n int hour=(int) ValuesGenerator.getRandomIntBetween(random, 0, 23);\n appt.setStartHour(hour);\t\t\t\t\t\t \n int minute=(int) ValuesGenerator.getRandomIntBetween(random, 0, 59);\n appt.setStartMinute(minute);\t\t\t\t\t\t \n int day=(int) ValuesGenerator.getRandomIntBetween(random, 1, 31);\n appt.setStartDay(day);\t\t\t\t\t\t \n int month=(int) ValuesGenerator.getRandomIntBetween(random, 1, 12);\n appt.setStartMonth(month);\n //change to invalid hours\n hour=(int) ValuesGenerator.getRandomIntBetween(random, -10, -1);\n appt.setStartHour(hour);\n hour=(int) ValuesGenerator.getRandomIntBetween(random, 0, 23);\n appt.setStartHour(hour);\n hour=(int) ValuesGenerator.getRandomIntBetween(random, 24, 30);\n appt.setStartHour(hour);\n hour=(int) ValuesGenerator.getRandomIntBetween(random, 0, 23);\n appt.setStartHour(hour);\n //change to invalid minutes\n minute=(int) ValuesGenerator.getRandomIntBetween(random, -20, -1);\n appt.setStartMinute(minute);\n minute=(int) ValuesGenerator.getRandomIntBetween(random, 0, 59);\n appt.setStartMinute(minute);\n minute=(int) ValuesGenerator.getRandomIntBetween(random, 60, 70);\n appt.setStartMinute(minute);\n minute=(int) ValuesGenerator.getRandomIntBetween(random, 0, 59);\n appt.setStartMinute(minute);\n //change to invalid days\n day=(int) ValuesGenerator.getRandomIntBetween(random, -10, 0);\n appt.setStartDay(day);\n day=(int) ValuesGenerator.getRandomIntBetween(random, 1, 31);\n appt.setStartDay(day);\n day=(int) ValuesGenerator.getRandomIntBetween(random, 32, 40);\n appt.setStartDay(day);\n day=(int) ValuesGenerator.getRandomIntBetween(random, 1, 31);\n appt.setStartDay(day);\n //change to invalid months\n month=(int) ValuesGenerator.getRandomIntBetween(random, -10, 0);\n appt.setStartMonth(month);\t\t\t\t\t\t \n month=(int) ValuesGenerator.getRandomIntBetween(random, 1, 12);\n appt.setStartMonth(month);\n month=(int) ValuesGenerator.getRandomIntBetween(random, 12, 20);\n appt.setStartMonth(month);\n month=(int) ValuesGenerator.getRandomIntBetween(random, 1, 12);\n appt.setStartMonth(month);\n }\n\n }\n\n elapsed = (Calendar.getInstance().getTimeInMillis() - startTime);\n if((iteration%10000)==0 && iteration!=0 )\n System.out.println(\"elapsed time: \"+ elapsed + \" of \"+TestTimeout);\n\n }\n\n\n System.out.println(\"Done testing...\");\n }",
"@Test\n public void testResetGame(){\n scoresModel.resetGame();\n try {\n scoresModel.resetGame();\n for(int i = 0; i < ScoresModel.maxNumOfAttempts; i++) {\n assertEquals(scoresModel.attemptsScore[i], 0);\n }\n for(int i = 0; i < ScoresModel.maxNumOfFrames; i++){\n assertEquals(scoresModel.frameTypes[i], FrameType.NOT_PLAYED);\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n }",
"@Test\r\n\tpublic void testRunAllSucceedSecond() throws Exception {\n\t\tRandom randomGen = Mockito.mock(Random.class);\r\n\t\twhen(randomGen.nextInt(2)).thenReturn(0);\r\n\t\tReflectionTestUtils.setField(semaphoreGatedRunner, \"randomGen\", randomGen);\r\n\t\tsemaphoreGatedRunner.setMaxNumberRunners(2);\r\n\r\n\t\twhen(mockSemaphoreDao.attemptToAcquireLock(semaphoreKey + \"-1\", timeoutMS)).thenReturn(null);\r\n\t\tString token = \"someToken\";\r\n\t\twhen(mockSemaphoreDao.attemptToAcquireLock(semaphoreKey + \"-0\", timeoutMS)).thenReturn(token);\r\n\t\t// run\r\n\t\tCallable<Void> call = Mockito.mock(Callable.class);\r\n\t\tsemaphoreGatedRunner.attemptToRunAllSlots(call, null);\r\n\t\tverify(call).call();\r\n\t\tverify(mockSemaphoreDao).attemptToAcquireLock(semaphoreKey + \"-1\", timeoutMS);\r\n\t\tverify(mockSemaphoreDao).attemptToAcquireLock(semaphoreKey + \"-0\", timeoutMS);\r\n\t\tverify(mockSemaphoreDao).releaseLock(semaphoreKey + \"-0\", token);\r\n\t\tverify(mockSemaphoreDao, never()).releaseLock(eq(semaphoreKey + \"-1\"), anyString());\r\n\t\tverifyNoMoreInteractions(mockSemaphoreDao);\r\n\t}",
"@Test\n\tpublic void testUpdatesSeeds() {\n\t\t//Arrange\n\t\tint startLoc[] = new int[]{2};\n\t\tint otherLocs[] = new int[]{0,1,3,4};\n\t\t\t\n\t\tMockito.when(randMock.generateRandomNumber(1, 4, seed)).thenReturn(startLoc);\n\t\tMockito.when(randMock.generateRandomNumber(10, 5, seed+1)).thenReturn(otherLocs);\n\t\t\t\n\t\t//Act\n\t\tlong seed = 2;\n\t\t\t\n\t\t//Assert\n\t\tassertEquals(seed, iteratorObj.startVisits());\n\t}",
"@Test\n public void test(){\n tmp = new Die(\"Red\",5);\n choose.modifyDie(tmp);\n assertEquals(4,tmp.getDieNumber());\n choose = new ChooseDieModifier(new DieEnhancer());\n choose.modifyDie(tmp);\n assertEquals(5,tmp.getDieNumber());\n choose = new ChooseDieModifier(new TurnTheDieOpposite());\n choose.modifyDie(tmp);\n assertEquals(2,tmp.getDieNumber());\n choose = new ChooseDieModifier(new RollDie());\n Die tmp2 = new Die(tmp.getDieColor(),tmp.getDieNumber());\n int i;\n int max=1000000;\n boolean testPassed=false;\n for(i=0;i<max;i++){\n choose.modifyDie(tmp);\n if(tmp.getDieNumber()!=tmp2.getDieNumber()){\n testPassed=true;\n i = max;\n }\n }\n assertTrue(testPassed);\n }",
"@Test\n public void test100True() {\n long start = System.currentTimeMillis();\n for (int i = 0; i < 100; i++) {\n RandomGUID myGUID = new RandomGUID(true);\n System.out.println(\"Seeding String=\" + myGUID.valueBeforeMD5);\n System.out.println(\"rawGUID=\" + myGUID.valueAfterMD5);\n System.out.println(\"RandomGUID=\" + myGUID.toString());\n }\n System.out.println(Ansi.ansi().eraseScreen().render(String.format(\"100 条@|blue 耗时 |@@|yellow %s |@@|blue 毫秒|@\", System.currentTimeMillis() - start)));\n }",
"@Test\r\n public void test3() throws Exception {\r\n int[] random = getRandomlyFromArray(new int[] {1, 2, 3, 4, 5, 6, 7, 8}, 3);\r\n String prepend = \"\";\r\n for (int i : random) {\r\n System.out.print(prepend + i);\r\n prepend = \", \";\r\n }\r\n System.out.println();\r\n \r\n try {\r\n getRandomlyFromArray(new int[] {1}, 2);\r\n Assert.fail(\"Should have thrown an exception\");\r\n } catch (Exception e) {\r\n // expected\r\n }\r\n }",
"private void getRandomNumber() {\n\t\tRandom generator = new Random();\n\t\trandomNumber = generator.nextInt(POSSIBLE_CHOICE.length);\n\t}",
"@Test\n public void selectReplacesSelectionOnlyOnce() throws Exception {\n ArgumentCaptor<Set> itemsCaptor = ArgumentCaptor.forClass(Set.class);\n\n // WHEN\n listView.select(Lists.newArrayList(A));\n verify(listener, only()).onItemSelection(itemsCaptor.capture());\n\n // THEN\n Set<?> items = itemsCaptor.getValue();\n assertThat(items, allOf(hasSize(1), contains(A)));\n }",
"@Test\n public void testFitnessProportionateSelection()\n {\n }",
"public void setSelection(int index) {\n/* 95 */ throw new RuntimeException(\"Stub!\");\n/* */ }",
"@Test(timeout = 500)\n\tpublic void testGetModuloOne() {\n\t\tAssert.fail();\n\t}",
"@Test\n\tpublic void testEvilPuzzleGeneration() {\n\t}",
"void testRandColor(Tester t) {\r\n initData();\r\n t.checkExpect(this.game2.randColor(), Color.ORANGE);\r\n t.checkExpect(this.game3.randColor(), Color.RED);\r\n t.checkExpect(this.game5.randColor(), Color.PINK);\r\n }",
"@Test\n public void f14SelectAssetTest() {\n FlowPane assets;\n int i = 0;\n Random random = new Random();\n\n //select 4 random assets out of the first 12 visible assets in the window\n do {\n clickOn(\"#thumbnailTab\").moveBy(300, 500);\n scroll(10, VerticalDirection.UP).sleep(2000);\n\n assets = (FlowPane) scene.getRoot().lookup(\"#assetsThumbPane\");\n clickOn(assets.getChildren().get(random.nextInt(12)));\n sleep(1000).clickOn(\"#serialNumberOutput\").sleep(1000);\n clickOn(\"#backBtn\");\n\n } while (++i < 4);\n\n assertTrue(\"There are selectable assets on the main page.\", assets.getChildren().size() > 0);\n }",
"@Test\r\n\tpublic void test() {\r\n\t\tfor(int i=0;i<100;i++) {\r\n\t\t\tinsert();\r\n\t\t}\r\n\t\tselectAll();\r\n\t}",
"@Test(timeout = 4000)\n public void test43() throws Throwable {\n DynamicSelectModel dynamicSelectModel0 = new DynamicSelectModel();\n dynamicSelectModel0.reset();\n }",
"public static void testRun(int a) throws Exception {\r\n\t\tRandomProperties.randomAll();\r\n\t\tThread.sleep(1000);\r\n\t\tSystem.out.println(\"the guys-\" + a + \" name is :\" + RandomProperties.getName());\r\n\t\tThread.sleep(300);\r\n\t\tSystem.out.println(\"the guys-\" + a + \" age is :\" + RandomProperties.getAge());\r\n\t\tThread.sleep(300);\r\n\t\tSystem.out.println(\"the guys-\" + a + \" ID is :\" + RandomProperties.getID());\r\n\t\tThread.sleep(300);\r\n\t\tSystem.out.println(\"the guys-\" + a + \" sex is :\" + RandomProperties.getGender());\r\n\t\tThread.sleep(1000);\r\n\t}",
"public void testSelect_4()\n throws Exception {\n BestChromosomesSelector selector = new BestChromosomesSelector(conf);\n selector.setDoubletteChromosomesAllowed(true);\n // the following original rate controls that only 30% of the chromosomes\n // will be considered for selection as given with BestChromosomesSelector.\n // The last 70% will be added as doublettes in this case.\n selector.setOriginalRate(0.3d);\n // add first chromosome\n // --------------------\n Gene gene = new BooleanGene(conf);\n gene.setAllele(Boolean.valueOf(true));\n Chromosome thirdBestChrom = new Chromosome(conf, gene, 7);\n thirdBestChrom.setFitnessValue(10);\n selector.add(thirdBestChrom);\n // add second chromosome\n // ---------------------\n gene = new BooleanGene(conf);\n gene.setAllele(Boolean.valueOf(false));\n Chromosome bestChrom = new Chromosome(conf, gene, 3);\n bestChrom.setFitnessValue(12);\n selector.add(bestChrom);\n // add third chromosome\n // ---------------------\n gene = new IntegerGene(conf);\n gene.setAllele(new Integer(444));\n Chromosome secondBestChrom = new Chromosome(conf, gene, 3);\n secondBestChrom.setFitnessValue(11);\n selector.add(secondBestChrom);\n // receive top 1 (= best) chromosome\n // ---------------------------------\n Population pop = new Population(conf);\n selector.select(1, null, pop);\n IChromosome[] bestChroms = pop.toChromosomes();\n assertEquals(1, bestChroms.length);\n assertEquals(bestChrom, bestChroms[0]);\n // receive top 4 chromosomes with original rate = 0.3\n // --------------------------------------------------\n pop.getChromosomes().clear();\n selector.select(4, null, pop);\n bestChroms = pop.toChromosomes();\n assertEquals(4, bestChroms.length);\n assertEquals(bestChrom, bestChroms[0]);\n assertEquals(bestChrom, bestChroms[1]); //because of originalRate = 0.3\n assertEquals(secondBestChrom, bestChroms[2]);\n assertEquals(thirdBestChrom, bestChroms[3]);\n // Non-unique chromosomes should have been returned, although not the same\n // but a cloned instance!\n assertEquals(bestChroms[0], bestChroms[1]);\n // receive top 4 chromosomes with original rate = 1\n // ------------------------------------------------\n pop.getChromosomes().clear();\n selector.setOriginalRate(1.0d);\n selector.select(4, null, pop);\n bestChroms = pop.toChromosomes();\n assertEquals(4, bestChroms.length);\n assertEquals(bestChrom, bestChroms[0]);\n assertEquals(secondBestChrom, bestChroms[1]);\n assertEquals(thirdBestChrom, bestChroms[2]);\n assertEquals(bestChrom, bestChroms[3]);\n }",
"@Test\n public void pickUpSomeGoldTest() {\n\tassertNotEquals(0,score);\n }",
"@Test\r\n\tpublic void testChooseResultWithChangeCarPositionSecond() {\r\n\t\tMontyHall monty = new MontyHall();\r\n\t\tmonty.setTheDoorWithCar(1);\r\n\t\tmonty.setChanged(true);\r\n\t\tmonty.setUserChoosedDoor(0);\r\n\t\tassertEquals(2, monty.getTheDoorChoosedBycompere());\r\n\t\tassertEquals(true, monty.winThePrize());\r\n\r\n\t\tmonty.setUserChoosedDoor(1);\r\n\t\tassertNotEquals(1, monty.getTheDoorChoosedBycompere());\r\n\t\tassertEquals(false, monty.winThePrize());\r\n\r\n\t\tmonty.setUserChoosedDoor(2);\r\n\t\tassertEquals(0, monty.getTheDoorChoosedBycompere());\r\n\t\tassertEquals(true, monty.winThePrize());\r\n\t}",
"@Test\r\n\tpublic void testChooseResultWithUnChangeCarPositionThird() {\r\n\t\tMontyHall monty = new MontyHall();\r\n\t\tmonty.setTheDoorWithCar(2);\r\n\t\tmonty.setChanged(false);\r\n\t\tmonty.setUserChoosedDoor(0);\r\n\t\tassertEquals(1, monty.getTheDoorChoosedBycompere());\r\n\t\tassertEquals(false, monty.winThePrize());\r\n\r\n\t\tmonty.setUserChoosedDoor(1);\r\n\t\tassertEquals(0, monty.getTheDoorChoosedBycompere());\r\n\t\tassertEquals(false, monty.winThePrize());\r\n\r\n\t\tmonty.setUserChoosedDoor(2);\r\n\t\tassertNotEquals(2, monty.getTheDoorChoosedBycompere());\r\n\t\tassertEquals(true, monty.winThePrize());\r\n\t}",
"private void randomTest(){\n\n int time = 5 ;\n\n test(time) ;\n }",
"@Test\n\tpublic void argumentTest() {\n\t\tSelectionController selectionController = new SelectionController();\n\t\ttry {\n\t\t\tselectionController.select(null);\n\t\t\tAssert.fail(\"The new selection was null\");\n\t\t} catch (NullPointerException e) {\n\t\t}\n\n\t\ttry {\n\t\t\tselectionController.unselect(null);\n\t\t\tAssert.fail(\"The new unselection was null\");\n\t\t} catch (NullPointerException e) {\n\t\t}\n\n\t\ttry {\n\t\t\tselectionController.reselect(null);\n\t\t\tAssert.fail(\"The new reselection was null\");\n\t\t} catch (NullPointerException e) {\n\t\t}\n\t}",
"@Test(expected = IllegalArgumentException.class)\n public void testChangeColorTwiceSameTime() {\n model1.addShape(Rectangle.createRectangle(\"R\", new Point.Double(500, 200),\n new Color(0, 0, 0), 0, 10, 10, 10));\n model1.addAction(new ChangeColorAction(\"R\", 10, 100,\n new Color(0, 0, 0), new Color(10, 10, 10)));\n model1.addAction(new ChangeColorAction(\"R\", 50, 120,\n new Color(0, 0, 0), new Color(10, 10, 10)));\n }",
"@Test\n public void test20False() {\n long start = System.currentTimeMillis();\n for (int i = 1; i <= 20; i++) {\n RandomGUID myguid = new RandomGUID(false);\n System.out.println(i + \" \" + myguid.toString());\n }\n System.out.println(Ansi.ansi().eraseScreen().render(String.format(\"20 条@|blue 耗时 |@@|yellow %s |@@|blue 毫秒|@\", System.currentTimeMillis() - start)));\n }",
"@Test //loop test 0 passes\n\tpublic void testLoop0pass() {\n\t\tGildedRose inn = new GildedRose();\n\t\tinn.oneDay();\n\t\t\n\t\t//access a list of items, get the quality\n\t\tList<Item> items = inn.getItems();\n\t\tint quality = -100;\n\t\tif(! items.isEmpty()) { //check if items is empty, if not get the first item's quality\n\t\t\titems.get(0).getQuality();\n\t\t}\n\t\t//assert quality is -100\n\t\tassertEquals(\"Quality -100 with 0 loop passes\", -100, quality);\n\t}",
"@Test(expected = LockUnavilableException.class)\r\n\tpublic void testRunAllFail() throws Exception {\n\t\tRandom randomGen = Mockito.mock(Random.class);\r\n\t\twhen(randomGen.nextInt(2)).thenReturn(0);\r\n\t\tReflectionTestUtils.setField(semaphoreGatedRunner, \"randomGen\", randomGen);\r\n\t\tsemaphoreGatedRunner.setMaxNumberRunners(2);\r\n\r\n\t\twhen(mockSemaphoreDao.attemptToAcquireLock(semaphoreKey + \"-1\", timeoutMS)).thenReturn(null);\r\n\t\twhen(mockSemaphoreDao.attemptToAcquireLock(semaphoreKey + \"-0\", timeoutMS)).thenReturn(null);\r\n\t\t// run\r\n\t\tCallable<Void> call = Mockito.mock(Callable.class);\r\n\t\ttry {\r\n\t\t\tsemaphoreGatedRunner.attemptToRunAllSlots(call, null);\r\n\t\t} finally {\r\n\t\t\tverify(call, never()).call();\r\n\t\t\tverify(mockSemaphoreDao).attemptToAcquireLock(semaphoreKey + \"-1\", timeoutMS);\r\n\t\t\tverify(mockSemaphoreDao).attemptToAcquireLock(semaphoreKey + \"-0\", timeoutMS);\r\n\t\t\tverify(mockSemaphoreDao, never()).releaseLock(anyString(), anyString());\r\n\t\t\tverifyNoMoreInteractions(mockSemaphoreDao);\r\n\t\t}\r\n\t}",
"@Test(timeout = 4000)\n public void test30() throws Throwable {\n DynamicSelectModel dynamicSelectModel0 = new DynamicSelectModel();\n DynamicSelectModel dynamicSelectModel1 = dynamicSelectModel0.enumeration(\"WSi5n[Vxv}\");\n dynamicSelectModel0.validate();\n assertSame(dynamicSelectModel0, dynamicSelectModel1);\n }",
"@Test\n public void randomTransitionsIncludesAllEligibleTransitionsInRoughProportion() throws PetriNetComponentException {\n \tPetriNet petriNet = APetriNet.with(AToken.called(\"Default\").withColor(Color.BLACK)).and(\n \t\t\tAPlace.withId(\"P1\").containing(1, \"Default\").token()).\n \t\t\tand(APlace.withId(\"P2\")).and(APlace.withId(\"P3\")).\n \t\t\tand(AnImmediateTransition.withId(\"T1\")).and(AnImmediateTransition.withId(\"T2\")).and(\n \t\t\tANormalArc.withSource(\"P1\").andTarget(\"T1\").with(\"1\", \"Default\").token()).and(\n \t\t\tANormalArc.withSource(\"T1\").andTarget(\"P2\").with(\"1\", \"Default\").token()).and(\n \t\t\tANormalArc.withSource(\"P1\").andTarget(\"T2\").with(\"1\", \"Default\").token()).andFinally(\n \t\t\tANormalArc.withSource(\"T2\").andTarget(\"P3\").with(\"1\", \"Default\").token());\n \t\n \tAnimator animator = new PetriNetAnimator(petriNet);\n \tTransition t = null; \n \tint t1 = 0; \n \tint t2 = 0; \n \tfor (int i = 0; i < 10; i++) {\n \t\tt = animator.getRandomEnabledTransition();\n \t\tif (t.getId().equalsIgnoreCase(\"T1\")) t1++;\n \t\telse t2++;\n\t\t}\n \tassertTrue(t1 > 0); \n \tassertTrue(t2 > 0); \n }",
"public void generateComputerChoice() {\n\t\tgetRandomNumber();\n\t\tsetComputerChoice();\n\t}",
"@Test\r\n\tpublic void testRunAllSucceedFirst() throws Exception {\n\t\tRandom randomGen = Mockito.mock(Random.class);\r\n\t\twhen(randomGen.nextInt(2)).thenReturn(0);\r\n\t\tReflectionTestUtils.setField(semaphoreGatedRunner, \"randomGen\", randomGen);\r\n\t\tsemaphoreGatedRunner.setMaxNumberRunners(2);\r\n\r\n\t\tString token = \"someToken\";\r\n\t\twhen(mockSemaphoreDao.attemptToAcquireLock(semaphoreKey + \"-1\", timeoutMS)).thenReturn(token);\r\n\t\t// run\r\n\t\tCallable<Void> call = Mockito.mock(Callable.class);\r\n\t\tsemaphoreGatedRunner.attemptToRunAllSlots(call, null);\r\n\t\tverify(call).call();\r\n\t\tverify(mockSemaphoreDao).attemptToAcquireLock(semaphoreKey + \"-1\", timeoutMS);\r\n\t\tverify(mockSemaphoreDao).releaseLock(semaphoreKey + \"-1\", token);\r\n\t\tverifyNoMoreInteractions(mockSemaphoreDao);\r\n\t}",
"@Test\n public void testShuffle() {\n System.out.println(\"shuffle\");\n // can't really test something random\n }",
"@Test\n public void TEST_FR_SELECTDIFFICULTY_UI() {\n GameData.gameDifficulty = \"unchanged\";\n ChooseDifficultyUI testUI = new ChooseDifficultyUI();\n clickButton(testUI, 1, \"easy\");\n clickButton(testUI, 2, \"medium\");\n clickButton(testUI, 3, \"hard\");\n }",
"@Test\n public void f10ModelPerformanceTest() {\n clickOn(\"#assetTypeMenuBtn\").sleep(1000);\n\n //select first asset type\n Node node = lookup(\"#columnName\").nth(1).query();\n clickOn(node).sleep(1000);\n\n //go to model tab\n clickOn(scene.getRoot().lookup(\"#modelTab\")).sleep(1000);\n\n //Modify sliders\n Slider trainSlider = (Slider) scene.getRoot().lookup(\"#trainSlider\");\n clickOn(trainSlider);\n type(KeyCode.TAB).type(KeyCode.RIGHT);\n type(KeyCode.TAB).type(KeyCode.RIGHT);\n moveBy(0, 10).clickOn().sleep(500).moveBy(0, 100).scroll(80, VerticalDirection.UP);\n\n FlowPane models = (FlowPane) scene.getRoot().lookup(\"#modelsThumbPane\");\n Pane additiveRegModel = (Pane) models.getChildren().get(5);\n Button evalButton = (Button) additiveRegModel.getChildren().get(additiveRegModel.getChildren().size() - 1);\n\n Text rmse = (Text) additiveRegModel.getChildren().get(additiveRegModel.getChildren().size() - 2);\n clickOn(rmse).sleep(3000);\n String oldRmseVal = rmse.getText();\n int i = 0;\n\n clickOn(evalButton);\n //incrementally check for 30 seconds to see if rmse has been updated\n do {\n if (rmse.getText().equals(oldRmseVal)) {\n sleep(2000);\n } else {\n break;\n }\n } while (++i < 15);\n\n clickOn(rmse).sleep(3000);\n\n assertNotNull(\"Evaluate button exists\", evalButton);\n assertNotNull(\"RMSE exists\", rmse);\n assertFalse(\"Assert current RMSE is different than old RMSE\", rmse.getText().equals(oldRmseVal));\n }",
"public void setSelection(int start, int stop) {\n/* 89 */ throw new RuntimeException(\"Stub!\");\n/* */ }",
"@Test\n public void test20True() {\n long start = System.currentTimeMillis();\n for (int i = 1; i <= 20; i++) {\n RandomGUID myguid = new RandomGUID(true);\n System.out.println(i + \" \" + myguid.toString());\n }\n System.out.println(Ansi.ansi().eraseScreen().render(String.format(\"20 条@|blue 耗时 |@@|yellow %s |@@|blue 毫秒|@\", System.currentTimeMillis() - start)));\n }",
"@Test\r\n public void startNextOptionTest()\r\n {\r\n presenter.onClickNext();\r\n\r\n Assert.assertEquals(stub.getNextCounter(), 1);\r\n }",
"@Test\n public void test2_verify_state_dropdown() throws InterruptedException{\n // we need to locate the dropdown\n\n Select stateDropdown = new Select(driver.findElement(By.xpath(\"//select[@id='state']\")));\n //3. Select Illinois --> selecting by visible text\n Thread.sleep(1000);\n stateDropdown.selectByVisibleText(\"Illinois\");\n\n //4. Select Virginia --> selecting by value\n Thread.sleep(1000);\n stateDropdown.selectByValue(\"VA\");\n\n //5. Select California --> select by index\n Thread.sleep(1000);\n stateDropdown.selectByIndex(5);\n //6. Verify final selected option is California.\n String expectedResult = \"California\";\n String actualResult = stateDropdown.getFirstSelectedOption().getText();\n\n Assert.assertEquals(actualResult, expectedResult, \"Actual vs expected is not equal!\");\n //Use all Select options. (visible text, value, index)\n }",
"@Test\n public void invalidTableEgress() throws InterruptedException {\n for (int i = 100; i < 110; ++i) {\n this.sfcOfRendererDataListener.onDataTreeChanged(createSfcOfRendererConfig(100, i));\n Thread.sleep(SLEEP); // otherwise the failure is not detected\n verifySettersNotCalled();\n }\n }",
"public SNGTestCases Options_TC1017() throws InterruptedException{\n \tString flavour = \"Electrical\";\n \t\n \tforDebugger();\n \twaitForElement(By.id(\"com.pointedsquares.gamy5.android:id/header_name\"),120);\n \ttry{\n \t\twaitForElement(By.xpath(\"//android.widget.TextView[contains(@text , 'Academics') and contains(@resource-id , 'itemTitle')]\") , 5);\n \t}catch(Exception ex){\n \t\tdriver.scrollTo(\"Academics\");\n \t}\n \tdriver.findElement(By.xpath(\"//android.widget.TextView[contains(@text , 'Academics') and contains(@resource-id , 'itemTitle')]/following-sibling::android.widget.TextView[contains(@text , 'More')]\")).click();\n \twaitForElement(By.id(\"com.pointedsquares.gamy5.android:id/search_all\"), 10);\n \tdriver.findElement(By.id(\"com.pointedsquares.gamy5.android:id/search_all\")).click();\n \tdriver.findElement(By.id(\"com.pointedsquares.gamy5.android:id/search_all\")).sendKeys(flavour);\n \tdriver.findElement(By.xpath(\"//android.widget.TextView[contains(@resource-id , 'flavour_name_list') and contains(@text , 'Electrical Engineering')]\")).click();\n \twaitForElement(By.xpath(\"//android.widget.TextView[contains(@resource-id , 'stake_amount') and contains(@text , '500')]\"),5);\n \tdriver.findElement(By.xpath(\"//android.widget.TextView[contains(@resource-id , 'stake_amount') and contains(@text , '500')]\")).click();\n \twaitForElement(By.xpath(\"//android.widget.TextView[contains(@resource-id , 'message_text') and contains(@text , 'You are about to play Electrical Engineering game with 500 coins stake.')]\"), 5);\n \tdriver.findElement(By.xpath(\"//android.widget.TextView[contains(@resource-id , 'message_text') and contains(@text , 'You are about to play Electrical Engineering game with 500 coins stake.')]\")).click();\n \tdriver.findElement(By.id(\"com.pointedsquares.gamy5.android:id/positive_button\")).click();\n \twaitForVisibilityOf(By.xpath(\"//android.widget.TextView[contains(@resource-id , 'response') and contains(@text , 'Finding room for you...')]\"));\n \tThread.sleep(5000);\n \ttry{\n \t\twaitForElement(By.xpath(\"//android.widget.TextView[contains(@resource-id , 'response') and contains(@text , 'Still Waiting.....')]\") , 2);\n \t}catch(Exception ex){\n \t\t\n \t}\n \twaitForVisibilityOf(By.id(\"com.pointedsquares.gamy5.android:id/choice_linear\"));\n \tList<WebElement> choices = driver.findElements(By.xpath(\"//android.widget.LinearLayout[contains(@resource-id , 'choice_linear')]/*\"));\n \t\n \tboolean noOfChoice = true;\n \tif(choices.size()!=4){\n \t\t\n \t\tnoOfChoice = false;\n \t}\n \tassertTrue(noOfChoice , \"Choice not equal to 4\");\n \t\n \tThread.sleep(7000);\n \treturn new SNGTestCases(driver);\n }",
"@Test\n public void testResetAndCanRetry() {\n assertTrue(rc.attempt());\n assertTrue(rc.attempt());\n assertTrue(rc.attempt());\n rc.reset();\n\n assertTrue(rc.attempt());\n assertTrue(rc.attempt());\n assertTrue(rc.attempt());\n assertFalse(rc.attempt());\n assertFalse(rc.attempt());\n assertFalse(rc.attempt());\n }",
"@Test(expected = ChangeException.class)\n public void testGiveChangeException()throws ChangeException{\n instance.scanItem(0.55);\n instance.scanItem(1.27);\n instance.giveChange();\n }",
"public void doSomeRandomization() {\n\t\tlbOp.setSelectedKey(\"+\");\n\t\tRandom random = new Random(System.currentTimeMillis());\n\t\tinpValue1.setNumber((double)random.nextInt(1000));\n\t\tinpValue2.setNumber((double)random.nextInt(1000));\n\t\tcalculate();\n\t}",
"@Test\n public void testRecursionsFailure() throws Exception {\n assertTrue(doRecursions(false));\n }",
"@Test\n public void shouldDropUnselectedLabelIndexes() throws Exception\n {\n // GIVEN\n LabelIndex[] types = LabelIndex.values();\n Set<Node> expectedNodes = new HashSet<>();\n for ( int i = 0; i < 5; i++ )\n {\n // WHEN\n GraphDatabaseService db = db( random.among( types ) );\n Node node = createNode( db );\n expectedNodes.add( node );\n\n // THEN\n assertNodes( db, expectedNodes );\n db.shutdown();\n }\n }",
"@Test\n public void RunwayAddRemoveTest(){\n for(Airport a : controller.get_airports()){\n controller.remove_Airport(a);\n Logger.Log(\"Removing Runway \" + a.toString());\n }\n\n Airport testAirport = new Airport(\"Test Airport\", \"TST\");\n controller.add_airport(testAirport);\n\n RunwayParameters testRP = new RunwayParameters(3901, 3901, 3500, 3000);\n\n\n Random random = new Random();\n int bound = 10;\n Logger.Log(\"Using upper bound for runway add + remove test [\" + bound + \"].\");\n\n ArrayList<Runway> runways = new ArrayList<>();\n for(int x = 0; x < bound; x++){\n String d1 = x + \"L\";\n String d2 = x + \"R\";\n\n Logger.Log(\"Adding virtual runway\");\n VirtualRunway vr1 = new VirtualRunway(d1, testRP);\n VirtualRunway vr2 = new VirtualRunway(d2, testRP);\n Runway runway = new Runway(vr1, vr2);\n runways.add(runway);\n Logger.Log(\"Adding \" + runway.toString());\n controller.add_Runway(runway, testAirport.getAirport_id());\n }\n\n ArrayList<Runway> recoveredRunways = new ArrayList<Runway>(Arrays.asList(controller.get_runways()));\n\n outer:\n for(int x = 0; x < bound; x++){\n for(Runway db_copy : recoveredRunways) {\n if(db_copy.toString().equals(runways.get(x).toString())){\n continue outer;\n }\n }\n fail(\"Failed to find Runway \" + runways.get(x) + \"in database!\");\n }\n\n\n Logger.Log(\"Test Passed! \" + bound + \" Runways added to database and removed again.\");\n controller = null;\n }",
"@Test\r\n\tpublic void testChooseResultWithUnChangeCarPositionFrist() {\r\n\t\tMontyHall monty = new MontyHall();\r\n\t\tmonty.setChanged(false);\r\n\t\tmonty.setTheDoorWithCar(0);\r\n\t\tmonty.setUserChoosedDoor(0);\r\n\t\tassertNotEquals(0, monty.getTheDoorChoosedBycompere());\r\n\t\tassertEquals(true, monty.winThePrize());\r\n\r\n\t\tmonty.setUserChoosedDoor(1);\r\n\t\tassertEquals(2, monty.getTheDoorChoosedBycompere());\r\n\t\tassertEquals(false, monty.winThePrize());\r\n\r\n\t\tmonty.setUserChoosedDoor(2);\r\n\t\tassertEquals(1, monty.getTheDoorChoosedBycompere());\r\n\t\tassertEquals(false, monty.winThePrize());\r\n\t}",
"@Test\n public void testCardSelectionIsValid_TRUE() throws Exception {\n System.out.println(\"cardSelectionIsValid not valid\");\n UnoCard cardSelection = new UnoCard(UnoCardColour.BLUE, UnoCardValue.TWO);\n UnoCard drawCard = new UnoCard(UnoCardColour.BLUE, UnoCardValue.ONE);\n UnoCardColour wildColour = UnoCardColour.BLUE;\n utils.cardSelectionIsValid(cardSelection, drawCard, wildColour);\n }",
"@Test\n public void setShuffleButtonState() {\n expandPanel();\n\n onView(withId(R.id.shuffle)).perform(click()); //Set state to shuffled\n\n onView(withId(R.id.shuffle)).check(matches(withHighlightState(true)));\n }",
"@Override\n\tpublic double compete() {\n\t\tdouble result=MyTools.getRandomNum(10, 20); \t\n\t\tsetThisResult(result);\n\t\treturn result;\n\t}",
"private void randomizePuzzle() {\n\t\t// Choose random puzzles, shuffle the options.\n\t\tthis.puzzle = BarrowsPuzzleData.PUZZLES[(int) (Math.random() * BarrowsPuzzleData.PUZZLES.length)];\n\t\tthis.shuffledOptions = shuffleIntArray(puzzle.getOptions());\n\t}",
"@Test\n public void RandomBallLocationStopped() {\n final boolean seenAll[] = new boolean[1];\n seenAll[0] = false;\n\n WheelObserver wheelObserver = new WheelObserver() {\n Set<Integer> seen = new HashSet<Integer>();\n public void stopped(final int location) {\n if (location < 0 || location > 36)\n throw new IllegalArgumentException();\n seen.add(location);\n if (seen.size() == 37) seenAll[0] = true;\n }\n };\n RouletteWheel wheel = new RouletteWheel(wheelObserver);\n\n for (int x = 0; x < 1000; x++)\n {\n wheel.spin(0);\n wheel.tick(20000);\n }\n\n assertTrue(seenAll[0]);\n }",
"private static void pickAllThings(Robot r)\n {\n while(r.canPickThing())\n {\n r.pickThing();\n }\n }",
"@Test\n public void badChoicePunisher() {\n Edge[] edgelist = {new Edge(new int[] {1, 7}), new Edge(new int[] {1, 8}),\n new Edge(new int[] {7, 3}), new Edge(new int[] {3, 2}), new Edge(new int[] {2, 4}),\n new Edge(new int[] {2, 5})};\n timeMethod(edgelist, 8, 2);\n\n\n Edge[] edgelist1 = {new Edge(new int[] {1, 6}), new Edge(new int[] {1, 7}),\n new Edge(new int[] {6, 3}), new Edge(new int[] {3, 2}), new Edge(new int[] {2, 4}),\n new Edge(new int[] {2, 5})};\n timeMethod(edgelist1, 7, 1);\n\n Edge[] edgelist2 = {new Edge(new int[] {1, 6}), new Edge(new int[] {1, 7}),\n new Edge(new int[] {6, 3}), new Edge(new int[] {3, 2}), new Edge(new int[] {2, 4}),\n new Edge(new int[] {2, 5}), new Edge(new int[] {2, 8})};\n timeMethod(edgelist2, 8, 2);\n\n Edge[] edgelist3 = {new Edge(new int[] {1, 6}), new Edge(new int[] {1, 7}),\n new Edge(new int[] {6, 3}), new Edge(new int[] {3, 2}), new Edge(new int[] {2, 4}),\n new Edge(new int[] {2, 5})};\n timeMethod(edgelist3, 7, 1);\n }",
"@Test\r\n\tpublic void executeReinforcement() {\r\n\r\n\t\tInteger reinforcementArmy = playerOne.getStrategyType().calculateReinforcementArmy();\r\n\r\n\t\tHashSet<String> countriesOwned = playerOne.getStrategyType().gameData.gameMap\r\n\t\t\t\t.getConqueredCountries(playerOne.getStrategyType().getPlayerID());\r\n\r\n\t\tArrayList<String> countriesOwnedList = new ArrayList<>(countriesOwned);\r\n\r\n\t\tHashMap<String, Integer> expectedArmyCountPerCountryAfterReinforcement = new HashMap<>();\r\n\r\n\t\tfor (String country : countriesOwnedList) {\r\n\t\t\texpectedArmyCountPerCountryAfterReinforcement.put(country,\r\n\t\t\t\t\tplayerOne.getStrategyType().gameData.gameMap.getCountry(country).getCountryArmyCount());\r\n\t\t}\r\n\r\n\t\twhile (reinforcementArmy > 0) {\r\n\r\n\t\t\tInteger randomReinforcementCount = 0;\r\n\t\t\tInteger randomCountryIndex = random.nextInt(countriesOwnedList.size());\r\n\r\n\t\t\tString randomCountry = countriesOwnedList.get(randomCountryIndex);\r\n\r\n\t\t\twhile (randomReinforcementCount == 0) {\r\n\t\t\t\trandomReinforcementCount = random.nextInt(reinforcementArmy + 1);\r\n\t\t\t}\r\n\r\n\t\t\tInteger randomCountryArmyCountBeforeFortification = expectedArmyCountPerCountryAfterReinforcement\r\n\t\t\t\t\t.get(randomCountry);\r\n\r\n\t\t\tInteger randomCountryArmyCountAfterFortification = randomCountryArmyCountBeforeFortification\r\n\t\t\t\t\t+ randomReinforcementCount;\r\n\r\n\t\t\texpectedArmyCountPerCountryAfterReinforcement.put(randomCountry, randomCountryArmyCountAfterFortification);\r\n\r\n\t\t\treinforcementArmy -= randomReinforcementCount;\r\n\r\n\t\t}\r\n\r\n\t\tplayerOne.getStrategyType().executeReinforcement();\r\n\r\n\t\tHashMap<String, Integer> actualArmyCountPerCountryAfterReinforcement = new HashMap<>();\r\n\r\n\t\tfor (String country : countriesOwnedList) {\r\n\t\t\tactualArmyCountPerCountryAfterReinforcement.put(country,\r\n\t\t\t\t\tplayerOne.getStrategyType().gameData.gameMap.getCountry(country).getCountryArmyCount());\r\n\t\t}\r\n\r\n\t\tassertEquals(actualArmyCountPerCountryAfterReinforcement, expectedArmyCountPerCountryAfterReinforcement);\r\n\t\t// assertTrue(strongerCountryAfterReinforcement >\r\n\t\t// strongerCountryBeforeReinforcement);\r\n\r\n\t}",
"public void testRanges() throws Exception {\n int num = atLeast(1000);\n for (int i = 0; i < num; i++) {\n BytesRef lowerVal = new BytesRef(TestUtil.randomUnicodeString(random()));\n BytesRef upperVal = new BytesRef(TestUtil.randomUnicodeString(random()));\n if (upperVal.compareTo(lowerVal) < 0) {\n assertSame(upperVal, lowerVal, random().nextBoolean(), random().nextBoolean());\n } else {\n assertSame(lowerVal, upperVal, random().nextBoolean(), random().nextBoolean());\n }\n }\n }",
"@Then(\"^items displayed as per choice made$\")\n\tpublic void items_displayed_as_per_choice_made() throws Throwable {\n\t\tString str = driver.findElement(By.xpath(\"//*[@id=\\\"center_column\\\"]/h1/span[2]\")).getText();\n\t\tassertEquals(\"7 results have been found.\", str);\n\t\tdriver.quit();\n\t}",
"protected void initializeExecutionRandomness() {\r\n\r\n\t}",
"public static void multiRunTest(){\n /* Input resources.\n * For each String:\n * - the first character is the name of the first image.\n * - the second character is the name of the second image.\n */\n String[] inputs = new String[]{\n \"ab\",\n \"cd\",\n \"ef\",\n \"gh\",\n \"il\",\n \"mn\"\n };\n \n BlueRand random = new BlueRand();\n random.setOutputFile(\"sample/output/multiRuns_output.txt\");\n random.setOutputImage(\"sample/output/multiRuns_output.bmp\");\n random.overwriteOutputFile(false); \n //random.deleteInputFiles(true);\n try {\n\t for (String s : inputs){\n\t random.setInputImages(\"sample/input/\"+s.charAt(0)+\".jpg\",\n\t \"sample/input/\"+s.charAt(1)+\".jpg\"); \n\t ArrayList<Byte> output = random.generateRandom();\n\t System.out.println(\"run finished... Bytes generated: \" + output.size());\n\t }\n } catch (BlueRandException e){\n \tSystem.out.println(e.getMessage());\n }\n }",
"@Test\n public void randomRecipeTest() {\n onView(withContentDescription(\"Open navigation drawer\")).perform(click());\n //Open the search bar at the top\n onView(withText(\"Find a Random Recipe!\")).perform(click());\n onView(withId(R.id.recipe_title)).check(matches(isDisplayed()));\n\n //Exit to the main activity\n pressBack();\n }",
"@Test(priority =21)\n\t public void newtest2() throws InterruptedException\n\t {\n\t\tThread.sleep(3000);\n\t\tdriver.findElement(By.name(\"nombre\")).sendKeys(\"manualchange\");\n\t\tThread.sleep(3000);\n driver.findElement(By.linkText(\"Generate\")).click();\n Thread.sleep(5000); \n driver.findElement(By.linkText(\"click here\")).click();\n Thread.sleep(5000);\n\t }",
"@Test\n\tpublic void testNormalPuzzleGeneration() {\n\t}",
"public void step()\n\t{\n\t\t// Reservoir sampling by generating ordered list of numbers\n\t\t// randomly pick a number within length and use that as index\n\t\tRandom rand = new Random();\n\t\tArrayList<Integer> numbers = new ArrayList<Integer>();\n\t\tfor(int i = 0; i < listOfCells.size(); i++) { numbers.add(i); }\n\t\t\n\t\t// Randomly sample from reservoir until empty\n\t\twhile(numbers.size() > 0)\n\t\t{\n\t\t\tint picked_index = rand.nextInt(numbers.size());\n\t\t\tint picked_val = numbers.get(picked_index);\n\t\t\t\n\t\t\t//TODO: Maybe call a function on cell of random action that might occur\n\t\t\t//\tConsider only returning object when necessary, (how it is now)\n\t\t\tPlantCell newObject = listOfCells.get(picked_val).doAction();\n\t\t\tif(newObject != null)\n\t\t\t{\n//\t\t\t\tSystem.out.println(\"New cell generated!\");\n\t\t\t\tlistOfCells.add(newObject);\n\t\t\t}\n\t\t\t\n\t\t\t//Kill spawning cell if its health drops <= 0\n\t\t\t//should die right away to make room for other cell\n\t\t\tif(listOfCells.get(picked_val).getHealth() <= 0)\n\t\t\t{\n\t\t\t\tenvironmentPointer.map[listOfCells.get(picked_val).getX()][listOfCells.get(picked_val).getY()] = null;\n\t\t\t\tlistOfCells.set(picked_val, null); //Set to null as to preserve list integrity for reservoir sampling, will be removed later\n\t\t\t}\n\t\t\t\n\t\t\tnumbers.remove(picked_index);\n\t\t}\n\t\t\n\t\t// All recently dead cells are now null in our cell list, so we are removing them from the list now\n\t\tfor(int i = 0; i < listOfCells.size(); i++)\n\t\t{\n\t\t\tif(listOfCells.get(i) == null)\n\t\t\t{\n\t\t\t\tlistOfCells.remove(i);\n\t\t\t\ti--; //Adjust for changing size\n\t\t\t}\n\t\t}\n\t}",
"public void testSelect_0()\n throws Exception {\n BestChromosomesSelector selector = new BestChromosomesSelector(conf);\n Gene gene = new IntegerGene(conf);\n gene.setAllele(new Integer(444));\n Chromosome secondBestChrom = new Chromosome(conf, gene, 3);\n secondBestChrom.setFitnessValue(11);\n selector.add(secondBestChrom);\n gene = new BooleanGene(conf);\n gene.setAllele(Boolean.valueOf(false));\n Chromosome bestChrom = new Chromosome(conf, gene, 3);\n bestChrom.setFitnessValue(12);\n selector.add(bestChrom);\n selector.select(1, null, new Population(conf));\n }",
"@Test\n public void endGameDetectionTrue() {\n logic.setDirection(1);\n for (int i = 0; i < 100; i++) {\n logic.eatFoodForTesting();\n logic.gameLogic();\n }\n assertFalse(logic.gameLogic());\n }",
"@Test\n\t@TestProperties(name = \"Clear element ${by}:${locator} selection\", paramsInclude = { \"by\", \"locator\" })\n\tpublic void clearSelections() {\n\t\tthrow new IllegalStateException(\"Unimplemenetd\");\n\t}",
"private static boolean KawigiEdit_RunTest(\n int testNum, int p0, int p1, boolean hasAnswer, int[] p2) {\n System.out.print(\"Test \" + testNum + \": [\" + p0 + \",\" + p1);\n System.out.println(\"]\");\n RearrangeAndIncrement obj;\n int[] answer;\n obj = new RearrangeAndIncrement();\n long startTime = System.currentTimeMillis();\n answer = obj.change(p0, p1);\n long endTime = System.currentTimeMillis();\n boolean res;\n res = true;\n System.out.println(\"Time: \" + (endTime - startTime) / 1000.0 + \" seconds\");\n if (hasAnswer) {\n System.out.println(\"Desired answer:\");\n System.out.print(\"\\t\" + \"{\");\n for (int i = 0; p2.length > i; ++i) {\n if (i > 0) {\n System.out.print(\",\");\n }\n System.out.print(p2[i]);\n }\n System.out.println(\"}\");\n }\n System.out.println(\"Your answer:\");\n System.out.print(\"\\t\" + \"{\");\n for (int i = 0; answer.length > i; ++i) {\n if (i > 0) {\n System.out.print(\",\");\n }\n System.out.print(answer[i]);\n }\n System.out.println(\"}\");\n if (hasAnswer) {\n if (answer.length != p2.length) {\n res = false;\n } else {\n for (int i = 0; answer.length > i; ++i) {\n if (answer[i] != p2[i]) {\n res = false;\n }\n }\n }\n }\n if (!res) {\n System.out.println(\"DOESN'T MATCH!!!!\");\n } else if ((endTime - startTime) / 1000.0 >= 2) {\n System.out.println(\"FAIL the timeout\");\n res = false;\n } else if (hasAnswer) {\n System.out.println(\"Match :-)\");\n } else {\n System.out.println(\"OK, but is it right?\");\n }\n System.out.println(\"\");\n return res;\n }",
"@Test(groups = \"smoke\")\n public void testKeepSelected() {\n String textSource = pickList.advanced().getSourceList().getItem(0).getText();\n pickList.add(0);\n ListItem item = pickList.advanced().getTargetList().getItem(0);\n assertTrue(item.getRootElement().getAttribute(\"class\").contains(\"rf-pick-sel\"));\n assertEquals(item.getText(), textSource);\n\n pickList.remove(0);\n item = pickList.advanced().getSourceList().getItem(ChoicePickerHelper.byIndex().last());\n assertTrue(item.getRootElement().getAttribute(\"class\").contains(\"rf-pick-sel\"));\n assertEquals(item.getText(), textSource);\n assertEquals(Utils.getIndexOfElement(item.getRootElement()), pickList\n .advanced().getSourceList().size() - 1, \"Index of removed item.\");\n }"
] | [
"0.7167595",
"0.67140025",
"0.6629662",
"0.6386812",
"0.6201545",
"0.61238974",
"0.60831475",
"0.6082942",
"0.6035929",
"0.5977129",
"0.59432274",
"0.5941678",
"0.5884778",
"0.5871666",
"0.5867275",
"0.5862037",
"0.585226",
"0.58342683",
"0.58279467",
"0.5827937",
"0.57792276",
"0.5756199",
"0.5754834",
"0.57506603",
"0.5742009",
"0.57128435",
"0.5703979",
"0.56892353",
"0.5687049",
"0.5685368",
"0.56744105",
"0.56716",
"0.5657265",
"0.5650825",
"0.5635574",
"0.5594633",
"0.5590556",
"0.558968",
"0.55887204",
"0.55731916",
"0.556365",
"0.5550337",
"0.55429864",
"0.5541433",
"0.55379844",
"0.5534861",
"0.5531588",
"0.55313355",
"0.55288655",
"0.55223644",
"0.55189854",
"0.5518061",
"0.55166334",
"0.55160314",
"0.55142057",
"0.55116224",
"0.550198",
"0.54979235",
"0.5494006",
"0.5486025",
"0.54830194",
"0.5478321",
"0.54561436",
"0.5455549",
"0.5450141",
"0.5447875",
"0.5445835",
"0.5445014",
"0.54429966",
"0.54399633",
"0.5439035",
"0.5437233",
"0.5432636",
"0.54276097",
"0.54274267",
"0.5426394",
"0.5424414",
"0.5423664",
"0.5419622",
"0.5418915",
"0.541801",
"0.5413693",
"0.54133093",
"0.5412551",
"0.5407088",
"0.5393414",
"0.53910327",
"0.5390289",
"0.53858954",
"0.53830254",
"0.53829163",
"0.5382858",
"0.53827196",
"0.5381171",
"0.53777915",
"0.53729665",
"0.5366284",
"0.5364521",
"0.5358953",
"0.5358137"
] | 0.58705765 | 14 |
tempt algorithm with higher cards (strategy hand has both wild and wd4) | @Test
public void testPlayer_getBoldStrategyCard_numeric_colorBeatsNumber() {
player2 = new Player("Player Two", true);
player2.setHand(strategyHand.getAllCards());
// pick a cpc that could return two possible options
// and assert that the higher value card comes back
// make a cpc that might return a yellow six or a red eight
// assert the yellow comes back, even though the red eight has a higher value
Card redSix = new Card(Card.RED, Card.SIX, cvm);
assertTrue(player2.getBoldStrategyCard(redSix, redSix.getColor()).equals(yellowSix));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void evaluateHand(){only public for testing\n //hand types will be\n //1 royal flush\n //2 straight flush\n //3 four of a kind\n //4 full house\n //5 flush\n //6 straight\n //7 three of a kind\n //8 two pair\n //9 pair\n //10 high card\n //hand secondary values will have to some how account for\n //the lead card of a flush or straight or the bigger pair\n //\n HandType = 0;\n\n //----------checking flush----------\n boolean flush = true;//will flip the vriable when proven wrong\n //if Hand.suites all equal\n for(Card c : Hand) {\n if (!c.getSuite().contains(Hand[0].getSuite())) {\n flush = false;\n }\n }\n //--Handtype = 5//flush\n if(flush){\n HandType=5;\n }\n\n //----------checking pair, two pair, boat,three of a kind, four of a kind----------\n int countmatches=0;\n HashMap<Integer, ArrayList<Card>> maskd = new HashMap<>();\n int[] mask = new int[5];\n int currentmask=1;\n maskd.put(0, new ArrayList<>());\n mask[0]=0;\n maskd.get(0).add(this.Hand[0]);\n //if any two hand.value equal\n for(int comp = 0; comp<Hand.length;comp++){//comparitor\n for(int check = comp+1; check<Hand.length;check++) {//checker\n //System.out.print(\"{\"+comp+check+\"}\");\n if(0==Hand[comp].compareTo(Hand[check])){\n //System.out.println(\"pair\"+Hand[comp]+Hand[check]);\n countmatches++;\n /*if(pairprimary==0&&!(pairprimary==Hand[check].getValue())){\n pairprimary=Hand[check].getValue();\n }else if(pairsecondary==0){\n pairsecondary=Hand[check].getValue();\n }//this wont work for boats\n */\n //create mask?\n if(mask[comp]==0){\n mask[comp]=currentmask;\n maskd.put(currentmask,new ArrayList<>());\n maskd.get(currentmask).add(this.Hand[comp]);\n currentmask++;\n if(maskd.get(0).contains(this.Hand[comp])){\n maskd.get(0).remove(this.Hand[comp]);\n }\n }\n mask[check]=mask[comp];\n if(!maskd.get(mask[comp]).contains(this.Hand[check])) {\n if(maskd.get(0).contains(this.Hand[check]))\n maskd.get(0).remove(this.Hand[check]);\n maskd.get(mask[comp]).add(this.Hand[check]);\n }\n continue;\n }\n if(!maskd.get(0).contains(this.Hand[check]))\n maskd.get(0).add(this.Hand[check]);\n }\n }\n\n //for(int m:maskd.keySet())\n // System.out.print(\"\"+m+\":\"+maskd.get(m));\n //System.out.println(\"\");\n\n if(HandType==0)\n switch (countmatches){ //basically i'm counting the collisions\n case 1: HandType=9;break;//one pair\n case 2: HandType=8;break;//two pair\n case 3: HandType=7;break;//triple\n case 4: HandType=4;break;//boat\n case 6: HandType=3;break;//four of a kind\n case 10: HandType=-1;break;//five of a kind\n }//reorder cards by mask?\n if(countmatches>0){\n Card[] newhand = new Card[5];\n int bigger = 0;\n if(currentmask==3) {//two pair boat\n //two pair\n if (maskd.get(1).get(0).getValue()\n > maskd.get(2).get(0).getValue()) {\n bigger = 1;\n } else {\n bigger = 2;\n }\n\n //boat\n if (maskd.get(1).size() == 3) {\n bigger = 1;\n }\n if (maskd.get(2).size() == 3) {\n bigger = 2;\n }\n }else {\n //one pair???\n bigger = 1;\n }\n\n for(int i = 0; i<5;i++){\n //if(maskd.containsKey(bigger)) {\n if(!maskd.get(bigger).isEmpty()) {\n newhand[i] = maskd.get(bigger).get(0);\n //if (maskd.get(bigger).size() > 0) {\n maskd.get(bigger).remove(0);\n //} else {\n // bigger = Math.abs(bigger - 3);\n //}\n }else{\n if(maskd.containsKey(Math.abs(bigger-3))){\n if(!maskd.get(Math.abs(bigger-3)).isEmpty()){\n bigger = Math.abs(bigger-3);\n }else{\n bigger = 0;\n }\n }else{\n bigger = 0;\n }\n i--;\n }\n //}\n\n }//end for loop\n\n //end pair bits\n\n //System.out.println(newhand);\n this.Hand=newhand;\n }//end reshuffle hand if statement\n //----------checking for straight----------\n //if first card is ace and second card is a 5, treat ace as one\n if(Hand[0].getValue()==14&&Hand[1].getValue()==5) {\n Hand[0] = new Card(\"Ace\", Hand[0].getSuite(), 1);\n //Hand[0].Value=1;\n this.sortHand();\n this.flipHand();\n }\n //go through hand and see if all 5 values are consecutive\n int n = Hand[0].getValue();\n boolean straight = true;\n for(int i = 1;i<Hand.length; i++){\n n--;\n if(!(Hand[i].getValue()==n)){\n straight=false;\n }\n }\n if(straight){\n //if above true\n //--if handtype = 5\n if(HandType==5) {\n //----if card1 is ace\n if (Hand[0].getValue() == 14) {\n //------handtype = 1 //royal flush\n HandType = 1;\n } else {\n //----else\n HandType=2;\n //------handtype = 2 //straight flush\n }\n }else {\n //--else //not a flush\n HandType=6;\n //----handtype = 6 //straight\n }\n }\n\n //----------checking high card----------\n //if handtype = 0\n if(HandType==0) {\n HandType=10;\n //--hand card = 10\n }\n }",
"private int GetBestCard(Card[] card) {\n\t int iPos = 0;\n\t int iWeightTemp = 0;\n\t int iWeight[] = new int[8];\n\t for (int i = 0; i < 8; i++){\n\t\t iWeight[i] = -1;\n\t }\n\t // For each selectable card, work out a weight, the highest weight is the one selected.\n\t // The weight is worked out by the distance another of the players cards is from playable ones, with no playable cards in between\n\t Card myCard, nextCard;\n\t for (int i = 0; i < 8; i++){\n\t\t if (card[i] != null){\n\t\t\t // if card value > 7\n\t\t\t if (card[i].GetValue() > 7){\n\t\t\t\t // do you have cards that are higher than this card\n\t\t\t\t myCard = card[i];\n\t\t\t\t iWeightTemp = 0;\n\t\t\t \tfor (int j = 0; j < mCardCount; j++){\n\t\t\t \t\tnextCard = mCard[j];\n\t\t\t \t\tif (nextCard != null && nextCard.GetSuit() == myCard.GetSuit() && nextCard.GetValue() > myCard.GetValue()){\n\t\t\t \t\t\tif (nextCard.GetValue() - myCard.GetValue() > iWeightTemp)\n\t\t\t \t\t\t\tiWeightTemp = nextCard.GetValue() - myCard.GetValue();\n\t\t\t \t\t\tmyCard = nextCard;\n\t\t\t \t\t}\n\t\t\t \t}\n\t\t\t \tiWeight[i] = iWeightTemp;\n\t\t\t \t\t\n\t\t\t }\n\t\t\t if (card[i].GetValue() < 7){\n\t\t\t\t // do you have cards that are lower than this card\n\t\t\t\t myCard = card[i];\n\t\t\t\t iWeightTemp = 0;\n\t\t\t \tfor (int j = mCardCount-1; j >=0; j--){\n\t\t\t \t\tnextCard = mCard[j];\n\t\t\t \t\tif (nextCard != null && nextCard.GetSuit() == myCard.GetSuit() && nextCard.GetValue() < myCard.GetValue()){\n\t\t\t \t\t\tif (myCard.GetValue() - nextCard.GetValue() > iWeightTemp)\n\t\t\t \t\t\t\tiWeightTemp = myCard.GetValue() - nextCard.GetValue();\n\t\t\t \t\t\tmyCard = nextCard;\n\t\t\t \t\t}\n\t\t\t \t}\n\t\t\t \tiWeight[i] = iWeightTemp;\n\t\t\t \t\t\n\t\t\t }\t\n\t\t\t if (card[i].GetValue() == 7){\n\t\t\t\t // do you have cards that are in this suit\n\t\t\t\t myCard = card[i];\n\t\t\t\t int iWeightTemp1;\n\t\t\t\t iWeightTemp = 0;\n\t\t\t\t iWeightTemp1 = 0;\n\t\t\t\t // do you have cards that are higher than this card\n\t\t\t \tfor (int j = 0; j < mCardCount; j++){\n\t\t\t \t\tnextCard = mCard[j];\n\t\t\t \t\tif (nextCard != null && nextCard.GetSuit() == myCard.GetSuit() && nextCard.GetValue() > myCard.GetValue()){\n\t\t\t \t\t\tif (nextCard.GetValue() - myCard.GetValue() > iWeightTemp)\n\t\t\t \t\t\t\tiWeightTemp = nextCard.GetValue() - myCard.GetValue();\n\t\t\t \t\t\tmyCard = nextCard;\n\t\t\t \t\t}\n\t\t\t \t}\n\t\t\t \tmyCard = card[i];\n\t\t\t \t// do you have cards that are lower than this card\n\t\t\t \tfor (int j = mCardCount-1; j >=0; j--){\n\t\t\t \t\tnextCard = mCard[j];\n\t\t\t \t\tif (nextCard != null && nextCard.GetSuit() == myCard.GetSuit() && nextCard.GetValue() < myCard.GetValue()){\n\t\t\t \t\t\tif (myCard.GetValue() - nextCard.GetValue() > iWeightTemp1)\n\t\t\t \t\t\t\tiWeightTemp1 = myCard.GetValue() - nextCard.GetValue();\n\t\t\t \t\t\tmyCard = nextCard;\n\t\t\t \t\t}\n\t\t\t \t} \t\n\t\t\t \tiWeight[i] = iWeightTemp + iWeightTemp1;\n\t\t\t \t\t\n\t\t\t }\t\t\t \n\t\t }\n\t\t \t \n\t }\n\t boolean bLoopAceKing = true;\n\t int iMaxTemp = 0;\n\t int iMaxCount = 0;\t\n\t int[] iMaxs;\n\t iMaxs = new int[8];\n\t while (bLoopAceKing){\n\t\t for (int i = 0; i < 8; i++){\n\t\t\t if (iWeight[i] >= iMaxTemp){\n\t\t\t\t if (iWeight[i] == iMaxTemp){\n\t\t\t\t\t iMaxs[iMaxCount] = i;\n\t\t\t\t\t iMaxCount++;\n\t\t\t\t }\n\t\t\t\t else {\n\t\t\t\t\t iMaxTemp = iWeight[i];\n\t\t\t\t\t iMaxs = new int[8];\n\t\t\t\t\t iMaxCount = 0;\n\t\t\t\t\t iMaxs[iMaxCount] = i;\n\t\t\t\t\t iMaxCount++;\n\t\t\t\t }\t\t\t \n\t\t\t }\t \n\t\t }\n\t\t boolean bAceKing = false;\n\t\t // If the top weight is zero, meaning your options don't help you, then play the one that is closest to ace/king\n\t\t if (iMaxTemp == 0 && iMaxCount > 1){\n\t\t\t for (int k = 0; k < iMaxCount; k++){\n\t\t\t\t\t iWeight[iMaxs[k]] = Math.abs(card[iMaxs[k]].GetValue()-7);\n\t\t\t\t\t bAceKing = true;\t\t\t\t \n\t\t\t } \t\t \n\t\t }\n\t\t if (bAceKing){\n\t\t\t bLoopAceKing = true;\n\t\t\t iMaxs = new int[8];\n\t\t\t iMaxTemp = 0;\n\t\t\t iMaxCount = 0;\t\t\t \n\t\t }\n\t\t else \n\t\t\t bLoopAceKing = false;\n\t }\n\t if (iMaxCount == 1)\n\t\t iPos = iMaxs[iMaxCount-1];\n\t else {\n\t\t Random generator = new Random();\n\t\t int randomIndex = generator.nextInt( iMaxCount );\n\t\t iPos = iMaxs[randomIndex];\n\t }\n\t\t \n\t return iPos;\n\t \n }",
"private static short eval_5cards(int[] hand)\n {\n int q = (hand[0] | hand[1] | hand[2] | hand[3] | hand[4]) >> 16;\n\n // This checks for any kind of Flushes\n if ((hand[0] & hand[1] & hand[2] & hand[3] & hand[4] & 0xf000) != 0)\n return flushes.get(q);\n\n // This checks for Straights and High Card hands\n if ( unique5.get(q) != 0)\n return unique5.get(q);\n\n // This performs a perfect-hash lookup for remaining possible hands\n long q1 = (hand[0] & 0xff) * (hand[1] & 0xff) * (hand[2] & 0xff) * (hand[3] & 0xff) * (hand[4] & 0xff);\n return hash_values.get((int)find_fast(q1));\n }",
"public void findBestTwoCardHandName() {\n if (handContainsTheseTwoCards_With_AtLeastOneFromPlayerOriginalHand(14, 'x', 14) == true) {//aces, any suit\n bestHandFromCardsNickNameString = \"Pocket Rockets\";\n } else if (handContainsTheseTwoCards_With_AtLeastOneFromPlayerOriginalHand(13, 'y', 14) == true) {//king, then ace, same suit\n bestHandFromCardsNickNameString = \"Big Slick in a Suit\";\n } else if (handContainsTheseTwoCards_With_AtLeastOneFromPlayerOriginalHand(13, 'x', 14) == true) {\n bestHandFromCardsNickNameString = \"Full Auto\";\n } else if (handContainsTheseTwoCards_With_AtLeastOneFromPlayerOriginalHand(8, 'x', 14) == true) {\n bestHandFromCardsNickNameString = \"Dead Man's Hand\";\n } else if (handContainsTheseTwoCards_With_AtLeastOneFromPlayerOriginalHand(13, 'x', 13) == true) {\n bestHandFromCardsNickNameString = \"Cowboys King Kong\";\n } else if (handContainsTheseTwoCards_With_AtLeastOneFromPlayerOriginalHand(9, 'x', 14) == true) {\n bestHandFromCardsNickNameString = \"The Dog\";\n } else if (handContainsTheseTwoCards_With_AtLeastOneFromPlayerOriginalHand(12, 'x', 12) == true) {\n bestHandFromCardsNickNameString = \"Ladies\";\n } else if (handContainsTheseTwoCards_With_AtLeastOneFromPlayerOriginalHand(3, 'x', 12) == true) {\n bestHandFromCardsNickNameString = \"The Waiter\";\n } else if (handContainsTheseTwoCards_With_AtLeastOneFromPlayerOriginalHand(9, 'x', 9) == true) {\n bestHandFromCardsNickNameString = \"A German Dime\";\n } else if (allCards[0].value == allCards[1].value) {\n bestHandFromCardsNickNameString = \"Pocket Pair\";\n } else if (allCards[0].suit == allCards[1].suit) {\n bestHandFromCardsNickNameString = \"Flush Rush\";\n } else if (allCards[0].value == allCards[1].value + 1 || allCards[0].value + 1 == allCards[1].value || (allCards[0].value == 14 && allCards[1].value == 2) || (allCards[0].value == 2 && allCards[1].value == 14) ) {\n bestHandFromCardsNickNameString = \"Straight Bait\";\n } else if (allCards[0].value == 14 || allCards[1].value == 14) {\n bestHandFromCardsNickNameString = \"A Spike\";\n } else if (allCards[0].value == 13 || allCards[1].value == 13) {\n bestHandFromCardsNickNameString = \"A Dame\";\n } else if (allCards[0].value == 12 || allCards[1].value == 12) {\n bestHandFromCardsNickNameString = \"A Jackal\";\n } else if (allCards[0].value == 11 || allCards[1].value == 11) {\n bestHandFromCardsNickNameString = \"A Fishhook\";\n } else if (allCards[0].value == 10 || allCards[1].value == 10) {\n bestHandFromCardsNickNameString = \"A Sawbuck\";\n } else if (allCards[0].value == 9 || allCards[1].value == 9) {\n bestHandFromCardsNickNameString = \"Nina Ross\";\n } else {\n bestHandFromCardsNickNameString = \"Down on Your Luck\";\n }\n \n System.out.println(\"findBestTwoCardHandName---->>> \" + bestHandFromCardsNickNameString);\n\n }",
"@Test\r\n public void testPlayer_getCautiousStrategyCardCard_higherFirst_wd4() {\n player2 = new Player(\"Player Two\", true);\r\n player2.setHand(strategyHand.getAllCards());\r\n\r\n // get rid of the wild so the wd4 is the most attractive option\r\n player2.getHand().discard(wild);\r\n assertTrue(player2.getCautiousStrategyCard(yellowThree, yellowThree.getColor()).equals(wildDrawFour));\r\n }",
"@Test\n public void bestowNighthowlerTest() {\n addCard(Zone.BATTLEFIELD, playerA, \"Mountain\", 4);\n // Instant - {2}{R}{R}\n // Chandra's Outrage deals 4 damage to target creature and 2 damage to that creature's controller.\n addCard(Zone.HAND, playerA, \"Chandra's Outrage\");\n\n // Enchantment Creature — Horror\n // 0/0\n // Bestow {2}{B}{B}\n // Nighthowler and enchanted creature each get +X/+X, where X is the number of creature cards in all graveyards.\n addCard(Zone.HAND, playerB, \"Nighthowler\");\n addCard(Zone.BATTLEFIELD, playerB, \"Swamp\", 4);\n // First strike\n // Whenever Alesha, Who Smiles at Death attacks, you may pay {W/B}{W/B}. If you do, return target creature card\n // with power 2 or less from your graveyard to the battlefield tapped and attacking.\n addCard(Zone.BATTLEFIELD, playerB, \"Alesha, Who Smiles at Death\"); // 3/2\n addCard(Zone.GRAVEYARD, playerB, \"Pillarfield Ox\");\n\n castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, \"Nighthowler using bestow\", \"Alesha, Who Smiles at Death\");\n\n // attacks by Alesha and return card on trigger\n attack(2, playerB, \"Alesha, Who Smiles at Death\");\n setChoice(playerB, true); // use trigger\n addTarget(playerB, \"Pillarfield Ox\"); // target card to return\n\n castSpell(2, PhaseStep.POSTCOMBAT_MAIN, playerA, \"Chandra's Outrage\", \"Alesha, Who Smiles at Death\");\n\n setStrictChooseMode(true);\n setStopAt(2, PhaseStep.END_TURN);\n execute();\n\n assertLife(playerB, 18); // -2 from Chandra's Outrage\n assertLife(playerA, 16); // -3 from attack Alesha with bestowed Nighthowler\n\n assertGraveyardCount(playerA, \"Chandra's Outrage\", 1);\n assertGraveyardCount(playerB, \"Alesha, Who Smiles at Death\", 1);\n assertPermanentCount(playerB, \"Nighthowler\", 1);\n assertPowerToughness(playerB, \"Nighthowler\", 2, 2);\n Permanent nighthowler = getPermanent(\"Nighthowler\", playerB);\n\n Assert.assertEquals(\"Nighthowler has to be a creature\", true, nighthowler.isCreature(currentGame));\n }",
"@Override\n protected Move makeDecision() {\n myTurn = index();\n /* block the nearest + most effective player (as in, people who arent blocked) */\n ArrayList<Move> pathMoves = new ArrayList<>();\n ArrayList<Move> playMoves = new ArrayList<>();\n ArrayList<Move> discardMoves = new ArrayList<>();\n Map<Integer, Card> destroyCards = new HashMap<Integer, Card>();\n Map<Integer, Card> repairCards = new HashMap<Integer, Card>();\n Map<Integer, Card> blockCards = new HashMap<Integer, Card>();\n Map<Integer, Card> pathCards = new HashMap<Integer, Card>();\n Set<Position> reachable = game().board().getReachable();\n canSee=false;\n canMove=false;\n canBlock=false;\n canRockfall=false;\n canRepair=false;\n int len = hand().size();\n for (int i = 0; i < len; ++i) {\n Card c = hand().get(i);\n if (c instanceof PathCard && !isSabotaged()) {\n pathCards.put(i,c);\n// pathMoves.addAll(generatePossiblePaths(i, (PathCard) c));\n canMove = true;\n }\n if (c instanceof PlayerActionCard) {\n// playMoves.addAll(generatePossiblePlayerActions(i, (PlayerActionCard) c));\n if(c.type()== Card.Type.BLOCK) {\n blockCards.put(i, c);\n canBlock=true;\n }\n else if(c.type()== Card.Type.REPAIR) {\n repairCards.put(i, c);\n canRepair=true;\n }\n }\n if (c.type() == Card.Type.MAP) {\n// playMoves.addAll(generatePossibleMap(i));\n mapIndex = i;\n canSee = true;\n }\n if (c.type() == Card.Type.ROCKFALL) {\n destroyCards.put(i,c);\n// playMoves.addAll(generatePossibleRockfall(i));\n canRockfall = true;\n }\n discardMoves.add(Move.NewDiscardMove(index(), i));\n }\n\n if(canSee) {\n //sum of all heuristics\n double sumGoal[] = new double[3];\n for (Position h : reachable) {\n sumGoal[0]+=(9-(8-h.x)+ 5-(4-h.y));\n sumGoal[1]+=(9-(8-h.x)+ 5-(2-h.y));\n sumGoal[2]+=(9-(8-h.x)+ 5-(-h.y));\n }\n //update goldProb\n for(int i=0; i<3; i++) {\n int seenSum=0;\n for(int j=0; j<numPlayers; j++) {\n if(j!=myTurn) {\n if(haveSeen.get(j)[i]==1) seenSum++;\n }\n }\n goldProb[i] = (i==1?0.5:1)*(1-haveSeen.get(myTurn)[i])*(mapRate*(seenSum/numPlayers)+(sumGoal[i]/10));\n }\n }\n\n// System.out.println(hand());\n// System.out.println(pathMoves);\n\n\n if (role() == Role.GOLD_MINER) {\n //Path\n if(canSee && !goldFound) {\n int selection=0;\n double maxProb=goldProb[0];\n for(int i=0; i<3; i++) {\n if(goldProb[i]>maxProb) {\n maxProb = goldProb[i];\n selection=i;\n }\n }\n Move look = Move.NewMapMove(index(), mapIndex, Board.GoalPosition.TOP);\n switch(selection) {\n case 0:\n look = Move.NewMapMove(index(), mapIndex, Board.GoalPosition.TOP);\n break;\n case 1:\n look = Move.NewMapMove(index(), mapIndex, Board.GoalPosition.MIDDLE);\n break;\n case 2:\n look = Move.NewMapMove(index(), mapIndex, Board.GoalPosition.BOTTOM);\n break;\n }\n return look;\n }\n if(canMove) {\n int globalIndex = 0;\n double maxH = 0;\n double oldH;\n Position bp = new Position(0,0);\n boolean rotate = false;\n //Find best path to place;\n Board board = game().board().copy();\n oldH = getClosest(board);\n// System.out.print(getClosest(board)+\" : \");\n for( Map.Entry<Integer, Card> p : pathCards.entrySet()) {\n int index = p.getKey();\n Card path = p.getValue();\n ((PathCard)path).setRotated(false);\n Set<Position> placeable = game().board().getPlaceable((PathCard)path);\n for (Position h : placeable) {\n Board simulated = board.simulatePlaceCardAt((PathCard)path, h.x, h.y);\n// System.out.println(path.type());\n double cH = getClosest(simulated);\n if(maxH<cH) {\n bp=h;\n globalIndex = index;\n maxH = cH;\n rotate=false;\n }\n }\n ((PathCard) path).setRotated(true);\n placeable = game().board().getPlaceable((PathCard)path);\n for (Position h : placeable) {\n Board simulated = board.simulatePlaceCardAt((PathCard)path, h.x, h.y);\n// System.out.println(simulated);\n double cH = getClosest(simulated);\n if(maxH<cH) {\n bp=h;\n globalIndex = index;\n rotate=true;\n maxH = cH;\n }\n }\n }\n// System.out.println(oldH+\": \"+maxH+\" (\"+abs(maxH-oldH)+\")\");\n oldBoard = game().board().copy();\n if(maxH>0 && abs(maxH-oldH)>0.01)\n return Move.NewPathMove(index(), globalIndex, bp.x, bp.y, rotate);\n }\n //Unblock\n if(canRepair) {\n double blockMore = 0.0;\n int targetPlayer = -1;\n int cardIndex = 0;\n for(int i=0; i<numPlayers; i++) {\n //heal self\n if(i == myTurn) {\n for(Map.Entry<Integer, Card> r : repairCards.entrySet()) {\n int index = r.getKey();\n// System.out.println(Arrays.toString(game().playerAt(index()).sabotaged()));\n PlayerActionCard repair = (PlayerActionCard) r.getValue();\n if (game().playerAt(index()).isRepairable(repair.effects())) {\n return Move.NewPlayerActionMove(index(),index, index());\n }\n }\n }\n else if(i!=myTurn) {\n for(Map.Entry<Integer, Card> r : repairCards.entrySet()) {\n int index = r.getKey();\n PlayerActionCard repair = (PlayerActionCard) r.getValue();\n// System.out.println(Arrays.toString(game().playerAt(i).sabotaged()));\n if (game().playerAt(i).isRepairable(repair.effects())) {\n //calculate the should i repair? function\n double shouldIBlockMore = Probability[i]+(0.03*(numPlayers-i));\n if(blockMore<shouldIBlockMore) {\n blockMore = shouldIBlockMore;\n targetPlayer = i;\n cardIndex = index;\n }\n }\n }\n }\n }\n if(blockMore>0.75 && targetPlayer>=0)\n return Move.NewPlayerActionMove(index(), cardIndex, targetPlayer);\n }\n //Block Enemy\n if(canBlock) {\n double blockMore = 0.0;\n int targetPlayer = -1;\n int cardIndex = 0;\n for (int i = 0; i < numPlayers; i++) {\n if (i != myTurn) {\n for (Map.Entry<Integer, Card> b : blockCards.entrySet()) {\n int index = b.getKey();\n PlayerActionCard block = (PlayerActionCard) b.getValue();\n if (game().playerAt(i).isSabotageable(block.effects()[0])) {\n //calculate the should i repair? function\n double shouldIBlockMore = (1 - Probability[i]) * ((1 - Probability[i]) + 0.2 * (numPlayers - i));\n if (blockMore < shouldIBlockMore) {\n blockMore = shouldIBlockMore;\n targetPlayer = i;\n cardIndex = index;\n }\n }\n }\n }\n }\n if(blockMore>0.6 && targetPlayer>=0)\n return Move.NewPlayerActionMove(index(), cardIndex, targetPlayer);\n }\n //Fix (Rockfall)\n if(canRockfall) {\n int globalIndex = 0;\n double maxH = 0.0;\n Position bp = new Position(0,0);\n //Find best path to place;\n Board board = game().board().copy();\n for( Map.Entry<Integer, Card> d : destroyCards.entrySet()) {\n int index = d.getKey();\n Set<Position> destroyable = game().board().getDestroyable();\n for (Position h : destroyable) {\n Board simulated = board.simulateRemoveCardAt(h.x, h.y);\n// System.out.println(path.type());\n double cH = getClosest(simulated);\n if(maxH<cH) {\n bp=h;\n globalIndex = index;\n maxH = cH;\n }\n }\n }\n oldBoard = game().board().copy();\n if(maxH>0)\n return Move.NewRockfallMove(index(), globalIndex, bp.x, bp.y);\n }\n //See map\n\n //Conserve (Find the best card to discard)\n\n //calculate the heuristics and adjust accordingly,\n //choose between playing a card or discarding.\n } else if (role() == Role.SABOTEUR) {\n //See map\n if(canSee && !goldFound) {\n int selection=0;\n //specific for saboteurs\n double maxProb=goldProb[0];\n for(int i=0; i<3; i++) {\n if(goldProb[i]>maxProb) {\n maxProb = goldProb[i];\n selection=i;\n }\n }\n Move look = Move.NewMapMove(index(), mapIndex, Board.GoalPosition.TOP);\n switch(selection) {\n case 0:\n look = Move.NewMapMove(index(), mapIndex, Board.GoalPosition.TOP);\n break;\n case 1:\n look = Move.NewMapMove(index(), mapIndex, Board.GoalPosition.MIDDLE);\n break;\n case 2:\n look = Move.NewMapMove(index(), mapIndex, Board.GoalPosition.BOTTOM);\n break;\n }\n return look;\n }\n //Path\n if(canMove) {\n int globalIndex = 0;\n double maxH = 0.0;\n Position bp = new Position(0,0);\n boolean rotate = false;\n //Find best path to place;\n Board board = game().board().copy();\n double oldH = getClosestSabotage(board);\n for( Map.Entry<Integer, Card> p : pathCards.entrySet()) {\n int index = p.getKey();\n Card path = p.getValue();\n ((PathCard)path).setRotated(false);\n Set<Position> placeable = game().board().getPlaceable((PathCard)path);\n for (Position h : placeable) {\n Board simulated = board.simulatePlaceCardAt((PathCard)path, h.x, h.y);\n// System.out.println(path.type());\n double cH = getClosestSabotage(simulated);\n if(maxH<cH) {\n bp=h;\n globalIndex = index;\n maxH = cH;\n rotate=false;\n }\n }\n ((PathCard) path).setRotated(true);\n placeable = game().board().getPlaceable((PathCard)path);\n for (Position h : placeable) {\n Board simulated = board.simulatePlaceCardAt((PathCard)path, h.x, h.y);\n// System.out.println(simulated);\n double cH = getClosestSabotage(simulated);\n if(maxH<cH) {\n bp=h;\n globalIndex = index;\n rotate=true;\n maxH = cH;\n }\n }\n }\n oldBoard = game().board().copy();\n if(maxH>0 && abs(maxH-oldH)>0.01)\n return Move.NewPathMove(index(), globalIndex, bp.x, bp.y, rotate);\n }\n //Unblock Friend\n if(canRepair) {\n double blockMore = 0.0;\n int targetPlayer = -1;\n int cardIndex = 0;\n for(int i=0; i<numPlayers; i++) {\n if(i == myTurn) {\n for(Map.Entry<Integer, Card> r : repairCards.entrySet()) {\n int index = r.getKey();\n PlayerActionCard repair = (PlayerActionCard) r.getValue();\n if (game().playerAt(myTurn).isRepairable(repair.effects())) {\n return Move.NewPlayerActionMove(index(),index, index());\n }\n }\n }\n else if(i!=myTurn) {\n for(Map.Entry<Integer, Card> r : repairCards.entrySet()) {\n int index = r.getKey();\n PlayerActionCard repair = (PlayerActionCard) r.getValue();\n if (game().playerAt(i).isRepairable(repair.effects())) {\n //calculate the should i repair? function\n double shouldIBlockMore = (1-Probability[i])+(0.03*(numPlayers-i));\n if(blockMore<shouldIBlockMore) {\n blockMore = shouldIBlockMore;\n targetPlayer = i;\n cardIndex = index;\n }\n }\n }\n }\n }\n if(blockMore>0.75 && targetPlayer>=0)\n return Move.NewPlayerActionMove(index(), cardIndex, targetPlayer);\n }\n //Block Enemy\n if(canBlock) {\n double blockMore = 0.0;\n int targetPlayer = -1;\n int cardIndex = 0;\n for (int i = 0; i < numPlayers; i++) {\n if (i != myTurn) {\n for (Map.Entry<Integer, Card> b : blockCards.entrySet()) {\n int index = b.getKey();\n PlayerActionCard block = (PlayerActionCard) b.getValue();\n if (game().playerAt(i).isSabotageable(block.effects()[0])) {\n //calculate the should i repair? function\n double shouldIBlockMore = (Probability[i]) * ((Probability[i]) + 0.2 * (numPlayers - i));\n if (blockMore < shouldIBlockMore) {\n blockMore = shouldIBlockMore;\n targetPlayer = i;\n cardIndex = index;\n }\n }\n }\n }\n }\n if(blockMore>0.6 && targetPlayer>=0)\n return Move.NewPlayerActionMove(index(), cardIndex, targetPlayer);\n }\n //Sabotage (Rockfall)\n if(canRockfall) {\n int globalIndex = 0;\n double maxH = 0;\n Position bp = new Position(0,0);\n //Find best path to place;\n Board board = game().board().copy();\n for( Map.Entry<Integer, Card> d : destroyCards.entrySet()) {\n int index = d.getKey();\n Set<Position> destroyable = game().board().getDestroyable();\n for (Position h : destroyable) {\n Board simulated = board.simulateRemoveCardAt(h.x, h.y);\n// System.out.println(path.type());\n double cH = getClosestSabotage(simulated);\n if(maxH<cH) {\n bp=h;\n globalIndex = index;\n maxH = cH;\n }\n }\n }\n oldBoard = game().board().copy();\n if(maxH>0)\n return Move.NewRockfallMove(index(), globalIndex, bp.x, bp.y);\n }\n //Conserve (Find the best card to discard\n\n //calculate the heuristics and adjust accordingly,\n //choose between playing a card or discarding.\n }\n return discardMoves.get(0);\n }",
"private WeightedSampler<String> getPossibleLethalActions(int team) {\n if (this.b.getCurrentPlayerTurn() != team || this.b.getWinner() != 0) {\n return null;\n }\n Player p = this.b.getPlayer(team);\n WeightedSampler<String> poss = new WeightedOrderedSampler<>();\n List<Minion> minions = this.b.getMinions(team, false, true).collect(Collectors.toList());\n for (Minion m : minions) {\n if (p.canUnleashCard(m)) {\n double totalWeight = UNLEASH_TOTAL_WEIGHT + UNLEASH_WEIGHT_PER_PRESENCE * m.getTotalEffectValueOf(e -> e.getPresenceValue(5));\n List<List<List<TargetList<?>>>> targetSearchSpace = new LinkedList<>();\n this.getPossibleListTargets(m.getUnleashTargetingSchemes(), new LinkedList<>(), targetSearchSpace);\n if (targetSearchSpace.isEmpty()) {\n targetSearchSpace.add(List.of());\n }\n for (List<List<TargetList<?>>> targets : targetSearchSpace) {\n poss.add(new UnleashMinionAction(p, m, targets).toString().intern(), totalWeight / targetSearchSpace.size());\n }\n }\n }\n if (this.b.getMinions(team * -1, false, true).anyMatch(m -> m.finalStats.get(Stat.WARD) > 0)) {\n // find ways to break through the wards\n for (Minion m : minions) {\n if (m.canAttack()) {\n double totalWeight = ATTACK_TOTAL_WEIGHT + ATTACK_WEIGHT_MULTIPLIER * m.finalStats.get(Stat.ATTACK);\n List<Minion> searchSpace = m.getAttackableTargets().collect(Collectors.toList());\n double weight = totalWeight / searchSpace.size();\n for (Minion target : searchSpace) {\n double overkillMultiplier = Math.pow(ATTACK_WEIGHT_OVERKILL_PENALTY, Math.max(0, m.finalStats.get(Stat.ATTACK) - target.health));\n poss.add(new OrderAttackAction(m, target).toString().intern(), overkillMultiplier * weight);\n }\n }\n }\n } else {\n // just go face\n this.b.getPlayer(team * -1).getLeader().ifPresent(l -> {\n for (Minion m : minions) {\n if (m.canAttack(l)) {\n double totalWeight = ATTACK_TOTAL_WEIGHT + ATTACK_WEIGHT_MULTIPLIER * m.finalStats.get(Stat.ATTACK);\n poss.add(new OrderAttackAction(m, l).toString().intern(), totalWeight);\n }\n }\n });\n }\n poss.add(new EndTurnAction(team).toString().intern(), END_TURN_WEIGHT);\n return poss;\n }",
"void dropcard3()\n{\nfor (int i=0;i<numberofhc()-1;i++)\n\t{\n\tint judgeA = (getcard(i)-3)/4;\n\t\n\tif(judgeA==12)\n\t\t{\n\t\tif(getcard(i)==54 && getcard(i+1)==54) //if the player has 2 SA, he/she can drop both\n\t\t\t{\n\t\t\tremove(i);\n\t\t\tremove(i);\n\t\t\ti--;\n\t\t\t}\n\t\telse if(getcard(i)==51 && getcard(i+1)==52) //if the player has CA and DA, he/she can drop both\n\t\t\t{\n\t\t\tremove(i);\n\t\t\tremove(i);\n\t\t\ti--;\n\t\t\t}\n\t\telse if(getcard(i)==51 && getcard(i+1)==53) //if the player has CA and HA, he/she can drop both\n\t\t\t{\n\t\t\tremove(i);\n\t\t\tremove(i);\n\t\t\ti--;\n\t\t\t}\n\t\telse if(getcard(i)==52 && getcard(i+1)==53) //if the player has DA and HA, he/she can drop both\n\t\t\t{\n\t\t\tremove(i);\n\t\t\tremove(i);\n\t\t\ti--;\n\t\t\t}\n\t\t}\n\telse\n\t\t{if((((getcard(i))-3)/4)==(((getcard(i+1))-3)/4))\n\t\t\t{remove(i);\n\t\t\tremove(i);\n\t\t\ti--;}}\n\t}\n\t}",
"public Play advise(Hand myHand, Card upCard){\r\n //initial values of card sin the hand\r\n Card cardOne = myHand.getCard(0);\r\n Card cardTwo = myHand.getCard(1);\r\n //dealer card value\r\n int secondValue = upCard.value();\r\n //array of the advices\r\n Play[] playArray;\r\n //the actual advice\r\n Play advice;\r\n \r\n if(myHand.size() > 2)\r\n {\r\n Integer total = myHand.getValue();\r\n playArray = totalTable.get(total);\r\n advice = playArray[secondValue];\r\n }else{\r\n if (myHand.isPair()) {\r\n //lookup is value since both cards are the same\r\n //pair hash table\r\n Integer value = cardOne.value();\r\n playArray = pairTable.get(value);\r\n advice = playArray[secondValue];\r\n } else if (cardOne.isAce()) {\r\n //ace hash table\r\n //key is value because its other card besides ace\r\n Integer value = cardTwo.value();\r\n playArray = aceTable.get(value);\r\n advice = playArray[secondValue];\r\n } else if (cardTwo.isAce()) {\r\n //ace hash table\r\n //key is value because its other card besides ace\r\n Integer value = cardOne.value();\r\n playArray = aceTable.get(value);\r\n advice = playArray[secondValue];\r\n } else {\r\n //total number hash table\r\n //key is total since its the amount\r\n Integer total = myHand.getValue();\r\n playArray = totalTable.get(total);\r\n advice = playArray[secondValue];\r\n }\r\n }\r\n return advice;\r\n }",
"@Test\r\n public void testPlayer_getBoldStrategyCard_higherLast_wild_wd4() {\n player2 = new Player(\"Player Two\", true);\r\n Hand hand = new Hand();\r\n player2.setHand(hand.getAllCards());\r\n player2.getHand().addCard(wild);\r\n assertTrue(player2.getBoldStrategyCard(yellowThree, yellowThree.getColor()).equals(wild));\r\n\r\n player2.getHand().discard(wild);\r\n player2.getHand().addCard(wildDrawFour);\r\n assertTrue(player2.getBoldStrategyCard(yellowThree, yellowThree.getColor()).equals(wildDrawFour));\r\n }",
"private void makeTrips() {\n int highestThree, firstKicker, secondKicker;\n highestThree = firstKicker = secondKicker = -1;\n for (Integer key : this.cardOccurrence.keySet()) {\n int value = this.cardOccurrence.get(key);\n if(value == 3 && value > highestThree)\n highestThree = key;\n else {\n if(key > firstKicker) {\n secondKicker = firstKicker;\n firstKicker = key;\n }\n else if(key > secondKicker)\n secondKicker = key;\n }\n }\n\n //Go through Cards ArrayList to get the actual cards pertaining\n ArrayList<String> validHand = new ArrayList<>();\n for(int i = 0; i < this.cards.size(); i++) {\n Card c = this.cards.get(i);\n if(c.sameValue(highestThree))\n validHand.add(c.toString());\n else if(c.sameValue(firstKicker) || c.sameValue(secondKicker))\n validHand.add(c.toString());\n }\n this.cardHand = new CardHand(validHand.toArray(new String[0]));\n }",
"static int getComputerCard(Card playerCard) {\n //The computer will iterate through different possible cards it might choose to play.\n //This represents a chosen card at any given time.\n Card possibleCard = null;\n //The position in the computer's hand where the possibleCard is stored.\n int cardPosition = 0;\n //True if the computer has a card of higher value than the player's.\n boolean hasHigherCard = false;\n //Iterate through the computer's hand, trying to find a card higher than the player's\n for (int i = 0; i < highCardGame.getHand(0).getNumCards(); i++) {\n if (playerCard.compareTo(highCardGame.getHand(0).inspectCard(i)) < 0) {\n //The computer has a higher card.\n if (possibleCard != null) {\n //If this card is lower than the possible card, but can still beat the player, then replace possible card.\n if (possibleCard.compareTo(highCardGame.getHand(0).inspectCard(i)) > 0) {\n possibleCard = new Card(highCardGame.getHand(0).inspectCard(i));\n cardPosition = i;\n }\n } else {\n //If the computer has not yet chosen a possible card, choose this one.\n possibleCard = new Card(highCardGame.getHand(0).inspectCard(i));\n hasHigherCard = true;\n cardPosition = i;\n }\n }\n }\n if (!hasHigherCard) {\n //If the computer does not have a card that can beat the player, then feed the lowest card\n //that the computer has to the player.\n for (int i = 0; i < highCardGame.getHand(0).getNumCards(); i++)\n if (playerCard.compareTo(highCardGame.getHand(0).inspectCard(i)) >= 0) {\n if (possibleCard != null) {\n if (possibleCard.compareTo(highCardGame.getHand(0).inspectCard(i)) > 0) {\n possibleCard = new Card(highCardGame.getHand(0).inspectCard(i));\n cardPosition = i;\n }\n } else {\n possibleCard = highCardGame.getHand(0).inspectCard(i);\n cardPosition = i;\n }\n }\n }\n return cardPosition;\n }",
"public static void warDriver(Deck hand1,Deck hand2){\n forbiddenCase = 0;\n //while hands do not have 0 cards, keep playing\n while((!hand1.isEmpty())||(!hand2.isEmpty())){\n //deals cards for player 1 and 2\n Card cp1 = hand1.deal();\n Card cp2 = hand2.deal();\n System.out.println(\"Player 1 hand: \" + cp1);\n System.out.println(\"Player 2 hand: \" + cp2);\n options();\n //if ranks are the same, call tie function and battle\n if(cp1.getRank() == cp2.getRank()){\n addUp.add(cp1); //add 2 cards\n addUp.add(cp2);\n tie(cp1, cp2);\n if(forbiddenCase == 1){\n drive = false;\n }\n }else{\n //if player 1 card is greater than player 2 card\n if(cp1.getRank() > cp2.getRank()){\n System.out.println(\"Player 1 wins\");\n addUp.add(cp1);\n addUp.add(cp2);\n hand1.toBottom(addUp);\n\n System.out.println(\"Player 1 cards: \" + hand1.cardsLeft());\n System.out.println(\"Player 2 cards: \"+ hand2.cardsLeft()+\"\\n\");\n\n }\n else{\n //if player 2 card is greater than player 1 card\n System.out.println(\"Player 2 wins\");\n addUp.add(cp1);\n addUp.add(cp2);\n hand2.toBottom(addUp);\n\n System.out.println(\"Player 1 cards: \" + hand1.cardsLeft());\n System.out.println(\"Player 2 cards: \"+ hand2.cardsLeft()+\"\\n\");\n\n }\n }\n\n }\n\n }",
"private WeightedSampler<String> getPossibleActions(int team) {\n if (this.b.getCurrentPlayerTurn() != team || this.b.getWinner() != 0) {\n return null;\n }\n Player p = this.b.getPlayer(team);\n WeightedSampler<String> poss = new WeightedRandomSampler<>();\n // playing cards & selecting targets\n List<Card> hand = p.getHand();\n for (Card c : hand) {\n if (p.canPlayCard(c)) {\n double totalWeight = PLAY_CARD_TOTAL_WEIGHT + PLAY_CARD_COST_WEIGHT_MULTIPLIER * c.finalStats.get(Stat.COST);\n List<List<List<TargetList<?>>>> targetSearchSpace = new LinkedList<>();\n this.getPossibleListTargets(c.getBattlecryTargetingSchemes(), new LinkedList<>(), targetSearchSpace);\n if (targetSearchSpace.isEmpty()) {\n targetSearchSpace.add(List.of());\n }\n if (c instanceof BoardObject) {\n double weightPerPos = totalWeight / (p.getPlayArea().size() + 1);\n // rip my branching factor lol\n for (int playPos = 0; playPos <= p.getPlayArea().size(); playPos++) {\n for (List<List<TargetList<?>>> targets : targetSearchSpace) {\n poss.add(new PlayCardAction(p, c, playPos, targets).toString().intern(), weightPerPos / targetSearchSpace.size());\n }\n }\n } else {\n // spells don't require positioning\n for (List<List<TargetList<?>>> targets : targetSearchSpace) {\n poss.add(new PlayCardAction(p, c, 0, targets).toString().intern(), totalWeight / targetSearchSpace.size());\n }\n }\n }\n }\n this.b.getMinions(team, false, true).forEachOrdered(m -> {\n // unleashing cards & selecting targets\n if (p.canUnleashCard(m)) {\n List<List<List<TargetList<?>>>> targetSearchSpace = new LinkedList<>();\n this.getPossibleListTargets(m.getUnleashTargetingSchemes(), new LinkedList<>(), targetSearchSpace);\n if (targetSearchSpace.isEmpty()) {\n targetSearchSpace.add(List.of());\n }\n for (List<List<TargetList<?>>> targets : targetSearchSpace) {\n poss.add(new UnleashMinionAction(p, m, targets).toString().intern(), UNLEASH_TOTAL_WEIGHT / targetSearchSpace.size());\n }\n }\n // minion attack\n if (m.canAttack()) {\n double totalWeight = ATTACK_TOTAL_WEIGHT + ATTACK_WEIGHT_MULTIPLIER * m.finalStats.get(Stat.ATTACK);\n double weight = totalWeight / m.getAttackableTargets().count();\n m.getAttackableTargets().forEachOrdered(target -> {\n double bonus = target instanceof Leader ? ATTACK_TARGET_LEADER_MULTIPLIER : 1;\n double overkillMultiplier = Math.pow(ATTACK_WEIGHT_OVERKILL_PENALTY, Math.max(0, m.finalStats.get(Stat.ATTACK) - target.health));\n poss.add(new OrderAttackAction(m, target).toString().intern(), overkillMultiplier * bonus * weight);\n });\n }\n });\n // ending turn\n poss.add(new EndTurnAction(team).toString().intern(), END_TURN_WEIGHT);\n return poss;\n }",
"public static Deck tie(Card cp1, Card cp2){\n //end if not enough cards, player 2 wins\n forbiddenCase = 0;\n if (hand1.cardsLeft() < 4){\n System.out.println();\n System.out.println(\"Player 1 cards: \" + hand1.cardsLeft());\n System.out.println(\"Player 2 cards: \" + hand2.cardsLeft()+\"\\n\");\n System.out.println(\"Not enough cards, Player 1 loses\");\n forbiddenCase = 1;\n outcome = 2;\n outcomes();\n return hand2;\n }\n //player 1 wins due to lack of cards\n else if (hand2.cardsLeft() < 4){\n System.out.println();\n System.out.println(\"Player 1 cards: \" + hand1.cardsLeft());\n System.out.println(\"Player 2 cards: \" + hand2.cardsLeft()+\"\\n\");\n System.out.println(\"Not enough cards, Player 2 loses\");\n forbiddenCase = 1;\n outcome = 1;\n outcomes();\n return hand1;\n }//tie\n else if(hand1.cardsLeft() < 4 && hand2.cardsLeft() < 4){\n System.out.println();\n System.out.println(\"Player 1 cards: \" + hand1.cardsLeft());\n System.out.println(\"Player 2 cards: \" + hand2.cardsLeft()+\"\\n\");\n System.out.println(\"No winner\");\n forbiddenCase = 1;\n outcome = 3;\n outcomes();\n }\n //add 3 cards\n\n\n for(int i = 1; i < 4; i++){\n System.out.println(\"You play card: ??? of ???\");\n\t System.out.println(\"Player two plays card: ??? of ???\");\n\t addUp.add(hand1.deal());\n addUp.add(hand2.deal());\n }\n\n //deal the 4th cards face up\n cp1 = hand1.deal();\n cp2 = hand2.deal();\n System.out.println(\"Player 1 hand: \" + cp1);\n System.out.println(\"Player 2 hand: \" + cp2);\n //add cards to the pile = 2 cards\n addUp.add(cp1);\n addUp.add(cp2);\n\n //if tie, try again\n if(cp1.getRank() == cp2.getRank()){\n tie(cp1,cp2);\n //player 1 win\n }else if(cp1.getRank() > cp2.getRank()){\n System.out.println(\"Player 1 wins\");\n //takes all the cards\n hand1.toBottom(addUp);//technically you win back your own cards then +5\n System.out.println(\"Player 1 cards: \" + hand1.cardsLeft());\n System.out.println(\"Player 2 cards: \" + hand2.cardsLeft()+\"\\n\");\n return hand1;\n }else//player 2 win\n System.out.println(\"Player 2 wins\");\n hand2.toBottom(addUp);\n System.out.println(\"Player 1 cards: \" + hand1.cardsLeft());\n System.out.println(\"Player 2 cards: \" + hand2.cardsLeft()+\"\\n\");\n return hand2;\n }",
"public boolean CheckForUnwinnableCondition(){\n int humanSize = GetSizeOfHumanHand();\n int computerSize = GetSizeOfComputerHand();\n\n for(int i = 0; i < humanSize; i++) {\n //Human can play a card\n String card = handHuman.get(i);\n\n String firstLetter = Character.toString(card.charAt(0));\n String topFirstLetter = Character.toString(topCard.charAt(0));\n\n if (topCard.contains(\"8\")) {\n //Can play any card ontop to determine suite\n return true;\n }\n\n if (card.contains(\"8\")) {\n //valid because 8s are wild cards, human can place it\n return true;\n }\n\n //the cards match in suite, doesn't matter what it is\n else if (firstLetter.equals(topFirstLetter)) {\n return true;\n }\n\n else {\n if (topFirstLetter.equals(\"c\")) {\n String temp = topCard.substring(5, topCard.length());\n\n if (card.contains(temp)) {\n return true;\n }\n\n } else if (topFirstLetter.equals(\"h\")) {\n String temp = topCard.substring(6, topCard.length());\n\n if (card.contains(temp)) {\n return true;\n }\n\n } else if (topFirstLetter.equals(\"d\")) {\n String temp = topCard.substring(8, topCard.length());\n\n if (card.contains(temp)) {\n return true;\n }\n\n } else if (topFirstLetter.equals(\"s\")) {\n String temp = topCard.substring(6, topCard.length());\n\n if (card.contains(temp)) {\n return true;\n }\n }\n }\n }\n\n for(int i = 0; i < computerSize; i++){\n //Human can play a card\n String card = handComputer.get(i);\n\n String firstLetter = Character.toString(card.charAt(0));\n String topFirstLetter = Character.toString(topCard.charAt(0));\n\n if (topCard.contains(\"8\")) {\n //Can play any card ontop to determine suite\n return true;\n }\n\n if (card.contains(\"8\")) {\n //valid because 8s are wild cards, human can place it\n return true;\n }\n\n //the cards match in suite, doesn't matter what it is\n else if (firstLetter.equals(topFirstLetter)) {\n return true;\n }\n\n else {\n if (topFirstLetter.equals(\"c\")) {\n String temp = topCard.substring(5, topCard.length());\n\n if (card.contains(temp)) {\n return true;\n }\n\n } else if (topFirstLetter.equals(\"h\")) {\n String temp = topCard.substring(6, topCard.length());\n\n if (card.contains(temp)) {\n return true;\n }\n\n } else if (topFirstLetter.equals(\"d\")) {\n String temp = topCard.substring(8, topCard.length());\n\n if (card.contains(temp)) {\n return true;\n }\n\n } else if (topFirstLetter.equals(\"s\")) {\n String temp = topCard.substring(6, topCard.length());\n\n if (card.contains(temp)) {\n return true;\n }\n }\n }\n }\n\n //Human and computer can't play a card\n return false;\n }",
"public int trickWinner(){\n Card.NUMBER one = player1Play.getValue();\n Card.NUMBER two = player2Play.getValue();\n Card.NUMBER three = player3Play.getValue();\n Card.NUMBER four = player4Play.getValue();\n Card.SUIT oneSuit = player1Play.getSuit();\n Card.SUIT twoSuit = player2Play.getSuit();\n Card.SUIT threeSuit = player3Play.getSuit();\n Card.SUIT fourSuit = player4Play.getSuit();\n int[] value = new int[4];\n value[0] = Card.getValsVal(one, oneSuit, currentTrumpSuit);\n value[1] = Card.getValsVal(two, twoSuit, currentTrumpSuit);\n value[2] = Card.getValsVal(three, threeSuit, currentTrumpSuit);\n value[3] = Card.getValsVal(four, fourSuit, currentTrumpSuit);\n if(player1Play.getSuit() == firstPlayedSuit && firstPlayedSuit != currentTrumpSuit && value[0] != 7){\n value[0] += 10;\n }\n if(player2Play.getSuit() == firstPlayedSuit && firstPlayedSuit != currentTrumpSuit && value[0] != 7){\n value[1] += 10;\n }\n if(player3Play.getSuit() == firstPlayedSuit && firstPlayedSuit != currentTrumpSuit && value[0] != 7){\n value[2] += 10;\n }\n if(player4Play.getSuit() == firstPlayedSuit && firstPlayedSuit != currentTrumpSuit && value[0] != 7){\n value[3] += 10;\n }\n if(player1Play.getSuit() == currentTrumpSuit || value[0] == 7){\n value[0] += 20;\n }\n if(player2Play.getSuit() == currentTrumpSuit || value[1] == 7){\n value[1] += 20;\n }\n if(player3Play.getSuit() == currentTrumpSuit || value[2] == 7){\n value[2] += 20;\n }\n if(player4Play.getSuit() == currentTrumpSuit || value[3] == 7){\n value[3] += 20;\n }\n int winner = 0;\n int winVal = 0;\n for(int i = 0; i < 4; i++){\n if(value[i] > winVal){\n winVal = value[i];\n winner = i;\n }\n }\n return winner;\n }",
"@Test\n public void play_HighCardVsHighCard() throws Exception {\n Hand hand1 = new Hand();\n hand1.addCard(new Card(Card.SUIT_CLUBS, Card.CARD_3));\n hand1.addCard(new Card(Card.SUIT_SPADES, Card.CARD_6));\n hand1.addCard(new Card(Card.SUIT_HEARTS, Card.CARD_7));\n hand1.addCard(new Card(Card.SUIT_DIAMONDS, Card.CARD_9));\n hand1.addCard(new Card(Card.SUIT_HEARTS, Card.CARD_10));\n Hand hand2 = new Hand();\n hand2.addCard(new Card(Card.SUIT_DIAMONDS, Card.CARD_3));\n hand2.addCard(new Card(Card.SUIT_DIAMONDS, Card.CARD_6));\n hand2.addCard(new Card(Card.SUIT_CLUBS, Card.CARD_7));\n hand2.addCard(new Card(Card.SUIT_SPADES, Card.CARD_9));\n hand2.addCard(new Card(Card.SUIT_CLUBS, Card.CARD_JACK));\n assertEquals(hand2, FiveCardDraw.play(hand1, hand2));\n }",
"private void yourturn() {\n if (whosturn != 3) {\n whosturn = 3;\n displayTable();\n }\n\n // TODO mega duplication\n int top = 0;\n // testing is player has a card they can play\n if (pile.notEmpty()) {\n boolean canplay = false;\n if (hand.getCard(0) == null) { // if player only has card on the table\n if (hand.isFaceUp()) // if player has faceup card on the table\n {\n for (int n = 0; n < 3; n++) {\n if (hand.getFaceUp(n) != null) {\n if (nine && pile.topValue() == 9) {\n top = 0;\n for (int i = 0; i < 52; i++) {\n if (pile.get(i) == null) {\n canplay = true;\n break;\n }\n if (pile.get(i).getValue() == 9) top++;\n else break;\n }\n }\n if (canplay) break;\n if (seven\n && pile.get(top).getValue() == 7\n && hand.getFaceUp(n).getValue() < 7) {\n canplay = true;\n break;\n } else if (hand.getFaceUp(n).getValue() == 2\n || hand.getFaceUp(n).getValue() == 10) {\n canplay = true;\n break;\n } else if (nine && hand.getFaceUp(n).getValue() == 9) {\n canplay = true;\n break;\n } else if (!seven || pile.get(top).getValue() != 7) {\n if (pile.get(top).getValue() <= hand.getFaceUp(n).getValue()) {\n canplay = true;\n break;\n }\n }\n }\n }\n } else // if player only has facedown cards\n canplay = true;\n } else {\n for (int n = 0; n < hand.length() - 1; n++) {\n if (hand.getCard(n) == null) break;\n if (nine && pile.topValue() == 9) {\n top = 0;\n for (int i = 0; i < 52; i++) {\n if (pile.get(i) == null) {\n canplay = true;\n break;\n }\n if (pile.get(i).getValue() == 9) top++;\n else break;\n }\n }\n if (canplay) break;\n if (hand.getCard(n).getValue() == 2 || hand.getCard(n).getValue() == 10) {\n canplay = true;\n break;\n }\n if (nine && hand.getCard(n).getValue() == 9) {\n canplay = true;\n break;\n }\n if (seven && pile.get(top).getValue() == 7 && hand.getCard(n).getValue() < 7) {\n canplay = true;\n break;\n } else if (seven != true || pile.get(top).getValue() != 7) {\n if (pile.get(top).getValue() <= hand.getCard(n).getValue()) {\n canplay = true;\n break;\n }\n }\n }\n }\n if (canplay) {\n // sh.addMsg(\"Its Your Turn\");\n sh.setmyTurn(true);\n } else { // cant play then must pick up the pile\n sh.addMsg(\n \"The card played was a \"\n + pile.top().getStringValue()\n + \" you had to pick up the pile. BLAOW\");\n pile.moveToHand(hand);\n sendCommand(\"turn:pickup:\");\n nextTurn();\n displayTable();\n }\n } else {\n // sh.addMsg(\"Its Your Turn\");\n sh.setmyTurn(true);\n }\n }",
"public void makeHigh() {\n Collections.sort(this.cards, Card.COMPARE_BY_VALUE);\n ArrayList<String> validHand = new ArrayList<>();\n for(int i = this.cards.size() - 5; i < this.cards.size(); i++)\n validHand.add(this.cards.get(i).toString());\n this.cardHand = new CardHand(validHand.toArray(new String[0]));\n }",
"public void applyCard(Card card, String user){\n if (user.equals(\"player\")){\n if (card == null){\n //System.out.println(\"No card in this slot\");\n //System.out.println(\"Size of tempDeck: \" + playerTempDeck.size());\n } else{\n if(playerMana >= card.getManaCost()){\n updateMana(\"player\", -card.getManaCost());\n //Check if has enough gold, too. Make free cards have a worth of gold = 0.\n //playerGoldAmount -= card.getGoldCost(); //------------------------------------------------Implement this once it can be tested.\n\n if(card.getEffect().contains(\"A\")){ //attack\n //looks long, but it finds the index of the Attack symbol (\"A\") and adds one to it, so it'll find the value 5 if the input is \"A5\", anywhere on the string.\n //Allows for things such as \"A4D1\" in theory.\n updateHealth(\"enemy\", -Character.getNumericValue(card.getEffect().charAt(card.getEffect().indexOf(\"A\") + 1)), true);\n }\n if(card.getEffect().contains(\"D\")) { //Defend\n updateDefence(\"player\", Character.getNumericValue(card.getEffect().charAt(card.getEffect().indexOf(\"D\") + 1)));\n }\n\n //Discard the card just used, put into discarded pile.\n Integer index = playerHand.indexOf(card);\n discardedCards.add(card);\n //System.out.println(\"Current index is: \" + index);\n //System.out.println(\"At that index was: \" + playerHand.get(index));\n playerHand.set(index, null);\n\n\n //System.out.println(\"The deck is currently: \" + playerHand.toString());\n //playerHand.remove(card); //Doesn't work, shortens the size all together.\n drawCard(index);\n }\n }\n }\n\n else if (user.equals(\"enemy\")){\n if(enemyMana >= card.getManaCost()){\n updateMana(\"enemy\", -card.getManaCost());\n if(card.getEffect().contains(\"A\")){\n updateHealth(\"player\", -Character.getNumericValue(card.getEffect().charAt(card.getEffect().indexOf(\"A\") + 1)), true);\n }\n if(card.getEffect().contains(\"D\")) {\n updateDefence(\"enemy\", Character.getNumericValue(card.getEffect().charAt(card.getEffect().indexOf(\"D\") + 1)));\n }\n }\n }\n }",
"@Override\n void pickCard() {\n\n boolean suitFound = false; // true if player has the suit\n Card cardToBeat; // strongest card on pile\n Card pickedCard = null; // card to throw\n ArrayList<Card> cardsToChooseFrom = new ArrayList<Card>();\n char trump = pitchTable.getTrump();\n\n // find the strongest card on pile\n cardToBeat = pitchTable.getCardToBeat();\n\n // if pile is empty\n if (cardToBeat == null){\n // pick the strongest non trump card\n for (Card card : hand)\n if (card.suit != trump)\n if ((pickedCard == null) || (pickedCard.rank < card.rank))\n pickedCard = card;\n\n // if non trump card not found (means all cards are trump)\n // then pick the strongest card\n if (pickedCard == null)\n for (Card card : hand)\n if ((pickedCard == null) || (pickedCard.rank < card.rank))\n pickedCard = card;\n }\n else { // means leading suit is set already\n // check if player has suit\n for (Card card : hand) {\n if (card.suit == pitchTable.getLeadingSuit())\n suitFound = true;\n }\n\n // if player does not have suit he can play any card\n if (!suitFound)\n cardsToChooseFrom = hand;\n else // if player has suit then cardsToChooseFrom = allowed cards\n for (Card card : hand)\n if ((card.suit == pitchTable.getLeadingSuit()) ||\n card.suit == pitchTable.getTrump())\n cardsToChooseFrom.add(card);\n }\n\n // try to take the trick with the lowest winning card\n // if no winning card then throw the lowest you have\n\n // (trying to take the trick)\n // if card not picked yet\n // then find the lowest card that has the suit and is higher than cardToBeat\n if (pickedCard == null)\n for (Card card : cardsToChooseFrom)\n if ((cardToBeat.suit == card.suit) && (cardToBeat.rank < card.rank))\n if ((pickedCard == null) || (pickedCard.rank > card.rank))\n pickedCard = card;\n\n // (trying to take the trick)\n // if card not picked yet and cardToBeat is not trump\n // then find the lowest trump\n if ((pickedCard == null) && (cardToBeat.suit != trump))\n for (Card card : cardsToChooseFrom)\n if (card.suit == trump)\n if ((pickedCard == null) || (pickedCard.rank > card.rank))\n pickedCard = card;\n\n // (trying to throw the lowest)\n // if still no card picked (means player cannot take the trick)\n // then throw the lowest non trump\n if (pickedCard == null)\n for (Card card : cardsToChooseFrom)\n if (card.suit != trump)\n if ((pickedCard == null) || (pickedCard.rank > card.rank))\n pickedCard = card;\n\n // (trying to throw the lowest)\n // if still no card picked (means all allowed cards are trump)\n // then throw the lowest trump\n if (pickedCard == null)\n for (Card card : cardsToChooseFrom)\n if ((pickedCard == null) || (pickedCard.rank > card.rank))\n pickedCard = card;\n\n if (pickedCard == null)\n System.out.println(\"Error: picked card still null\");\n\n pitchTable.putOnPile(pickedCard);\n hand.remove(pickedCard);\n\n }",
"public void challengeMove(){\n int maxOutcome = -1;\n int returnIndex = -1;\n Hole lastHole;\n Hole selectedHole;\n ArrayList<Hole> availableHoles = availableMoves(nextToPlay);\n for(int i = 0; i < availableHoles.size(); i++){\n selectedHole = availableHoles.get(i);\n lastHole = holes[(selectedHole.getHoleIndex() + selectedHole.getNumberOfKoorgools() - 1) % 18];\n if(lastHole.getOwner() != nextToPlay){\n int numOfKorgools = lastHole.getNumberOfKoorgools() +1;\n if(numOfKorgools == 3 && !nextToPlay.hasTuz()){\n int otherTuzIndex = getPlayerTuz(Side.WHITE);\n if(otherTuzIndex == -1 || ((otherTuzIndex + 9) != lastHole.getHoleIndex())) {\n redistribute(selectedHole.getHoleIndex());\n return;\n }\n redistribute(selectedHole.getHoleIndex());\n return;\n }\n if(numOfKorgools % 2 == 0 && numOfKorgools > maxOutcome){\n maxOutcome = numOfKorgools;\n returnIndex = selectedHole.getHoleIndex();\n }\n }\n }\n if(returnIndex <= -1){\n randomMove();\n return;\n }\n redistribute(returnIndex);\n }",
"private Hand getStraight(Hand handToCheck){\n\t\tHand hand = new FiveCardHand(handToCheck); //Make copy of the object so original doesn't get modified\n\t\tlog.debug(\"getStraight(hand = \"+hand+\")\");\n\t\tif(hand == null){\n\t\t\tlog.debug(\"Hand was null. Returning null\");\n\t\t\treturn null;\n\t\t}\n\t\tArrayList<Card> cards = hand.getCards();\n\t\tif(cards == null){\n\t\t\tlog.debug(\"The ArrayList<Card> inside the Hand Object was NULL. Returning null\");\n\t\t\treturn null;\n\t\t}\n\t\tlog.trace(\"Number of cards in Hand: \"+cards.size());\n\t\tSet<CardNumber> set = new HashSet<CardNumber>(hand.getNumberValues());\n\t\tif(set.size()<5){\n\t\t\tlog.debug(\"Only \"+set.size()+\" unique numbers\");\n\t\t\treturn null;\n\t\t}\n\t\tList<CardNumber> sorted = CollectionHelper.asSortedList(set);\n\t\tlog.debug(\"Sorted Size = \"+sorted.size());\n\t\tHand numberInSequence = new FiveCardHand();\n\t\tif(sorted.size()>1){\n\t\t\t//Inch worm a long, adding hands as this will handle more than 5 cards\n\t\t\tnumberInSequence.addHand(hand.getSubHandHavingNumber(sorted.get(0)));\n\t\t\tfor(int i=1; i<sorted.size();i++){\n\t\t\t\tif(CardUtil.areCardNumbersSequential(sorted.get(i-1),sorted.get(i))){\n\t\t\t\t\tnumberInSequence.addHand(hand.getSubHandHavingNumber(sorted.get(i)));\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tnumberInSequence = hand.getSubHandHavingNumber(sorted.get(i));\n\t\t\t\t}\n\t\t\t}\n\t\t\t //Check wrap around, (example: Ace)\n\t\t\tCardNumber start = sorted.get(0);\n\t\t\tCardNumber end = sorted.get(sorted.size()-1);\n\t\t\tlog.debug(\"Checking wrap around case, if \"+start+\" and \"\n\t\t\t\t\t+end+\" are sequential\");\n\t\t\tif(CardUtil.areCardNumbersSequential(start,end)){\n\t\t\t\tlog.debug(\"Wrap around Ace in play\");\n\t\t\t\t//Add the Ace\n\t\t\t\tnumberInSequence.addHand(hand.getSubHandHavingNumber(sorted.get(0)));\n\t\t\t}\n\t\t}\n\t\tlog.debug(\"Number of cards in sequence: \"+numberInSequence.getCards().size());\n\t\tif(numberInSequence.getCards().size()>4){\n\t\t\treturn numberInSequence;\n\t\t}\n\t\treturn null;\n\t}",
"public UnoCard searchForMatch(UnoCard prev) {\r\n \r\n //case where previous card was a \r\n // special card(wild, or WD4)\r\n if(UnoSpecialCardsV2.unoSpecialCard(prev)) {\r\n //Tests to determine 1) which special card previous was; and\r\n if(UnoSpecialCardsV2.unoCardWild(prev)) {\r\n int unoCardTgtColor = UnoV2.getWildColor();\r\n // 2) does player have a card to match it. \r\n for (int i = hand.handSize()-1; i >=0; i--) {\r\n UnoCard unocard = hand.getCard(i);\r\n if (unocard.getColor() == unoCardTgtColor \r\n || (unocard.getRank() > 24)) { \r\n return hand.popCard(i);\r\n }\r\n }\r\n return null;\r\n \r\n }\r\n // Same comments as above\r\n if(UnoSpecialCardsV2.unoCardWildDrawFour(prev)) {\r\n int unoCardTgtColor = UnoV2.getWildColor();\r\n System.out.println(\"unoCardTgtColor into WD4 SearchForMatch \" \r\n + UnoCard.getColors()[unoCardTgtColor]);\r\n \r\n for (int i = hand.handSize()-1; i >=0;i--) {\r\n UnoCard unocard = hand.getCard(i);\r\n if ((unocard.getColor() == unoCardTgtColor) \r\n || unocard.getRank() > 24) {\r\n return hand.popCard(i); //had problem bug just because I forgot the 'i' in popCard...\r\n }\r\n }\r\n return null;\r\n } \r\n } //end special card prev, search for match\r\n \r\n for (int i = 0; i < hand.handSize(); i++) {\r\n UnoCard unocard = hand.getCard(i);\r\n \r\n/** Runs thru hand looks for regular wild cards, plays \r\n * them first*/\r\n if (unocard.getRank() > 24 && unocard.getRank() < 29) { \r\n return hand.popCard(i); \r\n/** Look for skip,reverse, D2, plays them next */\r\n } else if((unocard.getRank() > 18 && unocard.getRank() < 25) \r\n && UnoCard.unoCardsMatch(unocard, prev)) {\r\n return hand.popCard(i);\r\n }\r\n }\r\n/** After 'filters'\r\n * above, only cases are unocard < 19(normal cards 0 \r\n * to 9} or unocard wild Draw4. \r\n * Sort cards that are not special cards \r\n * or regular wild cards to play highest first \r\n */ \r\n UnoHand.insertionSortUnoHand(hand); \r\n \r\n // search from end of hand as hand sorted ascending\r\n for (int i = hand.handSize() - 1; i >= 0; i--) { \r\n UnoCard unocard = hand.getCard(i);\r\n if (unocard.getRank() <= 19 \r\n && UnoCard.unoCardsMatch(unocard, prev)) {\r\n return hand.popCard(i);\r\n // all else fails, play DrawFour\r\n }else if (unocard.getColor() > 3) { \r\n return hand.popCard(i);\r\n } \r\n }\r\n return null;\r\n }",
"@Test\n public void bestowCheckForCorrectCMC() {\n addCard(Zone.BATTLEFIELD, playerA, \"Island\", 7);\n // Enchantment Creature — Siren\n // 1/1\n // Bestow {5}{U}{U} (If you cast this card for its bestow cost, it's an Aura spell with enchant creature. It becomes a creature again if it's not attached to a creature.)\n // Flying\n // You control enchanted creature.\n // Enchanted creature gets +1/+1 and has flying.\n addCard(Zone.HAND, playerA, \"Hypnotic Siren\");\n // Instant {1}{U}\n // Counter target spell with converted mana cost 4 or greater.\n addCard(Zone.HAND, playerB, \"Disdainful Stroke\");\n addCard(Zone.BATTLEFIELD, playerB, \"Island\", 2);\n\n addCard(Zone.BATTLEFIELD, playerB, \"Silvercoat Lion\");\n\n // B can't cast counter spell due CMC\n castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, \"Hypnotic Siren using bestow\", \"Silvercoat Lion\");\n checkStackSize(\"after\", 1, PhaseStep.PRECOMBAT_MAIN, playerB, 1);\n checkPlayableAbility(\"after\", 1, PhaseStep.PRECOMBAT_MAIN, playerB, \"Cast Disdainful Stroke\", false);\n //castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, \"Disdainful Stroke\", \"Hypnotic Siren\");\n\n setStrictChooseMode(true);\n setStopAt(1, PhaseStep.BEGIN_COMBAT);\n execute();\n\n //\n assertHandCount(playerA, \"Hypnotic Siren\", 0);\n assertGraveyardCount(playerA, \"Hypnotic Siren\", 0);\n assertHandCount(playerB, \"Disdainful Stroke\", 1);\n assertPermanentCount(playerA, \"Hypnotic Siren\", 1);\n\n // because cast with bestow, Boon Satyr may not be tapped\n assertPermanentCount(playerA, \"Silvercoat Lion\", 1);\n assertPowerToughness(playerA, \"Silvercoat Lion\", 3, 3);\n\n }",
"@Test\n public void bestowWithFusedSpell() {\n addCard(Zone.BATTLEFIELD, playerA, \"Mountain\", 2);\n /**\n * Cyclops of One-Eyed Pass {2}{R}{R} Creature - Cyclops 5/2\n */\n addCard(Zone.BATTLEFIELD, playerA, \"Cyclops of One-Eyed Pass\");\n\n /**\n * Nyxborn Rollicker {R} Enchantment Creature - Satyr 1/1 Bestow {1}{R}\n * (If you cast this card for its bestow cost, it's an Aura spell with\n * enchant creature. It becomes a creature again if it's not attached to\n * a creature.) Enchanted creature gets +1/+1.\n */\n addCard(Zone.HAND, playerA, \"Nyxborn Rollicker\");\n\n addCard(Zone.BATTLEFIELD, playerB, \"Swamp\", 3);\n addCard(Zone.BATTLEFIELD, playerB, \"Island\", 2);\n\n // Instant\n // Far {1}{U} Return target creature to its owner's hand.\n // Away {2}{B} Target player sacrifices a creature.\n // Fuse (You may cast one or both halves of this card from your hand.)\n addCard(Zone.HAND, playerB, \"Far // Away\");\n\n castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, \"Nyxborn Rollicker using bestow\", \"Cyclops of One-Eyed Pass\");\n\n castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerB, \"fused Far // Away\");\n addTarget(playerB, \"Cyclops of One-Eyed Pass\"); // Far\n addTarget(playerB, playerA); // Away\n addTarget(playerA, \"Nyxborn Rollicker\");\n\n setStrictChooseMode(true);\n setStopAt(1, PhaseStep.END_TURN);\n execute();\n\n assertHandCount(playerA, \"Cyclops of One-Eyed Pass\", 1);\n assertHandCount(playerB, 0);\n\n assertGraveyardCount(playerB, \"Far // Away\", 1);\n\n assertPermanentCount(playerA, \"Nyxborn Rollicker\", 0);\n assertGraveyardCount(playerA, \"Nyxborn Rollicker\", 1);\n\n }",
"@Test\n void pass3CardsRound2(){\n Dealer testDealer = new Dealer();\n testDealer.initDealer();\n testDealer.setRoundCount(2);\n \n List<Card> heartHand, spadeHand, clubHand, diamondHand,userPassedCards;\n\n heartHand = new ArrayList<Card>();\n spadeHand = new ArrayList<Card>();\n clubHand = new ArrayList<Card>();\n diamondHand = new ArrayList<Card>();\n userPassedCards = new ArrayList<Card>();\n \n userPassedCards.add(new Card(Suit.DIAMONDS, Rank.ACE, true));\n userPassedCards.add(new Card(Suit.DIAMONDS, Rank.KING, true));\n userPassedCards.add(new Card(Suit.DIAMONDS, Rank.QUEEN, true));\n\n \n for(Card c:userPassedCards) {\n c.setOwnerOfCard(\"user\");\n }\n\n for (Rank rank : Rank.values()) {\n heartHand.add(new Card(Suit.HEARTS, rank, true));\n }\n\n for (Rank rank : Rank.values()) {\n spadeHand.add(new Card(Suit.SPADES, rank, true));\n }\n\n for (Rank rank : Rank.values()) {\n clubHand.add(new Card(Suit.CLUBS, rank, true));\n }\n\n for (Rank rank : Rank.values()) {\n diamondHand.add(new Card(Suit.DIAMONDS, rank, true));\n }\n \n testDealer.getBotA().fillHandCards(heartHand);\n testDealer.getBotB().fillHandCards(spadeHand);\n testDealer.getBotC().fillHandCards(clubHand);\n testDealer.getUser().fillHandCards(diamondHand);\n\n testDealer.distributePassedCards(userPassedCards);\n\n assertEquals(13, testDealer.getUserHandCards().size());\n assertEquals(13, testDealer.getBotA().getHandCards().size());\n assertEquals(13, testDealer.getBotB().getHandCards().size());\n assertEquals(13, testDealer.getBotC().getHandCards().size());\n\n assertEquals(\"QUEEN of SPADES[pickable by botA]\", testDealer.getBotA().getHandCards().get(0).toString());\n assertEquals(\"KING of SPADES[pickable by botA]\", testDealer.getBotA().getHandCards().get(1).toString());\n assertEquals(\"ACE of SPADES[pickable by botA]\", testDealer.getBotA().getHandCards().get(2).toString());\n\n assertEquals(\"QUEEN of CLUBS[pickable by botB]\", testDealer.getBotB().getHandCards().get(0).toString());\n assertEquals(\"KING of CLUBS[pickable by botB]\", testDealer.getBotB().getHandCards().get(1).toString());\n assertEquals(\"ACE of CLUBS[pickable by botB]\", testDealer.getBotB().getHandCards().get(2).toString());\n System.out.println(testDealer.getBotC().getHandCards());\n assertEquals(\"QUEEN of DIAMONDS[pickable by botC]\", testDealer.getBotC().getHandCards().get(10).toString());\n assertEquals(\"KING of DIAMONDS[pickable by botC]\", testDealer.getBotC().getHandCards().get(11).toString());\n assertEquals(\"ACE of DIAMONDS[pickable by botC]\", testDealer.getBotC().getHandCards().get(12).toString());\n System.out.println(testDealer.getUser().getHandCards());\n assertEquals(\"QUEEN of HEARTS[pickable by user]\", testDealer.getUser().getHandCards().get(10).toString());\n assertEquals(\"KING of HEARTS[pickable by user]\", testDealer.getUser().getHandCards().get(11).toString());\n assertEquals(\"ACE of HEARTS[pickable by user]\", testDealer.getUser().getHandCards().get(12).toString());\n }",
"@Test\r\n public void testPlayer_getCautiousStrategyCardCard_higherFirst_drawTwo() {\n player2 = new Player(\"Player Two\", true);\r\n player2.setHand(strategyHand.getAllCards());\r\n\r\n // let the cpc be a red nine\r\n // get rid of the wild and wd4 cards so the red draw two is the most attractive option\r\n player2.getHand().discard(wild);\r\n player2.getHand().discard(wildDrawFour);\r\n Card redNine = new Card(Card.RED, Card.NINE, cvm);\r\n assertTrue(player2.getCautiousStrategyCard(redNine, redNine.getColor()).equals(redDrawTwo));\r\n }",
"@Test\n void pass3CardsRound4(){\n Dealer testDealer = new Dealer();\n testDealer.initDealer();\n testDealer.setRoundCount(4);\n \n List<Card> heartHand, spadeHand, clubHand, diamondHand,userPassedCards;\n\n heartHand = new ArrayList<Card>();\n spadeHand = new ArrayList<Card>();\n clubHand = new ArrayList<Card>();\n diamondHand = new ArrayList<Card>();\n userPassedCards = new ArrayList<Card>();\n \n userPassedCards.add(new Card(Suit.DIAMONDS, Rank.ACE, true));\n userPassedCards.add(new Card(Suit.DIAMONDS, Rank.KING, true));\n userPassedCards.add(new Card(Suit.DIAMONDS, Rank.QUEEN, true));\n\n \n for(Card c:userPassedCards) {\n c.setOwnerOfCard(\"user\");\n }\n\n for (Rank rank : Rank.values()) {\n heartHand.add(new Card(Suit.HEARTS, rank, true));\n }\n\n for (Rank rank : Rank.values()) {\n spadeHand.add(new Card(Suit.SPADES, rank, true));\n }\n\n for (Rank rank : Rank.values()) {\n clubHand.add(new Card(Suit.CLUBS, rank, true));\n }\n\n for (Rank rank : Rank.values()) {\n diamondHand.add(new Card(Suit.DIAMONDS, rank, true));\n }\n \n testDealer.getBotA().fillHandCards(heartHand);\n testDealer.getBotB().fillHandCards(spadeHand);\n testDealer.getBotC().fillHandCards(clubHand);\n testDealer.getUser().fillHandCards(diamondHand);\n\n testDealer.distributePassedCards(userPassedCards);\n\n assertEquals(13, testDealer.getUserHandCards().size());\n assertEquals(13, testDealer.getBotA().getHandCards().size());\n assertEquals(13, testDealer.getBotB().getHandCards().size());\n assertEquals(13, testDealer.getBotC().getHandCards().size());\n\n assertEquals(\"TWO of HEARTS[pickable by botA]\", testDealer.getBotA().getHandCards().get(0).toString());\n assertEquals(\"THREE of HEARTS[pickable by botA]\", testDealer.getBotA().getHandCards().get(1).toString());\n assertEquals(\"FOUR of HEARTS[pickable by botA]\", testDealer.getBotA().getHandCards().get(2).toString());\n\n assertEquals(\"TWO of SPADES[pickable by botB]\", testDealer.getBotB().getHandCards().get(0).toString());\n assertEquals(\"THREE of SPADES[pickable by botB]\", testDealer.getBotB().getHandCards().get(1).toString());\n assertEquals(\"FOUR of SPADES[pickable by botB]\", testDealer.getBotB().getHandCards().get(2).toString());\n\n assertEquals(\"QUEEN of CLUBS[pickable by botC]\", testDealer.getBotC().getHandCards().get(10).toString());\n assertEquals(\"KING of CLUBS[pickable by botC]\", testDealer.getBotC().getHandCards().get(11).toString());\n assertEquals(\"ACE of CLUBS[pickable by botC]\", testDealer.getBotC().getHandCards().get(12).toString());\n\n assertEquals(\"QUEEN of DIAMONDS[pickable by user]\", testDealer.getUser().getHandCards().get(10).toString());\n assertEquals(\"KING of DIAMONDS[pickable by user]\", testDealer.getUser().getHandCards().get(11).toString());\n assertEquals(\"ACE of DIAMONDS[pickable by user]\", testDealer.getUser().getHandCards().get(12).toString());\n }",
"@Test\n void pass3CardsRound99(){\n Dealer testDealer = new Dealer();\n testDealer.initDealer();\n testDealer.setRoundCount(99);\n \n List<Card> heartHand, spadeHand, clubHand, diamondHand,userPassedCards;\n\n heartHand = new ArrayList<Card>();\n spadeHand = new ArrayList<Card>();\n clubHand = new ArrayList<Card>();\n diamondHand = new ArrayList<Card>();\n userPassedCards = new ArrayList<Card>();\n \n userPassedCards.add(new Card(Suit.DIAMONDS, Rank.ACE, true));\n userPassedCards.add(new Card(Suit.DIAMONDS, Rank.KING, true));\n userPassedCards.add(new Card(Suit.DIAMONDS, Rank.QUEEN, true));\n\n \n for(Card c:userPassedCards) {\n c.setOwnerOfCard(\"user\");\n }\n\n for (Rank rank : Rank.values()) {\n heartHand.add(new Card(Suit.HEARTS, rank, true));\n }\n\n for (Rank rank : Rank.values()) {\n spadeHand.add(new Card(Suit.SPADES, rank, true));\n }\n\n for (Rank rank : Rank.values()) {\n clubHand.add(new Card(Suit.CLUBS, rank, true));\n }\n\n for (Rank rank : Rank.values()) {\n diamondHand.add(new Card(Suit.DIAMONDS, rank, true));\n }\n \n testDealer.getBotA().fillHandCards(heartHand);\n testDealer.getBotB().fillHandCards(spadeHand);\n testDealer.getBotC().fillHandCards(clubHand);\n testDealer.getUser().fillHandCards(diamondHand);\n\n testDealer.distributePassedCards(userPassedCards);\n\n assertEquals(13, testDealer.getUserHandCards().size());\n assertEquals(13, testDealer.getBotA().getHandCards().size());\n assertEquals(13, testDealer.getBotB().getHandCards().size());\n assertEquals(13, testDealer.getBotC().getHandCards().size());\n\n assertEquals(\"QUEEN of CLUBS[pickable by botA]\", testDealer.getBotA().getHandCards().get(0).toString());\n assertEquals(\"KING of CLUBS[pickable by botA]\", testDealer.getBotA().getHandCards().get(1).toString());\n assertEquals(\"ACE of CLUBS[pickable by botA]\", testDealer.getBotA().getHandCards().get(2).toString());\n\n assertEquals(\"QUEEN of DIAMONDS[pickable by botB]\", testDealer.getBotB().getHandCards().get(0).toString());\n assertEquals(\"KING of DIAMONDS[pickable by botB]\", testDealer.getBotB().getHandCards().get(1).toString());\n assertEquals(\"ACE of DIAMONDS[pickable by botB]\", testDealer.getBotB().getHandCards().get(2).toString());\n\n assertEquals(\"QUEEN of HEARTS[pickable by botC]\", testDealer.getBotC().getHandCards().get(10).toString());\n assertEquals(\"KING of HEARTS[pickable by botC]\", testDealer.getBotC().getHandCards().get(11).toString());\n assertEquals(\"ACE of HEARTS[pickable by botC]\", testDealer.getBotC().getHandCards().get(12).toString());\n\n assertEquals(\"QUEEN of SPADES[pickable by user]\", testDealer.getUser().getHandCards().get(10).toString());\n assertEquals(\"KING of SPADES[pickable by user]\", testDealer.getUser().getHandCards().get(11).toString());\n assertEquals(\"ACE of SPADES[pickable by user]\", testDealer.getUser().getHandCards().get(12).toString());\n }",
"@Test\n void pass3CardsRound1(){\n Dealer testDealer = new Dealer();\n testDealer.initDealer();\n testDealer.setRoundCount(1);\n \n List<Card> heartHand, spadeHand, clubHand, diamondHand,userPassedCards;\n\n heartHand = new ArrayList<Card>();\n spadeHand = new ArrayList<Card>();\n clubHand = new ArrayList<Card>();\n diamondHand = new ArrayList<Card>();\n userPassedCards = new ArrayList<Card>();\n \n userPassedCards.add(new Card(Suit.DIAMONDS, Rank.ACE, true));\n userPassedCards.add(new Card(Suit.DIAMONDS, Rank.KING, true));\n userPassedCards.add(new Card(Suit.DIAMONDS, Rank.QUEEN, true));\n\n for(Card c:userPassedCards) {\n c.setOwnerOfCard(\"user\");\n }\n\n for (Rank rank : Rank.values()) {\n heartHand.add(new Card(Suit.HEARTS, rank, true));\n }\n\n for (Rank rank : Rank.values()) {\n spadeHand.add(new Card(Suit.SPADES, rank, true));\n }\n\n for (Rank rank : Rank.values()) {\n clubHand.add(new Card(Suit.CLUBS, rank, true));\n }\n\n for (Rank rank : Rank.values()) {\n diamondHand.add(new Card(Suit.DIAMONDS, rank, true));\n }\n \n testDealer.getBotA().fillHandCards(heartHand);\n testDealer.getBotB().fillHandCards(spadeHand);\n testDealer.getBotC().fillHandCards(clubHand);\n testDealer.getUser().fillHandCards(diamondHand);\n\n testDealer.distributePassedCards(userPassedCards);\n\n assertEquals(13, testDealer.getUserHandCards().size());\n assertEquals(13, testDealer.getBotA().getHandCards().size());\n assertEquals(13, testDealer.getBotB().getHandCards().size());\n assertEquals(13, testDealer.getBotC().getHandCards().size());\n\n assertEquals(\"QUEEN of DIAMONDS[pickable by botA]\", testDealer.getBotA().getHandCards().get(0).toString());\n assertEquals(\"KING of DIAMONDS[pickable by botA]\", testDealer.getBotA().getHandCards().get(1).toString());\n assertEquals(\"ACE of DIAMONDS[pickable by botA]\", testDealer.getBotA().getHandCards().get(2).toString());\n\n assertEquals(\"QUEEN of HEARTS[pickable by botB]\", testDealer.getBotB().getHandCards().get(10).toString());\n assertEquals(\"KING of HEARTS[pickable by botB]\", testDealer.getBotB().getHandCards().get(11).toString());\n assertEquals(\"ACE of HEARTS[pickable by botB]\", testDealer.getBotB().getHandCards().get(12).toString());\n\n assertEquals(\"QUEEN of SPADES[pickable by botC]\", testDealer.getBotC().getHandCards().get(10).toString());\n assertEquals(\"KING of SPADES[pickable by botC]\", testDealer.getBotC().getHandCards().get(11).toString());\n assertEquals(\"ACE of SPADES[pickable by botC]\", testDealer.getBotC().getHandCards().get(12).toString());\n System.out.println(testDealer.getUser().getHandCards());\n System.out.println();\n assertEquals(\"QUEEN of CLUBS[pickable by user]\", testDealer.getUser().getHandCards().get(0).toString());\n assertEquals(\"KING of CLUBS[pickable by user]\", testDealer.getUser().getHandCards().get(1).toString());\n assertEquals(\"ACE of CLUBS[pickable by user]\", testDealer.getUser().getHandCards().get(2).toString());\n }",
"public boolean VerifyHumanChoice(int value){\n String card = handHuman.get(value);\n System.out.print(\"CARD IN VERIFY HUMAN\" + card);\n\n String firstLetter = Character.toString(card.charAt(0));\n String topFirstLetter = Character.toString(topCard.charAt(0));\n\n if(topCard.contains(\"8\")){\n //Can play any card ontop to determine suite\n topCard = card;\n return true;\n }\n\n if(card.contains(\"8\")){\n //valid because 8s are wild cards, human can place it\n topCard = card;\n return true;\n }\n\n //the cards match in suite, doesn't matter what it is\n else if(firstLetter.equals(topFirstLetter)){\n topCard = card;\n return true;\n }\n\n else{\n if(topFirstLetter.equals(\"c\")){\n String temp = topCard.substring(5, topCard.length());\n System.out.println(\"TEMP \" + temp);\n\n if(card.contains(temp)){\n topCard = card;\n return true;\n }\n\n }\n\n else if(topFirstLetter.equals(\"h\")){\n String temp = topCard.substring(6, topCard.length());\n System.out.println(\"TEMP \" + temp);\n\n if(card.contains(temp)){\n topCard = card;\n return true;\n }\n\n }\n\n else if(topFirstLetter.equals(\"d\")){\n String temp = topCard.substring(8, topCard.length());\n System.out.println(\"TEMP \" + temp);\n\n if(card.contains(temp)){\n topCard = card;\n return true;\n }\n\n }\n\n else if(topFirstLetter.equals(\"s\")){\n String temp = topCard.substring(6, topCard.length());\n System.out.println(\"TEMP \" + temp);\n\n if(card.contains(temp)){\n topCard = card;\n return true;\n }\n\n }\n }\n\n //You can't play this card\n return false;\n }",
"@Test\n void testWinnerOfTrickNotFollowingSuit() {\n Dealer testDealer = new Dealer();\n testDealer.initDealer();\n\n Bot botA = testDealer.getBotA();\n Bot botB = testDealer.getBotB();\n Bot botC = testDealer.getBotC();\n\n ArrayList<Card> botAHand, botBHand, botCHand = new ArrayList <Card>();\n\n // botAHand = new ArrayList <Card>();\n botAHand = new ArrayList <Card>();\n botBHand = new ArrayList <Card>();\n botCHand = new ArrayList <Card>();\n\n Card thrownCard = new Card(Suit.CLUBS,Rank.FOUR,true);\n \n Card cardA1 = new Card(Suit.CLUBS,Rank.ACE,true);\n\n Card cardB1 = new Card(Suit.DIAMONDS,Rank.ACE,true);\n\n Card cardC1 = new Card(Suit.SPADES,Rank.ACE,true);\n\n botAHand.add(cardA1);\n botBHand.add(cardB1);\n botCHand.add(cardC1);\n \n // botA.fillHandCards(botAHand);\n botA.fillHandCards(botAHand);\n botB.fillHandCards(botBHand);\n botC.fillHandCards(botCHand);\n\n testDealer.addToPlayedCards(thrownCard);\n \n Card cardToPlay = botA.playCard(thrownCard, 1);\n testDealer.addToPlayedCards(cardToPlay);\n Card largestPlayedCard = testDealer.getLargestCardFromTrick();\n\n cardToPlay = botB.playCard(largestPlayedCard, 2);\n testDealer.addToPlayedCards(cardToPlay);\n largestPlayedCard = testDealer.getLargestCardFromTrick();\n\n cardToPlay = botC.playCard(largestPlayedCard, 3);\n testDealer.addToPlayedCards(cardToPlay);\n\n // List<Card> allPlayedCards = testDealer.getPlayedCardsForTrick();\n assertEquals(\"botA\", testDealer.getWinnerOfTrick(testDealer.getPlayedCardsForTrick()));\n }",
"public static void main(String[] args) {\n\t\t\r\n\t\tScanner scan = new Scanner(System.in);\r\n\t\t\r\n\t\tint input = 0;\r\n\t\tint ai = 0;\r\n\t\tint win = 0;\r\n\t\tint defeat = 0;\r\n\t\tint draw = 0;\r\n\t\t\r\n\t\tString me = \"\";\r\n\t\tString com = \"\";\r\n\t\tSystem.out.println(\"★☆★☆★☆★☆가위바위보 게임입니다!★☆★☆★☆★☆\");\r\n\t\tfor(int i = 1 ; i < 4 ; i++) {\r\n\t\t\tSystem.out.println(\"\\t\\t\\t\\t\\t 최대횟수/남은횟수\");\r\n\t\t\tSystem.out.println(\"가위(1), 바위(2), 보(3) 중 하나를 입력하세요>>>\\t\\t3 / \" + i);\r\n\t\t\tinput = scan.nextInt();\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tai = (int)(Math.random()*3) + 1;\r\n\t\t\t\r\n\t\t\tif (input == 1) me = \"가위\";\r\n\t\t\telse if (input == 2) me = \"바위\";\r\n\t\t\telse if (input == 3) me = \"보\";\r\n\t\t\telse System.out.println(\"잘못 입력하셨습니다\");\r\n\t\t\tif (ai == 1) com = \"가위\";\r\n\t\t\telse if (ai == 2) com = \"바위\";\r\n\t\t\telse if (ai == 3) com = \"보\";\r\n\t\t\t\r\n\t\t\tif(me != \"\") {\r\n\t\t\t\tSystem.out.println(\"컴퓨터도 선택 했습니다.\");\r\n\t\t\t\tSystem.out.println(\"당신은 \\\"\" + me + \"\\\" 상대는 \\\"\" + com + \"\\\" 을 선택했습니다\");\r\n\t\t\t\r\n\t\t\t\tswitch (input - ai) {\r\n\t\t\t\tcase -1 : case 2 : \r\n\t\t\t\t\tSystem.out.println(\"★☆저런~~ 졌네요★☆\\n\"); defeat += 1; \r\n\t\t\t\t\tSystem.out.println(\"전적 => 승리 [ \" + win + \" ]\\t패배 [ \" + defeat + \" ]\\t무승부 [ \" + draw + \" ]\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\tcase -2 : case 1 : \r\n\t\t\t\t\tSystem.out.println(\"★☆오~~ 이겼네요★☆\\n\"); win += 1; \r\n\t\t\t\t\tSystem.out.println(\"전적 => 승리 [ \" + win + \" ]\\t패배 [ \" + defeat + \" ]\\t무승부 [ \" + draw + \" ]\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\tcase 0 : \r\n\t\t\t\t\tSystem.out.println(\"★☆이런! 비겼네요★☆\\n\"); draw += 1;\r\n\t\t\t\t\tSystem.out.println(\"전적 => 승리 [ \" + win + \" ]\\t패배 [ \" + defeat + \" ]\\t무승부 [ \" + draw + \" ]\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\tdefault : System.out.println(\"오류 입니다\"); \r\n\t\t\t\t}\r\n\t\t\t\tSystem.out.println(\"\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(win==defeat) {\r\n\t\t\tSystem.out.println(\"최종 결과 => 무승부 입니다\");\r\n\t\t} else if(win > defeat) {\r\n\t\t\tSystem.out.println(\"최종 결과 => 당신의 승리입니다\");\r\n\t\t} else if(win < defeat) {\r\n\t\t\tSystem.out.println(\"최종 결과 => 당신의 패배입니다\");\r\n\t\t} else {\r\n\t\t\tSystem.out.println(\"오류 입니다\");\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t}",
"public int[] hasNSequentially(int lengthOfHand) {//check for Ace case //need to NOT ALLOW DUPLICATES\n ArrayList<Card> handList = new ArrayList<Card>();\n int solution[] = {0, 0};//number in a row, lowest number of that\n boolean foundSomeNInAFow = false;\n int hasAce = 0;\n\n int usedNumbers[] = new int[13];//2,3,4,5,6,7,8,9,10,j,q,k,a --> THIS HANDLES THE ACE CASE\n for (int i = 0; i < lengthOfHand; i++) {//was\n usedNumbers[allCards[i].value - 2]++;//USED\n if (usedNumbers[allCards[i].value - 2] == 1) {//handles NOT having doubles of numbers like 2 3 4 4 5 \n handList.add(this.allCards[i]);\n if (this.allCards[i].value == 14) {\n Card c = new Card(1, this.allCards[i].suit);\n handList.add(0, c);//add to front..shifts elements to right\n }\n }\n }\n\n for (int i = 0; i < handList.size() - 4; i++) {//check for 5 in a row, //was - 4\n int val = handList.get(i).value;\n int counter = 0;\n for (int j = 0; j < 4; j++) {//was 4\n if (handList.get(j + i + 1).value == val + 1 + j) {\n counter++;\n } else {\n break;\n }\n if (counter == 4) {//was 4\n foundSomeNInAFow = true;\n solution[0] = 5;\n solution[1] = val;\n }\n }\n }\n\n if (foundSomeNInAFow == false) {\n for (int i = 0; i < handList.size() - 3; i++) {//check for 5 in a row, //was - 4\n int val = handList.get(i).value;\n int counter = 0;\n for (int j = 0; j < 3; j++) {\n if (handList.get(j + i + 1).value == val + 1 + j) {\n counter++;\n } else {\n break;\n }\n if (counter == 3) {\n // System.out.println(\"yes 4 sequentially\");\n foundSomeNInAFow = true;\n solution[0] = 4;\n solution[1] = val;\n }\n }\n }\n }\n\n if (foundSomeNInAFow == false) {\n for (int i = 0; i < handList.size() - 2; i++) {//check for 5 in a row, //was - 4\n int val = handList.get(i).value;\n int counter = 0;\n for (int j = 0; j < 2; j++) {\n if (handList.get(j + i + 1).value == val + 1 + j) {\n counter++;\n } else {\n break;\n }\n if (counter == 2) {\n // System.out.println(\"yes 3 sequentially\");\n foundSomeNInAFow = true;\n solution[0] = 3;\n solution[1] = val;\n }\n }\n }\n }\n\n if (foundSomeNInAFow == false) {\n for (int i = 0; i < handList.size() - 1; i++) {//check for 5 in a row, //was - 4\n int val = handList.get(i).value;\n int counter = 0;\n for (int j = 0; j < 1; j++) {\n if (handList.get(j + i + 1).value == val + 1 + j) {\n counter++;\n } else {\n break;\n }\n if (counter == 1) {\n //System.out.println(\"yes 2 sequentially\");\n foundSomeNInAFow = true;\n solution[0] = 2;\n solution[1] = val;\n\n }\n }\n }\n }\n\n return solution;//return at end that way if there is 2,3,5,7,8 it returns 7 8 not 2 3\n\n }",
"public void evaluateAllHands() {\n\t\tPlayer player;\n\t\tresetHandRanks();\n\n\t\tfor (int i = 0; i < table.getTablePlayers().size(); i++) {\n\t\t\tplayer = table.getTablePlayers().get(i);\n\t\t\thand = new Card[5];\n\n\t\t\tinitAndSortAllHands();\n\t\t\tif (checkStrFlush(player))\n\t\t\t\tcontinue;\n\n\t\t\tinitAndSortAllHands();\n\t\t\tif (checkQuads(player))\n\t\t\t\tcontinue;\n\n\t\t\tinitAndSortAllHands();\n\t\t\tif (checkFullHouse(player))\n\t\t\t\tcontinue;\n\n\t\t\tinitAndSortAllHands();\n\t\t\tif (checkFlush(player))\n\t\t\t\tcontinue;\n\n\t\t\tinitAndSortAllHands();\n\t\t\tif (checkStraight(player))\n\t\t\t\tcontinue;\n\n\t\t\tinitAndSortAllHands();\n\t\t\tif (player.isTrips())\n\t\t\t\tcontinue;\n\n\t\t\tinitAndSortAllHands();\n\t\t\tif (checkTwoPairs(player))\n\t\t\t\tcontinue;\n\t\t\t\n\t\t\tinitAndSortAllHands();\n\t\t\tif (player.isPair())\n\t\t\t\tcontinue;\n\t\t\t\n\t\t\tinitAndSortAllHands();\n\t\t\tcheckHighCard(player);\n\t\t}\n\t}",
"@Test\n void pass3CardsRound3(){\n Dealer testDealer = new Dealer();\n testDealer.initDealer();\n testDealer.setRoundCount(3);\n \n List<Card> heartHand, spadeHand, clubHand, diamondHand,userPassedCards;\n\n heartHand = new ArrayList<Card>();\n spadeHand = new ArrayList<Card>();\n clubHand = new ArrayList<Card>();\n diamondHand = new ArrayList<Card>();\n userPassedCards = new ArrayList<Card>();\n \n userPassedCards.add(new Card(Suit.DIAMONDS, Rank.ACE, true));\n userPassedCards.add(new Card(Suit.DIAMONDS, Rank.KING, true));\n userPassedCards.add(new Card(Suit.DIAMONDS, Rank.QUEEN, true));\n\n \n for(Card c:userPassedCards) {\n c.setOwnerOfCard(\"user\");\n }\n\n for (Rank rank : Rank.values()) {\n heartHand.add(new Card(Suit.HEARTS, rank, true));\n }\n\n for (Rank rank : Rank.values()) {\n spadeHand.add(new Card(Suit.SPADES, rank, true));\n }\n\n for (Rank rank : Rank.values()) {\n clubHand.add(new Card(Suit.CLUBS, rank, true));\n }\n\n for (Rank rank : Rank.values()) {\n diamondHand.add(new Card(Suit.DIAMONDS, rank, true));\n }\n \n testDealer.getBotA().fillHandCards(heartHand);\n testDealer.getBotB().fillHandCards(spadeHand);\n testDealer.getBotC().fillHandCards(clubHand);\n testDealer.getUser().fillHandCards(diamondHand);\n\n testDealer.distributePassedCards(userPassedCards);\n\n assertEquals(13, testDealer.getUserHandCards().size());\n assertEquals(13, testDealer.getBotA().getHandCards().size());\n assertEquals(13, testDealer.getBotB().getHandCards().size());\n assertEquals(13, testDealer.getBotC().getHandCards().size());\n\n assertEquals(\"QUEEN of CLUBS[pickable by botA]\", testDealer.getBotA().getHandCards().get(0).toString());\n assertEquals(\"KING of CLUBS[pickable by botA]\", testDealer.getBotA().getHandCards().get(1).toString());\n assertEquals(\"ACE of CLUBS[pickable by botA]\", testDealer.getBotA().getHandCards().get(2).toString());\n\n assertEquals(\"QUEEN of DIAMONDS[pickable by botB]\", testDealer.getBotB().getHandCards().get(0).toString());\n assertEquals(\"KING of DIAMONDS[pickable by botB]\", testDealer.getBotB().getHandCards().get(1).toString());\n assertEquals(\"ACE of DIAMONDS[pickable by botB]\", testDealer.getBotB().getHandCards().get(2).toString());\n\n assertEquals(\"QUEEN of HEARTS[pickable by botC]\", testDealer.getBotC().getHandCards().get(10).toString());\n assertEquals(\"KING of HEARTS[pickable by botC]\", testDealer.getBotC().getHandCards().get(11).toString());\n assertEquals(\"ACE of HEARTS[pickable by botC]\", testDealer.getBotC().getHandCards().get(12).toString());\n\n assertEquals(\"QUEEN of SPADES[pickable by user]\", testDealer.getUser().getHandCards().get(10).toString());\n assertEquals(\"KING of SPADES[pickable by user]\", testDealer.getUser().getHandCards().get(11).toString());\n assertEquals(\"ACE of SPADES[pickable by user]\", testDealer.getUser().getHandCards().get(12).toString());\n }",
"private static void checkForMatches() {\n int matchesThisTurn = 0;\n switch (pattern) {\n case RED:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardColor(playerDeck.get(i)).equals(\"Red\")) {\n //system.out.println(\"Matched Card Color:\" + GameDeck.getCardColor(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case BLACK:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardColor(playerDeck.get(i)).equals(\"Black\")) {\n //system.out.println(\"Matched Card Color:\" + GameDeck.getCardColor(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n matchesThisTurn++;\n playerDeck.get(i).setCardPurchased(true);\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case HEART:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardSuit(playerDeck.get(i)).equals(\"Heart\")) {\n //system.out.println(\"Matched Card Suit:\" + GameDeck.getCardSuit(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case DIAMOND:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardSuit(playerDeck.get(i)).equals(\"Diamond\")) {\n //system.out.println(\"Matched Card Suit:\" + GameDeck.getCardSuit(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case CLUB:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardSuit(playerDeck.get(i)).equals(\"Club\")) {\n //system.out.println(\"Matched Card Suit:\" + GameDeck.getCardSuit(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case SPADE:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardSuit(playerDeck.get(i)).equals(\"Spade\")) {\n //system.out.println(\"Matched Card Suit:\" + GameDeck.getCardSuit(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case TWO:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"2\")) {\n //system.out.println(\"Matched Card Name:\" + GameDeck.getCardName(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case THREE:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"3\")) {\n //system.out.println(\"Matched Card Name:\" + GameDeck.getCardName(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case FOUR:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"4\")) {\n //system.out.println(\"Matched Card Name:\" + GameDeck.getCardName(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case FIVE:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"5\")) {\n //system.out.println(\"Matched Card Name:\" + GameDeck.getCardName(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case SIX:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"6\")) {\n //system.out.println(\"Matched Card Name:\" + GameDeck.getCardName(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case SEVEN:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"7\")) {\n //system.out.println(\"Matched Card Name:\" + GameDeck.getCardName(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case EIGHT:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"8\")) {\n //system.out.println(\"Matched Card Name:\" + GameDeck.getCardName(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case NINE:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"9\")) {\n //system.out.println(\"Matched Card Name:\" + GameDeck.getCardName(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case TEN:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"10\")) {\n //system.out.println(\"Matched Card Name:\" + GameDeck.getCardName(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case JACK:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"J\")) {\n //system.out.println(\"Matched Card Name:\" + GameDeck.getCardName(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case QUEEN:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"Q\")) {\n //system.out.println(\"Matched Card Name:\" + GameDeck.getCardName(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case KING:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"K\")) {\n //system.out.println(\"Matched Card Name:\" + GameDeck.getCardName(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case ACE:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"A\")) {\n //system.out.println(\"Matched Card Name:\" + GameDeck.getCardName(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case SINGLEDIGITPRIMES:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"2\") ||\n GameDeck.getCardName(playerDeck.get(i)).equals(\"3\") ||\n GameDeck.getCardName(playerDeck.get(i)).equals(\"5\") ||\n GameDeck.getCardName(playerDeck.get(i)).equals(\"7\")) {\n //system.out.println(\"Matched Card Name:\" + GameDeck.getCardName(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case PAIRS:\n int[] isAPair = new int[]{0,0,0,0};\n if(GameDeck.getCardName(playerDeck.get(0)).equals(GameDeck.getCardName(playerDeck.get(1)))) {\n //system.out.println(\"Matched Pair Name:\" + GameDeck.getCardName(playerDeck.get(0)));\n matchedDeck.add(playerDeck.get(0));\n playerDeck.get(0).setCardPurchased(true);\n matchedDeck.add(playerDeck.get(1));\n playerDeck.get(1).setCardPurchased(true);\n isAPair[1] = 1;\n matchesThisTurn += 2;\n } else if(GameDeck.getCardName(playerDeck.get(0)).equals(GameDeck.getCardName(playerDeck.get(2)))) {\n //system.out.println(\"Matched Pair Name:\" + GameDeck.getCardName(playerDeck.get(0)));\n matchedDeck.add(playerDeck.get(0));\n playerDeck.get(0).setCardPurchased(true);\n matchedDeck.add(playerDeck.get(2));\n playerDeck.get(2).setCardPurchased(true);\n isAPair[2] = 1;\n matchesThisTurn += 2;\n } else if(GameDeck.getCardName(playerDeck.get(0)).equals(GameDeck.getCardName(playerDeck.get(3)))) {\n //system.out.println(\"Matched Pair Name:\" + GameDeck.getCardName(playerDeck.get(0)));\n matchedDeck.add(playerDeck.get(0));\n playerDeck.get(0).setCardPurchased(true);\n matchedDeck.add(playerDeck.get(3));\n playerDeck.get(3).setCardPurchased(true);\n isAPair[3] = 1;\n matchesThisTurn += 2;\n }\n else\n {\n \tplayerDeck.get(0).setCardPurchased(false);\n \tplayerDeck.get(1).setCardPurchased(false);\n \tplayerDeck.get(2).setCardPurchased(false);\n \tplayerDeck.get(3).setCardPurchased(false);\n }\n \n if(isAPair[1] != 1) {\n if(isAPair[2] != 1 && GameDeck.getCardName(playerDeck.get(1)).equals(GameDeck.getCardName(playerDeck.get(2)))) {\n //system.out.println(\"Matched Pair Name:\" + GameDeck.getCardName(playerDeck.get(1)));\n matchedDeck.add(playerDeck.get(1));\n playerDeck.get(1).setCardPurchased(true);\n matchedDeck.add(playerDeck.get(2));\n playerDeck.get(2).setCardPurchased(true);\n isAPair[2] = 1;\n matchesThisTurn += 2;\n } else if(isAPair[3] != 1 && GameDeck.getCardName(playerDeck.get(1)).equals(GameDeck.getCardName(playerDeck.get(3)))) {\n //system.out.println(\"Matched Pair Name:\" + GameDeck.getCardName(playerDeck.get(1)));\n matchedDeck.add(playerDeck.get(1));\n playerDeck.get(1).setCardPurchased(true);\n matchedDeck.add(playerDeck.get(3));\n playerDeck.get(3).setCardPurchased(true);\n isAPair[3] = 1;\n matchesThisTurn += 2;\n }\n else\n {\n \tplayerDeck.get(1).setCardPurchased(false);\n \tplayerDeck.get(2).setCardPurchased(false);\n \tplayerDeck.get(3).setCardPurchased(false);\n }\n \n }\n \n if(isAPair[2] != 1) {\n if(isAPair[3] != 1 && GameDeck.getCardName(playerDeck.get(2)).equals(GameDeck.getCardName(playerDeck.get(3)))) {\n //system.out.println(\"Matched Pair Name:\" + GameDeck.getCardName(playerDeck.get(2)));\n matchedDeck.add(playerDeck.get(2));\n playerDeck.get(2).setCardPurchased(true);\n matchedDeck.add(playerDeck.get(3));\n playerDeck.get(3).setCardPurchased(true);\n matchesThisTurn += 2;\n }\n else\n {\n \tplayerDeck.get(2).setCardPurchased(false);\n \tplayerDeck.get(3).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n guessPattern();\n }\n break;\n case SUMOFPAIRS: //Ace is high for this sum calculation(Ace=14)\n int tempSum;\n int sumPairCount = 0;\n for(int i=0;i<playerDeck.size();i+=2) {\n tempSum = 0;\n tempSum += GameDeck.getCardValue(playerDeck.get(i));\n tempSum += GameDeck.getCardValue(playerDeck.get(i+1));\n if(tempSum == sumValue) {\n //system.out.println(\"Sum Value:\" + tempSum);\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchedDeck.add(playerDeck.get(i+1));\n playerDeck.get(i+1).setCardPurchased(true);\n sumPairCount++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n \tplayerDeck.get(i+1).setCardPurchased(false);\n }\n }\n if(sumPairCount == 2)\n {\n// guessPattern();\n }\n break;\n case INCREMENTING:\n int[] isIncrementing = new int[]{0,0,0,0};\n int[] isConsecutive = new int[]{0,0,0};\n int consecutiveCount = 0;\n for(int i = 0; i< playerDeck.size()-1; i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"A\")) {\n if(1 == GameDeck.getCardValue(playerDeck.get(i+1))-1) {\n //system.out.println(\"Matched incrementing:\" + GameDeck.getCardName(playerDeck.get(i)) +\n // \" & \" + GameDeck.getCardName(playerDeck.get(i+1)));\n isIncrementing[i] = 1;\n isIncrementing[i+1] = 1;\n isConsecutive[i] = 1;\n }\n } else {\n if(GameDeck.getCardValue(playerDeck.get(i)) == GameDeck.getCardValue(playerDeck.get(i+1))-1) {\n //system.out.println(\"Matched incrementing:\" + GameDeck.getCardName(playerDeck.get(i)) +\n // \" & \" + GameDeck.getCardName(playerDeck.get(i+1)));\n isIncrementing[i] = 1;\n isIncrementing[i+1] = 1;\n isConsecutive[i] = 1;\n }\n }\n }\n for(int i=0;i<playerDeck.size();i++) {\n if(isIncrementing[i] == 1) {\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn ++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n for(int i=0;i<3;i++) {\n if(isConsecutive[i] == 1) {\n consecutiveCount++;\n }\n }\n if(consecutiveCount == 3)\n {\n// guessPattern();\n }\n break;\n case DECREMENTING:\n int[] isDecrementing = new int[]{0,0,0,0};\n int[] isConsecutive2 = new int[]{0,0,0};\n int consecutiveCount2 = 0;\n for(int i = 0; i< playerDeck.size()-1; i++) {\n if(GameDeck.getCardValue(playerDeck.get(i)) == 2) {\n if(GameDeck.getCardName(playerDeck.get(i+1)).equals(\"A\")) {\n //system.out.println(\"Matched decrementing:\" + GameDeck.getCardName(playerDeck.get(i)) +\n // \" & \" + GameDeck.getCardName(playerDeck.get(i+1)));\n isDecrementing[i] = 1;\n isDecrementing[i+1] = 1;\n isConsecutive2[i] = 1;\n }\n } else {\n if(GameDeck.getCardValue(playerDeck.get(i)) == GameDeck.getCardValue(playerDeck.get(i+1))+1) {\n //system.out.println(\"Matched decrementing:\" + GameDeck.getCardName(playerDeck.get(i)) +\n // \" & \" + GameDeck.getCardName(playerDeck.get(i+1)));\n isDecrementing[i] = 1;\n isDecrementing[i+1] = 1;\n isConsecutive2[i] = 1;\n }\n }\n }\n for(int i=0;i<playerDeck.size();i++) {\n if(isDecrementing[i] == 1) {\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn ++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n for(int i=0;i<3;i++) {\n if(isConsecutive2[i] == 1) {\n consecutiveCount2++;\n }\n }\n if(consecutiveCount2 == 3)\n {\n// guessPattern();\n }\n break;\n default:\n //system.out.println(\"\");\n break;\n }\n }",
"private int computeBetterResponse(int player, GameObserver go) {\n int[] devOutcome = currentOutcome.clone();\n double aspirationPayoff = eGame.getPayoff(currentOutcome, player) + aspirationLevel;\n double bestPayoff = eGame.getPayoff(currentOutcome, player);\n int bestResponse = currentOutcome[player];\n\n ///System.out.println(\"Finding BR: \" + Arrays.toString(currentOutcome));\n\n // get the order in which to test best responses\n List<Integer> order = deviationTestOrder.getDeviationTestOrder(currentOutcome, player);\n\n// if (order.size() < nActs[player]-1) {\n// System.out.println(\"To few actions in order listing: \" + order.size());\n// }\n\n int itr = 0;\n for (int a : order) {\n // skip current action\n if (a == currentOutcome[player]) continue;\n devOutcome[player] = a;\n\n //System.out.println(\"Testing dev: \" + Arrays.toString(devOutcome));\n\n // check whether this profile is \"tabu\"\n if (tabu.getValue(devOutcome)) {\n //System.out.println(\"TABU\");\n continue;\n }\n\n // sample if necessary; flag not enough samples\n if (eGame.getNumSamples(devOutcome) == 0) {\n if (go.numObsLeft() <= 0) return NO_SAMPLES_FLAG;\n sampleAndUpdate(devOutcome, go);\n //System.out.println(\"SAMPLED\");\n }\n\n // check BR\n double devPayoff = eGame.getPayoff(devOutcome, player);\n\n// if (devPayoff > aspirationPayoff) {\n// //System.out.println(\"Aspiration met.\");\n// return a;\n// } else\n\n if (devPayoff > bestPayoff) {\n //System.out.println(\"Br, but not aspiration level\");\n bestPayoff = devPayoff;\n bestResponse = a;\n }\n\n itr++;\n if (itr > minDeviationsTested &&\n bestPayoff > aspirationPayoff) {\n return bestResponse;\n }\n\n }\n\n if (bestResponse != currentOutcome[player]) {\n //System.out.println(\"return non-aspiration BR\");\n return bestResponse;\n }\n //System.out.println(\"NO BR\");\n return NO_BR_FLAG;\n }",
"public static void showHands(){\n Scanner scan=new Scanner(System.in);//call the Scanner constructor\n int Deck[]=new int[52];//set up the array for deck\n String answer=\"\";\n do{\n //store 0 to 51 into the Deck array\n for(int i=0;i<Deck.length;i++){\n Deck[i] = i; \n }\n \n int Hand[]={-1,-1,-1,-1,-1};//set up and initialize the array for hand\n \n Random r = new Random ();//Decalre a instance of the Random generator\n int k = Deck.length;//declare a variable to show the effective length of the Deck array\n //set up a loop to draw cards from the deck ramdomly\n for(int j=0;j<Hand.length;j++){\n int draw = r.nextInt(k-1);\n Hand[j] = Deck[draw];//store the ramdom pick from Deck into Hand\n //set the random pick in Deck to -1 and swap with the last effective number in Deck\n Deck[draw]=Deck[k-1];\n Deck[k-1]= -1;\n k--;//reduce the effective array size\n }\n \n //set up the strings, which will indicate the result\n String Clubs = \"Clubs: \";\n String Diamonds = \"Diamonds: \";\n String Hearts = \"Hearts: \";\n String Spades = \"Spades: \";\n //set up a loop to determine the kind and value of each card in hand\n for(int j=0;j<Hand.length;j++){\n int kind = Hand[j]/13;//calculate the kind of the card\n int rank = Hand[j]%13;//calculete the rank of the card\n switch (kind){\n case 0:\n switch (rank){\n case 0:\n Clubs += \"A \";\n break;\n case 1:\n Clubs += \"K \";\n break; \n case 2:\n Clubs += \"Q \";\n break; \n case 3:\n Clubs += \"J \";\n break; \n case 4:\n Clubs += \"10 \";\n break; \n case 5:\n Clubs += \"9 \";\n break; \n case 6:\n Clubs += \"8 \";\n break; \n case 7:\n Clubs += \"7 \";\n break; \n case 8:\n Clubs += \"6 \";\n break; \n case 9:\n Clubs += \"5 \";\n break; \n case 10:\n Clubs += \"4 \";\n break; \n case 11:\n Clubs += \"3 \";\n break; \n case 12:\n Clubs += \"2 \";\n break; \n } \n break;\n case 1:\n switch (rank){\n case 0:\n Diamonds += \"A \";\n break;\n case 1:\n Diamonds += \"K \";\n break; \n case 2:\n Diamonds += \"Q \";\n break; \n case 3:\n Diamonds += \"J \";\n break; \n case 4:\n Diamonds += \"10 \";\n break; \n case 5:\n Diamonds += \"9 \";\n break; \n case 6:\n Diamonds += \"8 \";\n break; \n case 7:\n Diamonds += \"7 \";\n break; \n case 8:\n Diamonds += \"6 \";\n break; \n case 9:\n Diamonds += \"5 \";\n break; \n case 10:\n Diamonds += \"4 \";\n break; \n case 11:\n Diamonds += \"3 \";\n break; \n case 12:\n Diamonds += \"2 \";\n break; \n } \n break;\n case 2:\n switch (rank){\n case 0:\n Hearts += \"A \";\n break;\n case 1:\n Hearts += \"K \";\n break; \n case 2:\n Hearts += \"Q \";\n break; \n case 3:\n Hearts += \"J \";\n break; \n case 4:\n Hearts += \"10 \";\n break; \n case 5:\n Hearts += \"9 \";\n break; \n case 6:\n Hearts += \"8 \";\n break; \n case 7:\n Hearts += \"7 \";\n break; \n case 8:\n Hearts += \"6 \";\n break; \n case 9:\n Hearts += \"5 \";\n break; \n case 10:\n Hearts += \"4 \";\n break; \n case 11:\n Hearts += \"3 \";\n break; \n case 12:\n Hearts += \"2 \";\n break; \n } \n break;\n case 3:\n switch (rank){\n case 0:\n Spades += \"A \";\n break;\n case 1:\n Spades += \"K \";\n break; \n case 2:\n Spades += \"Q \";\n break; \n case 3:\n Spades += \"J \";\n break; \n case 4:\n Spades += \"10 \";\n break; \n case 5:\n Spades += \"9 \";\n break; \n case 6:\n Spades += \"8 \";\n break; \n case 7:\n Spades += \"7 \";\n break; \n case 8:\n Spades += \"6 \";\n break; \n case 9:\n Spades += \"5 \";\n break; \n case 10:\n Spades += \"4 \";\n break; \n case 11:\n Spades += \"3 \";\n break; \n case 12:\n Spades += \"2 \";\n break; \n } \n break;\n }\n }\n \n //print out the results\n System.out.println(Clubs);\n System.out.println(Diamonds);\n System.out.println(Hearts);\n System.out.println(Spades);\n //ask user for input\n System.out.print(\"Go again? Enter 'y' or 'Y', anything else to quit- \");\n answer=scan.next();\n }while(answer.equals(\"Y\") || answer.equals(\"y\"));\n return;\n }",
"public void deal(){\n\t\tInteger topRank;\n\t\tInteger btmRank;\n\t\tDouble[] currPercent = {0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0};\n\t\tlastRaise = -1;\n\t\tcurrBet = 3.0;\n\t\tfor (int i = 0; i<tablePlayers.length*2+5; i++) {\n\t\t\tif (i<tablePlayers.length) {\n\t\t\t\ttablePlayers[i].setCard1(deck[i]); \n\t\t\t}\n\t\t\telse if (i<tablePlayers.length*2) {\n\t\t\t\ttablePlayers[i%tablePlayers.length].setCard2(deck[i]); \n\t\t\t}\n\t\t\telse {\n\t\t\t\ttableCards[i-tablePlayers.length*2].setRank(deck[i].getRank());\n\t\t\t\ttableCards[i-tablePlayers.length*2].setSuit(deck[i].getSuit());\n\t\t\t}\n\t\t}\n\t\t//determine each hand's winning percentage and go through first round of betting\n\t\tfor (int j = 0; j < tablePlayers.length; j++) {\n\t\t\tint i = (button + 3 + j) % 10;\n\t\t\t//if (j==0) System.out.println(\"button = \" + button + \"; first = \" + i);\n\t\t\tif (tablePlayers[i].getCard1().getRank() == 1 || tablePlayers[i].getCard2().getRank() == 1) {\n\t\t\t\ttopRank = 14;\n\t\t\t\tbtmRank = Math.max(tablePlayers[i].getCard1().getRank(), tablePlayers[i].getCard2().getRank());\n\t\t\t\tif (btmRank == 1) {\n\t\t\t\t\tbtmRank = 14;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (tablePlayers[i].getCard1().getRank() <= tablePlayers[i].getCard2().getRank()) {\n\t\t\t\t\ttopRank = tablePlayers[i].getCard2().getRank();\n\t\t\t\t\tbtmRank = tablePlayers[i].getCard1().getRank();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\ttopRank = tablePlayers[i].getCard1().getRank();\n\t\t\t\t\tbtmRank = tablePlayers[i].getCard2().getRank();\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (topRank == btmRank) { //pocket pair\n\t\t\t\tif (topRank == 14) {\n\t\t\t\t\tcurrPercent[i] = winPercent[168];\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tcurrPercent[i] = winPercent[154 + topRank];\n\t\t\t\t}\n\t\t\t} \n\t\t\telse {\n\t\t\t\tint index = -1;\n\t\t\t\tfor (int k = 1; k < topRank-2; k++) {\n\t\t\t\t\tindex += k;\n\t\t\t\t}\n\t\t\t\tindex += btmRank-1;\n\t\t\t\tindex *= 2;\n\t\t\t\tif (tablePlayers[i].getCard1().getSuit() == tablePlayers[i].getCard2().getSuit()) {\n\t\t\t\t\tindex++;\n\t\t\t\t}\n\t\t\t\tcurrPercent[i] = winPercent[index];\n\t\t\t}\n\t\t\t\n\t\t\t//place first round of pre-flop bets\n\t\t\tif (currPercent[i] > 0.20) { \n\t\t\t\tbetOrRaise(i,12.,3.);\n\t\t\t}\t\t\t\n\t\t\telse if ((currPercent[i] > 0.166 && currBet <= 3.0) ) { \n\t\t\t\tbetOrRaise(i,6.,3.);\n\t\t\t}\n\t\t\telse if (currPercent[i] > preFlopCallBBOdds[i] && currBet <= 3.0) {\n\t\t\t\tcallBetOrCheck(i,3.);\n\t\t\t}\n\t\t\telse if (currPercent[i] > preFlopCallARaiseOdds[i] && currBet <= 6.0) {\n\t\t\t\tcallBetOrCheck(i,6.);\n\t\t\t}\n\t\t\telse if (currPercent[i] > preFlopCallMultiRaiseOdds[i] && currBet > 6.0) {\n\t\t\t\tcallBetOrCheck(i,12.);\n\t\t\t}\n\t\t\telse if (i == ((button + 1) % 10)) {\n\t\t\t\ttablePlayers[i].placeBet(1.0);\n\t\t\t\tpot += 1.0;\n\t\t\t\ttablePlayers[i].foldHand();\n\t\t\t}\n\t\t\telse if (i == ((button + 2) % 10)) {\n\t\t\t\ttablePlayers[i].placeBet(3.0);\n\t\t\t\tpot += 3.0;\n\t\t\t\tif (currBet > 3.0) {\n\t\t\t\t\tif (currPercent[i] > preFlopCallBBOdds[i] && currBet <= 6.0) {\n\t\t\t\t\t\tcallBetOrCheck(i,6.);\n\t\t\t\t\t}\n\t\t\t\t\telse tablePlayers[i].foldHand();\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (tablePlayers[i].getBet() < currBet) {\n\t\t\t\ttablePlayers[i].foldHand();\n\t\t\t}\n\t\t}\n\t\tif (lastRaise > -1) {\n\t\t\traiseCount++;\n\t\t}\n\t\t// call raises and allow for re-raises to cap\n\t\twhile (lastRaise > -1) {\n\t\t\tlastRaise = -1;\n\t\t\tfor (int j = 0; j < tablePlayers.length; j++) {\n\t\t\t\tint i = (button + 3 + j) % 10;\n\t\t\t\tif (!tablePlayers[i].hasFolded()) {\n\t\t\t\t\tif (currPercent[i] > 0.20) {\n\t\t\t\t\t\tbetOrRaise(i,12.,3.);\n\t\t\t\t\t}\n\t\t\t\t\tif (tablePlayers[i].getBet() >= currBet) {\n\t\t\t\t\t\tcontinue; //check\n\t\t\t\t\t}\n\t\t\t\t\telse if (tablePlayers[i].getBet() == currBet - 3.0 && currPercent[i] > preFlopCallBBOdds[i]) {\n\t\t\t\t\t\t//call one raise if player would have called BB\n\t\t\t\t\t\tcallBetOrCheck(i, currBet);\n\t\t\t\t\t}\n\t\t\t\t\telse if (tablePlayers[i].getBet() < currBet - 3.0 && currPercent[i] > preFlopCallMultiRaiseOdds[i]) {\n\t\t\t\t\t\t//call the multiRaise if would have called multiple raises on first action\n\t\t\t\t\t\tcallBetOrCheck(i,12.);\n\t\t\t\t\t}\n\t\t\t\t\telse tablePlayers[i].foldHand();\n\t\t\t\t}\n\t\t\t}\n//\t\t\tprintTableStatus();\n\t\t}\n//\t\tfor (int i = 0; i < tablePlayers.length; i++) {\n//\t\t\tif (!tablePlayers[9].hasFolded()) flopsPlayed++;\n//\t\t}\n\t\t//Bet the flop\n\t\tresetPlayerBets();\n\t\tfor (int i = 0; i < tablePlayers.length; i++) {\n\t\t\tif (!tablePlayers[i].hasFolded()) {\n\t\t\t\tplayersLeft++;\n\t\t\t\tflopPlayers++;\n\t\t\t}\n\t\t}\n\t\tif (playersLeft > 1) flopsSeen++;\n\t\tplayersLeft = 0;\n\t\tbetFlop();\n\t\t//Bet the turn\n\t\tresetPlayerBets();\n\t\tfor (int i = 0; i < tablePlayers.length; i++) {\n\t\t\tif (!tablePlayers[i].hasFolded()) {\n\t\t\t\tplayersLeft++;\n\t\t\t\tturnPlayers++;\n\t\t\t}\n\t\t}\n\t\tif (playersLeft > 1) turnsSeen++;\n\t\tplayersLeft = 0;\n\t\tbetTurn();\n\t\t\n\t\t//Bet the river\n\t\tresetPlayerBets();\n\t\tfor (int i = 0; i < tablePlayers.length; i++) {\n\t\t\tif (!tablePlayers[i].hasFolded()) {\n\t\t\t\triverPlayers++;\n\t\t\t\tplayersLeft++;\n\t\t\t}\n\t\t}\n\t\tif (playersLeft > 1) riversSeen++;\n\t\tplayersLeft = 0;\n\t\tbetRiver();\n\t\tfor (int i = 0; i < tablePlayers.length; i++) {\n\t\t\tif (!tablePlayers[i].hasFolded()) {\n\t\t\t\tplayersLeft++;\n\t\t\t}\n\t\t}\n\t\tif (playersLeft > 1) showdowns++;\n\t\tplayersLeft = 0;\n\t\t\n\t}",
"void getArrangedDeck() {\n\t\t\t\t\n\t\tint strength = 1;\n\t\t\n\t\tfor(int index = 0; index < this.numberOfCards; index++) {\n\n\t\t\tif((index+1)%4==0) {\n\t\t\t\tthis.cardsInDeck[index].setColor('\\u2660');\n\t\t\t} else {\n\t\t\t\tif((index+2)%4==0) {\n\t\t\t\t\tthis.cardsInDeck[index].setColor('\\u2665');\n\t\t\t\t} else {\n\t\t\t\t\tif((index+3)%4==0) {\n\t\t\t\t\t\tthis.cardsInDeck[index].setColor('\\u2666');\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.cardsInDeck[index].setColor('\\u2663');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tthis.cardsInDeck[index].setStrength(strength);\n\t\t\tif((index+1) % 4 == 0){\n\t\t\t\tstrength++;\n\t\t\t}\n\t\t\t\n\t\t\tif (index >= 0 && index <= 3) {\n\t\t\t\tthis.cardsInDeck[index].setName(\"2\");\n\t\t\t}\n\t\t\tif (index >= 4 && index <= 7) {\n\t\t\t\tthis.cardsInDeck[index].setName(\"3\");\n\t\t\t}\n\t\t\tif (index >= 8 && index <= 11) {\n\t\t\t\tthis.cardsInDeck[index].setName(\"4\");\n\t\t\t}\n\t\t\tif (index >= 12 && index <= 15) {\n\t\t\t\tthis.cardsInDeck[index].setName(\"5\");\n\t\t\t}\n\t\t\tif (index >= 16 && index <= 19) {\n\t\t\t\tthis.cardsInDeck[index].setName(\"6\");\n\t\t\t}\n\t\t\tif (index >= 20 && index <= 23) {\n\t\t\t\tthis.cardsInDeck[index].setName(\"7\");\n\t\t\t}\n\t\t\tif (index >= 24 && index <= 27) {\n\t\t\t\tthis.cardsInDeck[index].setName(\"8\");\n\t\t\t}\n\t\t\tif (index >= 28 && index <= 31) {\n\t\t\t\tthis.cardsInDeck[index].setName(\"9\");\n\t\t\t}\n\t\t\tif (index >= 32 && index <= 35) {\n\t\t\t\tthis.cardsInDeck[index].setName(\"10\");\n\t\t\t}\n\t\t\tif (index >= 36 && index <= 39) {\n\t\t\t\tthis.cardsInDeck[index].setName(\"J\");\n\t\t\t}\n\t\t\tif (index >= 40 && index <= 43) {\n\t\t\t\tthis.cardsInDeck[index].setName(\"Q\");\n\t\t\t}\n\t\t\tif (index >= 44 && index <= 47) {\n\t\t\t\tthis.cardsInDeck[index].setName(\"K\");\n\t\t\t}\n\t\t\tif (index >= 48 && index <= 51) {\n\t\t\t\tthis.cardsInDeck[index].setName(\"A\");\n\t\t\t}\n\t\t\t\n\t\t}\n\t}",
"public void determineHandType(){\n \r\n if(isStraightFlush()){\r\n handType = HandType.STRAIGHT_FLUSH;\r\n }\r\n else if(isFourOfAKind()){\r\n handType = HandType.FOUR_OF_A_KIND;\r\n }\r\n else if(isFullHouse()){\r\n handType = HandType.FULL_HOUSE;\r\n }\r\n else if(isFlush()){\r\n handType = HandType.FLUSH;\r\n }\r\n else if(isStraight()){\r\n handType = HandType.STRAIGHT;\r\n }\r\n else if(isThreeOfAKind()){\r\n handType = HandType.THREE_OF_A_KIND;\r\n }\r\n else if(isTwoPairs()){\r\n handType = HandType.TWO_PAIRS;\r\n }\r\n else if(isPair()){\r\n handType = HandType.PAIR;\r\n }\r\n else{\r\n //High Card: Hands which do not fit any higher category are ranked by\r\n //the value of their highest card. If the highest cards have the same\r\n //value, the hands are ranked by the next highest, and so on.\r\n handType = HandType.HIGH_CARD;\r\n handValue = cards.get(cards.size()-1).getValue();\r\n }\r\n }",
"private void checkHighCard(Player player) {\n\t\tplayer.setHandRank(HandRank.HIGH_CARD);\n\n\t\tfor (int i = 0, j = 6; i < hand.length; i++, j--)\n\t\t\thand[i] = player.getSevenCardsTempHand().get(j);\n\n\t\tplayer.setFiveCardsHand(hand);\n\t}",
"private void decide(Player player, Card choiceCard) {\n player.removeCard(choiceCard);\n //Wild Draw\n if (choiceCard instanceof WildDrawCard) {\n //set wildDraw color\n while (true) {\n char color = controls.get(state.getTurn()).chooseColor();\n if (color == 'R' || color == 'G' || color == 'Y' || color == 'B') {\n ((WildDrawCard) choiceCard).setConfig(color);\n break;\n }\n System.out.println(\"Invalid color input.\");\n }\n //set wildDraw penalty\n char ch = 0;\n if(canChooseWildDrawCardPenalty(players.get(state.getNextTurn()))) {\n while (true) {\n ch = controls.get(state.getNextTurn()).yesOrNo();\n if (ch == 'Y' || ch == 'N'){\n break;\n }\n System.out.println(\"Invalid input.\");\n }\n }\n if (ch == 'N') {\n state.increaseWildDrawPenalty();\n }\n else {\n ((WildDrawCard) choiceCard).changeState(state);\n for (int i = 0; i < ((WildDrawCard) choiceCard).getForcedCards()*state.getWildDrawPenalty(); i++) {\n players.get(state.getTurn()).addCard(cards.get(0));\n cards.remove(0);\n }\n state.doWildDrawPenalty();\n }\n }\n\n //Wild\n else if (choiceCard instanceof WildCard) {\n while (true) {\n char color = controls.get(state.getTurn()).chooseColor();\n if (color == 'R' || color == 'G' || color == 'Y' || color == 'B') {\n ((WildCard) choiceCard).setConfig(color);\n break;\n }\n System.out.println(\"Invalid color input.\");\n }\n }\n\n //Reverse\n if (choiceCard instanceof ReverseCard) {\n ((ReverseCard) choiceCard).changeState(state);\n }\n\n //Skip\n if (choiceCard instanceof SkipCard) {\n ((SkipCard) choiceCard).changeState(state);\n }\n\n //Draw2\n if (choiceCard instanceof Draw2Card) {\n char ch = 0;\n if(canChooseDrawCardPenalty(players.get(state.getNextTurn()))) {\n while (true) {\n ch = controls.get(state.getNextTurn()).yesOrNo();\n if (ch == 'Y' || ch == 'N'){\n break;\n }\n System.out.println(\"Invalid input.\");\n }\n }\n if (ch == 'N') {\n state.increaseDrawPenalty();\n }\n else {\n ((Draw2Card) choiceCard).changeState(state);\n for (int i = 0; i < ((Draw2Card) choiceCard).getForcedCards()*state.getDrawPenalty(); i++) {\n players.get(state.getTurn()).addCard(cards.get(0));\n cards.remove(0);\n }\n state.doDrawPenalty();\n }\n }\n changeCurrentCard(choiceCard);\n }",
"private int demDoiThong(List<Card> bai) {\n List<Card> cards = new ArrayList<>() ;\n int max = 0;\n int count = 0;\n for (int i = 0; i < bai.size() - 1; i++) {\n if (bai.get(i).getId() >= 48) {\n break;\n }\n if (count == 0 && bai.get(i).getCardNumber() == bai.get(i + 1).getCardNumber()) {\n count = 1;\n if (cards.isEmpty()) {\n cards.add(bai.get(i));\n cards.add(bai.get(i + 1));\n }\n } else {\n if (count % 2 != 0) {\n if (bai.get(i).getCardNumber()== bai.get(i + 1).getCardNumber() - 1) {\n count++;\n } else if (bai.get(i).getCardNumber()!= bai.get(i + 1).getCardNumber()) {\n // valid = false;\n if (count > max) {\n max = count;\n }\n if(cards.size()<6){\n cards.clear();\n }\n count = 0;\n }\n } else {\n if (bai.get(i).getCardNumber()== bai.get(i + 1).getCardNumber()) {\n if(!cards.contains(bai.get(i))){\n cards.add(bai.get(i));\n }\n if(!cards.contains(bai.get(i+1))){\n cards.add(bai.get(i+1));\n }\n count++;\n } else {\n // valid = false;\n if (count > max) {\n max = count;\n }\n if(cards.size()<6){\n cards.clear();\n }\n count = 0;\n }\n }\n }\n }\n if (count > max) {\n max = count;\n }\n if (max >= 5) {\n this.specialCards.addAll(cards);\n }\n return (max + 1) / 2;\n }",
"public Card chooseCard(Hand h, Trick t);",
"@Override\r\n public void war(int playerOne, int playerTwo, int plDeckPosition, \r\n PlayingCard plOne, PlayingCard plTwo){\r\n \r\n //check to see if any player has run out of cards\r\n if(this.checkOnePlayerDecksEmpty(plDeckPosition)){\r\n \r\n // if a player has run out of cards have the player who has cards\r\n // win war and give them the cards\r\n if(!this.checkPlayerPlayingDeck(plDeckPosition, playerTwo)){\r\n this.giveCardToPlayer(plTwo, playerTwo, plDeckPosition+1);\r\n this.giveCardToPlayer(plOne, playerTwo, plDeckPosition+1);\r\n }\r\n else{\r\n this.giveCardToPlayer(plTwo, playerOne, plDeckPosition+1);\r\n this.giveCardToPlayer(plOne, playerOne, plDeckPosition+1);\r\n }\r\n this.currentAction.addActionReturnValue(plOne, plTwo);\r\n }\r\n\r\n else{\r\n \r\n // set a war flag to true, and add it to the action return values\r\n boolean hasWarOccured = true; \r\n this.currentAction.addActionReturnValue(plOne, plTwo, hasWarOccured);\r\n \r\n // initialize variables that will hold the playing cards that will\r\n // be inserted into an array \r\n PlayingCard plOneCard;\r\n PlayingCard plTwoCard;\r\n \r\n // create an array of PlayingCards that will hold the cards\r\n // that will be won by the winner of the war and array of cards to return\r\n // to acction return values\r\n ArrayList<PlayingCard> returnOneCards = new ArrayList<>();\r\n ArrayList<PlayingCard> returnTwoCards = new ArrayList<>();\r\n ArrayList<PlayingCard> plCardToReward = new ArrayList<>();\r\n \r\n // add the cards that triggered the war to the array of cards that\r\n // will be given to the winner of the war\r\n plCardToReward.add(plOne); \r\n plCardToReward.add(plTwo); \r\n \r\n // transfer cards from discard to deck if discard pile has cards\r\n if(!this.checkPlayerPlayingDeck(plDeckPosition+1, \r\n playerOne)){\r\n this.transferFromDiscard(plDeckPosition, playerOne);\r\n }\r\n if(!this.checkPlayerPlayingDeck(plDeckPosition+1, \r\n playerTwo)){\r\n this.transferFromDiscard(plDeckPosition, playerTwo);\r\n } \r\n \r\n // initialize length of war\r\n int lengthOfWar = 4;\r\n // add cards used in war into the arraylist of cards to be returned\r\n // to winner, and to the action return values\r\n for(int i = 0; i < lengthOfWar; i++){\r\n plOneCard = (PlayingCard)this.getPlayerCard(playerOne,\r\n plDeckPosition);\r\n plTwoCard = (PlayingCard)this.getPlayerCard(playerTwo,\r\n plDeckPosition);\r\n returnOneCards.add(plOneCard);\r\n returnTwoCards.add(plTwoCard);\r\n plCardToReward.add(plOneCard);\r\n plCardToReward.add(plTwoCard);\r\n if(this.checkOnePlayerDecksEmpty(plDeckPosition)){\r\n this.currentAction.addActionReturnValue(returnOneCards, \r\n returnTwoCards);\r\n break;\r\n }\r\n if(i == lengthOfWar - 1){\r\n if(!(this.comparePlayingCards(returnOneCards.get(\r\n returnOneCards.size() - 1),\r\n returnTwoCards.get(returnTwoCards.size() - 1)) \r\n instanceof Card)){\r\n this.currentAction.addActionReturnValue(returnOneCards,\r\n returnTwoCards, hasWarOccured);\r\n returnOneCards = new ArrayList<>();\r\n returnTwoCards = new ArrayList<>();\r\n lengthOfWar += 4;\r\n }\r\n else{\r\n this.currentAction.addActionReturnValue(returnOneCards,\r\n returnTwoCards);\r\n }\r\n }\r\n } \r\n\r\n // Compare the two player cards\r\n PlayingCard higherCard = this.comparePlayingCards(returnOneCards.get(\r\n returnOneCards.size() -1),\r\n returnTwoCards.get(returnTwoCards.size() -1));\r\n \r\n // See who owned that card and distribute cards accordingly or initialize\r\n if (higherCard == returnOneCards.get(returnOneCards.size() -1)) {\r\n for(PlayingCard p : plCardToReward){\r\n this.giveCardToPlayer(p, playerOne, plDeckPosition+1); \r\n }\r\n }\r\n else if (higherCard == returnTwoCards.get(returnTwoCards.size() -1)) {\r\n for(PlayingCard p : plCardToReward){\r\n this.giveCardToPlayer(p, playerTwo, plDeckPosition+1); \r\n }\r\n }\r\n else{\r\n if(!this.checkPlayerPlayingDeck(plDeckPosition, playerTwo)){\r\n for(PlayingCard p : plCardToReward){\r\n this.giveCardToPlayer(p, playerTwo, plDeckPosition+1);\r\n }\r\n }\r\n else{\r\n for(PlayingCard p : plCardToReward){\r\n this.giveCardToPlayer(p, playerOne, plDeckPosition+1); \r\n }\r\n }\r\n }\r\n }\r\n }",
"public static void main(String[] args) {\r\n \r\n //Check the input of cards should be multiple of 5 and more than 0\r\n if (args.length % 5 == 0 && args.length > 0) {\r\n \r\n int player = args.length / N; //count the player based on input\r\n int playerNo; //store the number of player for print\r\n int countCard = args.length; //count the number of card \r\n\r\n Suit[] CardSuit = new Suit[countCard]; //store the suit of cards\r\n Rank[] CardRank = new Rank[countCard]; //store the rank of cards\r\n Card[] card = new Card[countCard]; //store all cards\r\n Card[] cardinhand = new Card[N]; //store cards in one hand\r\n PokerHand[] hand = new PokerHand[player]; //store all players' hands\r\n \r\n //Deal with print of players draw\r\n int[] drawPlayer = new int[player]; //store draw players number \r\n /*set default value in the array as bigger than the number of player, \r\n so that will be sorted to the last if not updated*/\r\n Arrays.fill(drawPlayer, player + 1); \r\n int countDraw = 0; //count the number of draw players\r\n \r\n //Get the input: rank of the card\r\n for (int i = 0; i < countCard; i++) {\r\n switch (args[i].charAt(0)) {\r\n case ('2'):\r\n CardRank[i] = Rank.TWO;\r\n break;\r\n case ('3'):\r\n CardRank[i] = Rank.THREE;\r\n break;\r\n case ('4'):\r\n CardRank[i] = Rank.FOUR;\r\n break;\r\n case ('5'):\r\n CardRank[i] = Rank.FIVE;\r\n break;\r\n case ('6'):\r\n CardRank[i] = Rank.SIX;\r\n break;\r\n case ('7'):\r\n CardRank[i] = Rank.SEVEN;\r\n break;\r\n case ('8'):\r\n CardRank[i] = Rank.EIGHT;\r\n break;\r\n case ('9'):\r\n CardRank[i] = Rank.NINE;\r\n break;\r\n case ('T'):\r\n case ('t'):\r\n CardRank[i] = Rank.TEN;\r\n break;\r\n case ('J'):\r\n case ('j'):\r\n CardRank[i] = Rank.JACK;\r\n break;\r\n case ('Q'):\r\n case ('q'):\r\n CardRank[i] = Rank.QUEEN;\r\n break;\r\n case ('K'):\r\n case ('k'):\r\n CardRank[i] = Rank.KING;\r\n break;\r\n case ('A'):\r\n case ('a'):\r\n CardRank[i] = Rank.ACE;\r\n break;\r\n default:\r\n System.out.println\r\n (\"Error: invalid card name '\" + args[i] + \"'\");\r\n System.exit(i);\r\n break;\r\n }\r\n //Get the input: suit of the card\r\n switch (args[i].charAt(1)) {\r\n case ('C'):\r\n case ('c'):\r\n CardSuit[i] = Suit.Clubs;\r\n break;\r\n case ('D'):\r\n case ('d'):\r\n CardSuit[i] = Suit.Diamonds;\r\n break;\r\n case ('H'):\r\n case ('h'):\r\n CardSuit[i] = Suit.Hearts;\r\n break;\r\n case ('S'):\r\n case ('s'):\r\n CardSuit[i] = Suit.Spades;\r\n break;\r\n default:\r\n System.out.println\r\n (\"Error: invalid card name '\" + args[i] + \"'\");\r\n System.exit(i);\r\n break;\r\n }\r\n //Set all cards in the array\r\n card[i] = new Card(CardRank[i], CardSuit[i]);\r\n }\r\n\r\n //Use all cards to set cards for each player\r\n for (int i = 0; i < player; i++) {\r\n for (int j = 0; j < N; j++) {\r\n cardinhand[j] = card[i * 5 + j];\r\n }\r\n playerNo = i + 1;\r\n //Set cards and player number of each hand\r\n hand[i] = new PokerHand(cardinhand, playerNo);\r\n System.out.print(\"Player \" + playerNo + \": \");\r\n //Find the classification of each hand and print\r\n switch (hand[i].FindClass()) {\r\n case Straight_flush:\r\n System.out.println\r\n (hand[i].getR1().getRankName() + \"-high straight flush\");\r\n break;\r\n case Four_of_a_kind:\r\n System.out.println\r\n (\"Four \" + hand[i].getR1().getRankName() + \"s\");\r\n break;\r\n case Full_house:\r\n System.out.println\r\n (hand[i].getR1().getRankName() + \"s full of \" + \r\n hand[i].getR2().getRankName() + \"s\");\r\n break;\r\n case Flush:\r\n System.out.println\r\n (hand[i].getR1().getRankName() + \"-high flush\");\r\n break;\r\n case Straight:\r\n System.out.println\r\n (hand[i].getR1().getRankName() + \"-high straight\");\r\n break;\r\n case Three_of_a_kind:\r\n System.out.println\r\n (\"Three \" + hand[i].getR1().getRankName() + \"s\");\r\n break;\r\n case Two_pair:\r\n System.out.println\r\n (hand[i].getR1().getRankName() + \"s over \" + \r\n hand[i].getR2().getRankName() + \"s\");\r\n break;\r\n case One_pair:\r\n System.out.println\r\n (\"Pair of \" + hand[i].getR2().getRankName() + \"s\");\r\n break;\r\n case High_cards:\r\n System.out.println\r\n (hand[i].getR1().getRankName() + \"-high\");\r\n break;\r\n }\r\n }\r\n\r\n Arrays.sort(hand);//sort the comparable object hand\r\n\r\n // Find the player number that draw with the highest hand player\r\n for (int i = player - 2; i >= 0; i--) {\r\n if (hand[player - 1].compareTo(hand[i]) == 0) {\r\n drawPlayer[countDraw] = hand[i].getPlayerNo();\r\n countDraw++; // count the number of draw players\r\n }\r\n }\r\n\r\n Arrays.sort(drawPlayer); // ascending sort the player number \r\n //print result after compare and sort\r\n if (player > 1) {\r\n if (countDraw > 1)\r\n\r\n {\r\n System.out.print(\"Players \");\r\n for (int i = 0; i < countDraw - 1; i++) {\r\n System.out.print(drawPlayer[i] + \", \");\r\n }\r\n System.out.println(\r\n hand[player - 2].getPlayerNo() + \" and \" + \r\n hand[player - 1].getPlayerNo() + \" draw.\");\r\n } else if (countDraw == 1)\r\n System.out.println\r\n (\"Players \" + hand[player - 2].getPlayerNo() + \r\n \" and \"+ hand[player - 1].getPlayerNo() + \" draw.\");\r\n else\r\n System.out.println\r\n (\"Player \" + hand[player - 1].getPlayerNo() + \" wins.\");\r\n }\r\n } else\r\n System.out.println\r\n (\"Error: wrong number of arguments; must be a multiple of 5\");\r\n System.exit(args.length);\r\n }",
"@Override\n public void chooseAction(){\n healthDecay = getHealth() - 5;\n //now scan for Nazguls\n\n if(healthDecay == 0){\n death(this);\n }\n int scan_result = scan();\n\n if(scan_result == 1){\n move();\n }\n\n if(scan_result == 0 && healthDecay < 75){\n stay();\n }\n\n if(scan_result == 0 && hobbitCounter == 15){\n replicate();\n hobbitCounter = 0;\n }\n\n else{\n move();\n \n }\n hobbitCounter = hobbitCounter + 1;\n }",
"static int getHighCardWithinHand(String[] hand) {\n\tint highCard = 1;\n\tfor (int i = 0; i < hand.length; i++) {\n\t if (getNumberOfCard(hand[i]) > highCard) {\n\t\thighCard = getNumberOfCard(hand[i]);\n\t }\n\t}\n\treturn highCard;\n }",
"public void play() {\n\t\tthis.initializeTurn();\n\t\twhile(this.getAction() > 0) {\n\t\t\tint choix = RandomInt.randomInt(1,6, this.rand);\n\t\t\tif(choix == 1) {\n\t\t\t\t//add building, preference of Machine\n\t\t\t\tint max = 0;\n\t\t\t\tint maxi = 0;\n\t\t\t\tboolean find = false;\n\t\t\t\tfor(int i = 0; i < this.getBoard().getFiveBuildingCards().size(); i++) {\n\t\t\t\t\tif(this.getBoard().getFiveBuildingCards().get(i) != null) {\n\t\t\t\t\t\tif(this.getBoard().getFiveBuildingCards().get(i) instanceof Machine) {\n\t\t\t\t\t\t\tmaxi = i;\n\t\t\t\t\t\t\tfind = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(this.getBoard().getFiveBuildingCards().get(i).getPoint() > max && !find) {\n\t\t\t\t\t\t\tmax = this.getBoard().getFiveBuildingCards().get(i).getPoint();\n\t\t\t\t\t\t\tmaxi = i;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis.addBuilding(this.getBoard().getFiveBuildingCards().get(maxi));\n\t\t\t\tDesignString.printBorder(\"Ouverture d'un chantier\");\n\t\t\t}\n\t\t\telse if(choix == 2 || choix == 3) {\n\t\t\t\t//add worker, preference of the lowest one\n\t\t\t\tint min = 999;\n\t\t\t\tint mini = 0;\n\t\t\t\tfor(int i = 0; i < this.getBoard().getFiveWorkerCards().size(); i++) {\n\t\t\t\t\tif(this.getBoard().getFiveWorkerCards().get(i) != null) {\n\t\t\t\t\t\tif(this.getBoard().getFiveWorkerCards().get(i).getCost() < min && this.getBoard().getFiveWorkerCards().get(i).getCost() >= this.getCoin()) {\n\t\t\t\t\t\t\tmin = this.getBoard().getFiveWorkerCards().get(i).getCost();\n\t\t\t\t\t\t\tmini = i;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(this.getBoard().getFiveWorkerCards().get(mini).getCost() >= this.getCoin()) {\n\t\t\t\t\tDesignString.printBorder(\"Échange action vers écus\");\n\t\t\t\t\tthis.actionToCoins(RandomInt.randomInt(1,this.getAction(), this.rand));\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\tDesignString.printBorder(\"Recrutement d'un ouvrier\");\n\t\t\t\t\tthis.hireWorker(this.getBoard().getFiveWorkerCards().get(mini));\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(choix == 4 || choix == 5 || choix == 6) {\n\t\t\t\t//worker to building. Preference to the started building. If it can't play, preference to action to coin\n\t\t\t\tIBuilding building = null;\n\t\t\t\tIWorker worker = null;\n\t\t\t\tif(this.getWorkerCards().size() > 0) {\n\t\t\t\t\tif(this.getStartedBuilding().size() > 0) {\n\t\t\t\t\t\tchoix = RandomInt.randomInt(0,2,this.rand);\n\t\t\t\t\t\tif(choix%2 == 0) {\n\t\t\t\t\t\t\tint max = 0;\n\t\t\t\t\t\t\tint maxi = 0;\n\t\t\t\t\t\t\tfor(int i = 0; i < this.getStartedBuilding().size(); i++) {\n\t\t\t\t\t\t\t\tif(this.getStartedBuilding().get(i) != null) {\n\t\t\t\t\t\t\t\t\tif(this.getStartedBuilding().get(i).getWorkerOn().size() > max) {\n\t\t\t\t\t\t\t\t\t\tmax = this.getStartedBuilding().get(i).getWorkerOn().size();\n\t\t\t\t\t\t\t\t\t\tmaxi = i;\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\tbuilding = this.getStartedBuilding().get(maxi);\n\n\t\t\t\t\t\t\tworker = this.getWorkerCards().get(RandomInt.randomInt(0,this.getWorkerCards().size()-1, this.rand));\n\n\t\t\t\t\t\t\twhile(worker != null && worker.getCost() > this.getCoin() && this.getAction() > 0) {\n\t\t\t\t\t\t\t\tworker = this.getWorkerCards().get(RandomInt.randomInt(0,this.getWorkerCards().size()-1, this.rand));\n\t\t\t\t\t\t\t\tchoix = RandomInt.randomInt(1,5,this.rand);\n\t\t\t\t\t\t\t\tif(choix == 1) {\n\t\t\t\t\t\t\t\t\tDesignString.printBorder(\"Échange action vers écus\");\n\t\t\t\t\t\t\t\t\tthis.actionToCoins(RandomInt.randomInt(1,this.getAction(), this.rand));\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\tif(this.getAction() >= this.getRemoveBuilding(building)) {\n\t\t\t\t\t\t\t\tDesignString.printBorder(\"Envoi d'un ouvrier sur un chantier\");\n\t\t\t\t\t\t\t\tthis.workerToBuilding(worker, building);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tbuilding = this.getBuildingsCards().get(RandomInt.randomInt(0,this.getBuildingsCards().size()-1, this.rand));\n\t\t\t\t\t\t\twhile(building == null) {\n\t\t\t\t\t\t\t\tbuilding = this.getBuildingsCards().get(RandomInt.randomInt(0,this.getBuildingsCards().size()-1, this.rand));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tworker = this.getWorkerCards().get(RandomInt.randomInt(0,this.getWorkerCards().size()-1, this.rand));\n\t\t\t\t\t\t\twhile(worker != null && worker.getCost() > this.getCoin() && this.getAction() > 0) {\n\t\t\t\t\t\t\t\tworker = this.getWorkerCards().get(RandomInt.randomInt(0,this.getWorkerCards().size()-1, this.rand));\n\t\t\t\t\t\t\t\tchoix = RandomInt.randomInt(1,5,this.rand);\n\t\t\t\t\t\t\t\tif(choix == 1) {\n\t\t\t\t\t\t\t\t\tDesignString.printBorder(\"Échange action vers écus\");\n\t\t\t\t\t\t\t\t\tthis.actionToCoins(RandomInt.randomInt(1,this.getAction(), this.rand));\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\tif(this.getAction() >= this.getRemoveBuilding(building)) {\n\t\t\t\t\t\t\t\tDesignString.printBorder(\"Envoi d'un ouvrier sur un chantier\");\n\t\t\t\t\t\t\t\tthis.workerToBuilding(worker, building);\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} else if(this.getBuildingsCards().size() > 0) {\n\t\t\t\t\t\tbuilding = this.getBuildingsCards().get(RandomInt.randomInt(0,this.getBuildingsCards().size()-1, this.rand));\n\t\t\t\t\t\twhile(building == null) {\n\t\t\t\t\t\t\tbuilding = this.getBuildingsCards().get(RandomInt.randomInt(0,this.getBuildingsCards().size()-1, this.rand));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tworker = this.getWorkerCards().get(RandomInt.randomInt(0,this.getWorkerCards().size()-1, this.rand));\n\t\t\t\t\t\twhile(worker != null && worker.getCost() > this.getCoin() && this.getAction() > 0) {\n\t\t\t\t\t\t\tworker = this.getWorkerCards().get(RandomInt.randomInt(0,this.getWorkerCards().size()-1, this.rand));\n\t\t\t\t\t\t\tchoix = RandomInt.randomInt(1,5,this.rand);\n\t\t\t\t\t\t\tif(choix == 1) {\n\t\t\t\t\t\t\t\tDesignString.printBorder(\"Échange action vers écus\");\n\t\t\t\t\t\t\t\tthis.actionToCoins(RandomInt.randomInt(1,this.getAction(), this.rand));\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\tif(this.getAction() >= this.getRemoveBuilding(building)) {\n\t\t\t\t\t\t\tDesignString.printBorder(\"Envoi d'un ouvrier sur un chantier\");\n\t\t\t\t\t\t\tthis.workerToBuilding(worker, building);\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 static int hitOrStand(Player human, Player computer, Deck myDeck) {\n System.out.println(\"The dealer is showing: \" + computer.hand[0].name + \" of \" + computer.hand[0].suit);\n int choice = 0;\n int playerHandSize = 2;\n int computerHandSize = 2;\n boolean fail = false;\n Scanner input = new Scanner(System.in);\n\n while (choice != 2 && !fail) {\n System.out.println(\"You have been dealt: \");\n int i = 0;\n while (human.hand[i] != null) {\n if (i > 0) {\n System.out.print(\", \");\n }\n System.out.print(human.hand[i].name + \" of \" + human.hand[i].suit);\n i++;\n }\n System.out.print(\" Total: \" + human.printTotalValue());\n System.out.println();\n System.out.println(\"Would you like to hit or stand? Press 1 to hit, press 2 to stand: \");\n choice = input.nextInt();\n\n while (choice != 1 && choice != 2) {\n System.out.println(\"Invalid choice, please try again\");\n System.out.println(\"1. Hit\");\n System.out.println(\"2. Stand\");\n choice = input.nextInt();\n }\n\n if (choice == 1) {\n myDeck.hit(human, playerHandSize);\n playerHandSize++;\n fail = LoseConditions.doILose(human, myDeck);\n if (fail) {\n System.out.println(\"Sorry, you went over 21, you lose.\");\n }\n choice = 0;\n }\n }\n\n while (computer.getTotalValue(myDeck) < 17 || computerHandSize < 4) {\n myDeck.hit(computer, computerHandSize);\n computerHandSize++;\n fail = LoseConditions.doILose(computer, myDeck);\n if (fail) {\n System.out.println(\"You win!!\");\n }\n }\n boolean automaticWinHuman = false;\n boolean automaticWinComputer = false;\n automaticWinHuman = WinConditions.automaticWin(human, myDeck);\n automaticWinComputer = WinConditions.automaticWin(human, myDeck);\n\n if(automaticWinHuman && !automaticWinComputer){\n return 1;\n }\n if(automaticWinComputer && !automaticWinHuman){\n return -1;\n }\n\n boolean playerWin = WinConditions.whoWins(human, computer, myDeck);\n if(playerWin) return 1;\n else return -1;\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 void playBlackjack() {\n\t\tString choice;\n\t\t\n\t\tSystem.out.println(\"Welcome to Blackjack! \\n\");\n\t\tSystem.out.println(\"Dealing hands \\n\");\n\t\tdeck.shuffle();\n\t\tplayer.setHand(deck.drawHand());\n\t\tdealer.setHand(deck.drawHand());\n\t\t\n\t\t\n\t\tif(checkForBlackjack(player) && checkForBlackjack(dealer)) {\n\t\t\tSystem.out.println(showHands());\n\t\t\tSystem.out.println(\"Both player's have blackjack! \\n\");\n\t\t}\n\t\telse if(checkForBlackjack(player)) {\n\t\t\tSystem.out.println(showHands());\n\t\t\tSystem.out.println(\"Player has blackjack! You win! \\n\");\n\t\t}\n\t\telse if(checkForBlackjack(dealer)) {\n\t\t\tSystem.out.println(showHands());\n\t\t\tSystem.out.println(\"Dealer has blackjack! Dealer wins! \\n\");\n\t\t}\n\t\telse{\n\t\t\tSystem.out.println(showInitinalHand());\n\t\t\twhile(player.getHandVal() < 21) {\n\t\t\t\tSystem.out.println(\"Player's turn. Pick to hit or stand \\n\");\n\t\t\t\tchoice = scanner.nextLine().toUpperCase();\n\t\t\t\tif(choice.equals(\"STAND\") || choice.equals(\"S\")) {\n\t\t\t\t\tSystem.out.println(\"Player stands \\n\");\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\telse if(choice.equals(\"HIT\")|| choice.equals(\"H\")) {\n\t\t\t\t\tSystem.out.println(\"Player hits \\n\");\n\t\t\t\t\tplayer.addCard(deck.drawCard());\n\t\t\t\t\tSystem.out.println(showInitinalHand());\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tSystem.out.println(\"Invalid input \\n\");\n\t\t\t\t}\n\t\t\t}\n\t\t\twhile(dealer.getHandVal() < 17) {\n\t\t\t\tSystem.out.println(\"Dealer hits \\n\");\n\t\t\t\tdealer.addCard(deck.drawCard());\n\t\t\t\tSystem.out.println(showHands());\n\t\t\t}\n\t\t\tSystem.out.println(showHands());\n\t\t}\n\t\tcheckWinner();\n\t\tif(result.equals(\"TIE\")) {\n\t\t\tSystem.out.println(\"The result is a tie! \\n\");\n\t\t}\n\t\telse {\n\t\t\tSystem.out.println(\"The winner is the \" + result + \"!\\n\");\n\t\t}\n\t}",
"@Test\n \tpublic void testDisprovingSuggestion() {\n \t\t//Set suggestion\n \t\tSolution suggestion = new Solution(\"Colonel Mustard\", \"Knife\", \"Library\");\n \t\tComputerPlayer computer1 = new ComputerPlayer();\n \t\tComputerPlayer computer2 = new ComputerPlayer();\n \t\tComputerPlayer computer3 = new ComputerPlayer();\n \t\tHumanPlayer human = new HumanPlayer();\n \t\tArrayList<Card> hand = new ArrayList<Card>();\n \t\tArrayList<ComputerPlayer> comps = new ArrayList<ComputerPlayer>();\n \t\t\n \t\t\n \t\t//ensure If a player (human or computer) has a card that's suggested, that card is \"shown\"\n \t\tCard mustardCard = new Card(\"Colonel Mustard\", Card.cardType.PERSON);\n \t\thand.add(mustardCard);\n \t\tcomputer1.setCards(hand);\n \t\tAssert.assertEquals(computer1.disproveSuggestion(suggestion), mustardCard);\n \t\t\n \t\t\n \t\t//ensure If the player has multiple cards that match, the card to be returned is selected randomly.\n \t\tCard knifeCard = new Card (\"Knife\", Card.cardType.WEAPON);\n \t\tCard libraryCard = new Card(\"Library\", Card.cardType.ROOM);\n \t\thand.add(knifeCard);\n \t\thand.add(libraryCard);\n \t\thuman.setCards(hand);\n \t\tint mustard = 0, knife = 0, library = 0;\n \t\t//make sure card is valid and counts how many times each card is returned\n \t\tfor(int i = 0; i < 100; i++) {\n \t\t\tCard disproved = human.disproveSuggestion(suggestion);\n \t\t\t\n \t\t\tif(disproved == mustardCard)\n \t\t\t\tmustard++;\n \t\t\telse if(disproved == knifeCard)\n \t\t\t\tknife++;\n \t\t\telse if(disproved == libraryCard)\n \t\t\t\tlibrary++;\n \t\t\telse\n \t\t\t\tfail(\"Invalid card returned\");\n \t\t}\n \t\t//makes sure every card is returned more than once\n \t\tAssert.assertTrue(mustard > 10);\n \t\tAssert.assertTrue(knife > 10);\n \t\tAssert.assertTrue(library > 10);\n \t\t\n \t\thuman.setCards(null);\n \t\tgame.setCurrentPlayer(game.getHuman());\n \t\t\t\n \t\t//ensure In the board game, disproving a suggestion starts with a player to the left of the person making the suggestion\n \t\thand.remove(mustardCard);\n \t\thand.remove(knifeCard);\n \t\tcomputer2.setCards(hand);\n \t\thand.remove(libraryCard);\n \t\thand.add(knifeCard);\n \t\tcomputer3.setCards(hand);\n \t\tcomps.add(computer1);\n \t\tcomps.add(computer2);\n \t\tcomps.add(computer3);\n \t\t\n \t\tint comp1 = 0, comp2 = 0, comp3 = 0;\n \t\tgame.setComputer(comps);\n \t\tfor(int i = 0; i < 100; i++) {\n \t\t\tCard returned = game.handleSuggestion(suggestion);\n \t\t\tif(returned == mustardCard)\n \t\t\t\tcomp1++;\n \t\t\telse if(returned == libraryCard)\n \t\t\t\tcomp2++;\n \t\t\telse if(returned == knifeCard)\n \t\t\t\tcomp3++;\n \t\t\telse\n \t\t\t\tfail(\"Invalid card returned\");\t\n \t\t}\n\t\t//Assert.assertTrue(comp1 > 10);\n\t\t//Assert.assertTrue(comp2 > 10);\n \t\tAssert.assertTrue(comp3 > 10);\n \t\t//ensure The player making the suggestion should not be queried\n \t\tgame.setCurrentPlayer(computer1);\n \t\tfor(int i = 0; i < 100; i++) {\n \t\t\tCard returned = game.handleSuggestion(suggestion);\n \t\t\tif(returned == mustardCard)\n \t\t\t\tfail(\"Suggesting player cannot return a card\");\t\n \t\t}\n \t}",
"@Test\n public void play_FourOfAKindVsFourOfAKind() throws Exception {\n Hand hand1 = new Hand();\n hand1.addCard(new Card(Card.SUIT_SPADES, Card.CARD_5));\n hand1.addCard(new Card(Card.SUIT_HEARTS, Card.CARD_5));\n hand1.addCard(new Card(Card.SUIT_DIAMONDS, Card.CARD_5));\n hand1.addCard(new Card(Card.SUIT_CLUBS, Card.CARD_5));\n hand1.addCard(new Card(Card.SUIT_DIAMONDS, Card.CARD_JACK));\n Hand hand2 = new Hand();\n hand2.addCard(new Card(Card.SUIT_CLUBS, Card.CARD_3));\n hand2.addCard(new Card(Card.SUIT_SPADES, Card.CARD_10));\n hand2.addCard(new Card(Card.SUIT_HEARTS, Card.CARD_10));\n hand2.addCard(new Card(Card.SUIT_DIAMONDS, Card.CARD_10));\n hand2.addCard(new Card(Card.SUIT_CLUBS, Card.CARD_10));\n assertEquals(hand2, FiveCardDraw.play(hand1, hand2));\n }",
"public void CheckHands(){\n HashMap<CardRank, Integer> CardMap = getCardMap(ranks);\n ArrayList<Integer> MapValues = new ArrayList<>(CardMap.values());\n //sort MapValues in descending order, so that we can use\n // MapValues.get(0) to get the largest appear time and so on\n Collections.sort(MapValues, Collections.reverseOrder());\n System.out.print(\"Player 1: \");\n\n\n //Straight flush\n if (flush(suits) && straight(ranks)){\n System.out.println(ranks.get(ranks.size()-1).getName()\n + \"-high straight flush\");\n return;\n }\n\n //Four of a kind\n if (MapValues.get(0) == 4){\n CardRank rank4 = getKeysByValue(CardMap, 4).get(0);\n System.out.println(\"Four \" + rank4.getName() + \"s\");\n return;\n }\n\n //full house\n if (MapValues.get(0) == 3 && MapValues.get(1) == 2){\n CardRank rank3 = getKeysByValue(CardMap, 3).get(0);\n CardRank rank2 = getKeysByValue(CardMap,2).get(0);\n System.out.println(rank3.getName() + \"s full of \"\n + rank2.getName()+\"s\");\n return;\n }\n\n //Flush (not straight)\n if (flush(suits) && !straight(ranks)) {\n System.out.println(ranks.get(ranks.size() - 1).getName()\n + \"-high flush\");\n return;\n }\n\n //Straight (not flush)\n if (straight(ranks) && !flush(suits)){\n System.out.println(ranks.get(ranks.size() - 1).getName()\n + \"-high straight\");\n return;\n }\n\n //Three of a kind (not full house)\n if (MapValues.get(0) == 3 && MapValues.get(1) != 2){\n CardRank rank3 = getKeysByValue(CardMap, 3).get(0);\n System.out.println(\"Three \" + rank3.getName() + \"s\");\n return;\n }\n\n //Two Pair\n if (MapValues.get(0) == 2 && MapValues.get(1) == 2){\n CardRank rank21 = getKeysByValue(CardMap,2).get(0);\n CardRank rank22 = getKeysByValue(CardMap, 2).get(1);\n System.out.println(rank22.getName() + \"s over \"\n + rank21.getName() + \"s\" );\n return;\n\n }\n\n //One pair (only one)\n if (MapValues.get(0) == 2 && MapValues.get(1) == 1){\n CardRank rank2 = getKeysByValue(CardMap, 2).get(0);\n System.out.println(\"Pair of \" + rank2.getName()+ \"s\");\n return;\n }\n\n //High Card (not flush)\n if (MapValues.get(0) == 1 && !flush(suits)){\n System.out.println(ranks.get(ranks.size() - 1).getName() + \"-high\");\n return;\n }\n }",
"Deque<PokerCard> getShuffledHalfDeck();",
"private static String getMyHand(JSONObject data) {\n\n String rez = null;\n\n JSONArray myCard = (JSONArray)data.get(\"newRightHand\");\n\n JSONArray myFirstCard = (JSONArray)myCard.get(0);\n JSONArray mySecondCard = (JSONArray)myCard.get(1);\n\n if (!\"a\".equalsIgnoreCase(myFirstCard.get(0).toString()) && !\"a\".equalsIgnoreCase(mySecondCard.get(0).toString()))\n rez = mySecondCard.get(2).toString();\n else\n if (\"a\".equalsIgnoreCase(myFirstCard.get(0).toString()))\n rez = \"A\" + filterCard(mySecondCard.get(0).toString());\n else rez = \"A\" + filterCard(myFirstCard.get(0).toString());\n\n return \"A10\".equals(rez) ? \"20\" : rez;\n }",
"@Test\r\n public void testPlayer_getDumbStrategyCard_differentWinners() {\r\n player2 = new Player(\"\", true);\r\n player2.setHand(strategyHand.getAllCards());\r\n boolean differentLegalCardFound = false;\r\n Card firstDiscard = player2.getDumbStrategyCard(yellowSix, yellowSix.getColor());\r\n for(int i = 0; i < 25; i++) {\r\n Card loopCard = player2.getDumbStrategyCard(yellowSix, yellowSix.getColor());\r\n if(!loopCard.equals(firstDiscard)) {\r\n differentLegalCardFound = true;\r\n }\r\n }\r\n assertTrue(differentLegalCardFound);\r\n }",
"public boolean play(DiscardPile discardPile, \n\t Stack<Card> drawPile, \n\t\t\t\t\t\t\t\t\t\t\tArrayList<Player> players)\n\t{\t\n\t\n\t\n\tSystem.out.println(\"Before playing: \" + this.hand.toString());\n\t\tboolean temp = false;\n\t\tString suitEight = \"xyz\";\n\t\n\t\tif ((discardPile.top()).getRank() == 4 && super.checker_4 == true){\n\t\t\tSystem.out.println();\n\t\t\tSystem.out.println(\"\\t _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \");\n\t\t\tSystem.out.println(\"\\t | skipping the turn.. :( |\");\n\t\t\tSystem.out.println(\"\\t -----------------------------\");\n\t\t\tSystem.out.println();\n\t\t\tSystem.out.println();\n\t\t\tsuper.checker_4 = false;\n\t\t\treturn false;\n\t\t\t\n\t\t\t}\n\t\n\t\n\t\n\t\n\t\n\t\n\t\t/* adding two cards */\n\t\t if ((discardPile.top()).getRank() == 2 && super.checker_2 == true){\n\t\t\t \n\t\t\t System.out.println();\n\t\t\t System.out.println(\"\\t _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \");\n\t\t\t System.out.println(\"\\t | twice the value added! |\");\n\t\t\t System.out.println(\"\\t -----------------------------\");\n\t\t\t System.out.println();\n\t\t\t System.out.println();\n\t\t\t \n\t\t\t \n\t\t\tthis.hand.add(drawPile.pop());\n\t\t\t this.hand.add(drawPile.pop());\n\t\t\ttemp = false;\n\t\t\tsuper.checker_2 = false;\n\t\t }\n\t\t\n\t\t\n\t\t \n\t\t\n\t\telse{\n\t\t\tint i = location_1(discardPile);\n\t\t\t\n\t\t\t\n\t\t\tif(i == -1){\n\t\t\t\tthis.hand.add(drawPile.pop());\n\t\t\t\tif( i == location_2(discardPile)){ \n\t\t\t\t\t//System.out.println(\"value is added!\");\n\t\t\t\t\t//System.out.println();\n\t\t\t\t\t//System.out.println();\n\t\t\t\t\n\t\t\t\t} else{\n\t\t\t\t\ti = location_2(discardPile);\n\t\t\t\t\t//System.out.println(\"HAHA! got it!\");\n\t\t\t\t\tdiscardPile.add(this.hand.remove(i));\n\t\t\t\t\ttemp = false;\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tif ((discardPile.top()).getRank() == 2 && super.checker_2 == false){\n\t\t\t\t\t\tsuper.checker_2 = true;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(discardPile.top().getRank() == 4 && super.checker_4 == false){\n\t\t\t\t\t\tsuper.checker_4 = true;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif ((discardPile.top()).getRank() == 8 && temp == false){\n\t\t\t\t\t\tsuitEight = this.wildEight(discardPile, drawPile, players);\n\t\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t\tSystem.out.println(\"\\t \\t ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\");\n\t\t\t\t\t\tSystem.out.println(\"\\t \\t \\t Changing the suit to: \" + suitEight);\n\t\t\t\t\t\tSystem.out.print(\"\\t \\t \\t Processing....\");\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\tSystem.out.println();\n\t\t\t\t\t\t(discardPile.top()).setSuit(suitEight);\n\t\t\t\t\t\tSystem.out.println(\"\\t \\t \\t draw pile : \" + drawPile.peek() );\n\t\t\t\t\t\tSystem.out.println(\"\\t \\t \\t discard pile : \" + discardPile.top() );\n\t\t\t\t\t\tSystem.out.println(\"\\t \\t ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\");\n\t\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tif( this.hand.size() == 0 ){\n\t\t\t\t\ttemp = true;\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\t\n\t\t\t} else{\n\t\t\t\tdiscardPile.add(this.hand.remove(i));\n\t\t\t\ttemp = false;\n\t\t\t\t\n\t\t\t\tif ((discardPile.top()).getRank() == 2 && super.checker_2 == false){\n\t\t\t\t\t\tsuper.checker_2 = true;\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(discardPile.top().getRank() == 4 && super.checker_4 == false){\n\t\t\t\t\tsuper.checker_4 = true;\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ((discardPile.top()).getRank() == 8 && temp == false){\n\t\t\t\t\t\tsuitEight = this.wildEight(discardPile, drawPile, players);\n\t\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t\tSystem.out.println(\"\\t \\t ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\");\n\t\t\t\t\t\tSystem.out.println(\"\\t \\t \\t Changing the suit to: \" + suitEight);\n\t\t\t\t\t\tSystem.out.print(\"\\t \\t \\t Processing....\");\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\tSystem.out.println();\n\t\t\t\t\t\t(discardPile.top()).setSuit(suitEight);\n\t\t\t\t\t\tSystem.out.println(\"\\t \\t \\t draw pile : \" + drawPile.peek() );\n\t\t\t\t\t\tSystem.out.println(\"\\t \\t \\t discard pile : \" + discardPile.top() );\n\t\t\t\t\t\tSystem.out.println(\"\\t \\t ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\");\n\t\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t\tSystem.out.println();\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\tif( this.hand.size() == 0 ){\n\t\t\t\t\ttemp = true;\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\n\n\t\t\n\t\t\n\t\n\t\tSystem.out.println(\"After Playing: \" + this.hand.toString());\n\t\tSystem.out.println();\n\t\treturn temp;\n\t\t\n\t\n\t}",
"@Test\n public void play_ThreeOfAKindVsThreeOfAKind() throws Exception {\n Hand hand1 = new Hand();\n hand1.addCard(new Card(Card.SUIT_SPADES, Card.CARD_2));\n hand1.addCard(new Card(Card.SUIT_HEARTS, Card.CARD_2));\n hand1.addCard(new Card(Card.SUIT_DIAMONDS, Card.CARD_2));\n hand1.addCard(new Card(Card.SUIT_HEARTS, Card.CARD_5));\n hand1.addCard(new Card(Card.SUIT_DIAMONDS, Card.CARD_6));\n Hand hand2 = new Hand();\n hand2.addCard(new Card(Card.SUIT_SPADES, Card.CARD_8));\n hand2.addCard(new Card(Card.SUIT_HEARTS, Card.CARD_8));\n hand2.addCard(new Card(Card.SUIT_DIAMONDS, Card.CARD_8));\n hand2.addCard(new Card(Card.SUIT_HEARTS, Card.CARD_9));\n hand2.addCard(new Card(Card.SUIT_DIAMONDS, Card.CARD_10));\n assertEquals(hand2, FiveCardDraw.play(hand1, hand2));\n }",
"private void makeCards() {\n //make number cards(76 cards)\n for (int i = 0; i < 10; i++) {\n String s = i + \"\";\n cards.add(new NumberCard(s, Color.RED, i));\n cards.add(new NumberCard(s, Color.GREEN, i));\n cards.add(new NumberCard(s, Color.BLUE, i));\n cards.add(new NumberCard(s, Color.YELLOW, i));\n if(i > 0) {\n cards.add(new NumberCard(s, Color.RED, i));\n cards.add(new NumberCard(s, Color.GREEN, i));\n cards.add(new NumberCard(s, Color.BLUE, i));\n cards.add(new NumberCard(s, Color.YELLOW, i));\n }\n }\n\n //make wild cards(8 cards)⨁\n for (int i = 0; i < 4; i++) {\n cards.add(new WildCard(\"W\", Color.BLACK));\n cards.add(new WildDrawCard(\"W+4\", Color.BLACK));\n }\n\n //make reverse cards(8 cards)⤤⤦\n for (int i = 0; i < 2; i++) {\n cards.add(new ReverseCard(\"Rev\", Color.RED));\n cards.add(new ReverseCard(\"Rev\", Color.GREEN));\n cards.add(new ReverseCard(\"Rev\", Color.BLUE));\n cards.add(new ReverseCard(\"Rev\", Color.YELLOW));\n }\n\n //make draw cards(8 cards)⧉\n for (int i = 0; i < 2; i++) {\n cards.add(new Draw2Card(\"D+2\", Color.RED));\n cards.add(new Draw2Card(\"D+2\", Color.GREEN));\n cards.add(new Draw2Card(\"D+2\", Color.BLUE));\n cards.add(new Draw2Card(\"D+2\", Color.YELLOW));\n }\n\n //make skip cards(8 cards)🚫\n for (int i = 0; i < 2; i++) {\n cards.add(new SkipCard(\"Ski\", Color.RED));\n cards.add(new SkipCard(\"Ski\", Color.GREEN));\n cards.add(new SkipCard(\"Ski\", Color.BLUE));\n cards.add(new SkipCard(\"Ski\", Color.YELLOW));\n }\n //Shuffling cards list\n Collections.shuffle(cards);\n }",
"public int playHand(Hand hand){\r\n\r\n if( this.getRank() > hand.getRank()){\r\n System.out.println();\r\n System.out.println(\"Black: \" + this.getHand() + \" White: \" + hand.getHand());\r\n System.out.println(\"Black wins!\");\r\n return 1;\r\n }\r\n\r\n else if(this.getRank() < hand.getRank()){\r\n System.out.println();\r\n System.out.println(\"Black: \" + this.getHand() + \" White: \" + hand.getHand());\r\n System.out.println(\"White wins!\");\r\n return -1;\r\n }\r\n else{\r\n System.out.println();\r\n System.out.println(\"Black: \" + this.getHand() + \" White: \" + hand.getHand());\r\n\r\n if(this.getHighCard() > hand.getHighCard()){\r\n System.out.println(\"Black Wins!\");\r\n return 1;\r\n }\r\n else if(hand.getHighCard() > this.getHighCard()){\r\n System.out.println(\"white Wins!\");\r\n }\r\n System.out.print(\"Tie!\");\r\n return 0;\r\n }\r\n\r\n }",
"public void dealerAskCard() {\n int dealerScore = this.getDealerHand().getActualValue();\n while (dealerScore < 17) {\n Card card = this.deck.deal(this.getDealerHand());\n dealerScore = this.getDealerHand().getActualValue();\n }\n }",
"@Test\n void testForLargestCardInTrick() {\n Dealer testDealer = new Dealer();\n\n Suit suit1 = Suit.DIAMONDS;\n Suit suit2 = Suit.SPADES;\n Suit suit3 = Suit.SPADES;\n Suit suit4 = Suit.DIAMONDS;\n \n Rank rank1 = Rank.TWO;\n Rank rank2 = Rank.KING;\n Rank rank3 = Rank.ACE;\n Rank rank4 = Rank.FIVE;\n\n Card card1 = new Card(suit1,rank1,false);\n Card card2 = new Card(suit2,rank2,false);\n Card card3 = new Card(suit3,rank3,false);\n Card card4 = new Card(suit4,rank4,false);\n\n \n testDealer.addToPlayedCards(card1);\n testDealer.addToPlayedCards(card2);\n testDealer.addToPlayedCards(card3);\n testDealer.addToPlayedCards(card4);\n\n assertEquals(card4 , testDealer.getLargestCardFromTrick());\n }",
"public boolean checkIf_one_cardAwayFromStraight() {\n boolean oneAway = false;\n //CASE 1: Four in a row and missing one _ X X X X _ ---> open ended straight draw \n if (numSequentially == 4 && lowestValOfNumSequentially >= 2 && lowestValOfNumSequentially <= 10) {// _ 2 3 4 5 _, we can get ANY ace or ANY 6\n oneAway = true;\n numOuts += 8;\n bestHandFromCardsNickNameString = \"Open-Ended Straight Draw\";\n } else if (numSequentially == 4) {// A 2 3 4// any 5\n oneAway = true;\n numOuts += 4;\n bestHandFromCardsNickNameString = \"Single-Sided Straight Draw\";\n } else if (numSequentially == 3) {// CASE 2: 3 in a row and missing one between so either X _ X X X OR OR X X X _ X\n if (handContainsValueZ(lowestValOfNumSequentially - 2) || handContainsValueZ(lowestValOfNumSequentially + 4)) {\n numOuts += 4;\n oneAway = true;\n bestHandFromCardsNickNameString = \"Gutshot Straight Draw\";\n }\n } else if (numSequentially == 2) {//lowest value of num sequentially will be the higher pair X X _ K X (will be k)\n if (handContainsValueZ(lowestValOfNumSequentially - 2) && handContainsValueZ(lowestValOfNumSequentially - 3)) {\n numOuts += 4;\n oneAway = true;\n bestHandFromCardsNickNameString = \"Bulls-Eye Gutshot Straight Draw\";\n }\n\n }\n\n return oneAway;\n }",
"private static int zzaz(java.lang.String r5) {\n /*\n int r0 = r5.hashCode()\n r1 = 0\n r2 = 3\n r3 = 2\n r4 = 1\n switch(r0) {\n case -1095064472: goto L_0x002a;\n case 187078296: goto L_0x0020;\n case 1504578661: goto L_0x0016;\n case 1505942594: goto L_0x000c;\n default: goto L_0x000b;\n }\n L_0x000b:\n goto L_0x0034\n L_0x000c:\n java.lang.String r0 = \"audio/vnd.dts.hd\"\n boolean r5 = r5.equals(r0)\n if (r5 == 0) goto L_0x0034\n r5 = 3\n goto L_0x0035\n L_0x0016:\n java.lang.String r0 = \"audio/eac3\"\n boolean r5 = r5.equals(r0)\n if (r5 == 0) goto L_0x0034\n r5 = 1\n goto L_0x0035\n L_0x0020:\n java.lang.String r0 = \"audio/ac3\"\n boolean r5 = r5.equals(r0)\n if (r5 == 0) goto L_0x0034\n r5 = 0\n goto L_0x0035\n L_0x002a:\n java.lang.String r0 = \"audio/vnd.dts\"\n boolean r5 = r5.equals(r0)\n if (r5 == 0) goto L_0x0034\n r5 = 2\n goto L_0x0035\n L_0x0034:\n r5 = -1\n L_0x0035:\n if (r5 == 0) goto L_0x0045\n if (r5 == r4) goto L_0x0043\n if (r5 == r3) goto L_0x0041\n if (r5 == r2) goto L_0x003e\n return r1\n L_0x003e:\n r5 = 8\n return r5\n L_0x0041:\n r5 = 7\n return r5\n L_0x0043:\n r5 = 6\n return r5\n L_0x0045:\n r5 = 5\n return r5\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.android.gms.internal.ads.zzio.zzaz(java.lang.String):int\");\n }",
"private int highCard() {\n\t\tint highCard = 0;\n\t\tfor (int counter = 0; counter < Constants.HAND_SIZE; counter++) {\n\t\t\tif (hand[counter].getValueIndex() > highCard) {\n\t\t\t\thighCard = hand[counter].getValueIndex();\n\t\t\t}\n\t\t}\n\t\tresult.setPrimaryValuePos(highCard);\n\t\treturn highCard;\n\t}",
"public Location attack() {\n resetBoard();\n\n if (getHits().isEmpty()) {\n// System.out.println(\"Hunting\");\n\n for (final int[] r : board) {\n for (int c = 0; c < r.length; c++) {\n if (getIntegers().contains(5) && (c < (r.length - 4)))\n if ((-1 != r[c]) && (-1 != r[c + 1]) && (-1 != r[c + 2]) && (-1 != r[c + 3]) && (-1 != r[c + 4])) {\n ++r[c];\n ++r[c + 1];\n ++r[c + 2];\n ++r[c + 3];\n ++r[c + 4];\n }\n\n if (getIntegers().contains(4) && (c < (r.length - 3)))\n if ((-1 != r[c]) && (-1 != r[c + 1]) && (-1 != r[c + 2]) && (-1 != r[c + 3])) {\n ++r[c];\n ++r[c + 1];\n ++r[c + 2];\n ++r[c + 3];\n }\n if (getIntegers().contains(3) && (c < (r.length - 2)))\n if ((-1 != r[c]) && (-1 != r[c + 1]) && (-1 != r[c + 2])) {\n ++r[c];\n ++r[c + 1];\n ++r[c + 2];\n\n }\n if (getIntegers().contains(3) && (2 == Collections.frequency(getIntegers(), 3)) && (c < (r.length - 2)))\n if ((-1 != r[c]) && (-1 != r[c + 1]) && (-1 != r[c + 2])) {\n ++r[c];\n ++r[c + 1];\n ++r[c + 2];\n\n }\n if (getIntegers().contains(2) && (c < (r.length - 1)))\n if ((-1 != r[c]) && (-1 != r[c + 1])) {\n ++r[c];\n ++r[c + 1];\n }\n }\n }\n\n for (int c = 0; c < board[0].length; c++) {\n for (int r = 0; r < board.length; r++) {\n if (getIntegers().contains(5) && (r < (board.length - 4)))\n if ((-1 != board[r][c]) && (-1 != board[r + 1][c]) && (-1 != board[r + 2][c]) && (-1 != board[r + 3][c]) && (-1 != board[r + 4][c])) {\n ++board[r][c];\n ++board[r + 1][c];\n ++board[r + 2][c];\n ++board[r + 3][c];\n ++board[r + 4][c];\n }\n\n if (getIntegers().contains(4) && (r < (board.length - 3)))\n if ((-1 != board[r][c]) && (-1 != board[r + 1][c]) && (-1 != board[r + 2][c]) && (-1 != board[r + 3][c])) {\n ++board[r][c];\n ++board[r + 1][c];\n ++board[r + 2][c];\n ++board[r + 3][c];\n }\n if (getIntegers().contains(3) && (r < (board.length - 2)))\n if ((-1 != board[r][c]) && (-1 != board[r + 1][c]) && (-1 != board[r + 2][c])) {\n\n ++board[r][c];\n ++board[r + 1][c];\n ++board[r + 2][c];\n\n\n }\n if (getIntegers().contains(3) && (2 == Collections.frequency(getIntegers(), 3)) && (r < (board.length - 2)))\n if ((-1 != board[r][c]) && (-1 != board[r + 1][c]) && (-1 != board[r + 2][c])) {\n\n ++board[r][c];\n ++board[r + 1][c];\n ++board[r + 2][c];\n\n\n }\n if (getIntegers().contains(2) && (r < (board.length - 1)))\n if ((-1 != board[r][c]) && (-1 != board[r + 1][c])) {\n ++board[r][c];\n ++board[r + 1][c];\n }\n }\n }\n } else {\n// System.out.println(\"Hitting\");\n\n for (final Location hit : getHits()) {\n final int r = hit.getRow();\n final int c = hit.getCol();\n\n if (getIntegers().contains(2)) {\n if ((0 <= (c - 1)) && (-1 != board[r][c]) && (-1 != board[r][c - 1])) {\n ++board[r][c];\n ++board[r][c - 1];\n }\n\n\n if (((c + 1) < board[0].length) && (-1 != board[r][c]) && (-1 != board[r][c + 1])) {\n ++board[r][c];\n ++board[r][c + 1];\n }\n\n if ((0 <= (r - 1)) && (-1 != board[r][c]) && (-1 != board[r - 1][c])) {\n ++board[r][c];\n ++board[r - 1][c];\n }\n\n if (((r + 1) < board.length) && (-1 != board[r][c]) && (-1 != board[r + 1][c])) {\n ++board[r][c];\n ++board[r + 1][c];\n }\n\n\n }\n if (getIntegers().contains(3)) {\n final int inc = Collections.frequency(getIntegers(), 3);\n\n if ((0 <= (c - 2)) && (-1 != board[r][c]) && (-1 != board[r][c - 1]) && (-1 != board[r][c - 2])) {\n board[r][c] += inc;\n board[r][c - 1] += inc;\n board[r][c - 2] += inc;\n }\n if (((c + 2) < board[0].length) && (-1 != board[r][c]) && (-1 != board[r][c + 1]) && (-1 != board[r][c + 2])) {\n board[r][c] += inc;\n board[r][c + 1] += inc;\n board[r][c + 2] += inc;\n }\n if ((0 <= (r - 2)) && (-1 != board[r][c]) && (-1 != board[r - 1][c]) && (-1 != board[r - 2][c])) {\n board[r][c] += inc;\n board[r - 1][c] += inc;\n board[r - 2][c] += inc;\n }\n if (((r + 2) < board.length) && (-1 != board[r][c]) && (-1 != board[r + 1][c]) && (-1 != board[r + 2][c])) {\n board[r][c] += inc;\n board[r + 1][c] += inc;\n board[r + 2][c] += inc;\n }\n\n\n }\n if (getIntegers().contains(4)) {\n if ((0 <= (c - 3)) && (-1 != board[r][c]) && (-1 != board[r][c - 1]) && (-1 != board[r][c - 2]) && (-1 != board[r][c - 3])) {\n ++board[r][c];\n ++board[r][c - 1];\n ++board[r][c - 2];\n ++board[r][c - 3];\n }\n if (((c + 3) < board[0].length) && (-1 != board[r][c]) && (-1 != board[r][c + 1]) && (-1 != board[r][c + 2]) && (-1 != board[r][c + 3])) {\n ++board[r][c];\n ++board[r][c + 1];\n ++board[r][c + 2];\n ++board[r][c + 3];\n }\n if ((0 <= (r - 3)) && (-1 != board[r][c]) && (-1 != board[r - 1][c]) && (-1 != board[r - 2][c]) && (-1 != board[r - 3][c])) {\n ++board[r][c];\n ++board[r - 1][c];\n ++board[r - 2][c];\n ++board[r - 3][c];\n }\n if (((r + 3) < board.length) && (-1 != board[r][c]) && (-1 != board[r + 1][c]) && (-1 != board[r + 2][c]) && (-1 != board[r + 3][c])) {\n ++board[r][c];\n ++board[r + 1][c];\n ++board[r + 2][c];\n ++board[r + 3][c];\n }\n\n\n }\n if (getIntegers().contains(5)) {\n if ((0 <= (c - 4)) && (-1 != board[r][c]) && (-1 != board[r][c - 1]) && (-1 != board[r][c - 2]) && (-1 != board[r][c - 3]) && (-1 != board[r][c - 4])) {\n ++board[r][c];\n ++board[r][c - 1];\n ++board[r][c - 2];\n ++board[r][c - 3];\n ++board[r][c - 4];\n }\n if (((c + 4) < board[0].length) && (-1 != board[r][c]) && (-1 != board[r][c + 1]) && (-1 != board[r][c + 2]) && (-1 != board[r][c + 3]) && (-1 != board[r][c + 4])) {\n ++board[r][c];\n ++board[r][c + 1];\n ++board[r][c + 2];\n ++board[r][c + 3];\n ++board[r][c + 4];\n }\n if ((0 <= (r - 4)) && (-1 != board[r][c]) && (-1 != board[r - 1][c]) && (-1 != board[r - 2][c]) && (-1 != board[r - 3][c]) && (-1 != board[r - 4][c])) {\n ++board[r][c];\n ++board[r - 1][c];\n ++board[r - 2][c];\n ++board[r - 3][c];\n ++board[r - 4][c];\n }\n if (((r + 4) < board.length) && (-1 != board[r][c]) && (-1 != board[r + 1][c]) && (-1 != board[r + 2][c]) && (-1 != board[r + 3][c]) && (-1 != board[r + 4][c])) {\n ++board[r][c];\n ++board[r + 1][c];\n ++board[r + 2][c];\n ++board[r + 3][c];\n ++board[r + 4][c];\n }\n }\n }\n\n for (final Location hit : getHits()) {\n board[hit.getRow()][hit.getCol()] = 0;\n }\n }\n\n// for (int[] i : board)\n// System.out.println(Arrays.toString(i));\n return findLargest();\n }",
"@Override\n public Card playCard() {\n List<Card> rank1 = new ArrayList<>();\n List<Card> rank2 = new ArrayList<>();\n List<Card> rank3 = new ArrayList<>();\n List<Card> rank4 = new ArrayList<>();\n for (Card card : cardsInHand) {\n if (card.getRank().equals(Card.Rank.EIGHT)) {\n rank1.add(card);\n break;\n } else if (card.getSuit().equals(idealSuit)\n && card.getRank().equals(idealRank)\n && (topCard.getSuit().equals(card.getSuit())\n || topCard.getRank().equals(card.getRank()))) {\n rank2.add(card);\n } else if ((card.getSuit().equals(idealSuit) || card.getRank().equals(idealRank))\n && (topCard.getSuit().equals(card.getSuit())\n || topCard.getRank().equals(card.getRank()))) {\n rank3.add(card);\n } else if (topCard.getSuit().equals(card.getSuit())\n || topCard.getRank().equals(card.getRank())) {\n rank4.add(card);\n }\n }\n List<List<Card>> playPossibilities = new ArrayList<>(Arrays.asList(rank1, rank2, rank3, rank4));\n for (List<Card> list : playPossibilities) {\n if (list.size() > 0) {\n cardsInHand.remove(list.get(0));\n return list.get(0);\n }\n }\n // This method will never return null if shouldDrawCard() is called beforehand.\n return null;\n }",
"public boolean DecideMove(Crazy8sBoard board){\n boolean haveAnEight = false;\n int locationOf8Card = 0;\n\n String topCard = board.GetTopTrashCard();\n String topFirstLetter = Character.toString(topCard.charAt(0));\n\n for(int i = 0; i < board.GetSizeOfComputerHand(); i++){\n\n String card = board.GetComputerCard(i);\n String firstLetter = Character.toString(card.charAt(0));\n\n if(topCard.contains(\"8\")){\n //Play whatever card, get to choose suite\n board.ComputerUpdateTopCard(i);\n board.RemoveCardFromComputer(i);\n return true;\n }\n\n if(card.contains(\"8\")){\n haveAnEight = true;\n locationOf8Card = i;\n }\n\n else {\n //the cards match in suite, doesn't matter what it is\n if (firstLetter.equals(topFirstLetter)) {\n board.ComputerUpdateTopCard(i);\n board.RemoveCardFromComputer(i);\n return true;\n }\n\n else {\n if (topFirstLetter.equals(\"c\")) {\n String temp = topCard.substring(5, topCard.length());\n System.out.println(\"TEMP \" + temp);\n\n if (card.contains(temp)) {\n board.ComputerUpdateTopCard(i);\n board.RemoveCardFromComputer(i);\n return true;\n }\n\n } else if (topFirstLetter.equals(\"h\")) {\n String temp = topCard.substring(6, topCard.length());\n System.out.println(\"TEMP \" + temp);\n\n if (card.contains(temp)) {\n board.ComputerUpdateTopCard(i);\n board.RemoveCardFromComputer(i);\n return true;\n }\n\n } else if (topFirstLetter.equals(\"d\")) {\n String temp = topCard.substring(8, topCard.length());\n System.out.println(\"TEMP \" + temp);\n\n if (card.contains(temp)) {\n board.ComputerUpdateTopCard(i);\n board.RemoveCardFromComputer(i);\n return true;\n }\n\n } else if (topFirstLetter.equals(\"s\")) {\n String temp = topCard.substring(6, topCard.length());\n System.out.println(\"TEMP \" + temp);\n\n if (card.contains(temp)) {\n board.ComputerUpdateTopCard(i);\n board.RemoveCardFromComputer(i);\n return true;\n }\n }\n }\n }\n }\n\n //Only play an 8 if all other cards are exhausted\n if(haveAnEight){\n //valid because 8s are wild cards, can place it\n board.ComputerUpdateTopCard(locationOf8Card);\n board.RemoveCardFromComputer(locationOf8Card);\n return true;\n }\n\n //couldn't play any card\n return false;\n }",
"@Test\n public void fiveRankHandChooserHighCardTest() {\n PokerHand hand = new PokerHand();\n hand.addCard(new Card(Card.Rank.ACE, Card.Suit.HEARTS));\n hand.addCard(new Card(Card.Rank.QUEEN, Card.Suit.HEARTS));\n hand.addCard(new Card(Card.Rank.EIGHT, Card.Suit.SPADES));\n hand.addCard(new Card(Card.Rank.SIX, Card.Suit.HEARTS));\n hand.addCard(new Card(Card.Rank.TEN, Card.Suit.DIAMONDS));\n\n PokerHand.HandType result = hand.fiveRankHandChooser();\n\n Assert.assertTrue(result == PokerHand.HandType.HIGHCARD);\n }",
"abstract public void compute(int maxSameSuit, int mostRepSuit, Hand hand);",
"private Long handScore() {\n\t\tif (checkFlush(current5)&&checkStraight(current5)) {\r\n\t\t\treturn Long.decode(\"0x9\"+getHandString(current5));\r\n\t\t} else if(checkFour(current5)) {\r\n\t\t\t//check four of a kind\r\n\t\t\treturn Long.decode(\"0x8\"+getHandString(current5));\r\n\t\t} else if(checkHouse(current5)) {\r\n\t\t\t//check full house\r\n\t\t\tif(current5.get(2).getValue()!=current5.get(1).getValue()) {\r\n\t\t\t\tcurrent5.add(current5.remove(0));\r\n\t\t\t\tcurrent5.add(current5.remove(0));\r\n\t\t\t}\r\n\t\t\treturn Long.decode(\"0x7\"+getHandString(current5));\r\n\t\t} else if (checkFlush(current5)) {\r\n\t\t\treturn Long.decode(\"0x6\"+getHandString(current5));\r\n\t\t} else if (checkStraight(current5)) {\r\n\t\t\treturn Long.decode(\"0x5\"+getHandString(current5));\r\n\t\t}\r\n\t\tlong kind3 = checkKind3(current5);\r\n\t\tif(Long.compare(kind3, 0)!=0) {\r\n\t\t\treturn kind3;\r\n\t\t}\r\n\t\tlong pair2 = checkPair2(current5);\r\n\t\tif(Long.compare(pair2, 0)!=0) {\r\n\t\t\treturn pair2;\r\n\t\t}\r\n\t\tlong pair = checkPair(current5);\r\n\t\tif(Long.compare(pair, 0)!=0) {\r\n\t\t\treturn pair;\r\n\t\t}\r\n\t\t\r\n\t\treturn Long.decode(\"0x1\"+getHandString(current5));\r\n\t}",
"private static double calWinRate5Cards(Card[] cards, int playerNum) {\n\t\tint winTimes = 0;\n\t\tPlayer[] oppsPlayers = new Player[playerNum - 1]; \n\t\tPlayer mePlayer = new Player();\n\t\tfor(int i = 0; i<50; i++){\n\t\t\t//生成playerNum-1个人,每个人2+3=5张\t\t\n\t\t\t\n\t\t}\n\t\treturn 0.6;\n\t}",
"@Test\n public void test_BoostOnDies() {\n addCard(Zone.HAND, playerA, \"Silumgar Scavenger\", 1); // {4}{B}\n addCard(Zone.BATTLEFIELD, playerA, \"Swamp\", 5);\n //\n addCard(Zone.BATTLEFIELD, playerA, \"Balduvian Bears\", 1);\n\n // cast and exploit\n castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, \"Silumgar Scavenger\");\n setChoice(playerA, true); // yes, exploit\n addTarget(playerA, \"Balduvian Bears\");\n\n checkPermanentCounters(\"boost\", 1, PhaseStep.BEGIN_COMBAT, playerA, \"Silumgar Scavenger\", CounterType.P1P1, 1);\n checkAbility(\"boost\", 1, PhaseStep.BEGIN_COMBAT, playerA, \"Silumgar Scavenger\", HasteAbility.class, true);\n\n setStopAt(1, PhaseStep.END_TURN);\n setStrictChooseMode(true);\n execute();\n }",
"public static String StrategyHints(Player Gamer, Player Dealer){\n\t String ReturnString = \"\";\n\t if(Gamer.Hand[0].getFace() != 1 && Gamer.Hand[1].getFace() != 1){\n\t\t// If the player has a hard hand (two starting cards with no aces)\n\t\t if(Gamer.Score <= 8){\n\t\t\t\tReturnString = Gamer.Name+\" should hit\";\n\t\t\t}\n\t\t\telse if(Gamer.Score == 9){\n\t\t\t\tif(Dealer.Score >= 3 && Dealer.Score <= 6){\n\t\t\t\t\tReturnString = Gamer.Name+\" should double\";\n\t\t\t }\n\t\t\t else{\n\t\t\t\t\tReturnString = Gamer.Name+\" should hit\";\n\t\t\t }\n\t\t\t}\n\t\t\telse if(Gamer.Score == 10){\n\t\t\t\tif(Dealer.Score >= 2 && Dealer.Score <= 9){\n\t\t\t\t\tReturnString = Gamer.Name+\" should double\";\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tReturnString = Gamer.Name+\" should hit\";\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(Gamer.Score == 11){\n\t\t\t\tif(Dealer.Score >= 2 && Dealer.Score <=10){\n\t\t\t\t\tReturnString = Gamer.Name+\" should double\";\n\t\t\t\t}\n\t\t\t\telse if(Dealer.Hand[1].getFace() == 1){\n\t\t\t\t\tReturnString = Gamer.Name+\" should hit\";\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(Gamer.Score == 12){\n\t\t\t\tif(Dealer.Score == 2 || Dealer.Score == 3){\n\t\t\t\t\tReturnString = Gamer.Name+\" should hit\";\n\t\t\t\t}\n\t\t\t\telse if(Dealer.Score >= 4 && Dealer.Score <= 6){\n\t\t\t\t\tReturnString = Gamer.Name+\" should stand\";\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tReturnString = Gamer.Name+\" should hit\";\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(Gamer.Score >= 13 && Gamer.Score <= 16){\n\t\t\t\tif(Dealer.Score >= 2 && Dealer.Score <= 6){\n\t\t\t\t\tReturnString = Gamer.Name+\" should stand\";\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tReturnString = Gamer.Name+\" should hit\";\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(Gamer.Score >= 17 && Gamer.Score <= 21){\n\t\t\t ReturnString = Gamer.Name+\" should stand\";\n\t\t\t}\n\t\t}\n\t\telse if((Gamer.Hand[0].getFace() == 1 && Gamer.Hand[1].getFace() != 1) \n\t\t\t|| (Gamer.Hand[0].getFace() != 1 && Gamer.Hand[1].getFace() == 1)){\n\t\t\t// If the player has a soft hand (one of the starting hands contains an ace)\n\t\t if(((Gamer.Hand[0].getFace() == 1 && Gamer.Hand[1].getFace() == 2) \n\t\t\t\t|| (Gamer.Hand[0].getFace() == 2 && Gamer.Hand[1].getFace() == 1)) \n\t\t\t\t|| ((Gamer.Hand[0].getFace() == 1 && Gamer.Hand[1].getFace() == 3) \n\t\t\t\t|| (Gamer.Hand[0].getFace() == 3 && Gamer.Hand[1].getFace() == 1))){\n\t\t\t // If you have an Ace 2 or Ace 3\n\t\t\t if(Dealer.Score == 5 || Dealer.Score == 6){\n\t\t\t\t\tReturnString = Gamer.Name+\" should double\";\n\t\t\t }\n\t\t\t else{\n\t\t\t\t\tReturnString = Gamer.Name+\" should hit\";\n\t\t\t }\n\t\t\t}\n\t\t\telse if(((Gamer.Hand[0].getFace() == 1 && Gamer.Hand[1].getFace() == 4) \n\t\t\t\t|| (Gamer.Hand[0].getFace() == 4 && Gamer.Hand[1].getFace() == 1)) \n\t\t\t\t|| ((Gamer.Hand[0].getFace() == 1 && Gamer.Hand[1].getFace() == 5) \n\t\t\t\t|| (Gamer.Hand[0].getFace() == 5 && Gamer.Hand[1].getFace() == 1))){\n\t\t\t // If you have an Ace 4 or Ace 5\n\t\t\t if(Dealer.Score >= 4 && Dealer.Score <= 6){\n\t\t\t\t\tReturnString = Gamer.Name+\" should double\";\n\t\t\t }\n\t\t\t else{\n\t\t\t\t\tReturnString = Gamer.Name+\" should hit\";\n\t\t\t } \n\t\t\t}\n\t\t\telse if((Gamer.Hand[0].getFace() == 1 && Gamer.Hand[1].getFace() == 6) \n\t\t\t\t|| (Gamer.Hand[0].getFace() == 6 && Gamer.Hand[1].getFace() == 1)){\n\t\t\t\t// If you have an Ace 6\n\t\t\t if(Dealer.Score >= 3 && Dealer.Score <= 6){\n\t\t\t\t\tReturnString = Gamer.Name+\" should double\";\n\t\t\t }\n\t\t\t else{\n\t\t\t\t\tReturnString = Gamer.Name+\" should hit\";\n\t\t\t }\n\t\t\t}\n\t\t\telse if((Gamer.Hand[0].getFace() == 1 && Gamer.Hand[1].getFace() == 7) \n\t\t\t\t|| (Gamer.Hand[0].getFace() == 7 && Gamer.Hand[1].getFace() == 1)){\n\t\t\t\t// If you have an Ace 7\n\t\t\t\tif(Dealer.Score == 2 || Dealer.Score == 7 || Dealer.Score == 8){\n\t\t\t\t\tReturnString = Gamer.Name+\" should stand\";\n\t\t\t\t}\n\t\t\t else if(Dealer.Score >= 3 && Dealer.Score <= 6){\n\t\t\t\t\tReturnString = Gamer.Name+\" should double\";\n\t\t\t }\n\t\t\t}\n\t\t\telse if(((Gamer.Hand[0].getFace() == 1 && Gamer.Hand[1].getFace() == 8) \n\t\t\t\t|| (Gamer.Hand[0].getFace() == 8 && Gamer.Hand[1].getFace() == 1)) \n\t\t\t\t|| ((Gamer.Hand[0].getFace() == 1 && Gamer.Hand[1].getFace() == 9) \n\t\t\t\t|| (Gamer.Hand[0].getFace() == 9 && Gamer.Hand[1].getFace() == 1))){\n\t\t\t\t// If you have an Ace 8 or Ace 9\n\t\t\t\tReturnString = Gamer.Name+\" should stand\"; \n\t\t\t}\n\t\t}\n\t\treturn ReturnString;\n\t}",
"public String playTexasHoldEm() throws IOException {\n\n StringBuffer buffer = new StringBuffer();\n String input = FileReaderUtil.readInputFile();\n\n List<String> players = new ArrayList<>();\n List<Hand> hands = new ArrayList<>();\n Set<Integer> winners = new HashSet<>();\n String[] lines = input.split(\"\\n\");\n\n Hand highestHand = null;\n String[] highestCards = null;\n int highest = -1;\n int index = 0;\n\n for (String line : lines) {\n\n String[] cards = line.toUpperCase().split(\" \");\n players.add(line);\n\n if (cards.length == 7) {\n // Played until the end.\n Hand currHand = determineHand(cards);\n hands.add(currHand);\n\n if (highestHand == null) {\n highestHand = currHand;\n highest = index;\n highestCards = cards;\n\n winners.add(index);\n } else if (currHand.rank > highestHand.rank) {\n winners.clear();\n winners.add(index);\n\n highestHand = currHand;\n highest = index;\n highestCards = cards;\n } else if (currHand.rank == highestHand.rank) {\n\n int compare = breakTie(cards, highestCards);\n if (compare == 0) {\n // tied\n winners.add(highest);\n winners.add(index);\n } else if (compare < 0) {\n // current card wins\n winners.clear();\n winners.add(index);\n highest = index;\n highestCards = cards;\n }\n }\n } else {\n hands.add(null);\n }\n\n index++;\n }\n\n for (int i = 0; i < players.size(); i++) {\n String player = lines[i];\n Hand hand = hands.get(i);\n\n buffer.append(player);\n\n if (hand != null) {\n buffer.append(\" \").append(WordUtils.capitalizeFully(hand.formatted));\n }\n\n if (winners.contains(i)) {\n buffer.append(\" \").append(\"(winner)\");\n }\n\n buffer.append(\"\\n\");\n }\n\n return buffer.toString().trim();\n }",
"public void processStandardECard(ErgebnisLOSCard card) {\n\t\tswitch(card.getId()) {\n\t\tcase 1:\n\t\t\tcurrent.raiseScore(20);\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tcurrent.raiseScore(10);\n\t\t\tgetLeftNeighbor().raiseScore(20);\n\t\t\tbreak;\n\t\tcase 4:\n\t\t\traiseScoreOfEveryPlayer(10);\n\t\t\tbreak;\n\t\tcase 5:\n\t\t\tcurrent.raiseScore(10);\n\t\t\tbreak;\n\t\tcase 6:\n\t\t\tbreak;\n\t\tcase 7:\n\t\t\tcurrent.raiseScore(30);\n\t\t\tbreak;\n\t\tcase 8:\n\t\t\tbreak;\n\t\tcase 9:\n\t\t\tcurrent.raiseScore(20);\n\t\t\tbreak;\n\t\tcase 11:\n\t\t\tgetLeftNeighbor().raiseScore(10);\n\t\t\tgetRightNeigbour().raiseScore(10);\n\t\t\tbreak;\n\t\tcase (12):\n\t\tcase (13):\n\t\tcase (14):\n\t\t\tcurrent.raiseScore(10);\n\t\t\tbreak;\n\t\tcase (15):\n\t\tcase (16):\n\t\tcase (17):\n\t\t\tbreak;\n\t\tcase (18):\n\t\t\tcurrent.raiseScore(30);\n\t\t\tbreak;\n\t\tcase (19):\n\t\t\tcurrent.raiseScore(20);\n\t\t\tbreak;\n\t\tcase (20):\n\t\t\tcurrent.raiseScore(50);\n\t\t\tbreak;\n\t\tcase (21):\n\t\t\tgetRightNeigbour().lowerScore(50);\n\t\t\tcurrent.raiseScore(50);\n\t\t\tbreak;\n\t\tcase (22):\n\t\t\tcurrent.raiseScore(20);\n\t\t\tbreak;\n\t\tcase (23):\n\t\t\tbreak;\n\t\tcase (25):\n\t\t\tcurrent.raiseScore(20);\n\t\t\tbreak;\n\t\tcase (26):\n\t\tcase (27):\n\t\tcase (28):\n\t\tcase (29):\n\t\tcase (30):\n\t\tcase (31):\n\t\t\tcurrent.raiseScore(10);\n\t\tcase (32):\n\t\t\tcurrent.raiseScore(30);\n\t\tcase (33):\n\t\t\tcurrent.raiseScore(20);\n\t\tcase (34):\n\t\t\tcurrent.raiseScore(20);\n\t\t\tgetRightNeigbour().raiseScore(10);\n\t\tcase (35):\n\t\t\tcurrent.raiseScore(20);\n\t\tcase (36):{\n\t\t\tif(!projectsAvailable.isEmpty()) {\n\t\t\t\topenUpProject(drawProject());\t\t\t\t\n\t\t\t}\n\t\t\telse current.raiseScore(30);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase (37):\n\t\t\tcurrent.raiseScore(20);\n\t\t\tbreak;\n\t\tcase (38):\n\t\t\tcurrent.raiseScore(10);\n\t\t\tbreak;\n\t\tcase (39):\n\t\t\tcurrent.raiseScore(10);\n\t\t\traiseScoreSecondRightNeighbor(10);\n\t\t\tbreak;\n\t\tcase (40):\n\t\t\tcurrent.raiseScore(20);\n\t\t\tbreak;\n\t\tcase (41):\n\t\t\tcurrent.raiseScore(10);\n\t\t\tbreak;\n\t\tcase (43):\n\t\t\tcurrent.lowerScore(20);\n\t\t\tgetRightNeigbour().raiseScore(20);\n\t\t\tbreak;\n\t\tcase (44):\n\t\tcase (45):\n\t\t\tcurrent.raiseScore(20);\n\t\t\tbreak;\n\t\tcase (46):\n\t\t\traiseScoreOfEveryPlayer(10);\n\t\t\tbreak;\n\t\tcase (48):\n\t\t\tcurrent.raiseScore(20);\n\t\tcase (50):\n\t\t\tbreak;\n\t\tcase (52):\n\t\t\tcurrent.raiseScore(20);\n\t\t\tbreak;\n\t\tcase (54):\n\t\t\tcurrent.raiseScore(50);\n\t\t\tbreak;\n\t\tcase (55):\n\t\t\tcurrent.raiseScore(10);\n\t\t\tbreak;\n\t\t}\n\t}",
"public static void simulateOdds(){\n \n //set up counters for each rank pair\n int A=0;\n int two=0;\n int three=0;\n int four=0;\n int five=0;\n int six=0;\n int seven=0;\n int eight=0;\n int nine=0;\n int ten = 0;\n int J=0;\n int Q=0;\n int K=0;\n \n //set up a counter for not exactly one pair\n int notOnePair=0;\n \n //set up a loop to run 10000 simulations\n for(int a=0;a<10000;a++){\n \n int Deck[]=new int[52];//set up the array for deck\n \n \n //store 0 to 51 into the Deck array\n for(int i=0;i<Deck.length;i++){\n Deck[i] = i; \n }\n \n int Hand[]={-1,-1,-1,-1,-1};//set up and initialize the array for hand\n \n Random r = new Random ();//Decalre a instance of the Random generator\n int k = Deck.length;//declare a variable to show the effective length of the Deck array\n //set up a loop to draw cards from the deck ramdomly\n for(int j=0;j<Hand.length;j++){\n int draw = r.nextInt(k-1);\n Hand[j] = Deck[draw];//store the ramdom pick from Deck into Hand\n //set the random pick in Deck to -1 and swap with the last effective number in Deck\n Deck[draw]=Deck[k-1];\n Deck[k-1]= -1;\n k--;//reduce the effective array size\n }\n //set up a loop to calculate the rank of each card in hand\n for(int j=0;j<Hand.length;j++){\n Hand[j] = Hand[j]%13;\n }\n \n //check if there is only one pair in hand\n if(exactlyOneDup(Hand))\n {\n //set up a loop to compare numbers in the array with each other\n for(int i=0;i<Hand.length;i++){\n int j=i+1;\n while(j<Hand.length)\n {\n if (Hand[i]==Hand[j])\n {\n int rank=Hand[i];\n //use the switch to determine which counter should increment\n switch (rank){\n case 0:\n A++;\n break;\n case 1:\n K++;\n break;\n case 2:\n Q++;\n break;\n case 3:\n J++;\n break;\n case 4:\n ten++;\n break;\n case 5:\n nine++;\n break;\n case 6:\n eight++;\n break;\n case 7:\n seven++;\n break;\n case 8:\n six++;\n break;\n case 9:\n five++;\n break;\n case 10:\n four++;\n break;\n case 11:\n three++;\n break;\n case 12:\n two++;\n break;\n } \n \n }\n \n j++;\n \n }\n \n }\n \n \n }\n \n else{\n \n notOnePair++;\n }\n \n }\n //print out the simulation results\n System.out.println(\"rank freq of exactly one pair\");\n System.out.println(\" A \"+A);\n System.out.println(\" K \"+K);\n System.out.println(\" Q \"+Q);\n System.out.println(\" J \"+J);\n System.out.println(\" 10 \"+ten);\n System.out.println(\" 9 \"+nine);\n System.out.println(\" 8 \"+eight);\n System.out.println(\" 7 \"+seven);\n System.out.println(\" 6 \"+six);\n System.out.println(\" 5 \"+five);\n System.out.println(\" 4 \"+four);\n System.out.println(\" 3 \"+three);\n System.out.println(\" 2 \"+two);\n System.out.println(\"--------------------------------\");\n System.out.println(\"total not exactly one pair: \"+notOnePair);\n return; \n }",
"private static void processFlop(String content) {\n\t\tString[] sts = content.split(\" \\n| \");\n\n\t\tcards[2] = new Card();\n\t\tcards[2].setColor(sts[0]);\n\t\tcards[2].setPoint(sts[1]);\n\t\t\n\t\tcards[3] = new Card();\n\t\tcards[3].setColor(sts[2]);\n\t\tcards[3].setPoint(sts[3]);\n\t\t\n\t\tcards[4] = new Card();\n\t\tcards[4].setColor(sts[4]);\n\t\tcards[4].setPoint(sts[5]);\n\t\t\n\t\tCard.numsPlus();\n\t\tCard.numsPlus();\n\t\tCard.numsPlus();\n\t\t\n\t\t\n\n\t\t//之后模拟对手的牌,求胜率\n\t\twinRate = calWinRate5Cards(cards, Player.getNums());\n\t\t\n\t\t\n\t}",
"static HashMap <String, ArrayList> startGame(HashMap <String, ArrayList> paramsToFront) {\n CardsActions action = new CardsActions();\n ArrayList <Card> cards = new ArrayList<>();\n ArrayList<Card> upTable = new ArrayList<>();\n ArrayList<Card> downTable = new ArrayList<>(); \n ArrayList<String> state = new ArrayList<>(); \n \n state.add(\"player_attak\"); \n\n ArrayList<String> userId = new ArrayList<>();\n double id = Math.random();\n userId.add(Double.toString(id));\n\n cards = CardsActions.createCards(cards);\n \n Card trumpCard = action.setTrumpCard(cards);\n ArrayList <Card> trumpCards = new ArrayList<>();\n trumpCards.add(trumpCard);\n // System.out.println(\"Козырь: \" + trumpCard.getName()); \n\n ArrayList <Card> playerHand = new ArrayList<>();\n action.takeCards(playerHand,cards); \n \n ArrayList <Card> compHand = new ArrayList<>();\n action.takeCards(compHand,cards);\n\n ArrayList <Integer> quantaty = new ArrayList<>();\n int quantatyComp = compHand.size();\n quantaty.add(quantatyComp);\n\n ArrayList <Integer> deck = new ArrayList<>();\n int quantatyCards = cards.size();\n deck.add(quantatyCards);\n\n for (int j = 102,i=0;i<cards.size();i++){\n // Card minTrump = cards.get(i);\n Card checker = new Card (j,trumpCard.getMasti()); \n\n if (checker.isSameRank(cards)) {j++;} \n else { \n if (checker.isSameRank(compHand)) {\n System.out.println(\"Комп ходит первый\");\n turn.compAttak (playerHand,compHand,table,cards); \n } \n else {\n turn.humanAttak(playerHand,compHand,table,cards);\n } \n }\n }\n \n paramsToFront.put(\"player_hand\", playerHand);\n paramsToFront.put(\"up_table\", upTable);\n paramsToFront.put(\"down_table\", downTable);\n paramsToFront.put(\"trump_cards\", trumpCards);\n paramsToFront.put(\"deck\", deck);\n paramsToFront.put(\"comp_hand\", quantaty);\n paramsToFront.put(\"user_id\", userId);\n paramsToFront.put(\"state\", state);\n\n return paramsToFront;\n }",
"public War()\n {\n //create deck of cards\n deck.shuffle();\n \n //deal cards to two different hands\n while(!deck.isEmpty())\n {\n card=deck.dealCard();\n player1Hand.enqueue(card);\n \n card=deck.dealCard();\n player2Hand.enqueue(card);\n }\n \n }",
"void drawTrick(Kaiser kaiser, final int frontPlayer)\r\n {\r\n\r\n final int backPlayer = (frontPlayer+2)%4;\r\n final int leftPlayer = (frontPlayer+1)%4;\r\n final int rightPlayer = (frontPlayer+3)%4;\r\n \r\n \r\n Card card = kaiser.getTrick(backPlayer);\r\n String indentStr = \" \";\r\n String indent = indentStr;\r\n printf(\r\n \"%s %s\\n\"\r\n + \"%s+------+\\n\"\r\n + \"%s|%s |\\n\"\r\n //+ \"%s|%c |\\n\"\r\n + \"%s|%s|\\n\"\r\n + \"%s|%s|\\n\"\r\n + \"%s|%s|\\n\"\r\n + \"%s|%s|\\n\"\r\n + \"%s+------+\\n\"\r\n ,indent, getPlayerHeader(kaiser, kaiser.getPlayer(backPlayer))\r\n ,indent\r\n ,indent, card == null ? \" \" : card.rank.getRankString()\r\n //,indent, card == null ? ' ' : card.suit.getSuitChar()\r\n ,indent, card == null ? \" \" : cardSymbols[0][card.suit.ordinal()] \r\n ,indent, card == null ? \" \" : cardSymbols[1][card.suit.ordinal()]\r\n ,indent, card == null ? \" \" : cardSymbols[2][card.suit.ordinal()]\r\n ,indent, card == null ? \" \" : cardSymbols[3][card.suit.ordinal()]\r\n ,indent\r\n );\r\n\r\n indentStr = \" \";\r\n indent = indentStr;\r\n String spacingStr = \" \";\r\n String spacing = spacingStr;\r\n Card card0 = kaiser.getTrick(leftPlayer);\r\n Card card1 = kaiser.getTrick(rightPlayer);\r\n printf(\r\n \"%s %-8s%s %s\\n\"\r\n + \"%s+------+%s+------+\\n\"\r\n + \"%s|%s |%s|%s |\\n\"\r\n //+ \"%s|%c |%s|%c |\\n\"\r\n + \"%s|%s|%s|%s|\\n\"\r\n + \"%s|%s|%s|%s|\\n\"\r\n + \"%s|%s|%s|%s|\\n\"\r\n + \"%s|%s|%s|%s|\\n\"\r\n + \"%s+------+%s+------+\\n\"\r\n ,indent, getPlayerHeader(kaiser, kaiser.getPlayer(leftPlayer)), \r\n spacing, getPlayerHeader(kaiser, kaiser.getPlayer(rightPlayer))\r\n ,indent, spacing\r\n ,indent, card0 == null ? \" \" : card0.rank.getRankString(), spacing, card1 == null ? \" \" : card1.rank.getRankString()\r\n //,indent, card0 == null ? ' ' : card0.suit.getSuitChar(), spacing, card1 == null ? ' ' : card1.suit.getSuitChar()\r\n ,indent, card0 == null ? \" \" : cardSymbols[0][card0.suit.ordinal()], spacing, card1 == null ? \" \" : cardSymbols[0][card1.suit.ordinal()]\r\n ,indent, card0 == null ? \" \" : cardSymbols[1][card0.suit.ordinal()], spacing, card1 == null ? \" \" : cardSymbols[1][card1.suit.ordinal()]\r\n ,indent, card0 == null ? \" \" : cardSymbols[2][card0.suit.ordinal()], spacing, card1 == null ? \" \" : cardSymbols[2][card1.suit.ordinal()]\r\n ,indent, card0 == null ? \" \" : cardSymbols[3][card0.suit.ordinal()], spacing, card1 == null ? \" \" : cardSymbols[3][card1.suit.ordinal()]\r\n ,indent, spacing\r\n );\r\n\r\n card = kaiser.getTrick(frontPlayer);\r\n indentStr = \" \";\r\n indent = indentStr;\r\n printf(\r\n \"%s %s\\n\"\r\n + \"%s+------+\\n\"\r\n + \"%s|%s |\\n\"\r\n //+ \"%s|%c |\\n\"\r\n + \"%s|%s|\\n\"\r\n + \"%s|%s|\\n\"\r\n + \"%s|%s|\\n\"\r\n + \"%s|%s|\\n\"\r\n + \"%s+------+\\n\"\r\n ,indent, getPlayerHeader(kaiser, kaiser.getPlayer(frontPlayer))\r\n ,indent\r\n ,indent, card == null ? \" \" : card.rank.getRankString()\r\n //,indent, card == null ? ' ' : card.suit.getSuitChar()\r\n ,indent, card == null ? \" \" : cardSymbols[0][card.suit.ordinal()] \r\n ,indent, card == null ? \" \" : cardSymbols[1][card.suit.ordinal()]\r\n ,indent, card == null ? \" \" : cardSymbols[2][card.suit.ordinal()]\r\n ,indent, card == null ? \" \" : cardSymbols[3][card.suit.ordinal()]\r\n ,indent);\r\n\r\n }",
"@Test\n public void testNextCardGood() {\n System.out.println(\"nextCardGood\");\n Deck deck = new Deck();\n Card card = deck.nextCard();\n ////since the deck is unshuffled, that last card should be WILDCARD\n assertEquals(CardType.WILDCARD, card.getValue());\n }",
"private static Hand getResults() {\n System.out.println(hands.size());\n Optional<Hand> winner;\n winner = hands.stream()\n .reduce((hand1, hand2)\n -> hand1.compareTo(hand2) == 1 ? hand1 : hand2);\n Hand winningHand = null;\n if (winner.isPresent()) {\n winningHand = winner.get();\n }\n return winningHand;\n\n }",
"protected void wander() {\n\t\tfor(int i=3;i>0;){\n\t\t\tfindChest();\n\t\t\tint num = ((int) (Math.random()*100)) % 4;\n\t\t\tswitch (num+1){\n\t\t\t\tcase 1 :\n\t\t\t\t\tif(!(character.xOfFighter-1==game.getXofplayer()&&character.yOfFighter==game.getYofplayer())\n\t\t\t\t\t\t\t&&game.getPlayingmap().npcMove(character.xOfFighter,character.yOfFighter,character.xOfFighter-1,character.yOfFighter)){\n\t\t\t\t\t\tcharacter.xOfFighter = character.xOfFighter-1;\n\t\t\t\t\t\ti--;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2 :\n\t\t\t\t\tif(!(character.xOfFighter==game.getXofplayer()&&character.yOfFighter-1==game.getYofplayer())&&\n\t\t\t\t\t\t\tgame.getPlayingmap().npcMove(character.xOfFighter,character.yOfFighter,character.xOfFighter,character.yOfFighter-1)){\n\t\t\t\t\t\tcharacter.yOfFighter = character.yOfFighter-1;\n\t\t\t\t\t\ti--;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3 :\n\t\t\t\t\tif(!(character.xOfFighter+1==game.getXofplayer()&&character.yOfFighter==game.getYofplayer())&&\n\t\t\t\t\t\t\tgame.getPlayingmap().npcMove(character.xOfFighter,character.yOfFighter,character.xOfFighter+1,character.yOfFighter)){\n\t\t\t\t\t\tcharacter.xOfFighter = character.xOfFighter+1;\n\t\t\t\t\t\ti--;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 4 :\n\t\t\t\t\tif(!(character.xOfFighter==game.getXofplayer()&&character.yOfFighter+1==game.getYofplayer())&&\n\t\t\t\t\t\t\tgame.getPlayingmap().npcMove(character.xOfFighter,character.yOfFighter,character.xOfFighter,character.yOfFighter+1)){\n\t\t\t\t\t\tcharacter.yOfFighter = character.yOfFighter+1;\n\t\t\t\t\t\ti--;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tfindChest();\n\t}",
"@Test\n void testWinnerOfTrickFollowingClubSuit() {\n Dealer testDealer = new Dealer();\n testDealer.initDealer();\n\n Bot botA = testDealer.getBotA();\n Bot botB = testDealer.getBotB();\n Bot botC = testDealer.getBotC();\n\n ArrayList<Card> botAHand, botBHand, botCHand = new ArrayList <Card>();\n\n // botAHand = new ArrayList <Card>();\n botAHand = new ArrayList <Card>();\n botBHand = new ArrayList <Card>();\n botCHand = new ArrayList <Card>();\n\n Card thrownCard = new Card(Suit.CLUBS,Rank.FOUR,true);\n \n Card cardA1 = new Card(Suit.CLUBS,Rank.KING,true);\n\n Card cardB1 = new Card(Suit.CLUBS,Rank.FIVE,true);\n\n Card cardC1 = new Card(Suit.CLUBS,Rank.QUEEN,true);\n\n botAHand.add(cardA1);\n botBHand.add(cardB1);\n botCHand.add(cardC1);\n \n // botA.fillHandCards(botAHand);\n botA.fillHandCards(botAHand);\n botB.fillHandCards(botBHand);\n botC.fillHandCards(botCHand);\n\n testDealer.addToPlayedCards(thrownCard);\n \n Card cardToPlay = botA.playCard(thrownCard, 1);\n testDealer.addToPlayedCards(cardToPlay);\n Card largestPlayedCard = testDealer.getLargestCardFromTrick();\n\n cardToPlay = botB.playCard(largestPlayedCard, 2);\n testDealer.addToPlayedCards(cardToPlay);\n largestPlayedCard = testDealer.getLargestCardFromTrick();\n\n cardToPlay = botC.playCard(largestPlayedCard, 3);\n testDealer.addToPlayedCards(cardToPlay);\n\n // List<Card> allPlayedCards = testDealer.getPlayedCardsForTrick();\n assertEquals(\"botA\", testDealer.getWinnerOfTrick(testDealer.getPlayedCardsForTrick()));\n }",
"@Test\n public void play_FullHouseVsFullHouse() throws Exception {\n Hand hand1 = new Hand();\n hand1.addCard(new Card(Card.SUIT_HEARTS, Card.CARD_5));\n hand1.addCard(new Card(Card.SUIT_SPADES, Card.CARD_5));\n hand1.addCard(new Card(Card.SUIT_CLUBS, Card.CARD_7));\n hand1.addCard(new Card(Card.SUIT_DIAMONDS, Card.CARD_7));\n hand1.addCard(new Card(Card.SUIT_HEARTS, Card.CARD_7));\n Hand hand2 = new Hand();\n hand2.addCard(new Card(Card.SUIT_CLUBS, Card.CARD_10));\n hand2.addCard(new Card(Card.SUIT_DIAMONDS, Card.CARD_10));\n hand2.addCard(new Card(Card.SUIT_HEARTS, Card.CARD_ACE));\n hand2.addCard(new Card(Card.SUIT_SPADES, Card.CARD_ACE));\n hand2.addCard(new Card(Card.SUIT_CLUBS, Card.CARD_ACE));\n assertEquals(hand2, FiveCardDraw.play(hand1, hand2));\n }",
"public Card PlayCard() {\n\t Card ret = null;\n\t Card card;\n\t if (mCardCount > 0) {\n\t\t // To work out what card to play, see what cards can be played\n\t\t \tCard[] playableCards;\n\t\t \tplayableCards = mRules.GetPlayableCards();\n\t\t \tCard[] selectedCards;\n\t\t \tselectedCards = new Card[8];\n\t\t \tint iNumSelectableCards = 0;\n\t\t \tfor (int i = 0; i < 8; i++)\n\t\t \t\tselectedCards[i] = null;\n\t \tfor (int i = 0; i < mCardCount; i++){\n\t \t\tcard = mCard[i];\n\t \t\tswitch (card.GetSuit()){\n\t \t\tcase Card.HEARTS:\n\t \t\t\t\n\t \t\t\t// Card is a heart, can it be played?\n\t \t\t\t// Is it a seven, it can be played...\n\t \t\t\tif (card.GetValue() == 7){\n\t \t\t\t\tselectedCards[Rules.HEARTS8] = card;\n\t \t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t// and must be played first\n\t \t\t\t\tplayableCards[Rules.HEARTS8] = new Card(8,Card.HEARTS);\n\t \t\t\t\tplayableCards[Rules.HEARTS6] = new Card(6,Card.HEARTS);\n\t \t\t\t\tplayableCards[Rules.CLUBS8] = new Card(7,Card.CLUBS);\n\t \t\t\t\tplayableCards[Rules.DIAMONDS8] = new Card(7,Card.DIAMONDS);\n\t \t\t\t\tplayableCards[Rules.SPADES8] = new Card(7,Card.SPADES);\n\t \n\t \t\t\t\treturn card;\n\t \t\t\t}\n\t \t\t\tif (card.GetValue() < 7){\n\t \t\t\t\tif (card.Equals(playableCards[Rules.HEARTS6])){\n\t \t\t\t\t\tselectedCards[Rules.HEARTS6] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t\t//Log.i(\"\",\" Playing card \" + (card.GetValue()) + \" , \" +card.GetSuit());\n\t \t\t\t\t\t//Log.i(\"\",\" Updating playable card \" + (card.GetValue()-1) + \" , \" +Card.HEARTS);\t \t\t\t\t\t\n\t \t\t\t\t\t//playableCards[Rules.HEARTS6] = new Card(card.GetValue()-1,Card.HEARTS);\n\t \t\t\t\t\t//return card;\n\t \t\t\t\t}\n\t \t\t\t}\n\t \t\t\tif (card.GetValue() > 7){\n\t \t\t\t\tif (card.Equals( playableCards[Rules.HEARTS8])){\n\t \t\t\t\t\tselectedCards[Rules.HEARTS8] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t\t//Log.i(\"\",\" Playing card \" + (card.GetValue()) + \" , \" +card.GetSuit());\n\t \t\t\t\t\t//Log.i(\"\",\" Updating playable card \" + (card.GetValue()+1) + \" , \" +Card.HEARTS);\t \t\t\t\t\t\n\t \t\t\t\t\t//playableCards[Rules.HEARTS8] = new Card(card.GetValue()+1,Card.HEARTS);\n\t \t\t\t\t\t//return card;\n\t \t\t\t\t}\n\t \t\t\t}\t \t\t\t\n\t \t\t\t\n\t \t\t\tbreak;\n\t \t\tcase Card.DIAMONDS:\n\t \t\t\t// Is it a seven, it can be played...\n\t \t\t\tif (card.GetValue() == 7){\n\t \t\t\t\tif (card.Equals(playableCards[Rules.DIAMONDS8])){\n\t \t\t\t\t\tselectedCards[Rules.DIAMONDS8] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t}\n\t \t\t\t}\n\t \t\t\t\n\t \t\t\tif (card.GetValue() < 7){\n\t \t\t\t\tif (card.Equals( playableCards[Rules.DIAMONDS6])){\n\t \t\t\t\t\tselectedCards[Rules.DIAMONDS6] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t}\n\t \t\t\t}\n\t \t\t\tif (card.GetValue() > 7){\n\t \t\t\t\tif (card.Equals( playableCards[Rules.DIAMONDS8])){\n\t \t\t\t\t\tselectedCards[Rules.DIAMONDS8] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t}\n\t \t\t\t}\t\t \t\t\t\n\t \t\t\t\n\t \t\t\tbreak;\n\t \t\t\t\n\t \t\tcase Card.CLUBS:\n\t \t\t\t// Is it a seven, it can be played...\n\t \t\t\tif (card.GetValue() == 7){\n\t \t\t\t\tif (card.Equals(playableCards[Rules.CLUBS8])){\n\t \t\t\t\t\tselectedCards[Rules.CLUBS8] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t}\t \t\t\t\t\n\t \t\t\t}\n\t \t\t\t\n\t \t\t\tif (card.GetValue() < 7){\n\t \t\t\t\tif (card.Equals(playableCards[Rules.CLUBS6])){\n\t \t\t\t\t\tselectedCards[Rules.CLUBS6] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t}\n\t \t\t\t}\n\t \t\t\tif (card.GetValue() > 7){\n\t \t\t\t\tif (card.Equals(playableCards[Rules.CLUBS8])){\n\t \t\t\t\t\tselectedCards[Rules.CLUBS8] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t}\n\t \t\t\t}\t\t \t\t\t\n\t \t\t\tbreak;\n\t \t\t\t\n\t \t\tcase Card.SPADES:\n\t \t\t\t// Is it a seven, it can be played...\n\t \t\t\tif (card.GetValue() == 7){\n\t \t\t\t\tif (card.Equals(playableCards[Rules.SPADES8])){\n\t \t\t\t\t\tselectedCards[Rules.SPADES8] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t}\t \t\t\t\t\n\t \t\t\t}\n\t \t\t\t\n\t \t\t\tif (card.GetValue() < 7){\n\t \t\t\t\tif (card.Equals( playableCards[Rules.SPADES6])){\n\t \t\t\t\t\tselectedCards[Rules.SPADES6] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t}\n\t \t\t\t}\n\t \t\t\tif (card.GetValue() > 7){\n\t \t\t\t\tif (card.Equals( playableCards[Rules.SPADES8])){\n\t \t\t\t\t\tselectedCards[Rules.SPADES8] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t}\n\t \t\t\t}\t \t\t\t\n\t \t\t\tbreak;\n\n\t \t\t\t\t \t\t\t\n\t \t\t}\n\t\n\t \t}\t\n\t \t\n\t \t// Now go through the selectable cards and see which is best to be played\n\t \tif (iNumSelectableCards == 0)\n\t \t\treturn ret;\n\t \t\n\t \tint iPos;\n\t \tcard = null;\n\t \tif (iNumSelectableCards == 1){\n\t\t\t \tfor (int i = 0; i < 8; i++)\n\t\t\t \t\tif (selectedCards[i] != null){\n\t\t\t \t\t\tcard = selectedCards[i];\n\t\t\t \t\t\tbreak;\n\t\t\t \t\t}\n\t\t\t \t\t\t \t\n\t \t}\n\t \telse {\n\t\t\t String sDifficulty = mRules.mView.GetSettings().getString(\"Difficulty\", \"0\");// 0 = hard, 1 = easy\n\t\t\t int iDifficulty = Integer.parseInt(sDifficulty);\n\t\t\t if (iDifficulty == EASY){\n\t\t\t \t// Get a random card from the playable ones\n\t\t\t\t\t Random generator = new Random();\n\t\t\t\t\t int randomIndex = generator.nextInt( iNumSelectableCards );\n\t\t\t\t\t int iCount = 0;\n\t\t\t\t\t \tfor (int i = 0; i < 8; i++){\n\t\t\t\t\t \t\tif (selectedCards[i] != null){\n\t\t\t\t\t \t\t\tif (iCount == randomIndex){\n\t\t\t\t\t \t\t\t\tcard = selectedCards[i];\n\t\t\t\t\t \t\t\t\tbreak;\n\t\t\t\t\t \t\t\t}\n\t\t\t\t\t \t\t\telse iCount++;\n\t\t\t\t\t \t\t}\t\n\t\t\t\t\t \t}\n\t\t\t }\n\t\t\t else {\n\t\t\t \tiPos = GetBestCard(selectedCards);\n\t\t\t \tcard = selectedCards[iPos];\n\t\t\t }\n\t \t}\n\t \t\n\t \tswitch (card.GetSuit()){\n \t\tcase Card.HEARTS:\t \t\n \t\t\tif (card.GetValue() == 7){\n \t\t\t\t// and must be played first\n \t\t\t\tplayableCards[Rules.HEARTS8] = new Card(8,Card.HEARTS);\n \t\t\t\tplayableCards[Rules.HEARTS6] = new Card(6,Card.HEARTS);\n \t\t\t\tplayableCards[Rules.CLUBS8] = new Card(7,Card.CLUBS);\n \t\t\t\tplayableCards[Rules.DIAMONDS8] = new Card(7,Card.DIAMONDS);\n \t\t\t\tplayableCards[Rules.SPADES8] = new Card(7,Card.SPADES);\n \n \t\t\t\treturn card;\n \t\t\t}\n \t\t\tif (card.GetValue() < 7){\n \t\t\t\tif (card.Equals(playableCards[Rules.HEARTS6])){\n \t\t\t\t\tplayableCards[Rules.HEARTS6] = new Card(card.GetValue()-1,Card.HEARTS);\n \t\t\t\t\treturn card;\n \t\t\t\t}\n \t\t\t}\n \t\t\tif (card.GetValue() > 7){\n \t\t\t\tif (card.Equals( playableCards[Rules.HEARTS8])){ \t\t\t\t\t\n \t\t\t\t\tplayableCards[Rules.HEARTS8] = new Card(card.GetValue()+1,Card.HEARTS);\n \t\t\t\t\treturn card;\n \t\t\t\t}\n \t\t\t}\t \t\t\t\n \t\t\t\n \t\t\tbreak; \n \t\tcase Card.DIAMONDS:\n \t\t\t// Is it a seven, it can be played...\n \t\t\tif (card.GetValue() == 7){\n \t\t\t\tif (playableCards[Rules.HEARTS8] != null && playableCards[Rules.HEARTS8].GetValue() > 7){\n\t \t\t\t\tplayableCards[Rules.DIAMONDS8] = new Card(8,Card.DIAMONDS);\n\t \t\t\t\tplayableCards[Rules.DIAMONDS6] = new Card(6,Card.DIAMONDS);\t \t\t\t\t\t\n \t\t\t\t\treturn card;\n \t\t\t\t}\n \t\t\t}\n \t\t\t\n \t\t\tif (card.GetValue() < 7){\n \t\t\t\tif (card.Equals( playableCards[Rules.DIAMONDS6])){\t \t\t\t\t\t\n \t\t\t\t\tplayableCards[Rules.DIAMONDS6] = new Card(card.GetValue()-1,Card.DIAMONDS);\n \t\t\t\t\treturn card;\n \t\t\t\t}\n \t\t\t}\n \t\t\tif (card.GetValue() > 7){\n \t\t\t\tif (card.Equals( playableCards[Rules.DIAMONDS8])){\t \t\t\t\t\t\n \t\t\t\t\tplayableCards[Rules.DIAMONDS8] = new Card(card.GetValue()+1,Card.DIAMONDS);\n \t\t\t\t\treturn card;\n \t\t\t\t}\n \t\t\t}\t\t \t\t\t\n \t\t\t\n \t\t\tbreak; \n \t\t\t\n \t\tcase Card.CLUBS:\n \t\t\t// Is it a seven, it can be played...\n \t\t\tif (card.GetValue() == 7){\n\n \t\t\t\tif (playableCards[Rules.HEARTS8] != null && playableCards[Rules.HEARTS8].GetValue() > 7){\n\t \t\t\t\tplayableCards[Rules.CLUBS8] = new Card(8,Card.CLUBS);\n\t \t\t\t\tplayableCards[Rules.CLUBS6] = new Card(6,Card.CLUBS);\t \t\t\t\t\t\n \t\t\t\t\treturn card;\n \t\t\t\t}\t \t\t\t\t\n \t\t\t}\n \t\t\t\n \t\t\tif (card.GetValue() < 7){\n \t\t\t\tif (card.Equals(playableCards[Rules.CLUBS6])){\n \t\t\t\t\tplayableCards[Rules.CLUBS6] = new Card(card.GetValue()-1,Card.CLUBS);\n \t\t\t\t\treturn card;\n \t\t\t\t}\n \t\t\t}\n \t\t\tif (card.GetValue() > 7){\n \t\t\t\tif (card.Equals(playableCards[Rules.CLUBS8])){\n \t\t\t\t\tLog.i(\"\",\" Updating playable card \" + (card.GetValue()+1) + \" , \" +Card.CLUBS);\n \t\t\t\t\tplayableCards[Rules.CLUBS8] = new Card(card.GetValue()+1,Card.CLUBS);\n \t\t\t\t\treturn card;\n \t\t\t\t}\n \t\t\t}\t\t \t\t\t\n \t\t\tbreak; \n \t\tcase Card.SPADES:\n \t\t\t// Is it a seven, it can be played...\n \t\t\tif (card.GetValue() == 7){\n \t\t\t\tif (playableCards[Rules.HEARTS8] != null && playableCards[Rules.HEARTS8].GetValue() > 7){\n\t \t\t\t\tplayableCards[Rules.SPADES8] = new Card(8,Card.SPADES);\n\t \t\t\t\tplayableCards[Rules.SPADES6] = new Card(6,Card.SPADES);\t \t\t\t\t\t\n \t\t\t\t\treturn card;\n \t\t\t\t}\t \t\t\t\t\n \t\t\t}\n \t\t\t\n \t\t\tif (card.GetValue() < 7){\n \t\t\t\tif (card.Equals( playableCards[Rules.SPADES6])){ \t\t\t\t\t\n \t\t\t\t\tplayableCards[Rules.SPADES6] = new Card(card.GetValue()-1,Card.SPADES);\n \t\t\t\t\treturn card;\n \t\t\t\t}\n \t\t\t}\n \t\t\tif (card.GetValue() > 7){\n \t\t\t\tif (card.Equals( playableCards[Rules.SPADES8])){\t \t\t\t\t\t\n \t\t\t\t\tplayableCards[Rules.SPADES8] = new Card(card.GetValue()+1,Card.SPADES);\n \t\t\t\t\treturn card;\n \t\t\t\t}\n \t\t\t}\t \t\t\t\n \t\t\tbreak;\n \t\t\t\n\t \t}\n\t \n\t }\n\t return ret;\n }",
"public void processStandardVCard(VerantwortungsLOSCard card) {\n\t\tswitch(card.getId()) {\n\t\tcase (1):\n\t\t\tcurrent.raiseScore(100);\n\t\t\tbreak;\n\t\tcase (2):\n\t\t\tcurrent.raiseScore(50);\n\t\t\tgetRightNeigbour().raiseScore(100);\n\t\t\tbreak;\n\t\tcase (3):\n\t\t\tgetLeftNeighbor().raiseScore(50);\n\t\t\tbreak;\n\t\tcase (4):\n\t\t\tcurrent.raiseScore(100);\n\t\t\tbreak;\n\t\tcase (5):\n\t\t\tcurrent.setSkipNextRound(true);\n\t\t\tbreak;\n\t\tcase (6):\n\t\t\tcurrent.raiseScore(70);\n\t\t\tif(!projectsAvailable.isEmpty()) {\n\t\t\t\topenUpProject(drawProject());\n\t\t\t}\n\t\t\tbreak;\n\t\tcase (7):\n\t\t\tbreak;\n\t\tcase (9):\n\t\tcase (10):\n\t\tcase (13):\n\t\t\tbreak;\n\t\tcase (18):\n\t\t\traiseScoreOfEveryPlayer(50);\n\t\t\tbreak;\n\t\tcase (19):\n\t\t\tcurrent.raiseScore(100);\n\t\t\tsecondLeftNeighborGivesChipToCurrent();\n\t\t\tbreak;\n\t\tcase (21):\n\t\t\tsecondLeftNeighborGivesSZTToCurrent(50);\n\t\t\tbreak;\n\t\tcase (22):\n\t\t\tSZTFromEveryOtherPlayer(30);\n\t\t\tbreak;\n\t\tcase (24):\n\t\t\tcurrent.raiseScore(50);\n\t\t\tsecondLeftNeighborGivesChipToCurrent();\n\t\t\tbreak;\n\t\t}\n\t}",
"public static void main(String[] args) throws IOException, InterruptedException { HttpGet getIndex = new HttpGet(\"http://www.moswar.ru/\");\n//\n// HttpResponse indexResponse = client.execute(getIndex);\n//\n// System.out.println(indexResponse.getStatusLine());\n// System.out.println(indexResponse.toString());\n//\n//\n\n JSONObject data;\n\n login(\"[email protected]\",\"`1\");\n\n index();\n\n blackJackIndex();\n\n data = newBet(Bet.random());\n\n\n String mySumm = null;\n String myHand = getMyHand(data);\n if (!myHand.contains(\"A\"))\n mySumm = getMySumm(data);\n String dealerHand = getDealerHand(data);\n\n int i = 0;\n\n all:\n while(i < 100){\n //TODO if \"check\" right or left winner or looser - new game - alternative - check if > 21 then new game\n if (mySumm != null && Integer.parseInt(mySumm) > 17){\n ++i;\n if (Integer.parseInt(mySumm) <= 21)\n endGame(stand());\n else System.out.println(\"Dealer WIN\");\n data = newBet(Bet.random());\n myHand = getMyHand(data);\n mySumm = null;\n if (!myHand.contains(\"A\"))\n mySumm = getMySumm(data);\n dealerHand = getDealerHand(data);\n }\n else{\n switch (Answer.getTurn(myHand, dealerHand)){\n case \"S\": //STAND\n ++i;\n endGame(stand());\n\n// break all;\n data = newBet(Bet.random());\n myHand = getMyHand(data);\n mySumm = null;\n if (!myHand.contains(\"A\"))\n mySumm = getMySumm(data);\n dealerHand = getDealerHand(data);\n break;\n case \"H\": //HIT\n data = more();\n mySumm = getMyNextSumm(data);\n myHand = mySumm;\n break;\n case \"D\": //DOUBLE\n //TODO check if can double\n if (checkDouble(data)){\n data = doubleBet();\n mySumm = getMyNextSumm(data);\n myHand = mySumm;\n }else{\n data = more();\n mySumm = getMyNextSumm(data);\n myHand = mySumm;\n }\n break;\n case \"P\": //SPLIT\n data = more();\n mySumm = getMyNextSumm(data);\n myHand = mySumm;\n break;\n default:\n break;\n }\n\n }\n }\n\n client.getConnectionManager().shutdown();\n out.close();\n }",
"public Card bestEight()\n {\n String mostSuit = \"\";\n int most = 0;\n Hashtable<String, Integer> cardSuit = new Hashtable<String, Integer>();\n //Count the number of cards in players hand for each suit\n for(Card cardInHand: this.hand)\n {\n String suit = cardInHand.getSuit();\n if(cardSuit.containsKey(suit))\n {\n cardSuit.put(suit, cardSuit.get(suit) + 1);\n }\n else\n {\n cardSuit.put(suit, 1);\n }\n }\n //find the highest one.\n for(String key: cardSuit.keySet())\n {\n if(cardSuit.get(key) > most) {\n mostSuit = key;\n most = cardSuit.get(key);\n }\n }\n return new Card(mostSuit, \"8\");\n }",
"@Override\r\n\tprotected int giveCardProtected(ArrayList<Card> hand) {\n\t\treturn getRandomCard(hand);\r\n\t}",
"public boolean playCard(Cards card, Players player) {\n boolean higher = false;\n int compare = 0;\n if (playedCards.size() == 0 || this.playAgain(player)) { //to check if it is a new game or this is a new round\n if (card instanceof TrumpCards) { //to check if the first played card is a supertrump card\n setCategory(((TrumpCards) card).cardEffect());\n }\n higher = true;\n } else {\n if (card instanceof NormCards) { //to check if the played card is a normal card\n if (getLastCard() instanceof NormCards) { //to check whether the last played card is a normal card or a supertrump card\n if (category.equals(\"H\")) {\n Float now = new Float(((NormCards) card).getHardness());\n Float last = new Float(((NormCards) getLastCard()).getHardness());\n compare = now.compareTo(last);\n } else if (category.equals(\"S\")) {\n Float now = new Float(((NormCards) card).getSpecGravity());\n Float last = new Float(((NormCards) getLastCard()).getSpecGravity());\n compare = now.compareTo(last);\n } else if (category.equals(\"C\")) {\n Float now = new Float(((NormCards) card).getCleavageValue());\n Float last = new Float(((NormCards) getLastCard()).getCleavageValue());\n compare = now.compareTo(last);\n } else if (category.equals(\"CA\")) {\n Float now = new Float(((NormCards) card).getCrustalAbunVal());\n Float last = new Float(((NormCards) getLastCard()).getCrustalAbunVal());\n compare = now.compareTo(last);\n } else if (category.equals(\"EV\")) {\n Float now = new Float(((NormCards) card).getEcoValueValue());\n Float last = new Float(((NormCards) getLastCard()).getEcoValueValue());\n compare = now.compareTo(last);\n\n }\n if (compare > 0) {\n higher = true;\n } else {\n System.out.println(\"The selected card does not has higher value!\");\n }\n } else { //or else, the last played card is a supertrump card\n higher = true;\n }\n } else { //or else, the played is a supertrump card\n setCategory(((TrumpCards) card).cardEffect());\n higher = true;\n }\n }\n return higher;\n }",
"public static FiveCardHand findBestHand(ArrayList<Card> cards) {\n if (cards.size() == 5) {\n return new FiveCardHand(cards);\n }\n\n FiveCardHand bestHand = null;\n for (int i = 0; i < cards.size(); i++) {\n ArrayList<Card> cardsClone = (ArrayList<Card>) cards.clone();\n cardsClone.remove(i);\n FiveCardHand hand = findBestHand(cardsClone);\n if (bestHand == null) {\n bestHand = hand;\n } else if (hand.compareTo(bestHand) > 0) {\n bestHand = hand;\n }\n }\n return bestHand;\n }",
"public int evaluate (Player p) {\r\n\t\t/* Adding players hand and the cards from the game board */\r\n\t\t\r\n\t\tfor (Card c: p.hand) {\r\n\t\t\tcards.add(c);\r\n\t\t}\r\n\t\tfor (Card c: board) {\r\n\t\t\tcards.add(c);\r\n\t\t}\r\n\t\t/*Return the value based on the card evaluated. Will check in\r\n\t\t * order to the strength of the hand starting from the \r\n\t\t * strongest hand in order to avoid overlapping between certain \r\n\t\t * hands. (Ex. Three pair includes two pair but three pair will be \r\n\t\t * checked first)*/\r\n\t\tif (hasRoyalFlush(cards)) \r\n\t\t\treturn ROYALFLUSH;\r\n\t\t else if (hasStraightFlush(cards)) \r\n\t\t\treturn STRAIGHTFLUSH;\r\n\t\t else if (hasQuads(cards)) \r\n\t\t\treturn QUADS;\r\n\t\t else if (hasFlush(cards)) \r\n\t\t\treturn FLUSH;\r\n\t\t else if (hasStraight(cards)) \r\n\t\t\treturn STRAIGHT;\r\n\t\t else if (hasSet(cards)) \r\n\t\t\treturn SET;\r\n\t\t else if (hasTwoP(cards)) \r\n\t\t\treturn TWOPAIR;\r\n\t\t else if (hasPair(cards)) \r\n\t\t\treturn PAIR;\r\n\t\t else \r\n\t\t\treturn HIGHCARD;\r\n\t\t\r\n\t}"
] | [
"0.7056583",
"0.702746",
"0.67451876",
"0.6694648",
"0.6692249",
"0.6432276",
"0.6423483",
"0.63862234",
"0.6348517",
"0.63473004",
"0.6334134",
"0.6331812",
"0.632375",
"0.63087356",
"0.62950766",
"0.62899196",
"0.6248036",
"0.62069434",
"0.61801285",
"0.61534667",
"0.6152817",
"0.6144207",
"0.6126799",
"0.61075455",
"0.6106599",
"0.6090623",
"0.60825276",
"0.6079835",
"0.60191864",
"0.6016839",
"0.60167474",
"0.6012156",
"0.60085285",
"0.5996956",
"0.5977226",
"0.59654695",
"0.5958397",
"0.59532565",
"0.5952159",
"0.59514993",
"0.59390175",
"0.59357524",
"0.5921545",
"0.591678",
"0.5896682",
"0.5895163",
"0.5885263",
"0.58852255",
"0.58843696",
"0.5863372",
"0.58597386",
"0.5854461",
"0.58360904",
"0.5830706",
"0.58290786",
"0.58222604",
"0.58056456",
"0.5785246",
"0.5784732",
"0.5777193",
"0.5773114",
"0.57636344",
"0.5763612",
"0.57474995",
"0.5725767",
"0.5722958",
"0.5721422",
"0.5719896",
"0.5719409",
"0.57160604",
"0.57151777",
"0.5707106",
"0.570447",
"0.56935996",
"0.5691894",
"0.56890166",
"0.5684514",
"0.5676152",
"0.5662084",
"0.5652484",
"0.5651427",
"0.56481165",
"0.564574",
"0.5645009",
"0.56407326",
"0.562507",
"0.5621651",
"0.5612063",
"0.5598387",
"0.559696",
"0.55921423",
"0.5590554",
"0.55884814",
"0.5588202",
"0.55845225",
"0.55815357",
"0.55775046",
"0.55694",
"0.556731",
"0.55615634",
"0.5557269"
] | 0.0 | -1 |
assert that, given no nonnumeric cards, a color match is possible without a numeric match | @Test
public void testPlayer_getBoldStrategyCard_numeric_matchColorNotNumber() {
player2 = new Player("Player Two", true);
player2.setHand(strategyHand.getAllCards());
player2.getHand().discard(greenThree);
player2.getHand().discard(yellowZero);
assertTrue(player2.getBoldStrategyCard(yellowThree, yellowThree.getColor()).equals(yellowSix));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\r\n public void testPlayer_getCautiousStrategyCardCard_numeric_matchColorNotNumber() {\n player2 = new Player(\"Player Two\", true);\r\n player2.setHand(strategyHand.getAllCards());\r\n\r\n // let the cpc be a yellow three\r\n // get rid of all non-numeric cards and the green three so the yellow six is the most attractive option\r\n player2.getHand().discard(wild);\r\n player2.getHand().discard(wildDrawFour);\r\n player2.getHand().discard(yellowReverse);\r\n player2.getHand().discard(redDrawTwo);\r\n player2.getHand().discard(greenThree);\r\n\r\n assertTrue(player2.getCautiousStrategyCard(yellowThree, yellowThree.getColor()).equals(yellowSix));\r\n }",
"@Test\r\n public void testPlayer_getCautiousStrategyCardCard_numeric_matchNumberNotColor() {\n player2 = new Player(\"Player Two\", true);\r\n player2.setHand(strategyHand.getAllCards());\r\n\r\n // let the cpc be a blue eight\r\n Card blueEight = new Card(Card.BLUE, Card.EIGHT, cvm);\r\n\r\n // get rid of all non-numeric cards and the blue four so the red eight is the most attractive option\r\n player2.getHand().discard(wild);\r\n player2.getHand().discard(wildDrawFour);\r\n player2.getHand().discard(yellowReverse);\r\n player2.getHand().discard(redDrawTwo);\r\n player2.getHand().discard(blueFour);\r\n\r\n Card redEight = new Card(Card.RED, Card.EIGHT, cvm);\r\n\r\n assertTrue(player2.getCautiousStrategyCard(blueEight, yellowThree.getColor()).equals(redEight));\r\n }",
"@Test\r\n public void testPlayer_getBoldStrategyCard_numeric_matchNumberNotColor() {\n player2 = new Player(\"Player Two\", true);\r\n player2.setHand(strategyHand.getAllCards());\r\n Card blueEight = new Card(Card.BLUE, Card.EIGHT, cvm);\r\n player2.getHand().discard(blueFour);\r\n player2.getHand().discard(yellowZero);\r\n Card redEight = new Card(Card.RED, Card.EIGHT, cvm);\r\n assertTrue(player2.getBoldStrategyCard(blueEight, yellowThree.getColor()).equals(redEight));\r\n }",
"boolean similarColorTo(Card c);",
"@Test\r\n public void testPlayer_getBoldStrategyCard_numeric_colorBeatsNumber() {\n\r\n player2 = new Player(\"Player Two\", true);\r\n player2.setHand(strategyHand.getAllCards());\r\n\r\n // pick a cpc that could return two possible options\r\n // and assert that the higher value card comes back\r\n\r\n // make a cpc that might return a yellow six or a red eight\r\n // assert the yellow comes back, even though the red eight has a higher value\r\n Card redSix = new Card(Card.RED, Card.SIX, cvm);\r\n assertTrue(player2.getBoldStrategyCard(redSix, redSix.getColor()).equals(yellowSix));\r\n }",
"@Test\n\t\tpublic void testGetColour() {\n\t\t\tgreenSix = new Card (Card.Colour.Green, 6);\n\t\t\tblueSix = new Card (Card.Colour.Blue, 6);\n\t\t\twild = new Card (Card.Wild.Wild);\n\t\t\twild_Draw4 = new Card (Card.Wild.WildDraw4);\n\t\t\tblueSkip = new Card(Card.Colour.Blue, Card.Action.Skip);\n\t\t\tredDraw2 = new Card(Card.Colour.Red, Card.Action.Draw2);\n\t\t\tgreenReverse = new Card (Card.Colour.Green, Card.Action.Reverse);\n\t\t\tassertEquals(\"black\", wild.getColour());\n\t\t\tassertEquals(\"black\", wild_Draw4.getColour());\n\t\t\tassertEquals(\"Blue\", blueSkip.getColour());\n\t\t\tassertEquals(\"Red\", redDraw2.getColour());\n\t\t\tassertEquals(\"Green\", greenReverse.getColour());\n\t\t}",
"@Override\n public boolean match(Card card) {\n if (card.getColor().equals(\"BLACK\"))\n return true;\n\n return (card.getColor().equals(this.getColor())\n || card.getValue().equals(this.getValue()));\n }",
"@Test\r\n public void testPlayer_selectNewColor_dumb() {\r\n player2 = new Player(\"\", true);\r\n player2.setStrategy(Player.STRATEGY_DUMB);\r\n player2.setHand(strategyHand.getAllCards());\r\n player2.setLastPlayedCard(wild);\r\n String firstRandomColor = player2.selectNewColor();\r\n boolean differentColorFound = false;\r\n for(int i = 0; i < 25; i++) {\r\n String nextRandomColor = player2.selectNewColor();\r\n if(!nextRandomColor.equalsIgnoreCase(firstRandomColor)) {\r\n differentColorFound = true;\r\n }\r\n }\r\n assertTrue(differentColorFound);\r\n }",
"@Test\n public void testCardSelectionIsValid_TRUE() throws Exception {\n System.out.println(\"cardSelectionIsValid not valid\");\n UnoCard cardSelection = new UnoCard(UnoCardColour.BLUE, UnoCardValue.TWO);\n UnoCard drawCard = new UnoCard(UnoCardColour.BLUE, UnoCardValue.ONE);\n UnoCardColour wildColour = UnoCardColour.BLUE;\n utils.cardSelectionIsValid(cardSelection, drawCard, wildColour);\n }",
"private static void checkForMatches() {\n int matchesThisTurn = 0;\n switch (pattern) {\n case RED:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardColor(playerDeck.get(i)).equals(\"Red\")) {\n //system.out.println(\"Matched Card Color:\" + GameDeck.getCardColor(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case BLACK:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardColor(playerDeck.get(i)).equals(\"Black\")) {\n //system.out.println(\"Matched Card Color:\" + GameDeck.getCardColor(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n matchesThisTurn++;\n playerDeck.get(i).setCardPurchased(true);\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case HEART:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardSuit(playerDeck.get(i)).equals(\"Heart\")) {\n //system.out.println(\"Matched Card Suit:\" + GameDeck.getCardSuit(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case DIAMOND:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardSuit(playerDeck.get(i)).equals(\"Diamond\")) {\n //system.out.println(\"Matched Card Suit:\" + GameDeck.getCardSuit(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case CLUB:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardSuit(playerDeck.get(i)).equals(\"Club\")) {\n //system.out.println(\"Matched Card Suit:\" + GameDeck.getCardSuit(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case SPADE:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardSuit(playerDeck.get(i)).equals(\"Spade\")) {\n //system.out.println(\"Matched Card Suit:\" + GameDeck.getCardSuit(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case TWO:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"2\")) {\n //system.out.println(\"Matched Card Name:\" + GameDeck.getCardName(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case THREE:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"3\")) {\n //system.out.println(\"Matched Card Name:\" + GameDeck.getCardName(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case FOUR:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"4\")) {\n //system.out.println(\"Matched Card Name:\" + GameDeck.getCardName(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case FIVE:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"5\")) {\n //system.out.println(\"Matched Card Name:\" + GameDeck.getCardName(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case SIX:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"6\")) {\n //system.out.println(\"Matched Card Name:\" + GameDeck.getCardName(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case SEVEN:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"7\")) {\n //system.out.println(\"Matched Card Name:\" + GameDeck.getCardName(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case EIGHT:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"8\")) {\n //system.out.println(\"Matched Card Name:\" + GameDeck.getCardName(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case NINE:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"9\")) {\n //system.out.println(\"Matched Card Name:\" + GameDeck.getCardName(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case TEN:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"10\")) {\n //system.out.println(\"Matched Card Name:\" + GameDeck.getCardName(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case JACK:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"J\")) {\n //system.out.println(\"Matched Card Name:\" + GameDeck.getCardName(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case QUEEN:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"Q\")) {\n //system.out.println(\"Matched Card Name:\" + GameDeck.getCardName(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case KING:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"K\")) {\n //system.out.println(\"Matched Card Name:\" + GameDeck.getCardName(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case ACE:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"A\")) {\n //system.out.println(\"Matched Card Name:\" + GameDeck.getCardName(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case SINGLEDIGITPRIMES:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"2\") ||\n GameDeck.getCardName(playerDeck.get(i)).equals(\"3\") ||\n GameDeck.getCardName(playerDeck.get(i)).equals(\"5\") ||\n GameDeck.getCardName(playerDeck.get(i)).equals(\"7\")) {\n //system.out.println(\"Matched Card Name:\" + GameDeck.getCardName(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case PAIRS:\n int[] isAPair = new int[]{0,0,0,0};\n if(GameDeck.getCardName(playerDeck.get(0)).equals(GameDeck.getCardName(playerDeck.get(1)))) {\n //system.out.println(\"Matched Pair Name:\" + GameDeck.getCardName(playerDeck.get(0)));\n matchedDeck.add(playerDeck.get(0));\n playerDeck.get(0).setCardPurchased(true);\n matchedDeck.add(playerDeck.get(1));\n playerDeck.get(1).setCardPurchased(true);\n isAPair[1] = 1;\n matchesThisTurn += 2;\n } else if(GameDeck.getCardName(playerDeck.get(0)).equals(GameDeck.getCardName(playerDeck.get(2)))) {\n //system.out.println(\"Matched Pair Name:\" + GameDeck.getCardName(playerDeck.get(0)));\n matchedDeck.add(playerDeck.get(0));\n playerDeck.get(0).setCardPurchased(true);\n matchedDeck.add(playerDeck.get(2));\n playerDeck.get(2).setCardPurchased(true);\n isAPair[2] = 1;\n matchesThisTurn += 2;\n } else if(GameDeck.getCardName(playerDeck.get(0)).equals(GameDeck.getCardName(playerDeck.get(3)))) {\n //system.out.println(\"Matched Pair Name:\" + GameDeck.getCardName(playerDeck.get(0)));\n matchedDeck.add(playerDeck.get(0));\n playerDeck.get(0).setCardPurchased(true);\n matchedDeck.add(playerDeck.get(3));\n playerDeck.get(3).setCardPurchased(true);\n isAPair[3] = 1;\n matchesThisTurn += 2;\n }\n else\n {\n \tplayerDeck.get(0).setCardPurchased(false);\n \tplayerDeck.get(1).setCardPurchased(false);\n \tplayerDeck.get(2).setCardPurchased(false);\n \tplayerDeck.get(3).setCardPurchased(false);\n }\n \n if(isAPair[1] != 1) {\n if(isAPair[2] != 1 && GameDeck.getCardName(playerDeck.get(1)).equals(GameDeck.getCardName(playerDeck.get(2)))) {\n //system.out.println(\"Matched Pair Name:\" + GameDeck.getCardName(playerDeck.get(1)));\n matchedDeck.add(playerDeck.get(1));\n playerDeck.get(1).setCardPurchased(true);\n matchedDeck.add(playerDeck.get(2));\n playerDeck.get(2).setCardPurchased(true);\n isAPair[2] = 1;\n matchesThisTurn += 2;\n } else if(isAPair[3] != 1 && GameDeck.getCardName(playerDeck.get(1)).equals(GameDeck.getCardName(playerDeck.get(3)))) {\n //system.out.println(\"Matched Pair Name:\" + GameDeck.getCardName(playerDeck.get(1)));\n matchedDeck.add(playerDeck.get(1));\n playerDeck.get(1).setCardPurchased(true);\n matchedDeck.add(playerDeck.get(3));\n playerDeck.get(3).setCardPurchased(true);\n isAPair[3] = 1;\n matchesThisTurn += 2;\n }\n else\n {\n \tplayerDeck.get(1).setCardPurchased(false);\n \tplayerDeck.get(2).setCardPurchased(false);\n \tplayerDeck.get(3).setCardPurchased(false);\n }\n \n }\n \n if(isAPair[2] != 1) {\n if(isAPair[3] != 1 && GameDeck.getCardName(playerDeck.get(2)).equals(GameDeck.getCardName(playerDeck.get(3)))) {\n //system.out.println(\"Matched Pair Name:\" + GameDeck.getCardName(playerDeck.get(2)));\n matchedDeck.add(playerDeck.get(2));\n playerDeck.get(2).setCardPurchased(true);\n matchedDeck.add(playerDeck.get(3));\n playerDeck.get(3).setCardPurchased(true);\n matchesThisTurn += 2;\n }\n else\n {\n \tplayerDeck.get(2).setCardPurchased(false);\n \tplayerDeck.get(3).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n guessPattern();\n }\n break;\n case SUMOFPAIRS: //Ace is high for this sum calculation(Ace=14)\n int tempSum;\n int sumPairCount = 0;\n for(int i=0;i<playerDeck.size();i+=2) {\n tempSum = 0;\n tempSum += GameDeck.getCardValue(playerDeck.get(i));\n tempSum += GameDeck.getCardValue(playerDeck.get(i+1));\n if(tempSum == sumValue) {\n //system.out.println(\"Sum Value:\" + tempSum);\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchedDeck.add(playerDeck.get(i+1));\n playerDeck.get(i+1).setCardPurchased(true);\n sumPairCount++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n \tplayerDeck.get(i+1).setCardPurchased(false);\n }\n }\n if(sumPairCount == 2)\n {\n// guessPattern();\n }\n break;\n case INCREMENTING:\n int[] isIncrementing = new int[]{0,0,0,0};\n int[] isConsecutive = new int[]{0,0,0};\n int consecutiveCount = 0;\n for(int i = 0; i< playerDeck.size()-1; i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"A\")) {\n if(1 == GameDeck.getCardValue(playerDeck.get(i+1))-1) {\n //system.out.println(\"Matched incrementing:\" + GameDeck.getCardName(playerDeck.get(i)) +\n // \" & \" + GameDeck.getCardName(playerDeck.get(i+1)));\n isIncrementing[i] = 1;\n isIncrementing[i+1] = 1;\n isConsecutive[i] = 1;\n }\n } else {\n if(GameDeck.getCardValue(playerDeck.get(i)) == GameDeck.getCardValue(playerDeck.get(i+1))-1) {\n //system.out.println(\"Matched incrementing:\" + GameDeck.getCardName(playerDeck.get(i)) +\n // \" & \" + GameDeck.getCardName(playerDeck.get(i+1)));\n isIncrementing[i] = 1;\n isIncrementing[i+1] = 1;\n isConsecutive[i] = 1;\n }\n }\n }\n for(int i=0;i<playerDeck.size();i++) {\n if(isIncrementing[i] == 1) {\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn ++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n for(int i=0;i<3;i++) {\n if(isConsecutive[i] == 1) {\n consecutiveCount++;\n }\n }\n if(consecutiveCount == 3)\n {\n// guessPattern();\n }\n break;\n case DECREMENTING:\n int[] isDecrementing = new int[]{0,0,0,0};\n int[] isConsecutive2 = new int[]{0,0,0};\n int consecutiveCount2 = 0;\n for(int i = 0; i< playerDeck.size()-1; i++) {\n if(GameDeck.getCardValue(playerDeck.get(i)) == 2) {\n if(GameDeck.getCardName(playerDeck.get(i+1)).equals(\"A\")) {\n //system.out.println(\"Matched decrementing:\" + GameDeck.getCardName(playerDeck.get(i)) +\n // \" & \" + GameDeck.getCardName(playerDeck.get(i+1)));\n isDecrementing[i] = 1;\n isDecrementing[i+1] = 1;\n isConsecutive2[i] = 1;\n }\n } else {\n if(GameDeck.getCardValue(playerDeck.get(i)) == GameDeck.getCardValue(playerDeck.get(i+1))+1) {\n //system.out.println(\"Matched decrementing:\" + GameDeck.getCardName(playerDeck.get(i)) +\n // \" & \" + GameDeck.getCardName(playerDeck.get(i+1)));\n isDecrementing[i] = 1;\n isDecrementing[i+1] = 1;\n isConsecutive2[i] = 1;\n }\n }\n }\n for(int i=0;i<playerDeck.size();i++) {\n if(isDecrementing[i] == 1) {\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn ++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n for(int i=0;i<3;i++) {\n if(isConsecutive2[i] == 1) {\n consecutiveCount2++;\n }\n }\n if(consecutiveCount2 == 3)\n {\n// guessPattern();\n }\n break;\n default:\n //system.out.println(\"\");\n break;\n }\n }",
"@Test\r\n public void testPlayer_getBoldStrategyCard_zeroColor() {\n player2 = new Player(\"Player Two\", true);\r\n player2.setHand(strategyHand.getAllCards());\r\n assertTrue(player2.getBoldStrategyCard(yellowSix, yellowSix.getColor()).equals(yellowZero));\r\n\r\n // try again, but reduce the yellow color group to <= 2\r\n player2.getHand().discard(yellowSix);\r\n player2.getHand().discard(yellowReverse);\r\n\r\n assertTrue(player2.getBoldStrategyCard(yellowOne, yellowSix.getColor()).equals(yellowOne));\r\n }",
"@Test\r\n public void testPlayer_getDumbStrategyCard_oneWinner_color() {\n player2 = new Player(\"\", true);\r\n player2.setHand(strategyHand.getAllCards());\r\n player2.getHand().discard(wild);\r\n player2.getHand().discard(wildDrawFour);\r\n assertTrue(player2.getDumbStrategyCard(blueNine, blueNine.getColor()).equals(blueFour));\r\n }",
"@Test\n public void testCardCanPlay_FALSE() {\n System.out.println(\"cardCanPlay FALSE COLOUR\");\n UnoCard cardSelection = new UnoCard(UnoCardColour.RED, UnoCardValue.TWO);\n UnoCard drawCard = new UnoCard(UnoCardColour.BLUE, UnoCardValue.ONE);\n UnoCardColour wildColour = UnoCardColour.BLUE;\n boolean result = utils.cardCanPlay(cardSelection, drawCard, wildColour);\n assertEquals(false, result);\n }",
"@Test\n public void testCardCanPlay_TRUE() {\n System.out.println(\"cardCanPlay TRUE COLOUR\");\n UnoCard cardSelection = new UnoCard(UnoCardColour.BLUE, UnoCardValue.TWO);\n UnoCard drawCard = new UnoCard(UnoCardColour.BLUE, UnoCardValue.ONE);\n UnoCardColour wildColour = UnoCardColour.BLUE;\n boolean result = utils.cardCanPlay(cardSelection, drawCard, wildColour);\n assertEquals(true, result);\n }",
"@Override\n\tpublic String checkPlay(String cardNameRequest, String colorRequest) {\n\n\t\tfor (String color : AVAILABLE_COLORS) {\n\t\t\tif (color.equals(colorRequest)) // Checking if color is valid\n\t\t\t{\n\t\t\t\tif (\"Joker\".equals(cardNameRequest))\n\t\t\t\t\treturn \"Normal-Play\";\n\t\t\t\telse if (\"+4\".equals(cardNameRequest))\n\t\t\t\t\treturn \"+4\";\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn \"Invalid-Play\";\n\t}",
"@Test(expected = Exception.class)\n public void testCardSelectionIsValid_FALSE() throws Exception {\n System.out.println(\"cardSelectionIsValid not valid\");\n UnoCard cardSelection = new UnoCard(UnoCardColour.RED, UnoCardValue.TWO);\n UnoCard drawCard = new UnoCard(UnoCardColour.BLUE, UnoCardValue.ONE);\n UnoCardColour wildColour = UnoCardColour.BLUE;\n utils.cardSelectionIsValid(cardSelection, drawCard, wildColour);\n \n }",
"private void badMatch() {\n\t\tArrayList<Integer> faceValues = new ArrayList<Integer>();\n\t\tInteger firstSelectableCardPos = null;\n\t\t\n\t\tfor (int card = 0; card < CARDS_SUM; card++) {\n\t\t\tPlayingCard thisCard = ((PlayingCard) getActivity().findViewById(solo.getImage(card).getId()));\n\t\t\t\n\t\t\t// cheat by finding card face without turning card over\n\t\t\tint face = thisCard.getCard();\n\t\t\tfaceValues.add(face);\n\t\t\t\n\t\t\t// can't select all cards\n\t\t\tif (thisCard.isLocked() || thisCard.getVisible()) {\n\t\t\t\tcontinue;\n\t\t\t} else if (firstSelectableCardPos == null) {\n\t\t\t\tfirstSelectableCardPos = card;\n\t\t\t}\n\t\t\t\n\t\t\t// if this is a different card, select the bad pair\n\t\t\tif (faceValues.get(firstSelectableCardPos) != face) {\n\t\t\t\tsolo.clickOnImage(firstSelectableCardPos);\n\t\t\t\tsolo.clickOnImage(card);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}",
"private boolean isTheColorInputCorrect(int red, int green, int blue, int alpha){\n if(red > 255 || green > 255 || blue > 255 || alpha > 255){\n System.out.println(\"Values should be equal or smaller then 255.\");\n return false;\n }else if(red < 0 || green < 0 || blue < 0 || alpha < 0){\n System.out.println(\"Values should be equal or bigger then 0.\");\n return false;\n }else{\n return true;\n }\n }",
"public void testCheckForTripleSingleColor()\n {\n // Note that fromString calls the reset method internally.\n\n // An empty board\n assertEquals(b1.checkForTriple(), Cell.EMPTY);\n\n // A single filled cell\n b1.reset();\n b1.fromString(\"REEEEEEEE\");\n assertEquals(b1.checkForTriple(), Cell.EMPTY);\n\n // Some partially filled rows\n b1.fromString(\"RREEEEEEE\");\n assertEquals(b1.checkForTriple(), Cell.EMPTY);\n b1.fromString(\"EEEEEERER\");\n assertEquals(b1.checkForTriple(), Cell.EMPTY);\n b1.fromString(\"RRE\"+\"EEE\"+\"RER\");\n assertEquals(b1.checkForTriple(), Cell.EMPTY);\n\n // Some partially filled columns;\n b1.fromString(\"REEREEEEE\");\n assertEquals(b1.checkForTriple(), Cell.EMPTY);\n b1.fromString(\"EEREEEEER\");\n assertEquals(b1.checkForTriple(), Cell.EMPTY);\n b1.fromString(\"RER\"+\"REE\"+\"EER\");\n assertEquals(b1.checkForTriple(), Cell.EMPTY);\n\n // Partial Diagonals\n b1.fromString(\"REE\"+\"ERE\"+\"EEE\");\n assertEquals(b1.checkForTriple(), Cell.EMPTY);\n b1.fromString(\"REE\"+\"EEE\"+\"EER\");\n assertEquals(b1.checkForTriple(), Cell.EMPTY);\n b1.fromString(\"RER\"+\"ERE\"+\"EEE\");\n assertEquals(b1.checkForTriple(), Cell.EMPTY);\n\n // Filled columns\n b1.fromString(\"REEREEREE\");\n assertEquals(b1.checkForTriple(), Cell.RED1);\n b1.fromString(\"EEREEREER\");\n assertEquals(b1.checkForTriple(), Cell.RED1);\n b1.fromString(\"RERRERRER\");\n assertEquals(b1.checkForTriple(), Cell.RED1);\n\n // Filled Rows\n b1.fromString(\"RRREEEEEE\");\n assertEquals(b1.checkForTriple(), Cell.RED1);\n b1.fromString(\"EEEEEERRR\");\n assertEquals(b1.checkForTriple(), Cell.RED1);\n b1.fromString(\"RRREEERRR\");\n assertEquals(b1.checkForTriple(), Cell.RED1);\n\n // Filled Diagonals\n b1.fromString(\"REE\"+\"ERE\"+\"EER\");\n assertEquals(b1.checkForTriple(), Cell.RED1);\n b1.fromString(\"EER\"+\"ERE\"+\"REE\");\n assertEquals(b1.checkForTriple(), Cell.RED1);\n b1.fromString(\"RER\"+\"ERE\"+\"RER\");\n assertEquals(b1.checkForTriple(), Cell.RED1);\n\n }",
"protected final boolean isDifferentColor(Card cardOne, Card cardTwo)\n {\n return cardOne.getColor() != cardTwo.getColor();\n }",
"public void testCheckForTripleMultiColor()\n {\n // Note that fromString calls the reset method internally.\n\n // An empty board\n assertEquals(b1.checkForTriple(), Cell.EMPTY);\n\n // A single filled cell\n b1.reset();\n b1.fromString(\"REEEEBEEE\");\n assertEquals(b1.checkForTriple(), Cell.EMPTY);\n\n // Some partially filled rows\n b1.fromString(\"RREEBBEEE\");\n assertEquals(b1.checkForTriple(), Cell.EMPTY);\n b1.fromString(\"BEBEEERER\");\n assertEquals(b1.checkForTriple(), Cell.EMPTY);\n b1.fromString(\"RRB\"+\"BEB\"+\"RER\");\n assertEquals(b1.checkForTriple(), Cell.EMPTY);\n\n // Some partially filled columns;\n b1.fromString(\"RBERBEEEE\");\n assertEquals(b1.checkForTriple(), Cell.EMPTY);\n b1.fromString(\"EBREEEEBR\");\n assertEquals(b1.checkForTriple(), Cell.EMPTY);\n b1.fromString(\"RBR\"+\"REB\"+\"EBR\");\n assertEquals(b1.checkForTriple(), Cell.EMPTY);\n\n // Partial Diagonals\n b1.fromString(\"REE\"+\"ERE\"+\"EEB\");\n assertEquals(b1.checkForTriple(), Cell.EMPTY);\n b1.fromString(\"REB\"+\"EEE\"+\"BER\");\n assertEquals(b1.checkForTriple(), Cell.EMPTY);\n b1.fromString(\"RER\"+\"ERE\"+\"EEE\");\n assertEquals(b1.checkForTriple(), Cell.EMPTY);\n\n // Filled columns\n b1.fromString(\"RBBREERBB\");\n assertEquals(b1.checkForTriple(), Cell.RED1);\n b1.fromString(\"BBRBBREER\");\n assertEquals(b1.checkForTriple(), Cell.RED1);\n b1.fromString(\"RBRRBRRER\");\n assertEquals(b1.checkForTriple(), Cell.RED1);\n\n // Filled Rows\n b1.fromString(\"RRREEBBBE\");\n assertEquals(b1.checkForTriple(), Cell.RED1);\n b1.fromString(\"EEBBBERRR\");\n assertEquals(b1.checkForTriple(), Cell.RED1);\n b1.fromString(\"RRRBBERRR\");\n assertEquals(b1.checkForTriple(), Cell.RED1);\n\n // Filled Diagonals\n b1.fromString(\"REB\"+\"ERE\"+\"BER\");\n assertEquals(b1.checkForTriple(), Cell.RED1);\n b1.fromString(\"BBR\"+\"ERE\"+\"RBB\");\n assertEquals(b1.checkForTriple(), Cell.RED1);\n b1.fromString(\"RBR\"+\"BRB\"+\"RBR\");\n assertEquals(b1.checkForTriple(), Cell.RED1);\n\n }",
"boolean similarCard(Card c);",
"@Test\n public void isRedTest() {\n assertTrue(red_piece.isRed());\n assertTrue(!white_piece.isRed());\n }",
"@Test\n public void testCardCanPlay_WILD() {\n System.out.println(\"cardCanPlay WILD\");\n UnoCard cardSelection = new UnoCard(UnoCardColour.WILD, UnoCardValue.ONE);\n UnoCard drawCard = new UnoCard(UnoCardColour.BLUE, UnoCardValue.THREE);\n UnoCardColour wildColour = UnoCardColour.BLUE;\n boolean result = utils.cardCanPlay(cardSelection, drawCard, wildColour);\n assertEquals(true, result);\n }",
"private boolean isValidCard(int index)\n {\n if (index >= cards.size() || index < 0)\n return false;\n \n for (int i = index; i < cards.size() - 1; i++)\n if (!isDifferentColor(cards.get(i), cards.get(i + 1)) ||\n !isOneLess(cards.get(i + 1), cards.get(i)))\n return false;\n\n return true;\n }",
"public static void main(String[] args) {\r\n\t\tCard aceHearts = new Card(\"Ace\", \"Hearts\", 14);\r\n\t\tSystem.out.println(aceHearts.rank());\r\n\t\tSystem.out.println(aceHearts.suit());\r\n\t\tSystem.out.println(aceHearts.pointValue());\r\n\t\tSystem.out.println(aceHearts.toString());\r\n\t\tCard tenDiamonds = new Card(\"Ten\", \"Diamonds\", 10);\r\n\t\tSystem.out.println(tenDiamonds.rank());\r\n\t\tSystem.out.println(tenDiamonds.suit());\r\n\t\tSystem.out.println(tenDiamonds.pointValue());\r\n\t\tSystem.out.println(tenDiamonds.toString());\r\n\t\tCard fiveSpades = new Card(\"Five\", \"Spades\", 5);\r\n\t\tSystem.out.println(fiveSpades.rank());\r\n\t\tSystem.out.println(fiveSpades.suit());\r\n\t\tSystem.out.println(fiveSpades.pointValue());\r\n\t\tSystem.out.println(fiveSpades.toString());\r\n\t\tSystem.out.println(aceHearts.matches(tenDiamonds));\r\n\t\tSystem.out.println(aceHearts.matches(fiveSpades));\r\n\t\tSystem.out.println(aceHearts.matches(aceHearts));\r\n\t\tSystem.out.println(tenDiamonds.matches(fiveSpades));\r\n\t\tSystem.out.println(tenDiamonds.matches(aceHearts));\r\n\t\tSystem.out.println(tenDiamonds.matches(tenDiamonds));\r\n\t\tSystem.out.println(fiveSpades.matches(aceHearts));\r\n\t\tSystem.out.println(fiveSpades.matches(tenDiamonds));\r\n\t\tSystem.out.println(fiveSpades.matches(fiveSpades));\r\n\t}",
"@Test\r\n public void testPlayer_getDumbStrategyCard_differentWinners() {\r\n player2 = new Player(\"\", true);\r\n player2.setHand(strategyHand.getAllCards());\r\n boolean differentLegalCardFound = false;\r\n Card firstDiscard = player2.getDumbStrategyCard(yellowSix, yellowSix.getColor());\r\n for(int i = 0; i < 25; i++) {\r\n Card loopCard = player2.getDumbStrategyCard(yellowSix, yellowSix.getColor());\r\n if(!loopCard.equals(firstDiscard)) {\r\n differentLegalCardFound = true;\r\n }\r\n }\r\n assertTrue(differentLegalCardFound);\r\n }",
"@Test\n\t\t public void InitializeTest1() {\n\t\t\tCard colourNum = new Card(Card.Colour.Blue, 0);\n\t\t\tString expected = \"Blue\";\n\t\t\tString actual = colourNum.getColour();\n\t\t assertEquals(expected, actual);\n\t\t int expectedN = 0;\n\t\t int actualN = colourNum.getNumber();\n\t\t assertEquals(expectedN, actualN);\n\t\t expected = \"none\";\n\t\t actual = colourNum.getAction();\n\t\t assertEquals(expected, actual);\n\t\t expected = null;\n\t\t actual = colourNum.getWild();\n\t\t assertEquals(expected, actual);\n\t\t actualN = colourNum.getValue();\n\t\t assertEquals(expected, actual);\n\t\t }",
"private boolean canPlay(UnoCard topCard, UnoCard newCard) {\n\n\t\t// Color or value matches\n\t\tif (topCard.getColor().equals(newCard.getColor())\n\t\t\t\t|| topCard.getValue().equals(newCard.getValue()))\n\t\t\treturn true;\n\t\t// if chosen wild card color matches\n\t\telse if (topCard instanceof WildCard)\n\t\t\treturn ((WildCard) topCard).getWildColor().equals(newCard.getColor());\n\n\t\t// suppose the new card is a wild card\n\t\telse if (newCard instanceof WildCard)\n\t\t\treturn true;\n\n\t\t// else\n\t\treturn false;\n\t}",
"public boolean canPlace(Card o, String c)\r\n {\r\n if (this.color == c)\r\n return true;\r\n else if (this.value == o.value)\r\n return true;\r\n else if (this.color == \"none\") // Wild cards\r\n return true;\r\n return false;\r\n }",
"public boolean MatchColor(){\n boolean result = false;\n String gameData;\n gameData = DriverStation.getInstance().getGameSpecificMessage();\n if(gameData.length() > 0)\n {\n switch (gameData.charAt(0))\n {\n case 'B' :\n //Blue case code\n result = StopPanelWithColor(kRedTarget);\n break;\n case 'G' :\n //Green case code\n result = StopPanelWithColor(kYellowTarget);\n break; \n case 'R' :\n //Red case code\n result = StopPanelWithColor(kBlueTarget);\n break;\n case 'Y' :\n //Yellow case code\n result = StopPanelWithColor(kGreenTarget);\n break;\n default :\n //This is corrupt data\n break;\n }\n } else {\n //Code for no data received yet\n }\n return result;\n }",
"@Test\n public void getColorTest() {\n assertTrue(red_piece.getColor() == Piece.Color.RED);\n assertTrue(white_piece.getColor() == Piece.Color.WHITE);\n }",
"@Test\n void findDevCard() {\n ArrayList<DevelopmentCardExt> developmentCards= Starter.DevCardParser();\n DashboardExt dashboard= new DashboardExt(developmentCards);\n Random rand= new Random();\n\n for (int i=0; i<48; i++){\n assertNotNull(dashboard.findDevCard(i));\n }\n\n for (int i=48; i<100; i++){\n assertNull(dashboard.findDevCard(i));\n }\n\n\n assertEquals(dashboard.findDevCard(5).getLevel(), Level.ONE);\n assertEquals(dashboard.findDevCard(16).getColor(), ColorDevCard.GREEN);\n\n }",
"@Test\n public void testCardCanPlay_FALSE_VALUE() {\n System.out.println(\"cardCanPlay FALSE VALUE\");\n UnoCard cardSelection = new UnoCard(UnoCardColour.RED, UnoCardValue.TWO);\n UnoCard drawCard = new UnoCard(UnoCardColour.BLUE, UnoCardValue.THREE);\n UnoCardColour wildColour = UnoCardColour.BLUE;\n boolean result = utils.cardCanPlay(cardSelection, drawCard, wildColour);\n assertEquals(false, result);\n }",
"public boolean validCardPlay(UnoCard card) {\r\n return card.getColor() == validColor || card.getValue() == validValue;\r\n }",
"public boolean VerifyHumanChoice(int value){\n String card = handHuman.get(value);\n System.out.print(\"CARD IN VERIFY HUMAN\" + card);\n\n String firstLetter = Character.toString(card.charAt(0));\n String topFirstLetter = Character.toString(topCard.charAt(0));\n\n if(topCard.contains(\"8\")){\n //Can play any card ontop to determine suite\n topCard = card;\n return true;\n }\n\n if(card.contains(\"8\")){\n //valid because 8s are wild cards, human can place it\n topCard = card;\n return true;\n }\n\n //the cards match in suite, doesn't matter what it is\n else if(firstLetter.equals(topFirstLetter)){\n topCard = card;\n return true;\n }\n\n else{\n if(topFirstLetter.equals(\"c\")){\n String temp = topCard.substring(5, topCard.length());\n System.out.println(\"TEMP \" + temp);\n\n if(card.contains(temp)){\n topCard = card;\n return true;\n }\n\n }\n\n else if(topFirstLetter.equals(\"h\")){\n String temp = topCard.substring(6, topCard.length());\n System.out.println(\"TEMP \" + temp);\n\n if(card.contains(temp)){\n topCard = card;\n return true;\n }\n\n }\n\n else if(topFirstLetter.equals(\"d\")){\n String temp = topCard.substring(8, topCard.length());\n System.out.println(\"TEMP \" + temp);\n\n if(card.contains(temp)){\n topCard = card;\n return true;\n }\n\n }\n\n else if(topFirstLetter.equals(\"s\")){\n String temp = topCard.substring(6, topCard.length());\n System.out.println(\"TEMP \" + temp);\n\n if(card.contains(temp)){\n topCard = card;\n return true;\n }\n\n }\n }\n\n //You can't play this card\n return false;\n }",
"public Card()\r\n {\r\n rand = new Random();\r\n value = rand.nextInt(28); \r\n // Assigning value\r\n if (value >= 14) // Check if value is greater than 14 then value = value - 14;\r\n value -= 14;\r\n // Assigning color\r\n rand = new Random();\r\n // Switch statement for assigning different colors\r\n switch(rand.nextInt(4) )\r\n {\r\n case 0: color = \"Red\"; \r\n break;\r\n case 1: color = \"Green\"; \r\n break;\r\n case 2: color = \"Blue\"; \r\n break;\r\n case 3: color = \"Yellow\"; \r\n break;\r\n }\r\n // If the card is a wild card and value is greater than or equal to 13 then none value is assigned to color variable\r\n if (value >= 13)\r\n color = \"none\";\r\n }",
"public UnoCard searchForMatch(UnoCard prev) {\r\n \r\n //case where previous card was a \r\n // special card(wild, or WD4)\r\n if(UnoSpecialCardsV2.unoSpecialCard(prev)) {\r\n //Tests to determine 1) which special card previous was; and\r\n if(UnoSpecialCardsV2.unoCardWild(prev)) {\r\n int unoCardTgtColor = UnoV2.getWildColor();\r\n // 2) does player have a card to match it. \r\n for (int i = hand.handSize()-1; i >=0; i--) {\r\n UnoCard unocard = hand.getCard(i);\r\n if (unocard.getColor() == unoCardTgtColor \r\n || (unocard.getRank() > 24)) { \r\n return hand.popCard(i);\r\n }\r\n }\r\n return null;\r\n \r\n }\r\n // Same comments as above\r\n if(UnoSpecialCardsV2.unoCardWildDrawFour(prev)) {\r\n int unoCardTgtColor = UnoV2.getWildColor();\r\n System.out.println(\"unoCardTgtColor into WD4 SearchForMatch \" \r\n + UnoCard.getColors()[unoCardTgtColor]);\r\n \r\n for (int i = hand.handSize()-1; i >=0;i--) {\r\n UnoCard unocard = hand.getCard(i);\r\n if ((unocard.getColor() == unoCardTgtColor) \r\n || unocard.getRank() > 24) {\r\n return hand.popCard(i); //had problem bug just because I forgot the 'i' in popCard...\r\n }\r\n }\r\n return null;\r\n } \r\n } //end special card prev, search for match\r\n \r\n for (int i = 0; i < hand.handSize(); i++) {\r\n UnoCard unocard = hand.getCard(i);\r\n \r\n/** Runs thru hand looks for regular wild cards, plays \r\n * them first*/\r\n if (unocard.getRank() > 24 && unocard.getRank() < 29) { \r\n return hand.popCard(i); \r\n/** Look for skip,reverse, D2, plays them next */\r\n } else if((unocard.getRank() > 18 && unocard.getRank() < 25) \r\n && UnoCard.unoCardsMatch(unocard, prev)) {\r\n return hand.popCard(i);\r\n }\r\n }\r\n/** After 'filters'\r\n * above, only cases are unocard < 19(normal cards 0 \r\n * to 9} or unocard wild Draw4. \r\n * Sort cards that are not special cards \r\n * or regular wild cards to play highest first \r\n */ \r\n UnoHand.insertionSortUnoHand(hand); \r\n \r\n // search from end of hand as hand sorted ascending\r\n for (int i = hand.handSize() - 1; i >= 0; i--) { \r\n UnoCard unocard = hand.getCard(i);\r\n if (unocard.getRank() <= 19 \r\n && UnoCard.unoCardsMatch(unocard, prev)) {\r\n return hand.popCard(i);\r\n // all else fails, play DrawFour\r\n }else if (unocard.getColor() > 3) { \r\n return hand.popCard(i);\r\n } \r\n }\r\n return null;\r\n }",
"public abstract void colorChecker(Color c);",
"@Test\n public void testMatch() {\n assertMetrics(\"match:1\", \"a\",\"a\");\n assertMetrics(\"match:0.9339\",\"a\",\"a x\");\n assertMetrics(\"match:0\", \"a\",\"x\");\n assertMetrics(\"match:0.9243\",\"a\",\"x a\");\n assertMetrics(\"match:0.9025\",\"a\",\"x a x\");\n\n assertMetrics(\"match:1\", \"a b\",\"a b\");\n assertMetrics(\"match:0.9558\",\"a b\",\"a b x\");\n assertMetrics(\"match:0.9463\",\"a b\",\"x a b\");\n assertMetrics(\"match:0.1296\",\"a b\",\"a x x x x x x x x x x x x x x x x x x x x x x b\");\n assertMetrics(\"match:0.1288\",\"a b\",\"a x x x x x x x x x x x x x x x x x x x x x x x x x x x b\");\n\n assertMetrics(\"match:0.8647\",\"a b c\",\"x x a x b x x x x x x x x a b c x x x x x x x x c x x\");\n assertMetrics(\"match:0.861\", \"a b c\",\"x x a x b x x x x x x x x x x a b c x x x x x x c x x\");\n assertMetrics(\"match:0.4869\",\"a b c\",\"a b x x x x x x x x x x x x x x x x x x x x x x c x x\");\n assertMetrics(\"match:0.4853\",\"a b c\",\"x x a x b x x x x x x x x x x b a c x x x x x x c x x\");\n assertMetrics(\"match:0.3621\",\"a b c\",\"a x b x x x x x x x x x x x x x x x x x x x x x c x x\");\n assertMetrics(\"match:0.3619\",\"a b c\",\"x x a x b x x x x x x x x x x x x x x x x x x x c x x\");\n assertMetrics(\"match:0.3584\",\"a b c\",\"x x a x b x x x x x x x x x x x x x x x x x x x x x c\");\n assertMetrics(\"match:0.3474\",\"a b c\",\"x x a x b x x x x x x x x x x x x x x b x x x b x b x\");\n assertMetrics(\"match:0.3421\",\"a b c\",\"x x a x b x x x x x x x x x x x x x x x x x x x x x x\");\n assertMetrics(\"match:0.305\" ,\"a b c\",\"x x a x b:0.7 x x x x x x x x x x x x x x x x x x x x x x\");\n assertMetrics(\"match:0.2927\",\"a b!200 c\",\"x x a x b:0.7 x x x x x x x x x x x x x x x x x x x x x x\");\n }",
"public void testCOLOUR6() throws Exception {\n\t\tObject retval = execLexer(\"COLOUR\", 125, \"or\", false);\n\t\tObject actual = examineExecResult(org.antlr.gunit.gUnitParser.FAIL, retval);\n\t\tObject expecting = \"FAIL\";\n\n\t\tassertEquals(\"testing rule \"+\"COLOUR\", expecting, actual);\n\t}",
"private boolean is_valid(int x, int y, int proposed_color) {\n\t\tfor (int x1 = 1; x1 <= x; x1++) {\n\t\t\tif (color[x1 - 1][y - 1] == proposed_color)\n\t\t\t\treturn false;\n\t\t}\n\t\tfor (int y1 = 1; y1 <= y; y1++) {\n\t\t\tif (color[x - 1][y1 - 1] == proposed_color)\n\t\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}",
"@Test \n\tpublic void testIfValueisBlackPiece()\n\t{\n \tData d = new Data();\n\t\tassertFalse(d.isWhite(4)); // 4 is the value of one of the black pieces. \n\t}",
"private void checkCorrectColor(String color) {\n List<String> colors = Arrays.asList(COLORS);\n if (!colors.contains(color)) {\n throw new IllegalArgumentException(\"Google Calendar Event color must be one of the specified\");\n }\n }",
"@Test\n public void testNextCardGood() {\n System.out.println(\"nextCardGood\");\n Deck deck = new Deck();\n Card card = deck.nextCard();\n ////since the deck is unshuffled, that last card should be WILDCARD\n assertEquals(CardType.WILDCARD, card.getValue());\n }",
"@Test\n public void testCardCanPlay_TRUE_VALUE() {\n System.out.println(\"cardCanPlay TRUE VALUE\");\n UnoCard cardSelection = new UnoCard(UnoCardColour.RED, UnoCardValue.TWO);\n UnoCard drawCard = new UnoCard(UnoCardColour.BLUE, UnoCardValue.TWO);\n UnoCardColour wildColour = UnoCardColour.BLUE;\n boolean result = utils.cardCanPlay(cardSelection, drawCard, wildColour);\n assertEquals(true, result);\n }",
"protected int verify(Node<T> u) {\n\t\tif (u == nil)\n\t\t\treturn u.colour;\n\t\tif (u.colour < red || u.colour > black)\n\t\t\tthrow new AssertionError(\"Invalid color: \" + u.colour);\n\t\tif (u.colour == red)\n\t\t\tif (u.left.colour == red || u.right.colour == red)\n\t\t\t\tthrow new AssertionError(\"red-red edge found\");\n\t\tif (u.right.colour == red && u.left.colour != red)\n\t\t\tthrow new AssertionError(\"non-left-leaning node found\");\n\t\tint dl = verify(u.left);\n\t\tint dr = verify(u.right);\n\t\tif (dl != dr)\n\t\t\tthrow new AssertionError(\"black-height property violated\");\n\t\treturn dl + u.colour;\n\t}",
"public boolean canUseCard(Card card) {\r\n\t\tif (card.cardColor.contains(CardColor.GREEN)\r\n\t\t\t\t|| card.cardColor.contains(CardColor.GREY)) {\r\n\t\t\treturn false;\r\n\t\t} else if (this.blackTurns > 0) {\r\n\t\t\treturn true;\r\n\t\t} else if (card.cardColor.contains(CardColor.PURPLE)\r\n\t\t\t\t&& this.purpleTurns > 0) {\r\n\t\t\treturn true;\r\n\t\t} else if (card.cardColor.contains(CardColor.RED) && this.redTurns > 0) {\r\n\t\t\treturn true;\r\n\t\t} else if (card.cardColor.contains(CardColor.BLUE)\r\n\t\t\t\t&& this.blueTurns > 0) {\r\n\t\t\treturn true;\r\n\t\t} else if (card.cardColor.contains(CardColor.BROWN)\r\n\t\t\t\t&& this.brownTurns > 0) {\r\n\t\t\treturn true;\r\n\t\t} else\r\n\t\t\treturn false;\r\n\t}",
"void testColorChecker(Tester t) {\r\n initData();\r\n Cell topLeft = (Cell) this.game7.indexHelp(0, 0);\r\n Cell topRight = (Cell) this.game7.indexHelp(1, 0);\r\n Cell botLeft = (Cell) this.game7.indexHelp(0, 1);\r\n Cell botRight = (Cell) this.game7.indexHelp(1, 1);\r\n t.checkExpect(topLeft.flooded, true);\r\n t.checkExpect(topRight.flooded, false);\r\n t.checkExpect(botLeft.flooded, false);\r\n t.checkExpect(botRight.flooded, false);\r\n\r\n topRight.colorChecker(topLeft.color);\r\n t.checkExpect(topRight.flooded, true);\r\n t.checkExpect(botRight.flooded, true);\r\n t.checkExpect(botLeft.flooded, false);\r\n t.checkExpect(topLeft.flooded, true);\r\n }",
"private String printColorError(List<Card> hand, Card upCard,\n UnoPlayer.Color calledColor, ArrayList<Integer> validPlays,\n UnoPlayer.Color newColor)\n {\n String s = \"\";\n s += \"Whoops -- your callColor() method has an error!\\n\";\n s += \"You were given this hand:\\n\";\n for (int i = 0; i < hand.size(); i++)\n {\n s += \" \" + i + \". \" + hand.get(i) + \"\\n\";\n }\n\n s += \"and the up card was: \" + upCard + \"\\n\";\n if (upCard.getRank() == UnoPlayer.Rank.WILD\n || upCard.getRank() == UnoPlayer.Rank.WILD_D4)\n {\n s += \"and the called color was: \" + calledColor + \"\\n\";\n }\n s += \"and you (wrongly) returned \" + newColor + \".\\n\";\n return s;\n }",
"private void checkCardMatch(Card card1, Card card2) {\n if(card1.getColor().getColor() == card2.getColor().getColor()){\n card1.setCardState(CardState.MATCHED);\n card2.setCardState(CardState.MATCHED);\n\n playerManager.incrementScore();\n } else{\n card1.flipCard();\n card2.flipCard();\n }\n cardsClicked = new Card[2];\n switchPlayer();\n setRandomColors();\n checkGameOver();\n }",
"public void testCOLOUR4() throws Exception {\n\t\tObject retval = execLexer(\"COLOUR\", 123, \"azure\", false);\n\t\tObject actual = examineExecResult(org.antlr.gunit.gUnitParser.OK, retval);\n\t\tObject expecting = \"OK\";\n\n\t\tassertEquals(\"testing rule \"+\"COLOUR\", expecting, actual);\n\t}",
"public void testCanPlayOn() {\n \n DrawCard redDraw2 = new DrawCard(Card.COLOUR_RED, 2);\n \n // create another 4 normal cards\n \n Card card1 = new Card(Card.COLOUR_BLUE, 5);\n Card card2 = new Card(Card.COLOUR_BLUE,2);\n \n //card 1 and card 2 should yield false on the method\n assertFalse(redDraw2.canPlayOn(card1));\n assertFalse(redDraw2.canPlayOn(card2));\n \n Card card3 = new Card(Card.COLOUR_RED, 5);\n Card card4 = new Card(Card.COLOUR_RED,2);\n \n // card 3 and card 4 should gives true\n \n assertTrue(redDraw2.canPlayOn(card3));\n assertTrue(redDraw2.canPlayOn(card4));\n \n }",
"@Test\n public void getDeckTest3() {\n GenericStandardDeckGame g = new GenericStandardDeckGame();\n List<Card> deck = g.getDeck();\n String s = \"♣♦♥♠\";\n for (char ch : s.toCharArray()) {\n int counter = 0;\n for (Card c : deck) {\n if (c.getSuit().getValue() == ch) {\n counter++;\n }\n }\n assertEquals(counter, 13);\n }\n }",
"@Test\n public void testIsValidTap() {\n setUpCorrect();\n assertTrue(boardManager.isValidTap(11));\n assertTrue(boardManager.isValidTap(14));\n assertFalse(boardManager.isValidTap(10));\n }",
"@Test //TEST FOUR\n void testLowercaseBlackColor()\n {\n Rabbit_RegEx rabbit_color = new Rabbit_RegEx();\n rabbit_color.setIsBaby(true);\n rabbit_color.setWeight(2);\n rabbit_color.setAge(4);\n rabbit_color.setColor(\"black\");\n String expected = \"Is the rabbit a baby?: true\\n\" +\n \"How old is the rabbit?: 4 weeks\\n\" +\n \"Weight: 2.0 in ounces\\n\" +\n \"Color: black\";\n assertEquals(expected, rabbit_color.toString());\n }",
"@Test\n public void testShuffleGood() {\n System.out.println(\"shuffleGood\");\n Deck deck = new Deck();\n boolean shuffled = false;\n deck.shuffle();\n //we take out one card from the deck\n Card lastCard = deck.nextCard();\n //we take out 58 more cards\n for (int i =0 ; i<57;i++)\n {\n deck.nextCard();\n }\n //we take out the last card from the deck\n Card firstCard = deck.nextCard();\n \n //if both cards = the same value they were before being shuffled, then test will fail.\n if (lastCard.getValue() != CardType.WILDCARD )\n shuffled = true;\n else if (firstCard.getValue()!=CardType.ZERO)\n shuffled = true;\n \n //if either of the cards are different, that means the deck was shuffled and the test will pass\n assertEquals(true, shuffled);\n }",
"public boolean isValid() {\n //valid melds must have 3+ tile\n if (tiles.size() < 3) {\n //System.out.println(\"fail 1\");\n return false;\n }\n if (tiles.get(0).getColour() == tiles.get(1).getColour() &&\n\t\t\ttiles.get(0).getValue() != tiles.get(1).getValue()) { //test a run\n\t\t\tif (this.size() > 13) {\n //System.out.println(\"fail 2\");\n return false;\n }\n for (int i=1; i<tiles.size(); i++) {\n if (tiles.get(i).getColour() != tiles.get(0).getColour()) { //make sure all are same colour\n //System.out.println(\"fail 3\");\n return false;\n }\n if (tiles.get(i).getValue() != (tiles.get(0).getValue() + i)) { //make sure all values make a run\n //System.out.println(\"fail 4\");\n return false;\n }\n }\n } else { //test a set\n Set<Character> colours = new HashSet<>();\n for (int i=0; i<tiles.size(); i++) {\n if (tiles.get(i).getValue() != tiles.get(0).getValue()) { //all are same value\n //System.out.println(\"fail 5\");\n\t\t\t\t\treturn false;\n }\n\n if (colours.contains(tiles.get(i).getColour()) && tiles.get(i).getColour() != 'J') { //check for duplicate colours\n //System.out.println(\"fail 6\");\n\t\t\t\t\treturn false;\n } else {\n\t\t\t\t\tcolours.add(tiles.get(i).getColour()); //keep track of all the colours this set has\n }\n }\n if (this.size() > 4) { //only possible if there are 5 cards, including a joker\n //System.out.println(\"fail 7\");\n\t\t\t\treturn false;\n }\n }\n\n return true; \n }",
"public void testCOLOUR2() throws Exception {\n\t\tObject retval = execLexer(\"COLOUR\", 121, \"sable\", false);\n\t\tObject actual = examineExecResult(org.antlr.gunit.gUnitParser.OK, retval);\n\t\tObject expecting = \"OK\";\n\n\t\tassertEquals(\"testing rule \"+\"COLOUR\", expecting, actual);\n\t}",
"public void testCOLOUR5() throws Exception {\n\t\tObject retval = execLexer(\"COLOUR\", 124, \"purpure\", false);\n\t\tObject actual = examineExecResult(org.antlr.gunit.gUnitParser.OK, retval);\n\t\tObject expecting = \"OK\";\n\n\t\tassertEquals(\"testing rule \"+\"COLOUR\", expecting, actual);\n\t}",
"public boolean sameColor(Card card) {\r\n boolean isSameColor = false;\r\n if (card.getColor().equals(color)) {\r\n isSameColor = true;\r\n }\r\n return isSameColor;\r\n }",
"@Test\n @Disabled\n public void testValidateMatriculaCoche() {\n assertFalse(RegExprMain.validateMatriculaCoche(\"543 JTD\"));\n assertTrue(RegExprMain.validateMatriculaCoche(\"5432 JTD\"));\n assertFalse(RegExprMain.validateMatriculaCoche(\"5433 JAD\"));\n assertFalse(RegExprMain.validateMatriculaCoche(\"54333 JTD\"));\n assertTrue(RegExprMain.validateMatriculaCoche(\"5432 JTD\"));\n assertTrue(RegExprMain.validateMatriculaCoche(\"6784 CLD\"));\n assertTrue(RegExprMain.validateMatriculaCoche(\"4563 BVB\"));\n assertTrue(RegExprMain.validateMatriculaCoche(\"6789 LMN\"));\n assertTrue(RegExprMain.validateMatriculaCoche(\"2435 JKD\"));\n assertTrue(RegExprMain.validateMatriculaCoche(\"4567 GJD\"));\n \n\n }",
"@Test\n public void isGameOverNoRed()\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 = 8 - 3; y < 8; 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(0));\n assertThat(environment.getTokenCountFor(CheckersTeam.WHITE), is(12));\n\n final CheckersAdjudicator adjudicator = injector.injectAdjudicator();\n\n // Run / Verify.\n assertTrue(adjudicator.isGameOver(environment));\n }",
"boolean isAllowed(int rgb, float[] hsl);",
"@Test\n\tpublic void verifyCombosOnBoard() {\n\t\tBoard board = boardFactory.fromTextGenerateBoard(\"/boards/1LineOf3.txt\", mockGroup);\n\t\tassertFalse(board.outOfMoves());\n\n\t}",
"boolean isMismatch(double score);",
"void testRandColor(Tester t) {\r\n initData();\r\n t.checkExpect(this.game2.randColor(), Color.ORANGE);\r\n t.checkExpect(this.game3.randColor(), Color.RED);\r\n t.checkExpect(this.game5.randColor(), Color.PINK);\r\n }",
"@Test\n public void testGetColor() {\n assertEquals(r1.getColor(), new Color(255, 0, 0));\n assertEquals(r2.getColor(), new Color(255, 255, 255));\n assertEquals(r3.getColor(), new Color(255, 255, 0));\n assertEquals(r4.getColor(), new Color(200, 150, 133));\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 }",
"private void testHand(List<Card> hand, Card upCard,\n UnoPlayer.Color calledColor, ArrayList<Integer> validPlays, int n)\n {\n int cardPlayed = thePlayer.play(hand, upCard, calledColor,\n new GameState(upCard));\n\n if (!validPlays.contains(new Integer(cardPlayed)))\n {\n String error = printCardError(hand, upCard, calledColor,\n validPlays, cardPlayed);\n fail(\"Failed test \" + n + \".\\n\" + error);\n }\n\n UnoPlayer.Color color = thePlayer.callColor(hand);\n\n if (color != UnoPlayer.Color.RED && color != UnoPlayer.Color.BLUE\n && color != UnoPlayer.Color.GREEN\n && color != UnoPlayer.Color.YELLOW)\n {\n String error = printColorError(hand, upCard, calledColor,\n validPlays, color);\n fail(\"Failed test \" + n + \".\\n\" + error);\n }\n\n }",
"@Test\n\t\t public void InitializeTest2() {\n\t\t\tCard colourAction = new Card(Card.Colour.Red, Card.Action.Draw2);\n\t\t\tString expected = \"Red\";\n\t\t\tString actual = colourAction.getColour();\n\t\t assertEquals(expected, actual);\n\t\t int expectedN = -10;\n\t\t int actualN = colourAction.getNumber();\n\t\t assertEquals(expectedN, actualN);\n\t\t expected = \"Draw2\";\n\t\t actual = colourAction.getAction();\n\t\t assertEquals(expected, actual);\n\t\t expected = null;\n\t\t actual = colourAction.getWild();\n\t\t assertEquals(expected, actual);\n\t\t expectedN = 20;\n\t\t actualN = colourAction.getValue();\n\t\t assertEquals(expected, actual);\n\t\t }",
"public void testCOLOUR7() throws Exception {\n\t\tObject retval = execLexer(\"COLOUR\", 126, \"blue\", false);\n\t\tObject actual = examineExecResult(org.antlr.gunit.gUnitParser.FAIL, retval);\n\t\tObject expecting = \"FAIL\";\n\n\t\tassertEquals(\"testing rule \"+\"COLOUR\", expecting, actual);\n\t}",
"public static Card of(Color color) {\n if (color == null){\n return LOCOMOTIVE;\n } else{\n switch (color) {\n case BLACK: return BLACK;\n case VIOLET: return VIOLET;\n case BLUE: return BLUE;\n case GREEN: return GREEN;\n case YELLOW: return YELLOW;\n case ORANGE: return ORANGE;\n case RED: return RED;\n case WHITE: return WHITE;\n default: throw new Error();\n }\n }\n }",
"public boolean checkColorValue(String valueCombo) {\r\n\t\tString Storedvalue = valueCombo.substring(0,1);\r\n\t\tint storeValueInt = Integer.parseInt(Storedvalue);\r\n\t\tint[] colorValues = getScreenColor(lifeGlobe.getPosition().get(9 - storeValueInt).get(1), \r\n\t\t\t\tlifeGlobe.getPosition().get(9 - storeValueInt).get(0));\r\n\t\tdouble dist = calcDist(colorValues);\r\n\r\n\t\t\r\n\t\t// I might wanna rework this because it dont work 100% of the times\r\n\t\tif(dist < 40){\r\n\t\t\tfc.playSound();\r\n\t\t}\r\n\t\t\r\n\t\r\n\t\treturn false;\r\n\t\r\n\t\t/*\r\n\t\tif(colorValues[0] != 186.0 && colorValues[0] != 91.0){\r\n\t\t\tif(colorValues[1] != 149.0 && colorValues[1] != 70.0){\r\n\t\t\t\tif(colorValues[1] != 107.0 && colorValues[1] != 45.0){\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\r\n\t\t\r\n\t\t}\r\n\t\t*/\r\n\t}",
"boolean matches(String medium, CSSCanvas canvas);",
"public boolean CheckForUnwinnableCondition(){\n int humanSize = GetSizeOfHumanHand();\n int computerSize = GetSizeOfComputerHand();\n\n for(int i = 0; i < humanSize; i++) {\n //Human can play a card\n String card = handHuman.get(i);\n\n String firstLetter = Character.toString(card.charAt(0));\n String topFirstLetter = Character.toString(topCard.charAt(0));\n\n if (topCard.contains(\"8\")) {\n //Can play any card ontop to determine suite\n return true;\n }\n\n if (card.contains(\"8\")) {\n //valid because 8s are wild cards, human can place it\n return true;\n }\n\n //the cards match in suite, doesn't matter what it is\n else if (firstLetter.equals(topFirstLetter)) {\n return true;\n }\n\n else {\n if (topFirstLetter.equals(\"c\")) {\n String temp = topCard.substring(5, topCard.length());\n\n if (card.contains(temp)) {\n return true;\n }\n\n } else if (topFirstLetter.equals(\"h\")) {\n String temp = topCard.substring(6, topCard.length());\n\n if (card.contains(temp)) {\n return true;\n }\n\n } else if (topFirstLetter.equals(\"d\")) {\n String temp = topCard.substring(8, topCard.length());\n\n if (card.contains(temp)) {\n return true;\n }\n\n } else if (topFirstLetter.equals(\"s\")) {\n String temp = topCard.substring(6, topCard.length());\n\n if (card.contains(temp)) {\n return true;\n }\n }\n }\n }\n\n for(int i = 0; i < computerSize; i++){\n //Human can play a card\n String card = handComputer.get(i);\n\n String firstLetter = Character.toString(card.charAt(0));\n String topFirstLetter = Character.toString(topCard.charAt(0));\n\n if (topCard.contains(\"8\")) {\n //Can play any card ontop to determine suite\n return true;\n }\n\n if (card.contains(\"8\")) {\n //valid because 8s are wild cards, human can place it\n return true;\n }\n\n //the cards match in suite, doesn't matter what it is\n else if (firstLetter.equals(topFirstLetter)) {\n return true;\n }\n\n else {\n if (topFirstLetter.equals(\"c\")) {\n String temp = topCard.substring(5, topCard.length());\n\n if (card.contains(temp)) {\n return true;\n }\n\n } else if (topFirstLetter.equals(\"h\")) {\n String temp = topCard.substring(6, topCard.length());\n\n if (card.contains(temp)) {\n return true;\n }\n\n } else if (topFirstLetter.equals(\"d\")) {\n String temp = topCard.substring(8, topCard.length());\n\n if (card.contains(temp)) {\n return true;\n }\n\n } else if (topFirstLetter.equals(\"s\")) {\n String temp = topCard.substring(6, topCard.length());\n\n if (card.contains(temp)) {\n return true;\n }\n }\n }\n }\n\n //Human and computer can't play a card\n return false;\n }",
"public boolean testColourcomponents(EIfcpixeltexture type) throws SdaiException;",
"@Test\n\tpublic void testCreateEmptyCarColor() {\n\t\tCarFactory _carFactory = new CarFactory();\n\n\t\tCarType _carType = CarType.valueOf((\"coupe\".toUpperCase()));\n\t\tString _make = \"BMW\";\n\t\tString _model = \"Z4\";\n\t\tString _color = \"\";\n\t\tint _year = 1990;\n\n\t\t// ---------------------------------------------\n\t\t// Creating an empty color car.\n\t\ttry {\n\t\t\t@SuppressWarnings(\"unused\")\n\t\t\tAbstractCar _unknown = _carFactory.buildCar(_carType, _make, _model, _color, _year);\n\n\t\t\tfail(\"Successfully created an invalid car (should not work).\");\n\t\t} catch (Exception expected_) {\n\n\t\t}\n\t}",
"@Test\r\n public void testIsValidTap() {\r\n assertTrue(boardManager3.isValidTap(7));\r\n assertTrue(boardManager3.isValidTap(5));\r\n assertFalse(boardManager3.isValidTap(0));\r\n }",
"@Test\r\n public void testPlayer_getCautiousStrategyCardCard_higherFirst_wd4() {\n player2 = new Player(\"Player Two\", true);\r\n player2.setHand(strategyHand.getAllCards());\r\n\r\n // get rid of the wild so the wd4 is the most attractive option\r\n player2.getHand().discard(wild);\r\n assertTrue(player2.getCautiousStrategyCard(yellowThree, yellowThree.getColor()).equals(wildDrawFour));\r\n }",
"@Test\r\n public void testPlayer_getCautiousStrategyCardCard_higherFirst_drawTwo() {\n player2 = new Player(\"Player Two\", true);\r\n player2.setHand(strategyHand.getAllCards());\r\n\r\n // let the cpc be a red nine\r\n // get rid of the wild and wd4 cards so the red draw two is the most attractive option\r\n player2.getHand().discard(wild);\r\n player2.getHand().discard(wildDrawFour);\r\n Card redNine = new Card(Card.RED, Card.NINE, cvm);\r\n assertTrue(player2.getCautiousStrategyCard(redNine, redNine.getColor()).equals(redDrawTwo));\r\n }",
"private boolean isBlack(Color color){\r\n return color == Color.black;\r\n }",
"public static boolean validateCard(String[] args) {\n return true;\n }",
"@SmallTest\n\tpublic void testBadMatchPenalty() {\n\t\tbadMatch();\n\t\tassertEquals((Integer) (START_SCORE - BAD_MATCH_PENALTY), Integer.valueOf(solo.getText(1).getText().toString()));\n\t}",
"int canon_600_color (int ratio[], int mar)\n{\n int clipped=0, target, miss;\n\n if (flash_used != 0.0) {\n if (ratio[1] < -104)\n { ratio[1] = -104; clipped = 1; }\n if (ratio[1] > 12)\n { ratio[1] = 12; clipped = 1; }\n } else {\n if (ratio[1] < -264 || ratio[1] > 461) return 2;\n if (ratio[1] < -50)\n { ratio[1] = -50; clipped = 1; }\n if (ratio[1] > 307)\n { ratio[1] = 307; clipped = 1; }\n }\n target = flash_used != 0.0 || ratio[1] < 197\n\t? -38 - (398 * ratio[1] >> 10)\n\t: -123 + (48 * ratio[1] >> 10);\n if (target - mar <= ratio[0] &&\n target + 20 >= ratio[0] && clipped == 0) return 0;\n miss = target - ratio[0];\n if ( Math.abs(miss) >= mar*4) return 2;\n if (miss < -20) miss = -20;\n if (miss > mar) miss = mar;\n ratio[0] = target - miss;\n return 1;\n}",
"public static boolean validColor(String code) {\n\n String colorCode = \"(1?\\\\d{1,2}|2[0-4]\\\\d|25[0-5])\";\n String transparency = \"([0-1]|(\\\\.\\\\d*)|[0-1](\\\\.\\\\d*))\";\n Matcher rgb = Pattern.compile(\"rgb\\\\(\" +\n \"(\" + colorCode + \",){2}\" + colorCode +\n \"\\\\)\").matcher(code);\n Matcher rgba = Pattern.compile(\"rgba\\\\(\" +\n \"(\" + colorCode + \",){3}\" + transparency +\n \"\\\\)\").matcher(code);\n return rgb.matches() || rgba.matches();\n }",
"public static interface CardColors{\n public static final Color RGBA_0 = new Color(0xCCC0B3FF);\n public static final Color RGBA_2 = new Color(0xEEE4DAFF);\n public static final Color RGBA_4 = new Color(0xEDE0C8FF);\n public static final Color RGBA_8 = new Color(0xF2B179FF);\n public static final Color RGBA_16 = new Color(0xF49563FF);\n public static final Color RGBA_32 = new Color(0xF5794DFF);\n public static final Color RGBA_64 = new Color(0xF55D37FF);\n public static final Color RGBA_128 = new Color(0xEEE863FF);\n public static final Color RGBA_256 = new Color(0xEDB04DFF);\n public static final Color RGBA_512 = new Color(0xECB04DFF);\n public static final Color RGBA_1024 = new Color(0xEB9437FF);\n public static final Color RGBA_2048 = new Color(0xEA7821FF);\n }",
"public boolean CheckIfCardPlayedIsValid(UNOCard aCard) {\n\t\t\n\t\tif (discardPile.size() == 0) {\n\t\t\tdiscardPile.add(aCard);\n\t\t\treturn true;\n\t\t}\n\t\telse if (discardPile.get(discardPile.size() - 1).getName() == aCard.getName()) { // If card has the same value as last card played it is valid\n\t\t\tdiscardPile.add(aCard);\n\t\t\tcurrentTurnColor = aCard.getColor();\n\t\t\tif (aCard.getName() == \"Skip\" || aCard.getName() == \"Reverse\" || aCard.getName() == \"Draw Two\") { //if it is a special card it needs to have the action performed\n\t\t\t\tSpecialCardAction(aCard);\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\telse if (currentTurnColor == aCard.getColor()) { // if card is the same color as last card played's color it is valid\n\t\t\tdiscardPile.add(aCard);\n\t\t\tif (aCard.getName() == \"Skip\" || aCard.getName() == \"Reverse\" || aCard.getName() == \"Draw Two\") { //if it is a special card it needs to have the action performed\n\t\t\t\tSpecialCardAction(aCard);\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\telse if (aCard.getName() == \"Wild\" || aCard.getName() == \"Wild Draw Four\") { // if it is a wild or wild draw four card it is valid and performs its special action\n\t\t\tSpecialCardAction(aCard);\n\t\t\tdiscardPile.add(aCard);\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}",
"protected boolean canChoose(int n, Board gameBoard) {\n Card chosenCard = myCards.get(n);// get the chosenCard\n Card groundCard = gameBoard.getGroundCard();\n if (chosenCard.getColor() == groundCard.getColor()) { // if they had same color\n return true;\n }\n if (chosenCard instanceof NumericCard && groundCard instanceof NumericCard) {// if they had same number\n NumericCard tempChosen = (NumericCard) chosenCard; // change the static type\n NumericCard tempground = (NumericCard) groundCard; // change the static type\n if (tempChosen.getNumber() == tempground.getNumber()) {\n return true;\n }\n }\n\n if (groundCard.getClass().equals(chosenCard.getClass()) && !(groundCard instanceof NumericCard)\n && !(chosenCard instanceof NumericCard)) {// if they were sameInstance\n return true;\n }\n return false;\n }",
"@Test\n public void checkValidityTest2() {\n GenericStandardDeckGame g = new GenericStandardDeckGame();\n List<Card> deck = g.getDeck();\n deck.set(32, new Card(Card.number.four, Card.suit.club));\n assert (!g.checkValidity(deck));\n }",
"public static boolean checkSequence(String cards){\r\n //split all the cards and store in card array\r\n String[] cardArray = cards.split(\",\");\r\n //convert card array into card object arrayList\r\n ArrayList<Card> cardList = new ArrayList<Card>();\r\n int numCards = cardArray.length;\r\n //if there is less than 3 cards eliminate deck\r\n if(numCards < 3) return false;\r\n //store suit and face value in card object\r\n for(int i=0;i<numCards;i++){\r\n Card c = new Card(cardArray[i].split(\"#\")[0].trim(),cardArray[i].split(\"#\")[1].trim());\r\n cardList.add(c);\r\n }\r\n int i=0;\r\n String cardSuit=\"\",nextCardSuit=\"\";\r\n int cardValue=-1,nextCardValue=-1,prevCardValue = -1;\r\n \r\n //loop till penultimate card\r\n for(i=0; i<numCards-1 ;i++){ \r\n \r\n cardValue = cardList.get(i).value;\r\n nextCardValue = cardList.get(i+1).value;\r\n cardSuit = cardList.get(i).suit;\r\n nextCardSuit = cardList.get(i+1).suit;\r\n \r\n //suit check\r\n if(!cardSuit.equals(nextCardSuit)) return false;\r\n \r\n //card check\r\n if(cardValue != nextCardValue-1){\r\n \r\n //exception only for queen followed by king followed by ace\r\n if(!(prevCardValue==11 && cardValue == 12 && nextCardValue ==0)){\r\n return false;\r\n }\r\n }\r\n //execption for king followed by ace followed by 2\r\n if(prevCardValue == 12 && cardValue == 0 && nextCardValue==1) return false;\r\n prevCardValue = cardValue;\r\n }\r\n \r\n return true;\r\n }",
"@Test\n public void NineAndMissExpected_90(){\n String input = \"9-9-9-9-9-9-9-9-9-9-\";\n assertEquals(game.scoreOfGame(input),90);\n }",
"@Test\n public void shouldReturnValidBoardLayouts()\n {\n String[] layout = DatabaseHelper.getBoardLayout();\n int expectedRs = (layout[0].equals(\"R\")) ? 9 : 8;\n int expectedBs = (layout[0].equals(\"B\")) ? 9 : 8;\n int expectedCs = 7;\n int expectedA = 1;\n boolean validLayout = true;\n\n // Functional method to count instances of char in string take from: https://stackoverflow.com/a/23906674/1585599\n\n if(layout[1].chars().filter(num -> num == 'R').count() != expectedRs)\n {\n validLayout = false;\n System.out.println(\"Wrong number of Rs.\");\n }\n\n if(layout[1].chars().filter(num -> num == 'B').count() != expectedBs)\n {\n validLayout = false;\n System.out.println(\"Wrong number of Bs.\");\n }\n\n if(layout[1].chars().filter(num -> num == 'C').count() != expectedCs)\n {\n validLayout = false;\n System.out.println(\"Wrong number of Cs.\");\n }\n\n if(layout[1].chars().filter(num -> num == 'A').count() != expectedA)\n {\n validLayout = false;\n System.out.println(\"Wrong number of A.\");\n }\n\n assertTrue(validLayout);\n }",
"public void addCard() {\n for (int i = 0; i < 4; i++) {\n cards.add(new Wild());\n cards.add(new WildDrawFour());\n }\n for (Color color : Color.values())\n cards.add(new NumberCard(color.name(),0));\n for (Color color : Color.values()) {\n for (int i = 0; i < 2; i++) {\n for (int j = 1; j < 10; j++)\n cards.add(new NumberCard(color.name(),j));\n cards.add(new DrawTwo(color.name()));\n cards.add(new Reverse(color.name()));\n cards.add(new Skip(color.name()));\n }\n }\n }",
"public boolean anyValid(OthelloPiece colour){\n boolean valid = false;\n for(int i=0; i<WIDTH;i++){\n for(int j=0;j<HEIGHT;j++){\n if(anyMove(i,j,colour)){\n valid = true;\n }\n } \n }\n clearPieces();\n return valid;\n }",
"public void testCOLOUR3() throws Exception {\n\t\tObject retval = execLexer(\"COLOUR\", 122, \"vert\", false);\n\t\tObject actual = examineExecResult(org.antlr.gunit.gUnitParser.OK, retval);\n\t\tObject expecting = \"OK\";\n\n\t\tassertEquals(\"testing rule \"+\"COLOUR\", expecting, actual);\n\t}",
"private boolean checkMatch(InventoryCrafting inventoryCrafting,IInventory schematic, int par2, int par3, boolean par4) {\r\n\t\tfor (int k = 0; k < 5; ++k) {\r\n\t\t\tfor (int l = 0; l < 5; ++l) {\r\n\t\t\t\tint i1 = k - par2;\r\n\t\t\t\tint j1 = l - par3;\r\n\t\t\t\tItemStack itemstack = null;\r\n\r\n\t\t\t\tif (i1 >= 0 && j1 >= 0 && i1 < this.recipeWidth && j1 < this.recipeHeight) {\r\n\t\t\t\t\tif (par4) {\r\n\t\t\t\t\t\titemstack = this.recipeItems[this.recipeWidth - i1 - 1 + j1 * this.recipeWidth];\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\titemstack = this.recipeItems[i1 + j1 * this.recipeWidth];\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tItemStack itemstack1 = inventoryCrafting.getStackInRowAndColumn(k, l);\r\n\r\n\t\t\t\tif (itemstack1 != null || itemstack != null) {\r\n\t\t\t\t\tif (itemstack1 == null && itemstack != null || itemstack1 != null && itemstack == null) {\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (itemstack.getItem() != itemstack1.getItem()) {\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (itemstack.getItemDamage() != 32767 && itemstack.getItemDamage() != itemstack1.getItemDamage()) {\r\n\t\t\t\t\t\treturn 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\t// for debugging\r\n\t\t/* if(schematicTypeNeeded != null)\r\n\t\t * System.out.println(schematicTypeNeeded.getUnlocalizedName());\r\n\t\t * else System.out.println(\"null type needed\"); */\r\n\r\n\t\t// if there is no specilness needed, just return true\r\n\t\tif (schematicTypeNeeded == null) return true;\r\n\r\n\t\tItemStack schematicStack = schematic.getStackInSlot(0);\r\n\t\t\r\n\t\tif (schematicStack == null) return false;\r\n\r\n\t\tSystem.out.println(schematicStack.getUnlocalizedName());\r\n\r\n\t\tSystem.out.println(\"[NausicaaMod] block that needs schematic\");\r\n\r\n\t\tif (!schematicStack.hasTagCompound()) {\r\n\t\t\tSystem.out.println(\"[NausicaaMod] crafting canceled: no tags\");\r\n\t\t\treturn false;\r\n\r\n\t\t} else if (!SchematicHolder.getCanCraft(schematicStack, schematicTypeNeeded)) {\r\n\t\t\tSystem.out.println(\"[NausicaaMod] crafting canceled\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\r\n\t}",
"@Test\n public void testVictoryRed(){\n for (Cell c: modelTest.grid) {\n if (c.getX() == 6)\n c.setColor(Color.RED);\n }\n\n modelTest.researchVictory(1,0);\n Color winnerTest = modelTest.getWinner();\n\n Assert.assertEquals(winnerTest,Color.RED);\n }",
"@Test\n public void test000_collision_scheme() {\n HashTableADT htIntegerKey = new HashTable<Integer, String>();\n int scheme = htIntegerKey.getCollisionResolution();\n if (scheme < 1 || scheme > 9)\n fail(\"collision resolution must be indicated with 1-9\");\n }",
"private boolean isWrong() {\n\t\treturn wrongMatches >= 5;\n\t}"
] | [
"0.7842191",
"0.7588271",
"0.7198289",
"0.68563515",
"0.6844098",
"0.6414499",
"0.6370853",
"0.6358855",
"0.6278115",
"0.6202722",
"0.61457115",
"0.6121987",
"0.6080572",
"0.60732263",
"0.6056853",
"0.6050172",
"0.5984559",
"0.59475005",
"0.5928625",
"0.5836331",
"0.58111525",
"0.58006847",
"0.57554233",
"0.5744848",
"0.5743839",
"0.5710705",
"0.5700116",
"0.5699658",
"0.5698137",
"0.5687273",
"0.5586786",
"0.557654",
"0.5515682",
"0.5473521",
"0.5473223",
"0.546123",
"0.54558474",
"0.54452336",
"0.54439306",
"0.54326993",
"0.5421449",
"0.5420695",
"0.54174876",
"0.5411771",
"0.53931665",
"0.5381931",
"0.537419",
"0.5369758",
"0.53599364",
"0.5350863",
"0.5350009",
"0.53461444",
"0.53423834",
"0.53383875",
"0.53363574",
"0.533299",
"0.5319874",
"0.53163135",
"0.53145915",
"0.53100985",
"0.53015107",
"0.5297685",
"0.5290673",
"0.5281891",
"0.52776325",
"0.5272955",
"0.5263626",
"0.52599734",
"0.5257776",
"0.52536154",
"0.52481014",
"0.5236677",
"0.5236635",
"0.5236595",
"0.5236219",
"0.52344656",
"0.5221077",
"0.5211684",
"0.5210355",
"0.52082866",
"0.52082396",
"0.52068913",
"0.5194553",
"0.51858",
"0.5184795",
"0.5183968",
"0.51784754",
"0.5174131",
"0.5173757",
"0.5173098",
"0.51671803",
"0.5165659",
"0.5162281",
"0.5158804",
"0.5157625",
"0.5151486",
"0.5150776",
"0.51459754",
"0.51443994",
"0.5143944"
] | 0.73046434 | 2 |
assert that, given no nonnumeric cards, a numeric match is possible without a color match | @Test
public void testPlayer_getBoldStrategyCard_numeric_matchNumberNotColor() {
player2 = new Player("Player Two", true);
player2.setHand(strategyHand.getAllCards());
Card blueEight = new Card(Card.BLUE, Card.EIGHT, cvm);
player2.getHand().discard(blueFour);
player2.getHand().discard(yellowZero);
Card redEight = new Card(Card.RED, Card.EIGHT, cvm);
assertTrue(player2.getBoldStrategyCard(blueEight, yellowThree.getColor()).equals(redEight));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\r\n public void testPlayer_getCautiousStrategyCardCard_numeric_matchColorNotNumber() {\n player2 = new Player(\"Player Two\", true);\r\n player2.setHand(strategyHand.getAllCards());\r\n\r\n // let the cpc be a yellow three\r\n // get rid of all non-numeric cards and the green three so the yellow six is the most attractive option\r\n player2.getHand().discard(wild);\r\n player2.getHand().discard(wildDrawFour);\r\n player2.getHand().discard(yellowReverse);\r\n player2.getHand().discard(redDrawTwo);\r\n player2.getHand().discard(greenThree);\r\n\r\n assertTrue(player2.getCautiousStrategyCard(yellowThree, yellowThree.getColor()).equals(yellowSix));\r\n }",
"@Test\r\n public void testPlayer_getCautiousStrategyCardCard_numeric_matchNumberNotColor() {\n player2 = new Player(\"Player Two\", true);\r\n player2.setHand(strategyHand.getAllCards());\r\n\r\n // let the cpc be a blue eight\r\n Card blueEight = new Card(Card.BLUE, Card.EIGHT, cvm);\r\n\r\n // get rid of all non-numeric cards and the blue four so the red eight is the most attractive option\r\n player2.getHand().discard(wild);\r\n player2.getHand().discard(wildDrawFour);\r\n player2.getHand().discard(yellowReverse);\r\n player2.getHand().discard(redDrawTwo);\r\n player2.getHand().discard(blueFour);\r\n\r\n Card redEight = new Card(Card.RED, Card.EIGHT, cvm);\r\n\r\n assertTrue(player2.getCautiousStrategyCard(blueEight, yellowThree.getColor()).equals(redEight));\r\n }",
"@Test\r\n public void testPlayer_getBoldStrategyCard_numeric_matchColorNotNumber() {\n player2 = new Player(\"Player Two\", true);\r\n player2.setHand(strategyHand.getAllCards());\r\n player2.getHand().discard(greenThree);\r\n player2.getHand().discard(yellowZero);\r\n assertTrue(player2.getBoldStrategyCard(yellowThree, yellowThree.getColor()).equals(yellowSix));\r\n }",
"@Test\r\n public void testPlayer_getBoldStrategyCard_numeric_colorBeatsNumber() {\n\r\n player2 = new Player(\"Player Two\", true);\r\n player2.setHand(strategyHand.getAllCards());\r\n\r\n // pick a cpc that could return two possible options\r\n // and assert that the higher value card comes back\r\n\r\n // make a cpc that might return a yellow six or a red eight\r\n // assert the yellow comes back, even though the red eight has a higher value\r\n Card redSix = new Card(Card.RED, Card.SIX, cvm);\r\n assertTrue(player2.getBoldStrategyCard(redSix, redSix.getColor()).equals(yellowSix));\r\n }",
"@Test\n public void testCardSelectionIsValid_TRUE() throws Exception {\n System.out.println(\"cardSelectionIsValid not valid\");\n UnoCard cardSelection = new UnoCard(UnoCardColour.BLUE, UnoCardValue.TWO);\n UnoCard drawCard = new UnoCard(UnoCardColour.BLUE, UnoCardValue.ONE);\n UnoCardColour wildColour = UnoCardColour.BLUE;\n utils.cardSelectionIsValid(cardSelection, drawCard, wildColour);\n }",
"boolean similarColorTo(Card c);",
"private static void checkForMatches() {\n int matchesThisTurn = 0;\n switch (pattern) {\n case RED:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardColor(playerDeck.get(i)).equals(\"Red\")) {\n //system.out.println(\"Matched Card Color:\" + GameDeck.getCardColor(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case BLACK:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardColor(playerDeck.get(i)).equals(\"Black\")) {\n //system.out.println(\"Matched Card Color:\" + GameDeck.getCardColor(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n matchesThisTurn++;\n playerDeck.get(i).setCardPurchased(true);\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case HEART:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardSuit(playerDeck.get(i)).equals(\"Heart\")) {\n //system.out.println(\"Matched Card Suit:\" + GameDeck.getCardSuit(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case DIAMOND:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardSuit(playerDeck.get(i)).equals(\"Diamond\")) {\n //system.out.println(\"Matched Card Suit:\" + GameDeck.getCardSuit(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case CLUB:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardSuit(playerDeck.get(i)).equals(\"Club\")) {\n //system.out.println(\"Matched Card Suit:\" + GameDeck.getCardSuit(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case SPADE:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardSuit(playerDeck.get(i)).equals(\"Spade\")) {\n //system.out.println(\"Matched Card Suit:\" + GameDeck.getCardSuit(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case TWO:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"2\")) {\n //system.out.println(\"Matched Card Name:\" + GameDeck.getCardName(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case THREE:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"3\")) {\n //system.out.println(\"Matched Card Name:\" + GameDeck.getCardName(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case FOUR:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"4\")) {\n //system.out.println(\"Matched Card Name:\" + GameDeck.getCardName(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case FIVE:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"5\")) {\n //system.out.println(\"Matched Card Name:\" + GameDeck.getCardName(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case SIX:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"6\")) {\n //system.out.println(\"Matched Card Name:\" + GameDeck.getCardName(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case SEVEN:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"7\")) {\n //system.out.println(\"Matched Card Name:\" + GameDeck.getCardName(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case EIGHT:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"8\")) {\n //system.out.println(\"Matched Card Name:\" + GameDeck.getCardName(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case NINE:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"9\")) {\n //system.out.println(\"Matched Card Name:\" + GameDeck.getCardName(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case TEN:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"10\")) {\n //system.out.println(\"Matched Card Name:\" + GameDeck.getCardName(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case JACK:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"J\")) {\n //system.out.println(\"Matched Card Name:\" + GameDeck.getCardName(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case QUEEN:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"Q\")) {\n //system.out.println(\"Matched Card Name:\" + GameDeck.getCardName(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case KING:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"K\")) {\n //system.out.println(\"Matched Card Name:\" + GameDeck.getCardName(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case ACE:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"A\")) {\n //system.out.println(\"Matched Card Name:\" + GameDeck.getCardName(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case SINGLEDIGITPRIMES:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"2\") ||\n GameDeck.getCardName(playerDeck.get(i)).equals(\"3\") ||\n GameDeck.getCardName(playerDeck.get(i)).equals(\"5\") ||\n GameDeck.getCardName(playerDeck.get(i)).equals(\"7\")) {\n //system.out.println(\"Matched Card Name:\" + GameDeck.getCardName(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case PAIRS:\n int[] isAPair = new int[]{0,0,0,0};\n if(GameDeck.getCardName(playerDeck.get(0)).equals(GameDeck.getCardName(playerDeck.get(1)))) {\n //system.out.println(\"Matched Pair Name:\" + GameDeck.getCardName(playerDeck.get(0)));\n matchedDeck.add(playerDeck.get(0));\n playerDeck.get(0).setCardPurchased(true);\n matchedDeck.add(playerDeck.get(1));\n playerDeck.get(1).setCardPurchased(true);\n isAPair[1] = 1;\n matchesThisTurn += 2;\n } else if(GameDeck.getCardName(playerDeck.get(0)).equals(GameDeck.getCardName(playerDeck.get(2)))) {\n //system.out.println(\"Matched Pair Name:\" + GameDeck.getCardName(playerDeck.get(0)));\n matchedDeck.add(playerDeck.get(0));\n playerDeck.get(0).setCardPurchased(true);\n matchedDeck.add(playerDeck.get(2));\n playerDeck.get(2).setCardPurchased(true);\n isAPair[2] = 1;\n matchesThisTurn += 2;\n } else if(GameDeck.getCardName(playerDeck.get(0)).equals(GameDeck.getCardName(playerDeck.get(3)))) {\n //system.out.println(\"Matched Pair Name:\" + GameDeck.getCardName(playerDeck.get(0)));\n matchedDeck.add(playerDeck.get(0));\n playerDeck.get(0).setCardPurchased(true);\n matchedDeck.add(playerDeck.get(3));\n playerDeck.get(3).setCardPurchased(true);\n isAPair[3] = 1;\n matchesThisTurn += 2;\n }\n else\n {\n \tplayerDeck.get(0).setCardPurchased(false);\n \tplayerDeck.get(1).setCardPurchased(false);\n \tplayerDeck.get(2).setCardPurchased(false);\n \tplayerDeck.get(3).setCardPurchased(false);\n }\n \n if(isAPair[1] != 1) {\n if(isAPair[2] != 1 && GameDeck.getCardName(playerDeck.get(1)).equals(GameDeck.getCardName(playerDeck.get(2)))) {\n //system.out.println(\"Matched Pair Name:\" + GameDeck.getCardName(playerDeck.get(1)));\n matchedDeck.add(playerDeck.get(1));\n playerDeck.get(1).setCardPurchased(true);\n matchedDeck.add(playerDeck.get(2));\n playerDeck.get(2).setCardPurchased(true);\n isAPair[2] = 1;\n matchesThisTurn += 2;\n } else if(isAPair[3] != 1 && GameDeck.getCardName(playerDeck.get(1)).equals(GameDeck.getCardName(playerDeck.get(3)))) {\n //system.out.println(\"Matched Pair Name:\" + GameDeck.getCardName(playerDeck.get(1)));\n matchedDeck.add(playerDeck.get(1));\n playerDeck.get(1).setCardPurchased(true);\n matchedDeck.add(playerDeck.get(3));\n playerDeck.get(3).setCardPurchased(true);\n isAPair[3] = 1;\n matchesThisTurn += 2;\n }\n else\n {\n \tplayerDeck.get(1).setCardPurchased(false);\n \tplayerDeck.get(2).setCardPurchased(false);\n \tplayerDeck.get(3).setCardPurchased(false);\n }\n \n }\n \n if(isAPair[2] != 1) {\n if(isAPair[3] != 1 && GameDeck.getCardName(playerDeck.get(2)).equals(GameDeck.getCardName(playerDeck.get(3)))) {\n //system.out.println(\"Matched Pair Name:\" + GameDeck.getCardName(playerDeck.get(2)));\n matchedDeck.add(playerDeck.get(2));\n playerDeck.get(2).setCardPurchased(true);\n matchedDeck.add(playerDeck.get(3));\n playerDeck.get(3).setCardPurchased(true);\n matchesThisTurn += 2;\n }\n else\n {\n \tplayerDeck.get(2).setCardPurchased(false);\n \tplayerDeck.get(3).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n guessPattern();\n }\n break;\n case SUMOFPAIRS: //Ace is high for this sum calculation(Ace=14)\n int tempSum;\n int sumPairCount = 0;\n for(int i=0;i<playerDeck.size();i+=2) {\n tempSum = 0;\n tempSum += GameDeck.getCardValue(playerDeck.get(i));\n tempSum += GameDeck.getCardValue(playerDeck.get(i+1));\n if(tempSum == sumValue) {\n //system.out.println(\"Sum Value:\" + tempSum);\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchedDeck.add(playerDeck.get(i+1));\n playerDeck.get(i+1).setCardPurchased(true);\n sumPairCount++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n \tplayerDeck.get(i+1).setCardPurchased(false);\n }\n }\n if(sumPairCount == 2)\n {\n// guessPattern();\n }\n break;\n case INCREMENTING:\n int[] isIncrementing = new int[]{0,0,0,0};\n int[] isConsecutive = new int[]{0,0,0};\n int consecutiveCount = 0;\n for(int i = 0; i< playerDeck.size()-1; i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"A\")) {\n if(1 == GameDeck.getCardValue(playerDeck.get(i+1))-1) {\n //system.out.println(\"Matched incrementing:\" + GameDeck.getCardName(playerDeck.get(i)) +\n // \" & \" + GameDeck.getCardName(playerDeck.get(i+1)));\n isIncrementing[i] = 1;\n isIncrementing[i+1] = 1;\n isConsecutive[i] = 1;\n }\n } else {\n if(GameDeck.getCardValue(playerDeck.get(i)) == GameDeck.getCardValue(playerDeck.get(i+1))-1) {\n //system.out.println(\"Matched incrementing:\" + GameDeck.getCardName(playerDeck.get(i)) +\n // \" & \" + GameDeck.getCardName(playerDeck.get(i+1)));\n isIncrementing[i] = 1;\n isIncrementing[i+1] = 1;\n isConsecutive[i] = 1;\n }\n }\n }\n for(int i=0;i<playerDeck.size();i++) {\n if(isIncrementing[i] == 1) {\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn ++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n for(int i=0;i<3;i++) {\n if(isConsecutive[i] == 1) {\n consecutiveCount++;\n }\n }\n if(consecutiveCount == 3)\n {\n// guessPattern();\n }\n break;\n case DECREMENTING:\n int[] isDecrementing = new int[]{0,0,0,0};\n int[] isConsecutive2 = new int[]{0,0,0};\n int consecutiveCount2 = 0;\n for(int i = 0; i< playerDeck.size()-1; i++) {\n if(GameDeck.getCardValue(playerDeck.get(i)) == 2) {\n if(GameDeck.getCardName(playerDeck.get(i+1)).equals(\"A\")) {\n //system.out.println(\"Matched decrementing:\" + GameDeck.getCardName(playerDeck.get(i)) +\n // \" & \" + GameDeck.getCardName(playerDeck.get(i+1)));\n isDecrementing[i] = 1;\n isDecrementing[i+1] = 1;\n isConsecutive2[i] = 1;\n }\n } else {\n if(GameDeck.getCardValue(playerDeck.get(i)) == GameDeck.getCardValue(playerDeck.get(i+1))+1) {\n //system.out.println(\"Matched decrementing:\" + GameDeck.getCardName(playerDeck.get(i)) +\n // \" & \" + GameDeck.getCardName(playerDeck.get(i+1)));\n isDecrementing[i] = 1;\n isDecrementing[i+1] = 1;\n isConsecutive2[i] = 1;\n }\n }\n }\n for(int i=0;i<playerDeck.size();i++) {\n if(isDecrementing[i] == 1) {\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn ++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n for(int i=0;i<3;i++) {\n if(isConsecutive2[i] == 1) {\n consecutiveCount2++;\n }\n }\n if(consecutiveCount2 == 3)\n {\n// guessPattern();\n }\n break;\n default:\n //system.out.println(\"\");\n break;\n }\n }",
"@Override\n public boolean match(Card card) {\n if (card.getColor().equals(\"BLACK\"))\n return true;\n\n return (card.getColor().equals(this.getColor())\n || card.getValue().equals(this.getValue()));\n }",
"@Test(expected = Exception.class)\n public void testCardSelectionIsValid_FALSE() throws Exception {\n System.out.println(\"cardSelectionIsValid not valid\");\n UnoCard cardSelection = new UnoCard(UnoCardColour.RED, UnoCardValue.TWO);\n UnoCard drawCard = new UnoCard(UnoCardColour.BLUE, UnoCardValue.ONE);\n UnoCardColour wildColour = UnoCardColour.BLUE;\n utils.cardSelectionIsValid(cardSelection, drawCard, wildColour);\n \n }",
"public static void main(String[] args) {\r\n\t\tCard aceHearts = new Card(\"Ace\", \"Hearts\", 14);\r\n\t\tSystem.out.println(aceHearts.rank());\r\n\t\tSystem.out.println(aceHearts.suit());\r\n\t\tSystem.out.println(aceHearts.pointValue());\r\n\t\tSystem.out.println(aceHearts.toString());\r\n\t\tCard tenDiamonds = new Card(\"Ten\", \"Diamonds\", 10);\r\n\t\tSystem.out.println(tenDiamonds.rank());\r\n\t\tSystem.out.println(tenDiamonds.suit());\r\n\t\tSystem.out.println(tenDiamonds.pointValue());\r\n\t\tSystem.out.println(tenDiamonds.toString());\r\n\t\tCard fiveSpades = new Card(\"Five\", \"Spades\", 5);\r\n\t\tSystem.out.println(fiveSpades.rank());\r\n\t\tSystem.out.println(fiveSpades.suit());\r\n\t\tSystem.out.println(fiveSpades.pointValue());\r\n\t\tSystem.out.println(fiveSpades.toString());\r\n\t\tSystem.out.println(aceHearts.matches(tenDiamonds));\r\n\t\tSystem.out.println(aceHearts.matches(fiveSpades));\r\n\t\tSystem.out.println(aceHearts.matches(aceHearts));\r\n\t\tSystem.out.println(tenDiamonds.matches(fiveSpades));\r\n\t\tSystem.out.println(tenDiamonds.matches(aceHearts));\r\n\t\tSystem.out.println(tenDiamonds.matches(tenDiamonds));\r\n\t\tSystem.out.println(fiveSpades.matches(aceHearts));\r\n\t\tSystem.out.println(fiveSpades.matches(tenDiamonds));\r\n\t\tSystem.out.println(fiveSpades.matches(fiveSpades));\r\n\t}",
"private void badMatch() {\n\t\tArrayList<Integer> faceValues = new ArrayList<Integer>();\n\t\tInteger firstSelectableCardPos = null;\n\t\t\n\t\tfor (int card = 0; card < CARDS_SUM; card++) {\n\t\t\tPlayingCard thisCard = ((PlayingCard) getActivity().findViewById(solo.getImage(card).getId()));\n\t\t\t\n\t\t\t// cheat by finding card face without turning card over\n\t\t\tint face = thisCard.getCard();\n\t\t\tfaceValues.add(face);\n\t\t\t\n\t\t\t// can't select all cards\n\t\t\tif (thisCard.isLocked() || thisCard.getVisible()) {\n\t\t\t\tcontinue;\n\t\t\t} else if (firstSelectableCardPos == null) {\n\t\t\t\tfirstSelectableCardPos = card;\n\t\t\t}\n\t\t\t\n\t\t\t// if this is a different card, select the bad pair\n\t\t\tif (faceValues.get(firstSelectableCardPos) != face) {\n\t\t\t\tsolo.clickOnImage(firstSelectableCardPos);\n\t\t\t\tsolo.clickOnImage(card);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}",
"boolean similarCard(Card c);",
"@Test\n public void testCardCanPlay_FALSE() {\n System.out.println(\"cardCanPlay FALSE COLOUR\");\n UnoCard cardSelection = new UnoCard(UnoCardColour.RED, UnoCardValue.TWO);\n UnoCard drawCard = new UnoCard(UnoCardColour.BLUE, UnoCardValue.ONE);\n UnoCardColour wildColour = UnoCardColour.BLUE;\n boolean result = utils.cardCanPlay(cardSelection, drawCard, wildColour);\n assertEquals(false, result);\n }",
"@Test\n public void testCardCanPlay_TRUE() {\n System.out.println(\"cardCanPlay TRUE COLOUR\");\n UnoCard cardSelection = new UnoCard(UnoCardColour.BLUE, UnoCardValue.TWO);\n UnoCard drawCard = new UnoCard(UnoCardColour.BLUE, UnoCardValue.ONE);\n UnoCardColour wildColour = UnoCardColour.BLUE;\n boolean result = utils.cardCanPlay(cardSelection, drawCard, wildColour);\n assertEquals(true, result);\n }",
"@Test\n\t\tpublic void testGetColour() {\n\t\t\tgreenSix = new Card (Card.Colour.Green, 6);\n\t\t\tblueSix = new Card (Card.Colour.Blue, 6);\n\t\t\twild = new Card (Card.Wild.Wild);\n\t\t\twild_Draw4 = new Card (Card.Wild.WildDraw4);\n\t\t\tblueSkip = new Card(Card.Colour.Blue, Card.Action.Skip);\n\t\t\tredDraw2 = new Card(Card.Colour.Red, Card.Action.Draw2);\n\t\t\tgreenReverse = new Card (Card.Colour.Green, Card.Action.Reverse);\n\t\t\tassertEquals(\"black\", wild.getColour());\n\t\t\tassertEquals(\"black\", wild_Draw4.getColour());\n\t\t\tassertEquals(\"Blue\", blueSkip.getColour());\n\t\t\tassertEquals(\"Red\", redDraw2.getColour());\n\t\t\tassertEquals(\"Green\", greenReverse.getColour());\n\t\t}",
"@Test\r\n public void testPlayer_selectNewColor_dumb() {\r\n player2 = new Player(\"\", true);\r\n player2.setStrategy(Player.STRATEGY_DUMB);\r\n player2.setHand(strategyHand.getAllCards());\r\n player2.setLastPlayedCard(wild);\r\n String firstRandomColor = player2.selectNewColor();\r\n boolean differentColorFound = false;\r\n for(int i = 0; i < 25; i++) {\r\n String nextRandomColor = player2.selectNewColor();\r\n if(!nextRandomColor.equalsIgnoreCase(firstRandomColor)) {\r\n differentColorFound = true;\r\n }\r\n }\r\n assertTrue(differentColorFound);\r\n }",
"public boolean VerifyHumanChoice(int value){\n String card = handHuman.get(value);\n System.out.print(\"CARD IN VERIFY HUMAN\" + card);\n\n String firstLetter = Character.toString(card.charAt(0));\n String topFirstLetter = Character.toString(topCard.charAt(0));\n\n if(topCard.contains(\"8\")){\n //Can play any card ontop to determine suite\n topCard = card;\n return true;\n }\n\n if(card.contains(\"8\")){\n //valid because 8s are wild cards, human can place it\n topCard = card;\n return true;\n }\n\n //the cards match in suite, doesn't matter what it is\n else if(firstLetter.equals(topFirstLetter)){\n topCard = card;\n return true;\n }\n\n else{\n if(topFirstLetter.equals(\"c\")){\n String temp = topCard.substring(5, topCard.length());\n System.out.println(\"TEMP \" + temp);\n\n if(card.contains(temp)){\n topCard = card;\n return true;\n }\n\n }\n\n else if(topFirstLetter.equals(\"h\")){\n String temp = topCard.substring(6, topCard.length());\n System.out.println(\"TEMP \" + temp);\n\n if(card.contains(temp)){\n topCard = card;\n return true;\n }\n\n }\n\n else if(topFirstLetter.equals(\"d\")){\n String temp = topCard.substring(8, topCard.length());\n System.out.println(\"TEMP \" + temp);\n\n if(card.contains(temp)){\n topCard = card;\n return true;\n }\n\n }\n\n else if(topFirstLetter.equals(\"s\")){\n String temp = topCard.substring(6, topCard.length());\n System.out.println(\"TEMP \" + temp);\n\n if(card.contains(temp)){\n topCard = card;\n return true;\n }\n\n }\n }\n\n //You can't play this card\n return false;\n }",
"@Test\r\n public void testPlayer_getDumbStrategyCard_differentWinners() {\r\n player2 = new Player(\"\", true);\r\n player2.setHand(strategyHand.getAllCards());\r\n boolean differentLegalCardFound = false;\r\n Card firstDiscard = player2.getDumbStrategyCard(yellowSix, yellowSix.getColor());\r\n for(int i = 0; i < 25; i++) {\r\n Card loopCard = player2.getDumbStrategyCard(yellowSix, yellowSix.getColor());\r\n if(!loopCard.equals(firstDiscard)) {\r\n differentLegalCardFound = true;\r\n }\r\n }\r\n assertTrue(differentLegalCardFound);\r\n }",
"@Test\r\n public void testPlayer_getDumbStrategyCard_oneWinner_color() {\n player2 = new Player(\"\", true);\r\n player2.setHand(strategyHand.getAllCards());\r\n player2.getHand().discard(wild);\r\n player2.getHand().discard(wildDrawFour);\r\n assertTrue(player2.getDumbStrategyCard(blueNine, blueNine.getColor()).equals(blueFour));\r\n }",
"@Test\r\n public void testPlayer_getBoldStrategyCard_zeroColor() {\n player2 = new Player(\"Player Two\", true);\r\n player2.setHand(strategyHand.getAllCards());\r\n assertTrue(player2.getBoldStrategyCard(yellowSix, yellowSix.getColor()).equals(yellowZero));\r\n\r\n // try again, but reduce the yellow color group to <= 2\r\n player2.getHand().discard(yellowSix);\r\n player2.getHand().discard(yellowReverse);\r\n\r\n assertTrue(player2.getBoldStrategyCard(yellowOne, yellowSix.getColor()).equals(yellowOne));\r\n }",
"@Test\n public void testMatch() {\n assertMetrics(\"match:1\", \"a\",\"a\");\n assertMetrics(\"match:0.9339\",\"a\",\"a x\");\n assertMetrics(\"match:0\", \"a\",\"x\");\n assertMetrics(\"match:0.9243\",\"a\",\"x a\");\n assertMetrics(\"match:0.9025\",\"a\",\"x a x\");\n\n assertMetrics(\"match:1\", \"a b\",\"a b\");\n assertMetrics(\"match:0.9558\",\"a b\",\"a b x\");\n assertMetrics(\"match:0.9463\",\"a b\",\"x a b\");\n assertMetrics(\"match:0.1296\",\"a b\",\"a x x x x x x x x x x x x x x x x x x x x x x b\");\n assertMetrics(\"match:0.1288\",\"a b\",\"a x x x x x x x x x x x x x x x x x x x x x x x x x x x b\");\n\n assertMetrics(\"match:0.8647\",\"a b c\",\"x x a x b x x x x x x x x a b c x x x x x x x x c x x\");\n assertMetrics(\"match:0.861\", \"a b c\",\"x x a x b x x x x x x x x x x a b c x x x x x x c x x\");\n assertMetrics(\"match:0.4869\",\"a b c\",\"a b x x x x x x x x x x x x x x x x x x x x x x c x x\");\n assertMetrics(\"match:0.4853\",\"a b c\",\"x x a x b x x x x x x x x x x b a c x x x x x x c x x\");\n assertMetrics(\"match:0.3621\",\"a b c\",\"a x b x x x x x x x x x x x x x x x x x x x x x c x x\");\n assertMetrics(\"match:0.3619\",\"a b c\",\"x x a x b x x x x x x x x x x x x x x x x x x x c x x\");\n assertMetrics(\"match:0.3584\",\"a b c\",\"x x a x b x x x x x x x x x x x x x x x x x x x x x c\");\n assertMetrics(\"match:0.3474\",\"a b c\",\"x x a x b x x x x x x x x x x x x x x b x x x b x b x\");\n assertMetrics(\"match:0.3421\",\"a b c\",\"x x a x b x x x x x x x x x x x x x x x x x x x x x x\");\n assertMetrics(\"match:0.305\" ,\"a b c\",\"x x a x b:0.7 x x x x x x x x x x x x x x x x x x x x x x\");\n assertMetrics(\"match:0.2927\",\"a b!200 c\",\"x x a x b:0.7 x x x x x x x x x x x x x x x x x x x x x x\");\n }",
"@Override\n\tpublic String checkPlay(String cardNameRequest, String colorRequest) {\n\n\t\tfor (String color : AVAILABLE_COLORS) {\n\t\t\tif (color.equals(colorRequest)) // Checking if color is valid\n\t\t\t{\n\t\t\t\tif (\"Joker\".equals(cardNameRequest))\n\t\t\t\t\treturn \"Normal-Play\";\n\t\t\t\telse if (\"+4\".equals(cardNameRequest))\n\t\t\t\t\treturn \"+4\";\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn \"Invalid-Play\";\n\t}",
"boolean isMismatch(double score);",
"@Test\n public void NineAndMissExpected_90(){\n String input = \"9-9-9-9-9-9-9-9-9-9-\";\n assertEquals(game.scoreOfGame(input),90);\n }",
"@Test\n public void testCardCanPlay_WILD() {\n System.out.println(\"cardCanPlay WILD\");\n UnoCard cardSelection = new UnoCard(UnoCardColour.WILD, UnoCardValue.ONE);\n UnoCard drawCard = new UnoCard(UnoCardColour.BLUE, UnoCardValue.THREE);\n UnoCardColour wildColour = UnoCardColour.BLUE;\n boolean result = utils.cardCanPlay(cardSelection, drawCard, wildColour);\n assertEquals(true, result);\n }",
"@Test\n public void testNextCardGood() {\n System.out.println(\"nextCardGood\");\n Deck deck = new Deck();\n Card card = deck.nextCard();\n ////since the deck is unshuffled, that last card should be WILDCARD\n assertEquals(CardType.WILDCARD, card.getValue());\n }",
"@Test\n public void shouldMatchDigits(){\n Assert.assertThat(\"match all digits\",CharMatcher.DIGIT.matchesAllOf(\"1234434\"),is(true));\n Assert.assertThat(\"match any digits \",CharMatcher.DIGIT.matchesAnyOf(\"123TTT4\"),is(true));\n }",
"private boolean isValidCard(int index)\n {\n if (index >= cards.size() || index < 0)\n return false;\n \n for (int i = index; i < cards.size() - 1; i++)\n if (!isDifferentColor(cards.get(i), cards.get(i + 1)) ||\n !isOneLess(cards.get(i + 1), cards.get(i)))\n return false;\n\n return true;\n }",
"@Test\n @Disabled\n public void testValidateMatriculaCoche() {\n assertFalse(RegExprMain.validateMatriculaCoche(\"543 JTD\"));\n assertTrue(RegExprMain.validateMatriculaCoche(\"5432 JTD\"));\n assertFalse(RegExprMain.validateMatriculaCoche(\"5433 JAD\"));\n assertFalse(RegExprMain.validateMatriculaCoche(\"54333 JTD\"));\n assertTrue(RegExprMain.validateMatriculaCoche(\"5432 JTD\"));\n assertTrue(RegExprMain.validateMatriculaCoche(\"6784 CLD\"));\n assertTrue(RegExprMain.validateMatriculaCoche(\"4563 BVB\"));\n assertTrue(RegExprMain.validateMatriculaCoche(\"6789 LMN\"));\n assertTrue(RegExprMain.validateMatriculaCoche(\"2435 JKD\"));\n assertTrue(RegExprMain.validateMatriculaCoche(\"4567 GJD\"));\n \n\n }",
"@Test\n public void getDeckTest3() {\n GenericStandardDeckGame g = new GenericStandardDeckGame();\n List<Card> deck = g.getDeck();\n String s = \"♣♦♥♠\";\n for (char ch : s.toCharArray()) {\n int counter = 0;\n for (Card c : deck) {\n if (c.getSuit().getValue() == ch) {\n counter++;\n }\n }\n assertEquals(counter, 13);\n }\n }",
"@SmallTest\n\tpublic void testBadMatchPenalty() {\n\t\tbadMatch();\n\t\tassertEquals((Integer) (START_SCORE - BAD_MATCH_PENALTY), Integer.valueOf(solo.getText(1).getText().toString()));\n\t}",
"@Test\n public void testIsValidTap() {\n setUpCorrect();\n assertTrue(boardManager.isValidTap(11));\n assertTrue(boardManager.isValidTap(14));\n assertFalse(boardManager.isValidTap(10));\n }",
"public void testCheckForTripleSingleColor()\n {\n // Note that fromString calls the reset method internally.\n\n // An empty board\n assertEquals(b1.checkForTriple(), Cell.EMPTY);\n\n // A single filled cell\n b1.reset();\n b1.fromString(\"REEEEEEEE\");\n assertEquals(b1.checkForTriple(), Cell.EMPTY);\n\n // Some partially filled rows\n b1.fromString(\"RREEEEEEE\");\n assertEquals(b1.checkForTriple(), Cell.EMPTY);\n b1.fromString(\"EEEEEERER\");\n assertEquals(b1.checkForTriple(), Cell.EMPTY);\n b1.fromString(\"RRE\"+\"EEE\"+\"RER\");\n assertEquals(b1.checkForTriple(), Cell.EMPTY);\n\n // Some partially filled columns;\n b1.fromString(\"REEREEEEE\");\n assertEquals(b1.checkForTriple(), Cell.EMPTY);\n b1.fromString(\"EEREEEEER\");\n assertEquals(b1.checkForTriple(), Cell.EMPTY);\n b1.fromString(\"RER\"+\"REE\"+\"EER\");\n assertEquals(b1.checkForTriple(), Cell.EMPTY);\n\n // Partial Diagonals\n b1.fromString(\"REE\"+\"ERE\"+\"EEE\");\n assertEquals(b1.checkForTriple(), Cell.EMPTY);\n b1.fromString(\"REE\"+\"EEE\"+\"EER\");\n assertEquals(b1.checkForTriple(), Cell.EMPTY);\n b1.fromString(\"RER\"+\"ERE\"+\"EEE\");\n assertEquals(b1.checkForTriple(), Cell.EMPTY);\n\n // Filled columns\n b1.fromString(\"REEREEREE\");\n assertEquals(b1.checkForTriple(), Cell.RED1);\n b1.fromString(\"EEREEREER\");\n assertEquals(b1.checkForTriple(), Cell.RED1);\n b1.fromString(\"RERRERRER\");\n assertEquals(b1.checkForTriple(), Cell.RED1);\n\n // Filled Rows\n b1.fromString(\"RRREEEEEE\");\n assertEquals(b1.checkForTriple(), Cell.RED1);\n b1.fromString(\"EEEEEERRR\");\n assertEquals(b1.checkForTriple(), Cell.RED1);\n b1.fromString(\"RRREEERRR\");\n assertEquals(b1.checkForTriple(), Cell.RED1);\n\n // Filled Diagonals\n b1.fromString(\"REE\"+\"ERE\"+\"EER\");\n assertEquals(b1.checkForTriple(), Cell.RED1);\n b1.fromString(\"EER\"+\"ERE\"+\"REE\");\n assertEquals(b1.checkForTriple(), Cell.RED1);\n b1.fromString(\"RER\"+\"ERE\"+\"RER\");\n assertEquals(b1.checkForTriple(), Cell.RED1);\n\n }",
"@Override\n public boolean isLegal(List<Integer> selectedCards)\n {\n //checks if the two cards selected added together equal 13\n if(selectedCards.size() == 2)\n {\n if(containsSum13(selectedCards))\n {\n \treturn true;\n }\n }\n \n //checks if the selected card is a K\n if(selectedCards.size() == 1)\n {\n \treturn containsK(selectedCards);\n }\n return false;\n \n }",
"@Test\n void findDevCard() {\n ArrayList<DevelopmentCardExt> developmentCards= Starter.DevCardParser();\n DashboardExt dashboard= new DashboardExt(developmentCards);\n Random rand= new Random();\n\n for (int i=0; i<48; i++){\n assertNotNull(dashboard.findDevCard(i));\n }\n\n for (int i=48; i<100; i++){\n assertNull(dashboard.findDevCard(i));\n }\n\n\n assertEquals(dashboard.findDevCard(5).getLevel(), Level.ONE);\n assertEquals(dashboard.findDevCard(16).getColor(), ColorDevCard.GREEN);\n\n }",
"private boolean canPlay(UnoCard topCard, UnoCard newCard) {\n\n\t\t// Color or value matches\n\t\tif (topCard.getColor().equals(newCard.getColor())\n\t\t\t\t|| topCard.getValue().equals(newCard.getValue()))\n\t\t\treturn true;\n\t\t// if chosen wild card color matches\n\t\telse if (topCard instanceof WildCard)\n\t\t\treturn ((WildCard) topCard).getWildColor().equals(newCard.getColor());\n\n\t\t// suppose the new card is a wild card\n\t\telse if (newCard instanceof WildCard)\n\t\t\treturn true;\n\n\t\t// else\n\t\treturn false;\n\t}",
"private boolean isWrong() {\n\t\treturn wrongMatches >= 5;\n\t}",
"public boolean canPlace(Card o, String c)\r\n {\r\n if (this.color == c)\r\n return true;\r\n else if (this.value == o.value)\r\n return true;\r\n else if (this.color == \"none\") // Wild cards\r\n return true;\r\n return false;\r\n }",
"public boolean CheckForUnwinnableCondition(){\n int humanSize = GetSizeOfHumanHand();\n int computerSize = GetSizeOfComputerHand();\n\n for(int i = 0; i < humanSize; i++) {\n //Human can play a card\n String card = handHuman.get(i);\n\n String firstLetter = Character.toString(card.charAt(0));\n String topFirstLetter = Character.toString(topCard.charAt(0));\n\n if (topCard.contains(\"8\")) {\n //Can play any card ontop to determine suite\n return true;\n }\n\n if (card.contains(\"8\")) {\n //valid because 8s are wild cards, human can place it\n return true;\n }\n\n //the cards match in suite, doesn't matter what it is\n else if (firstLetter.equals(topFirstLetter)) {\n return true;\n }\n\n else {\n if (topFirstLetter.equals(\"c\")) {\n String temp = topCard.substring(5, topCard.length());\n\n if (card.contains(temp)) {\n return true;\n }\n\n } else if (topFirstLetter.equals(\"h\")) {\n String temp = topCard.substring(6, topCard.length());\n\n if (card.contains(temp)) {\n return true;\n }\n\n } else if (topFirstLetter.equals(\"d\")) {\n String temp = topCard.substring(8, topCard.length());\n\n if (card.contains(temp)) {\n return true;\n }\n\n } else if (topFirstLetter.equals(\"s\")) {\n String temp = topCard.substring(6, topCard.length());\n\n if (card.contains(temp)) {\n return true;\n }\n }\n }\n }\n\n for(int i = 0; i < computerSize; i++){\n //Human can play a card\n String card = handComputer.get(i);\n\n String firstLetter = Character.toString(card.charAt(0));\n String topFirstLetter = Character.toString(topCard.charAt(0));\n\n if (topCard.contains(\"8\")) {\n //Can play any card ontop to determine suite\n return true;\n }\n\n if (card.contains(\"8\")) {\n //valid because 8s are wild cards, human can place it\n return true;\n }\n\n //the cards match in suite, doesn't matter what it is\n else if (firstLetter.equals(topFirstLetter)) {\n return true;\n }\n\n else {\n if (topFirstLetter.equals(\"c\")) {\n String temp = topCard.substring(5, topCard.length());\n\n if (card.contains(temp)) {\n return true;\n }\n\n } else if (topFirstLetter.equals(\"h\")) {\n String temp = topCard.substring(6, topCard.length());\n\n if (card.contains(temp)) {\n return true;\n }\n\n } else if (topFirstLetter.equals(\"d\")) {\n String temp = topCard.substring(8, topCard.length());\n\n if (card.contains(temp)) {\n return true;\n }\n\n } else if (topFirstLetter.equals(\"s\")) {\n String temp = topCard.substring(6, topCard.length());\n\n if (card.contains(temp)) {\n return true;\n }\n }\n }\n }\n\n //Human and computer can't play a card\n return false;\n }",
"@Test\n void checkIsTrueForStringWithNumbers() {\n // Act, Assert\n assertTrue(IsNumeric.check(\"3\"));\n assertTrue(IsNumeric.check(\"0\"));\n assertTrue(IsNumeric.check(\"-0f\"));\n assertTrue(IsNumeric.check(\"3.8f\"));\n assertTrue(IsNumeric.check(\"-3.87F\"));\n assertTrue(IsNumeric.check(\"-3\"));\n assertTrue(IsNumeric.check(\"32f\"));\n assertTrue(IsNumeric.check(\"15D\"));\n assertTrue(IsNumeric.check(\"3.2\"));\n assertTrue(IsNumeric.check(\"0.2\"));\n assertTrue(IsNumeric.check(\"-0.28\"));\n assertTrue(IsNumeric.check(\"0.24D\"));\n assertTrue(IsNumeric.check(\"0.379d\"));\n }",
"public void verifyCards() {\n\t\t\n\t\tString text = myTextField.getText();\n\t\tString settext = setText.getText();\n\t\t\n\t\t// Stack for cards\n\t\tStack<Integer> cardNums = new Stack<Integer>();\n\t\tStack<Integer>tmpCard = new Stack<Integer>(); \n\t\t// Set up Stack for numbers\n\t\tStack<Integer> nums = new Stack<Integer>();\n\t\tStack<Integer>tmpNums = new Stack<Integer>(); \n\n\t\t// Set up Stack for Operators\n\t\tStack<Character> ops = new Stack<Character>();\n\n\t\t\n\t\tchar[] cardChars = settext.toCharArray();\n\t\t\n\t\t\n\t\tfor (int i = 0; i < cardChars.length; i++) {\n\t\t\tif (cardChars[i] >= '1' && cardChars[i] <= '9') {\n\t\t\t\tStringBuffer sbuf = new StringBuffer();\n\t\t\t\t\n\t\t\t\t// If there is more than one digit in a number, check, then push if so\n\t\t\t\twhile (i < cardChars.length && cardChars[i] >= '0' && cardChars[i] <= '9') {\n\t\t\t\t\tsbuf.append(cardChars[i++]);\n\t\t\t\t\tcardNums.push(Integer.parseInt(sbuf.toString()));\n\t\t\t\t\ttmpCard.push(Integer.parseInt(sbuf.toString()));\n\t\t\t\t}\n\t\t\t\tSystem.out.println(cardNums.peek()); \n\t\t\t\tSystem.out.println(tmpCard.peek()); \n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\tchar[] chars = text.toCharArray();\n\t\t\n\t\t\n\t\tmyTextField.textProperty().addListener(new ChangeListener<String>() {\n @Override\n public void changed(ObservableValue<? extends String> observable, String oldValue, \n String newValue) {\n if (!newValue.matches(\"\\\\d*\")) {\n \tmyTextField.setText(newValue.replaceAll(\"[^\\\\d\\\\h+-/*]\", \"\"));\n }\n }\n });\n \n\n\t\tfor (int i = 0; i < chars.length; i++) {\n\n\t\t\t// Do the stack for numbers, if its 0 - 9, means its a number\n\t\t\tif (chars[i] >= '1' && chars[i] <= '9') {\n\t\t\t\tStringBuffer sbuf = new StringBuffer();\n\t\t\t\t\n\t\t\t\t// If there is more than one digit in a number, check, then push if so\n\t\t\t\twhile (i < chars.length && chars[i] >= '0' && chars[i] <= '9') {\n\t\t\t\t\tsbuf.append(chars[i++]);\n\t\t\t\t\tnums.push(Integer.parseInt(sbuf.toString()));\n\t\t\t\t\ttmpNums.push(Integer.parseInt(sbuf.toString()));\n\n\t\t\t\t}\n\t\t\t\tSystem.out.println(nums.peek());\n\t\t\t}\n\t\t\t\n\t\t\t// open brace, pushed to operator stack\n\t\t\telse if (chars[i] == '(')\n\t\t\t\tops.push(chars[i]);\n\n\t\t\t// Closing brace, now solve\n\t\t\telse if (chars[i] == ')') {\n\t\t\t\t// look at the top of the stack, see if there was a ( brace before the ) brace\n\t\t\t\twhile (ops.peek() != '(')\n\t\t\t\t\tnums.push(operatorCases(ops.pop(), nums.pop(), nums.pop()));\n\t\t\t\tops.pop();\n\t\t\t}\n\n\t\t\n\t\t\telse if (chars[i] == '+' || chars[i] == '-' || chars[i] == '*' || chars[i] == '/') {\n\n\t\t\t\twhile (!ops.empty() && precedenceOrder(chars[i], ops.peek()))\n\t\t\t\t\tnums.push(operatorCases(ops.pop(), nums.pop(), nums.pop()));\n\t\t\t\tops.push(chars[i]);\n\t\t\t}\n\t\t\t\n\t\t}\n\t \n\t\t// pop out the tmp values, then check to see if they equal eachother for validation.\n\n\t\t\nint cardP1 = tmpCard.pop(); \nint cardP2 = tmpCard.pop(); \nint cardP3 = tmpCard.pop(); \nint cardP4 = tmpCard.pop(); \n\n\nint numP1 = tmpNums.pop(); \nint numP2 = tmpNums.pop(); \nint numP3 = tmpNums.pop(); \nint numP4 = tmpNums.pop(); \nint whileLoopGood = 0; \nboolean resultWhile;\nresultWhile = false;\nwhile(!resultWhile) { \n\twhile(numP1 == cardP1 || numP1 == cardP2 || numP1 == cardP3 || numP1 == cardP4) {\n\t\twhile(numP2 == cardP1 || numP2 == cardP2 || numP2 == cardP3 || numP2 == cardP4) {\n\t\t\twhile(numP3 == cardP1 || numP3 == cardP2 || numP3 == cardP3 || numP3 == cardP4) {\n\t\t\t\twhile(numP4 == cardP1 || numP4 == cardP2 || numP4 == cardP3 || numP4 == cardP4) {\n\t\t\t\t\twhileLoopGood = 1;\n\t\t\t\t\tresultWhile = true; \n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tbreak; \n\t\t}\n\t\tbreak;\n\t}\n\tbreak;\n}\n\n//if the while loop does reach the final desitintion then user did not type in correctly. \n\n\n\n\t\t// Entire expression has been parsed at this point, apply remaining\n\t\t// ops to remaining nums\n\t\twhile (!ops.empty())\n\t\t\tnums.push(operatorCases(ops.pop(), nums.pop(), nums.pop()));\n\n\t\t// Result is on the top of the numbs Stack so Return the Top of number stack\n\t\t// Check to see if the number is equal to 24\n\t\tint result = nums.pop();\n\t\tif (result != 24) {\n\t\t\ttxtFldAns.setText(\"Wrong : \" + result + \" is NOT equal to 24\");\n\t\t\tif(whileLoopGood == 0) {\n\t\t\t\ttxtFldAns.setText(\"You must use all 4 cards Once and only once\");\n\t\t\t\t}\n\t\t} else\n\t\t\ttxtFldAns.setText(\"Correct : \" + result + \" is equal to 24\");\n\t\tif(whileLoopGood == 0) {\n\t\t\ttxtFldAns.setText(\"You must use all 4 cards Once and only once\");\n\t\t\t}\n\t}",
"@Test\n\t\t public void InitializeTest1() {\n\t\t\tCard colourNum = new Card(Card.Colour.Blue, 0);\n\t\t\tString expected = \"Blue\";\n\t\t\tString actual = colourNum.getColour();\n\t\t assertEquals(expected, actual);\n\t\t int expectedN = 0;\n\t\t int actualN = colourNum.getNumber();\n\t\t assertEquals(expectedN, actualN);\n\t\t expected = \"none\";\n\t\t actual = colourNum.getAction();\n\t\t assertEquals(expected, actual);\n\t\t expected = null;\n\t\t actual = colourNum.getWild();\n\t\t assertEquals(expected, actual);\n\t\t actualN = colourNum.getValue();\n\t\t assertEquals(expected, actual);\n\t\t }",
"@Test\n public void shouldMatchDigitsWithSpace() {\n Assert.assertThat(\"match any digits with space\",CharMatcher.DIGIT.matchesAllOf(\"123T TT4\"),is(false));\n Assert.assertThat(\"match any digits with space\",CharMatcher.DIGIT.matchesAnyOf(\"123 TTT4\"),is(true));\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 }",
"@Test\n public void testCardCanPlay_FALSE_VALUE() {\n System.out.println(\"cardCanPlay FALSE VALUE\");\n UnoCard cardSelection = new UnoCard(UnoCardColour.RED, UnoCardValue.TWO);\n UnoCard drawCard = new UnoCard(UnoCardColour.BLUE, UnoCardValue.THREE);\n UnoCardColour wildColour = UnoCardColour.BLUE;\n boolean result = utils.cardCanPlay(cardSelection, drawCard, wildColour);\n assertEquals(false, result);\n }",
"public void testCheckForTripleMultiColor()\n {\n // Note that fromString calls the reset method internally.\n\n // An empty board\n assertEquals(b1.checkForTriple(), Cell.EMPTY);\n\n // A single filled cell\n b1.reset();\n b1.fromString(\"REEEEBEEE\");\n assertEquals(b1.checkForTriple(), Cell.EMPTY);\n\n // Some partially filled rows\n b1.fromString(\"RREEBBEEE\");\n assertEquals(b1.checkForTriple(), Cell.EMPTY);\n b1.fromString(\"BEBEEERER\");\n assertEquals(b1.checkForTriple(), Cell.EMPTY);\n b1.fromString(\"RRB\"+\"BEB\"+\"RER\");\n assertEquals(b1.checkForTriple(), Cell.EMPTY);\n\n // Some partially filled columns;\n b1.fromString(\"RBERBEEEE\");\n assertEquals(b1.checkForTriple(), Cell.EMPTY);\n b1.fromString(\"EBREEEEBR\");\n assertEquals(b1.checkForTriple(), Cell.EMPTY);\n b1.fromString(\"RBR\"+\"REB\"+\"EBR\");\n assertEquals(b1.checkForTriple(), Cell.EMPTY);\n\n // Partial Diagonals\n b1.fromString(\"REE\"+\"ERE\"+\"EEB\");\n assertEquals(b1.checkForTriple(), Cell.EMPTY);\n b1.fromString(\"REB\"+\"EEE\"+\"BER\");\n assertEquals(b1.checkForTriple(), Cell.EMPTY);\n b1.fromString(\"RER\"+\"ERE\"+\"EEE\");\n assertEquals(b1.checkForTriple(), Cell.EMPTY);\n\n // Filled columns\n b1.fromString(\"RBBREERBB\");\n assertEquals(b1.checkForTriple(), Cell.RED1);\n b1.fromString(\"BBRBBREER\");\n assertEquals(b1.checkForTriple(), Cell.RED1);\n b1.fromString(\"RBRRBRRER\");\n assertEquals(b1.checkForTriple(), Cell.RED1);\n\n // Filled Rows\n b1.fromString(\"RRREEBBBE\");\n assertEquals(b1.checkForTriple(), Cell.RED1);\n b1.fromString(\"EEBBBERRR\");\n assertEquals(b1.checkForTriple(), Cell.RED1);\n b1.fromString(\"RRRBBERRR\");\n assertEquals(b1.checkForTriple(), Cell.RED1);\n\n // Filled Diagonals\n b1.fromString(\"REB\"+\"ERE\"+\"BER\");\n assertEquals(b1.checkForTriple(), Cell.RED1);\n b1.fromString(\"BBR\"+\"ERE\"+\"RBB\");\n assertEquals(b1.checkForTriple(), Cell.RED1);\n b1.fromString(\"RBR\"+\"BRB\"+\"RBR\");\n assertEquals(b1.checkForTriple(), Cell.RED1);\n\n }",
"public static boolean checkSequence(String cards){\r\n //split all the cards and store in card array\r\n String[] cardArray = cards.split(\",\");\r\n //convert card array into card object arrayList\r\n ArrayList<Card> cardList = new ArrayList<Card>();\r\n int numCards = cardArray.length;\r\n //if there is less than 3 cards eliminate deck\r\n if(numCards < 3) return false;\r\n //store suit and face value in card object\r\n for(int i=0;i<numCards;i++){\r\n Card c = new Card(cardArray[i].split(\"#\")[0].trim(),cardArray[i].split(\"#\")[1].trim());\r\n cardList.add(c);\r\n }\r\n int i=0;\r\n String cardSuit=\"\",nextCardSuit=\"\";\r\n int cardValue=-1,nextCardValue=-1,prevCardValue = -1;\r\n \r\n //loop till penultimate card\r\n for(i=0; i<numCards-1 ;i++){ \r\n \r\n cardValue = cardList.get(i).value;\r\n nextCardValue = cardList.get(i+1).value;\r\n cardSuit = cardList.get(i).suit;\r\n nextCardSuit = cardList.get(i+1).suit;\r\n \r\n //suit check\r\n if(!cardSuit.equals(nextCardSuit)) return false;\r\n \r\n //card check\r\n if(cardValue != nextCardValue-1){\r\n \r\n //exception only for queen followed by king followed by ace\r\n if(!(prevCardValue==11 && cardValue == 12 && nextCardValue ==0)){\r\n return false;\r\n }\r\n }\r\n //execption for king followed by ace followed by 2\r\n if(prevCardValue == 12 && cardValue == 0 && nextCardValue==1) return false;\r\n prevCardValue = cardValue;\r\n }\r\n \r\n return true;\r\n }",
"private boolean isTheColorInputCorrect(int red, int green, int blue, int alpha){\n if(red > 255 || green > 255 || blue > 255 || alpha > 255){\n System.out.println(\"Values should be equal or smaller then 255.\");\n return false;\n }else if(red < 0 || green < 0 || blue < 0 || alpha < 0){\n System.out.println(\"Values should be equal or bigger then 0.\");\n return false;\n }else{\n return true;\n }\n }",
"@Test\n public void allOnesExpected_20(){\n String input = \"11111111111111111111\";\n assertEquals(game.scoreOfGame(input),20);\n }",
"@Test\r\n public void testIsValidTap() {\r\n assertTrue(boardManager3.isValidTap(7));\r\n assertTrue(boardManager3.isValidTap(5));\r\n assertFalse(boardManager3.isValidTap(0));\r\n }",
"public boolean validCardPlay(UnoCard card) {\r\n return card.getColor() == validColor || card.getValue() == validValue;\r\n }",
"@Test\n public void testShuffleGood() {\n System.out.println(\"shuffleGood\");\n Deck deck = new Deck();\n boolean shuffled = false;\n deck.shuffle();\n //we take out one card from the deck\n Card lastCard = deck.nextCard();\n //we take out 58 more cards\n for (int i =0 ; i<57;i++)\n {\n deck.nextCard();\n }\n //we take out the last card from the deck\n Card firstCard = deck.nextCard();\n \n //if both cards = the same value they were before being shuffled, then test will fail.\n if (lastCard.getValue() != CardType.WILDCARD )\n shuffled = true;\n else if (firstCard.getValue()!=CardType.ZERO)\n shuffled = true;\n \n //if either of the cards are different, that means the deck was shuffled and the test will pass\n assertEquals(true, shuffled);\n }",
"private static void validate(Card card) throws CardNumberException {\n card.validateNumber();\n }",
"@Test\n void checkIsFalseForStringWithNumbersAndOtherChars() {\n // Act, Assert\n assertFalse(IsNumeric.check(\"a3\"));\n assertFalse(IsNumeric.check(\"3l\"));\n assertFalse(IsNumeric.check(\"345L\"));\n assertFalse(IsNumeric.check(\"32b\"));\n assertFalse(IsNumeric.check(\"*3.2 \"));\n assertFalse(IsNumeric.check(\"/0.2\"));\n assertFalse(IsNumeric.check(\"0.28L\"));\n assertFalse(IsNumeric.check(\"0.28.\"));\n assertFalse(IsNumeric.check(\"3.2.4\"));\n assertFalse(IsNumeric.check(\"0x400\"));\n assertFalse(IsNumeric.check(\"0.24Dd\"));\n }",
"@Test\n public void testCardCanPlay_TRUE_VALUE() {\n System.out.println(\"cardCanPlay TRUE VALUE\");\n UnoCard cardSelection = new UnoCard(UnoCardColour.RED, UnoCardValue.TWO);\n UnoCard drawCard = new UnoCard(UnoCardColour.BLUE, UnoCardValue.TWO);\n UnoCardColour wildColour = UnoCardColour.BLUE;\n boolean result = utils.cardCanPlay(cardSelection, drawCard, wildColour);\n assertEquals(true, result);\n }",
"public UnoCard searchForMatch(UnoCard prev) {\r\n \r\n //case where previous card was a \r\n // special card(wild, or WD4)\r\n if(UnoSpecialCardsV2.unoSpecialCard(prev)) {\r\n //Tests to determine 1) which special card previous was; and\r\n if(UnoSpecialCardsV2.unoCardWild(prev)) {\r\n int unoCardTgtColor = UnoV2.getWildColor();\r\n // 2) does player have a card to match it. \r\n for (int i = hand.handSize()-1; i >=0; i--) {\r\n UnoCard unocard = hand.getCard(i);\r\n if (unocard.getColor() == unoCardTgtColor \r\n || (unocard.getRank() > 24)) { \r\n return hand.popCard(i);\r\n }\r\n }\r\n return null;\r\n \r\n }\r\n // Same comments as above\r\n if(UnoSpecialCardsV2.unoCardWildDrawFour(prev)) {\r\n int unoCardTgtColor = UnoV2.getWildColor();\r\n System.out.println(\"unoCardTgtColor into WD4 SearchForMatch \" \r\n + UnoCard.getColors()[unoCardTgtColor]);\r\n \r\n for (int i = hand.handSize()-1; i >=0;i--) {\r\n UnoCard unocard = hand.getCard(i);\r\n if ((unocard.getColor() == unoCardTgtColor) \r\n || unocard.getRank() > 24) {\r\n return hand.popCard(i); //had problem bug just because I forgot the 'i' in popCard...\r\n }\r\n }\r\n return null;\r\n } \r\n } //end special card prev, search for match\r\n \r\n for (int i = 0; i < hand.handSize(); i++) {\r\n UnoCard unocard = hand.getCard(i);\r\n \r\n/** Runs thru hand looks for regular wild cards, plays \r\n * them first*/\r\n if (unocard.getRank() > 24 && unocard.getRank() < 29) { \r\n return hand.popCard(i); \r\n/** Look for skip,reverse, D2, plays them next */\r\n } else if((unocard.getRank() > 18 && unocard.getRank() < 25) \r\n && UnoCard.unoCardsMatch(unocard, prev)) {\r\n return hand.popCard(i);\r\n }\r\n }\r\n/** After 'filters'\r\n * above, only cases are unocard < 19(normal cards 0 \r\n * to 9} or unocard wild Draw4. \r\n * Sort cards that are not special cards \r\n * or regular wild cards to play highest first \r\n */ \r\n UnoHand.insertionSortUnoHand(hand); \r\n \r\n // search from end of hand as hand sorted ascending\r\n for (int i = hand.handSize() - 1; i >= 0; i--) { \r\n UnoCard unocard = hand.getCard(i);\r\n if (unocard.getRank() <= 19 \r\n && UnoCard.unoCardsMatch(unocard, prev)) {\r\n return hand.popCard(i);\r\n // all else fails, play DrawFour\r\n }else if (unocard.getColor() > 3) { \r\n return hand.popCard(i);\r\n } \r\n }\r\n return null;\r\n }",
"@Override\n\tboolean isValid(){\n\t\tif(size()==5) {\n\t\t\tint suite = getCard(0).suit;\n\t\t\tfor(int i = 1 ; i< size(); i++) {\n\t\t\t\tif(getCard(i).suit != suite) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tsort();\n\t\t\tint currRank = (getCard(0).rank +11)%13;\n\t\t\tfor(int i=0; i<size(); i++) {\n\t\t\t\tif((getCard(i).rank+11)%13 != currRank) return false;\n\t\t\t\tcurrRank++;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}",
"@Test\n public void checkValidityTest2() {\n GenericStandardDeckGame g = new GenericStandardDeckGame();\n List<Card> deck = g.getDeck();\n deck.set(32, new Card(Card.number.four, Card.suit.club));\n assert (!g.checkValidity(deck));\n }",
"@Test\n public void isRedTest() {\n assertTrue(red_piece.isRed());\n assertTrue(!white_piece.isRed());\n }",
"@Test \n\tpublic void testIfValueisBlackPiece()\n\t{\n \tData d = new Data();\n\t\tassertFalse(d.isWhite(4)); // 4 is the value of one of the black pieces. \n\t}",
"int compareValue(Card c);",
"@Test\n\tpublic void test() {\n\t\tString r1 = CGroup.createRandomId();\n\t\tassertTrue(r1.matches(\"[0-9]+\"));\n\t\t\n\t\tString r2 = CGroup.createRandomId();\n\t\tassertFalse(r1.equals(r2));\n\t}",
"@Test\r\n public void testPlayer_getCautiousStrategyCardCard_higherFirst_wd4() {\n player2 = new Player(\"Player Two\", true);\r\n player2.setHand(strategyHand.getAllCards());\r\n\r\n // get rid of the wild so the wd4 is the most attractive option\r\n player2.getHand().discard(wild);\r\n assertTrue(player2.getCautiousStrategyCard(yellowThree, yellowThree.getColor()).equals(wildDrawFour));\r\n }",
"@Ignore\n @Test\n public void kingSecurity() {\n board = new Board(\"rnbqkbnr/ppp2ppp/8/8/8/8/3PPPPP/RNBQKBNR w qkQK -\");\n board.printBoard();\n\n int value = StaticEvaluator.getValue(board.getSquares());\n\n assertTrue(value > 0);\n\n }",
"private boolean faceCard(ArrayList<Card> cards) {\r\n\t\tfor (Card card: cards) {\r\n\t\t\tif (card.getValue() >= 11 && card.getValue() <= 13) \r\n\t\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"public static boolean validateCard(String[] args) {\n return true;\n }",
"@Test\n public void isCorrectTest(){\n BuyCard cardErr = new BuyCard(12,0);\n\n thrown.expect(IllegalArgumentException.class);\n thrown.expectMessage(\"Row index out of bounds.\");\n cardErr.isCorrect();\n }",
"private boolean checkMatch(InventoryCrafting inventoryCrafting,IInventory schematic, int par2, int par3, boolean par4) {\r\n\t\tfor (int k = 0; k < 5; ++k) {\r\n\t\t\tfor (int l = 0; l < 5; ++l) {\r\n\t\t\t\tint i1 = k - par2;\r\n\t\t\t\tint j1 = l - par3;\r\n\t\t\t\tItemStack itemstack = null;\r\n\r\n\t\t\t\tif (i1 >= 0 && j1 >= 0 && i1 < this.recipeWidth && j1 < this.recipeHeight) {\r\n\t\t\t\t\tif (par4) {\r\n\t\t\t\t\t\titemstack = this.recipeItems[this.recipeWidth - i1 - 1 + j1 * this.recipeWidth];\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\titemstack = this.recipeItems[i1 + j1 * this.recipeWidth];\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tItemStack itemstack1 = inventoryCrafting.getStackInRowAndColumn(k, l);\r\n\r\n\t\t\t\tif (itemstack1 != null || itemstack != null) {\r\n\t\t\t\t\tif (itemstack1 == null && itemstack != null || itemstack1 != null && itemstack == null) {\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (itemstack.getItem() != itemstack1.getItem()) {\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (itemstack.getItemDamage() != 32767 && itemstack.getItemDamage() != itemstack1.getItemDamage()) {\r\n\t\t\t\t\t\treturn 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\t// for debugging\r\n\t\t/* if(schematicTypeNeeded != null)\r\n\t\t * System.out.println(schematicTypeNeeded.getUnlocalizedName());\r\n\t\t * else System.out.println(\"null type needed\"); */\r\n\r\n\t\t// if there is no specilness needed, just return true\r\n\t\tif (schematicTypeNeeded == null) return true;\r\n\r\n\t\tItemStack schematicStack = schematic.getStackInSlot(0);\r\n\t\t\r\n\t\tif (schematicStack == null) return false;\r\n\r\n\t\tSystem.out.println(schematicStack.getUnlocalizedName());\r\n\r\n\t\tSystem.out.println(\"[NausicaaMod] block that needs schematic\");\r\n\r\n\t\tif (!schematicStack.hasTagCompound()) {\r\n\t\t\tSystem.out.println(\"[NausicaaMod] crafting canceled: no tags\");\r\n\t\t\treturn false;\r\n\r\n\t\t} else if (!SchematicHolder.getCanCraft(schematicStack, schematicTypeNeeded)) {\r\n\t\t\tSystem.out.println(\"[NausicaaMod] crafting canceled\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\r\n\t}",
"@Test //TEST THREE\n void testallNumbersRabbitName()\n {\n Rabbit_RegEx rabbit_Name = new Rabbit_RegEx();\n rabbit_Name.setRabbitName(\"12345\");\n assertFalse(rabbit_Name.getRabbitName().matches(\"[A-Za-z-]*\"));\n }",
"@Test\n void compareTo_NoMatch_AllParts() {\n runIsMatchTest(AnswerType.no, AnswerType.no, AnswerType.no, AnswerType.no, ContactMatchType.NoMatch);\n }",
"@Test\n void checkIsFalseForStringWithoutNumbers() {\n // Act, Assert\n assertFalse(IsNumeric.check(\"a\"));\n assertFalse(IsNumeric.check(\"ö\"));\n assertFalse(IsNumeric.check(\"\"));\n assertFalse(IsNumeric.check(\"´´´\"));\n assertFalse(IsNumeric.check(\"lgk\"));\n assertFalse(IsNumeric.check(\"lL y\"));\n assertFalse(IsNumeric.check(\" \"));\n assertFalse(IsNumeric.check(\"h* \"));\n assertFalse(IsNumeric.check(\"/+\"));\n assertFalse(IsNumeric.check(\"-\"));\n assertFalse(IsNumeric.check(\"+\"));\n assertFalse(IsNumeric.check(\"d\"));\n assertFalse(IsNumeric.check(\"ariel\"));\n assertFalse(IsNumeric.check(\"#€%/!\"));\n }",
"public void testCanPlayOn() {\n \n DrawCard redDraw2 = new DrawCard(Card.COLOUR_RED, 2);\n \n // create another 4 normal cards\n \n Card card1 = new Card(Card.COLOUR_BLUE, 5);\n Card card2 = new Card(Card.COLOUR_BLUE,2);\n \n //card 1 and card 2 should yield false on the method\n assertFalse(redDraw2.canPlayOn(card1));\n assertFalse(redDraw2.canPlayOn(card2));\n \n Card card3 = new Card(Card.COLOUR_RED, 5);\n Card card4 = new Card(Card.COLOUR_RED,2);\n \n // card 3 and card 4 should gives true\n \n assertTrue(redDraw2.canPlayOn(card3));\n assertTrue(redDraw2.canPlayOn(card4));\n \n }",
"@Test\n public void isNumericNegetive() {\n Boolean bool = Utils.isNumeric(\"123a\");\n Assert.assertEquals(false, bool);\n }",
"@Test\n public void shouldRetainDigitsAndWhiteSpace() {\n Assert.assertThat(\"match any digits\",CharMatcher.DIGIT.or(CharMatcher.WHITESPACE)\n .retainFrom(\"123TT T4\"),is(\"123 4\"));\n }",
"@Test\n @Disabled\n public void testValidateFormat() {\n assertTrue(RegExprMain.validateFormat(\"CC222CC\"));\n assertTrue(RegExprMain.validateFormat(\"DD333DD\"));\n assertTrue(RegExprMain.validateFormat(\"AA999AA\"));\n assertTrue(RegExprMain.validateFormat(\"VV555VV\"));\n assertTrue(RegExprMain.validateFormat(\"JJ777JJ\"));\n assertFalse(RegExprMain.validateFormat(\"J777JJ\"));\n assertFalse(RegExprMain.validateFormat(\"JJ777J\"));\n assertFalse(RegExprMain.validateFormat(\"JJ77JJ\"));\n assertFalse(RegExprMain.validateFormat(\"JJ777AA\"));\n assertFalse(RegExprMain.validateFormat(\"AA777JJ\"));\n \n\n }",
"@Test\n void checkIsTrueForStringWithNumbersWithSpacesAtTheBeginningAndEnd() {\n // Act, Assert\n assertTrue(IsNumeric.check(\" 3\"));\n assertTrue(IsNumeric.check(\"32 \"));\n assertTrue(IsNumeric.check(\" 3.2 \"));\n assertTrue(IsNumeric.check(\" -0.2\"));\n assertTrue(IsNumeric.check(\" -0.2d\"));\n assertTrue(IsNumeric.check(\"0.24D \"));\n assertTrue(IsNumeric.check(\"0.28 \"));\n assertTrue(IsNumeric.check(\" 3.8f\"));\n assertTrue(IsNumeric.check(\"-3.87F \"));\n }",
"@Test\n public void testStringCom11CaracteresIguaisIsNotCPF() {\n ArrayList<String> stringsCom11CaracteresIguais = new ArrayList<>();\n stringsCom11CaracteresIguais.add(\"00000000000\");\n stringsCom11CaracteresIguais.add(\"11111111111\");\n stringsCom11CaracteresIguais.add(\"22222222222\");\n stringsCom11CaracteresIguais.add(\"33333333333\");\n stringsCom11CaracteresIguais.add(\"44444444444\");\n stringsCom11CaracteresIguais.add(\"55555555555\");\n stringsCom11CaracteresIguais.add(\"66666666666\");\n stringsCom11CaracteresIguais.add(\"77777777777\");\n stringsCom11CaracteresIguais.add(\"88888888888\");\n stringsCom11CaracteresIguais.add(\"99999999999\");\n\n boolean todosInvalidos = true;\n for (String stringCom11CaracteresIguais : stringsCom11CaracteresIguais) {\n //Se algum for validado, o teste falha:\n if (ValidadorCPF.isCPF(stringCom11CaracteresIguais)) {\n todosInvalidos = false;\n }\n }\n assertTrue(todosInvalidos);\n }",
"@Test\n public void TestIlegalCorrectInputCheck(){\n Assert.assertEquals(player.CorrectInputCheck(\"horisonaz\",5,1,1)\n ,false , \" check horisontal spelling\"\n );\n\n //illegal : check vertical\n Assert.assertEquals(player.CorrectInputCheck(\"verticles\",5,1,1)\n ,false , \" check vertical spelling\"\n );\n\n //illegal : place a 5 ship horisontal at 0,1 outside of the grid\n Assert.assertEquals(player.CorrectInputCheck(\"horisontal\",5,0,1)\n ,false,\" illegal : place a 5 ship horisontal at 0,1 outside of the grid \"\n );\n\n // illegal : place a 5 ship horisontal at 1,0 outside of the grid\n Assert.assertEquals(player.CorrectInputCheck(\"horisontal\",5,1,0)\n ,false, \" illegal : place a 5 ship horisontal at 1,0 outside of the grid \"\n );\n\n // illegal : place a 5 ship horisontal at 7,1 ship is to big it goes outside the grid\n Assert.assertEquals(player.CorrectInputCheck(\"horisontal\",5,7,1)\n ,false , \" illegal : place a 5 ship horisontal at 7,1 outside of the grid \"\n );\n\n // illegal : place a 5 ship horisontal at 1,10\n Assert.assertEquals(player.CorrectInputCheck(\"vertical\",5,1,7)\n ,false , \" illegal : place a 5 ship horisontal at 1,7 outside of the grid \"\n );\n\n\n }",
"@Test\r\n public void testHasAtLeastTwoPlayableCards() {\n Player player2 = new Player(\"Three Playable Cards Test\", true);\r\n Hand threePlayableCardsHand = strategyHand;\r\n player2.setHand(threePlayableCardsHand.getAllCards());\r\n\r\n // Make it harder to find playable cards:\r\n player2.getHand().discard(new Card(Card.COLORLESS, Card.WILD, cvm));\r\n player2.getHand().discard(new Card(Card.COLORLESS, Card.WILD_DRAW_FOUR, cvm));\r\n\r\n Card currentPlayedCard_1 = new Card(Card.YELLOW, Card.ONE, cvm);\r\n assertTrue(player2.hasAtLeastTwoPlayableCards(currentPlayedCard_1, Card.BLUE));\r\n\r\n Card currentPlayedCard_2 = new Card(Card.BLUE, Card.SEVEN, cvm);\r\n assertFalse(player2.hasAtLeastTwoPlayableCards(currentPlayedCard_2, Card.BLUE));\r\n }",
"@Override\n public boolean anotherPlayIsPossible()\n {\n \t\n List<Integer> test = cardIndexes();\n return containsSum13(test) || containsK(test);\n \n }",
"@Test //TEST FOUR\n void testOneNumberinRabbitName()\n {\n Rabbit_RegEx rabbit_Name = new Rabbit_RegEx();\n rabbit_Name.setRabbitName(\"MO0N\");\n assertFalse(rabbit_Name.getRabbitName().matches(\"[A-Za-z-]*\"));\n }",
"@Test(priority = 7, description=\"Check for remaining cards field, with bad value to Draw\", dependsOnGroups = \"StatusCheck\")\n public void drawUsingBadCountValue() throws IOException, URISyntaxException {\n response = DeckOfCardsApi.drawCardsFromDeckUsingGet(\"https://deckofcardsapi.com/api/deck/\", deckID, \"-1\");\n jsonObject = DeckOfCardsApi.getJsonData(response);\n\n Assert.assertEquals(DeckOfCardsApi.getJsonValue(jsonObject, jkey_remaining), \"50\", \"Expected to Fail, Seems like an error in the API; When given -n, n is a number, All Cards are deleted but only n card remains.\");\n }",
"@Test\n \tpublic void testDisprovingSuggestion() {\n \t\t//Set suggestion\n \t\tSolution suggestion = new Solution(\"Colonel Mustard\", \"Knife\", \"Library\");\n \t\tComputerPlayer computer1 = new ComputerPlayer();\n \t\tComputerPlayer computer2 = new ComputerPlayer();\n \t\tComputerPlayer computer3 = new ComputerPlayer();\n \t\tHumanPlayer human = new HumanPlayer();\n \t\tArrayList<Card> hand = new ArrayList<Card>();\n \t\tArrayList<ComputerPlayer> comps = new ArrayList<ComputerPlayer>();\n \t\t\n \t\t\n \t\t//ensure If a player (human or computer) has a card that's suggested, that card is \"shown\"\n \t\tCard mustardCard = new Card(\"Colonel Mustard\", Card.cardType.PERSON);\n \t\thand.add(mustardCard);\n \t\tcomputer1.setCards(hand);\n \t\tAssert.assertEquals(computer1.disproveSuggestion(suggestion), mustardCard);\n \t\t\n \t\t\n \t\t//ensure If the player has multiple cards that match, the card to be returned is selected randomly.\n \t\tCard knifeCard = new Card (\"Knife\", Card.cardType.WEAPON);\n \t\tCard libraryCard = new Card(\"Library\", Card.cardType.ROOM);\n \t\thand.add(knifeCard);\n \t\thand.add(libraryCard);\n \t\thuman.setCards(hand);\n \t\tint mustard = 0, knife = 0, library = 0;\n \t\t//make sure card is valid and counts how many times each card is returned\n \t\tfor(int i = 0; i < 100; i++) {\n \t\t\tCard disproved = human.disproveSuggestion(suggestion);\n \t\t\t\n \t\t\tif(disproved == mustardCard)\n \t\t\t\tmustard++;\n \t\t\telse if(disproved == knifeCard)\n \t\t\t\tknife++;\n \t\t\telse if(disproved == libraryCard)\n \t\t\t\tlibrary++;\n \t\t\telse\n \t\t\t\tfail(\"Invalid card returned\");\n \t\t}\n \t\t//makes sure every card is returned more than once\n \t\tAssert.assertTrue(mustard > 10);\n \t\tAssert.assertTrue(knife > 10);\n \t\tAssert.assertTrue(library > 10);\n \t\t\n \t\thuman.setCards(null);\n \t\tgame.setCurrentPlayer(game.getHuman());\n \t\t\t\n \t\t//ensure In the board game, disproving a suggestion starts with a player to the left of the person making the suggestion\n \t\thand.remove(mustardCard);\n \t\thand.remove(knifeCard);\n \t\tcomputer2.setCards(hand);\n \t\thand.remove(libraryCard);\n \t\thand.add(knifeCard);\n \t\tcomputer3.setCards(hand);\n \t\tcomps.add(computer1);\n \t\tcomps.add(computer2);\n \t\tcomps.add(computer3);\n \t\t\n \t\tint comp1 = 0, comp2 = 0, comp3 = 0;\n \t\tgame.setComputer(comps);\n \t\tfor(int i = 0; i < 100; i++) {\n \t\t\tCard returned = game.handleSuggestion(suggestion);\n \t\t\tif(returned == mustardCard)\n \t\t\t\tcomp1++;\n \t\t\telse if(returned == libraryCard)\n \t\t\t\tcomp2++;\n \t\t\telse if(returned == knifeCard)\n \t\t\t\tcomp3++;\n \t\t\telse\n \t\t\t\tfail(\"Invalid card returned\");\t\n \t\t}\n\t\t//Assert.assertTrue(comp1 > 10);\n\t\t//Assert.assertTrue(comp2 > 10);\n \t\tAssert.assertTrue(comp3 > 10);\n \t\t//ensure The player making the suggestion should not be queried\n \t\tgame.setCurrentPlayer(computer1);\n \t\tfor(int i = 0; i < 100; i++) {\n \t\t\tCard returned = game.handleSuggestion(suggestion);\n \t\t\tif(returned == mustardCard)\n \t\t\t\tfail(\"Suggesting player cannot return a card\");\t\n \t\t}\n \t}",
"public Card()\r\n {\r\n rand = new Random();\r\n value = rand.nextInt(28); \r\n // Assigning value\r\n if (value >= 14) // Check if value is greater than 14 then value = value - 14;\r\n value -= 14;\r\n // Assigning color\r\n rand = new Random();\r\n // Switch statement for assigning different colors\r\n switch(rand.nextInt(4) )\r\n {\r\n case 0: color = \"Red\"; \r\n break;\r\n case 1: color = \"Green\"; \r\n break;\r\n case 2: color = \"Blue\"; \r\n break;\r\n case 3: color = \"Yellow\"; \r\n break;\r\n }\r\n // If the card is a wild card and value is greater than or equal to 13 then none value is assigned to color variable\r\n if (value >= 13)\r\n color = \"none\";\r\n }",
"@Test\n public void TestLegalCorrectInputCheck(){\n Assert.assertEquals(player.CorrectInputCheck(\"horisontal\",5,1,1)\n ,true , \" check horisontal \"\n );\n\n //legal : check vertical spelling\n Assert.assertEquals(player.CorrectInputCheck(\"vertical\",5,1,1)\n ,true , \" check vertical \"\n );\n\n //legal : place a 5 ship horisontal at 1,1\n Assert.assertEquals(player.CorrectInputCheck(\"horisontal\",5,1,1)\n ,true , \" legal : place a 5 ship horisontal at 1,1 \"\n );\n\n // legal : place a 5 ship horisontal at 1,10\n Assert.assertEquals(player.CorrectInputCheck(\"horisontal\",5,1,10)\n ,true ,\" legal : place a 5 ship horisontal at 1,10 \"\n );\n\n // legal : place a 5 ship vertical at 1,10\n Assert.assertEquals(player.CorrectInputCheck(\"vertical\",5,1,1)\n ,true , \" legal : place a 5 ship vertical at 1,10 \"\n );\n\n // legal : place a 5 ship vertical at 1,10\n Assert.assertEquals(player.CorrectInputCheck(\"vertical\",5,10,1)\n ,true ,\"000 legal : place a 5 ship vertical at 1,10 \"\n );\n\n // legal : place a 5 ship horisontal at 6,1\n Assert.assertEquals(player.CorrectInputCheck(\"horisontal\",5,6,1)\n ,true , \" legal : place a 5 ship horisontal at 6,1 \"\n );\n\n // legal : place a 5 ship vertical at 1,6\n Assert.assertEquals(player.CorrectInputCheck(\"vertical\",5,1,6)\n ,true ,\"000 legal : place a 5 ship vertical at 10,6 \"\n );\n\n }",
"public boolean match( DataExp p ) { return false; }",
"@Test\n\tpublic void testIfKingIsNotOnSpecialSquare()\n\t{\n\t\tData d = new Data();\n\t\tassertFalse(d.isKingOnSpecialSquare(61));\n\t\tassertFalse(d.isKingOnSpecialSquare(2));\n\t}",
"@Test\n public void testNumbersInvalid() throws Exception {\n testLexerSource(\"6x foo\", true, INVALID, WHITESPACE, IDENTIFIER);\n testLexerSource(\"6g foo\", true, INVALID, WHITESPACE, IDENTIFIER);\n testLexerSource(\"6xsd foo\", true, INVALID, WHITESPACE, IDENTIFIER);\n testLexerSource(\"6gsd foo\", true, INVALID, WHITESPACE, IDENTIFIER);\n }",
"void showFaithCards(int first, int second, int third);",
"protected final boolean isDifferentColor(Card cardOne, Card cardTwo)\n {\n return cardOne.getColor() != cardTwo.getColor();\n }",
"@Test\n\tpublic void testDigitTestReplacementInValid() {\n\t\tString input = \"0\";\n\t\tString actualOutput = GeneralUtility.digitHasReplacement(input);\n\t\tAssert.assertEquals(null, actualOutput);\n\t}",
"@Test\r\n public void testPlayer_getCautiousStrategyCardCard_higherFirst_drawTwo() {\n player2 = new Player(\"Player Two\", true);\r\n player2.setHand(strategyHand.getAllCards());\r\n\r\n // let the cpc be a red nine\r\n // get rid of the wild and wd4 cards so the red draw two is the most attractive option\r\n player2.getHand().discard(wild);\r\n player2.getHand().discard(wildDrawFour);\r\n Card redNine = new Card(Card.RED, Card.NINE, cvm);\r\n assertTrue(player2.getCautiousStrategyCard(redNine, redNine.getColor()).equals(redDrawTwo));\r\n }",
"private boolean determineValid(){\n for(Integer val : group){\n if(!racers.containsKey(val)){\n WrongNumber = val;\n return false;\n }\n }\n return true;\n }",
"public static boolean isValid(String _card){\r\n\t\t//communication with sumOfDoubleEvenPlace() and sumOfOddPlace()\r\n\t\tsumOfDoubleEvenPlace(_card);\r\n\t\tsumOfOddPlace(_card);\r\n\t\tgetCompany(_card);\r\n\t\tString _errorLength = \"Invalid number of digits.\";\r\n\t\tString _errorInvalid = \"Invalid credit card number.\";\r\n\t\t\r\n\t\t//condition for valid credit card.\r\n\t\tif((getCompany(_card) != _errorInvalid) && (getCompany(_card) != _errorLength)){\r\n\t\t\tif((sumOfDoubleEvenPlace(_card) + sumOfOddPlace(_card) != 0)){\t//if user enters all zeroes\r\n\t\t\t\tif ((sumOfDoubleEvenPlace(_card) + sumOfOddPlace(_card)) % 10 == 0 ){\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\treturn false;\r\n\t\t\t\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\treturn false;\r\n\t\t}\t\r\n\t}",
"@Test\n\tpublic void verifyCombosOnBoard() {\n\t\tBoard board = boardFactory.fromTextGenerateBoard(\"/boards/1LineOf3.txt\", mockGroup);\n\t\tassertFalse(board.outOfMoves());\n\n\t}",
"@Test(expected = TooManyDiscardsException.class)\n public void allow_discard_no_more_than_2_cards(){\n\n Deck deck = new Deck();\n Card card1 = new Card(3,2,5);\n Card card2 = new Card(2,7,1);\n Card card3 = new Card(2,7,1);\n deck.add(card1);\n deck.add(card2);\n deck.add(card3);\n Game game = new Game(deck);\n\n game.join(\"susan\");\n game.join(\"peter\");\n\n Card pickedCard1 = game.pickCard(\"susan\");\n game.discard(\"susan\");\n Card pickedCard2 = game.pickCard(\"susan\");\n game.discard(\"susan\");\n Card pickedCard3 = game.pickCard(\"susan\");\n game.discard(\"susan\");\n\n }",
"@Test\n public void testTakeNumberFromString224() { // FlairImage: 224\n assertEquals(\"From: FlairImage line: 225\", 123, takeNumberFromString(\"123\")); \n assertEquals(\"From: FlairImage line: 226\", 0, takeNumberFromString(\"123a\")); \n assertEquals(\"From: FlairImage line: 227\", -123, takeNumberFromString(\"-123\")); \n assertEquals(\"From: FlairImage line: 228\", 0, takeNumberFromString(\"--123\")); \n assertEquals(\"From: FlairImage line: 229\", 0, takeNumberFromString(\"pz4\")); \n }",
"@Test\n public void test000_collision_scheme() {\n HashTableADT htIntegerKey = new HashTable<Integer, String>();\n int scheme = htIntegerKey.getCollisionResolution();\n if (scheme < 1 || scheme > 9)\n fail(\"collision resolution must be indicated with 1-9\");\n }",
"protected boolean canChoose(int n, Board gameBoard) {\n Card chosenCard = myCards.get(n);// get the chosenCard\n Card groundCard = gameBoard.getGroundCard();\n if (chosenCard.getColor() == groundCard.getColor()) { // if they had same color\n return true;\n }\n if (chosenCard instanceof NumericCard && groundCard instanceof NumericCard) {// if they had same number\n NumericCard tempChosen = (NumericCard) chosenCard; // change the static type\n NumericCard tempground = (NumericCard) groundCard; // change the static type\n if (tempChosen.getNumber() == tempground.getNumber()) {\n return true;\n }\n }\n\n if (groundCard.getClass().equals(chosenCard.getClass()) && !(groundCard instanceof NumericCard)\n && !(chosenCard instanceof NumericCard)) {// if they were sameInstance\n return true;\n }\n return false;\n }",
"@Test\n\tpublic void TestR1NonIntegerParseableChars() {\n\t\tString invalid_solution = \"a74132865635897241812645793126489357598713624743526189259378416467251938381964572\";\n\t\tassertEquals(-1, sv.verify(invalid_solution));\n\t}"
] | [
"0.7716127",
"0.77016693",
"0.71657795",
"0.6784718",
"0.6116214",
"0.60920346",
"0.6069052",
"0.59803843",
"0.59409875",
"0.58873224",
"0.58651394",
"0.5849499",
"0.58392483",
"0.58081114",
"0.5796819",
"0.57575345",
"0.57564896",
"0.5713951",
"0.5704936",
"0.5664257",
"0.5637904",
"0.5630886",
"0.5627698",
"0.5626189",
"0.56212664",
"0.55966055",
"0.55934733",
"0.5590011",
"0.5552665",
"0.5537475",
"0.5534602",
"0.5534153",
"0.5511223",
"0.5510925",
"0.54794455",
"0.5477812",
"0.5467278",
"0.54654914",
"0.54608494",
"0.54573846",
"0.5445445",
"0.5441369",
"0.5440427",
"0.5431573",
"0.5428425",
"0.5425599",
"0.5411187",
"0.53955346",
"0.5395484",
"0.53883237",
"0.53701174",
"0.53620017",
"0.53592885",
"0.53458863",
"0.5337801",
"0.53367996",
"0.53187233",
"0.5314569",
"0.53123724",
"0.53095055",
"0.5286934",
"0.52864593",
"0.5267898",
"0.5266711",
"0.52599055",
"0.5259507",
"0.5255059",
"0.52415085",
"0.5241506",
"0.52364564",
"0.52283883",
"0.52208245",
"0.5212893",
"0.521282",
"0.5209016",
"0.5208737",
"0.5203223",
"0.51921093",
"0.51775956",
"0.5177584",
"0.51756036",
"0.51728487",
"0.5167655",
"0.5164283",
"0.5160499",
"0.5159277",
"0.51556396",
"0.5150881",
"0.51426375",
"0.5136788",
"0.51354194",
"0.5135278",
"0.5133637",
"0.5133124",
"0.51272905",
"0.51272136",
"0.51057434",
"0.51050687",
"0.5104969",
"0.5099344"
] | 0.726576 | 2 |
make sure the cautious strategy gets rid of higher value cards last when there are no other legal lower value cards in the hand. should pick nonnumeric colors (skip, reverse, draw two) before wilds. | @Test
public void testPlayer_getBoldStrategyCard_higherLast_drawTwo() {
player2 = new Player("Player Two", true);
Hand hand = new Hand();
player2.setHand(hand.getAllCards());
player2.getHand().addCard(blueDrawTwo);
player2.getHand().addCard(wild);
player2.getHand().addCard(wildDrawFour);
assertTrue(player2.getBoldStrategyCard(blueFour, blueFour.getColor()).equals(blueDrawTwo));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\r\n public void testPlayer_getCautiousStrategyCardCard_numeric_matchColorNotNumber() {\n player2 = new Player(\"Player Two\", true);\r\n player2.setHand(strategyHand.getAllCards());\r\n\r\n // let the cpc be a yellow three\r\n // get rid of all non-numeric cards and the green three so the yellow six is the most attractive option\r\n player2.getHand().discard(wild);\r\n player2.getHand().discard(wildDrawFour);\r\n player2.getHand().discard(yellowReverse);\r\n player2.getHand().discard(redDrawTwo);\r\n player2.getHand().discard(greenThree);\r\n\r\n assertTrue(player2.getCautiousStrategyCard(yellowThree, yellowThree.getColor()).equals(yellowSix));\r\n }",
"@Test\r\n public void testPlayer_getCautiousStrategyCardCard_numeric_matchNumberNotColor() {\n player2 = new Player(\"Player Two\", true);\r\n player2.setHand(strategyHand.getAllCards());\r\n\r\n // let the cpc be a blue eight\r\n Card blueEight = new Card(Card.BLUE, Card.EIGHT, cvm);\r\n\r\n // get rid of all non-numeric cards and the blue four so the red eight is the most attractive option\r\n player2.getHand().discard(wild);\r\n player2.getHand().discard(wildDrawFour);\r\n player2.getHand().discard(yellowReverse);\r\n player2.getHand().discard(redDrawTwo);\r\n player2.getHand().discard(blueFour);\r\n\r\n Card redEight = new Card(Card.RED, Card.EIGHT, cvm);\r\n\r\n assertTrue(player2.getCautiousStrategyCard(blueEight, yellowThree.getColor()).equals(redEight));\r\n }",
"@Test\r\n public void testPlayer_getDumbStrategyCard_oneWinner_color() {\n player2 = new Player(\"\", true);\r\n player2.setHand(strategyHand.getAllCards());\r\n player2.getHand().discard(wild);\r\n player2.getHand().discard(wildDrawFour);\r\n assertTrue(player2.getDumbStrategyCard(blueNine, blueNine.getColor()).equals(blueFour));\r\n }",
"public void makeHigh() {\n Collections.sort(this.cards, Card.COMPARE_BY_VALUE);\n ArrayList<String> validHand = new ArrayList<>();\n for(int i = this.cards.size() - 5; i < this.cards.size(); i++)\n validHand.add(this.cards.get(i).toString());\n this.cardHand = new CardHand(validHand.toArray(new String[0]));\n }",
"@Test\r\n public void testPlayer_getCautiousStrategyCardCard_higherFirst_wd4() {\n player2 = new Player(\"Player Two\", true);\r\n player2.setHand(strategyHand.getAllCards());\r\n\r\n // get rid of the wild so the wd4 is the most attractive option\r\n player2.getHand().discard(wild);\r\n assertTrue(player2.getCautiousStrategyCard(yellowThree, yellowThree.getColor()).equals(wildDrawFour));\r\n }",
"@Test\r\n public void testPlayer_selectNewColor_dumb() {\r\n player2 = new Player(\"\", true);\r\n player2.setStrategy(Player.STRATEGY_DUMB);\r\n player2.setHand(strategyHand.getAllCards());\r\n player2.setLastPlayedCard(wild);\r\n String firstRandomColor = player2.selectNewColor();\r\n boolean differentColorFound = false;\r\n for(int i = 0; i < 25; i++) {\r\n String nextRandomColor = player2.selectNewColor();\r\n if(!nextRandomColor.equalsIgnoreCase(firstRandomColor)) {\r\n differentColorFound = true;\r\n }\r\n }\r\n assertTrue(differentColorFound);\r\n }",
"@Test\r\n public void testPlayer_getCautiousStrategyCardCard_higherFirst_drawTwo() {\n player2 = new Player(\"Player Two\", true);\r\n player2.setHand(strategyHand.getAllCards());\r\n\r\n // let the cpc be a red nine\r\n // get rid of the wild and wd4 cards so the red draw two is the most attractive option\r\n player2.getHand().discard(wild);\r\n player2.getHand().discard(wildDrawFour);\r\n Card redNine = new Card(Card.RED, Card.NINE, cvm);\r\n assertTrue(player2.getCautiousStrategyCard(redNine, redNine.getColor()).equals(redDrawTwo));\r\n }",
"private void makeTrips() {\n int highestThree, firstKicker, secondKicker;\n highestThree = firstKicker = secondKicker = -1;\n for (Integer key : this.cardOccurrence.keySet()) {\n int value = this.cardOccurrence.get(key);\n if(value == 3 && value > highestThree)\n highestThree = key;\n else {\n if(key > firstKicker) {\n secondKicker = firstKicker;\n firstKicker = key;\n }\n else if(key > secondKicker)\n secondKicker = key;\n }\n }\n\n //Go through Cards ArrayList to get the actual cards pertaining\n ArrayList<String> validHand = new ArrayList<>();\n for(int i = 0; i < this.cards.size(); i++) {\n Card c = this.cards.get(i);\n if(c.sameValue(highestThree))\n validHand.add(c.toString());\n else if(c.sameValue(firstKicker) || c.sameValue(secondKicker))\n validHand.add(c.toString());\n }\n this.cardHand = new CardHand(validHand.toArray(new String[0]));\n }",
"void dropcard3()\n{\nfor (int i=0;i<numberofhc()-1;i++)\n\t{\n\tint judgeA = (getcard(i)-3)/4;\n\t\n\tif(judgeA==12)\n\t\t{\n\t\tif(getcard(i)==54 && getcard(i+1)==54) //if the player has 2 SA, he/she can drop both\n\t\t\t{\n\t\t\tremove(i);\n\t\t\tremove(i);\n\t\t\ti--;\n\t\t\t}\n\t\telse if(getcard(i)==51 && getcard(i+1)==52) //if the player has CA and DA, he/she can drop both\n\t\t\t{\n\t\t\tremove(i);\n\t\t\tremove(i);\n\t\t\ti--;\n\t\t\t}\n\t\telse if(getcard(i)==51 && getcard(i+1)==53) //if the player has CA and HA, he/she can drop both\n\t\t\t{\n\t\t\tremove(i);\n\t\t\tremove(i);\n\t\t\ti--;\n\t\t\t}\n\t\telse if(getcard(i)==52 && getcard(i+1)==53) //if the player has DA and HA, he/she can drop both\n\t\t\t{\n\t\t\tremove(i);\n\t\t\tremove(i);\n\t\t\ti--;\n\t\t\t}\n\t\t}\n\telse\n\t\t{if((((getcard(i))-3)/4)==(((getcard(i+1))-3)/4))\n\t\t\t{remove(i);\n\t\t\tremove(i);\n\t\t\ti--;}}\n\t}\n\t}",
"@Test\r\n public void testPlayer_getBoldStrategyCard_zeroColor() {\n player2 = new Player(\"Player Two\", true);\r\n player2.setHand(strategyHand.getAllCards());\r\n assertTrue(player2.getBoldStrategyCard(yellowSix, yellowSix.getColor()).equals(yellowZero));\r\n\r\n // try again, but reduce the yellow color group to <= 2\r\n player2.getHand().discard(yellowSix);\r\n player2.getHand().discard(yellowReverse);\r\n\r\n assertTrue(player2.getBoldStrategyCard(yellowOne, yellowSix.getColor()).equals(yellowOne));\r\n }",
"private void decide(Player player, Card choiceCard) {\n player.removeCard(choiceCard);\n //Wild Draw\n if (choiceCard instanceof WildDrawCard) {\n //set wildDraw color\n while (true) {\n char color = controls.get(state.getTurn()).chooseColor();\n if (color == 'R' || color == 'G' || color == 'Y' || color == 'B') {\n ((WildDrawCard) choiceCard).setConfig(color);\n break;\n }\n System.out.println(\"Invalid color input.\");\n }\n //set wildDraw penalty\n char ch = 0;\n if(canChooseWildDrawCardPenalty(players.get(state.getNextTurn()))) {\n while (true) {\n ch = controls.get(state.getNextTurn()).yesOrNo();\n if (ch == 'Y' || ch == 'N'){\n break;\n }\n System.out.println(\"Invalid input.\");\n }\n }\n if (ch == 'N') {\n state.increaseWildDrawPenalty();\n }\n else {\n ((WildDrawCard) choiceCard).changeState(state);\n for (int i = 0; i < ((WildDrawCard) choiceCard).getForcedCards()*state.getWildDrawPenalty(); i++) {\n players.get(state.getTurn()).addCard(cards.get(0));\n cards.remove(0);\n }\n state.doWildDrawPenalty();\n }\n }\n\n //Wild\n else if (choiceCard instanceof WildCard) {\n while (true) {\n char color = controls.get(state.getTurn()).chooseColor();\n if (color == 'R' || color == 'G' || color == 'Y' || color == 'B') {\n ((WildCard) choiceCard).setConfig(color);\n break;\n }\n System.out.println(\"Invalid color input.\");\n }\n }\n\n //Reverse\n if (choiceCard instanceof ReverseCard) {\n ((ReverseCard) choiceCard).changeState(state);\n }\n\n //Skip\n if (choiceCard instanceof SkipCard) {\n ((SkipCard) choiceCard).changeState(state);\n }\n\n //Draw2\n if (choiceCard instanceof Draw2Card) {\n char ch = 0;\n if(canChooseDrawCardPenalty(players.get(state.getNextTurn()))) {\n while (true) {\n ch = controls.get(state.getNextTurn()).yesOrNo();\n if (ch == 'Y' || ch == 'N'){\n break;\n }\n System.out.println(\"Invalid input.\");\n }\n }\n if (ch == 'N') {\n state.increaseDrawPenalty();\n }\n else {\n ((Draw2Card) choiceCard).changeState(state);\n for (int i = 0; i < ((Draw2Card) choiceCard).getForcedCards()*state.getDrawPenalty(); i++) {\n players.get(state.getTurn()).addCard(cards.get(0));\n cards.remove(0);\n }\n state.doDrawPenalty();\n }\n }\n changeCurrentCard(choiceCard);\n }",
"@Test\r\n public void testPlayer_getDumbStrategyCard_differentWinners() {\r\n player2 = new Player(\"\", true);\r\n player2.setHand(strategyHand.getAllCards());\r\n boolean differentLegalCardFound = false;\r\n Card firstDiscard = player2.getDumbStrategyCard(yellowSix, yellowSix.getColor());\r\n for(int i = 0; i < 25; i++) {\r\n Card loopCard = player2.getDumbStrategyCard(yellowSix, yellowSix.getColor());\r\n if(!loopCard.equals(firstDiscard)) {\r\n differentLegalCardFound = true;\r\n }\r\n }\r\n assertTrue(differentLegalCardFound);\r\n }",
"private void badMatch() {\n\t\tArrayList<Integer> faceValues = new ArrayList<Integer>();\n\t\tInteger firstSelectableCardPos = null;\n\t\t\n\t\tfor (int card = 0; card < CARDS_SUM; card++) {\n\t\t\tPlayingCard thisCard = ((PlayingCard) getActivity().findViewById(solo.getImage(card).getId()));\n\t\t\t\n\t\t\t// cheat by finding card face without turning card over\n\t\t\tint face = thisCard.getCard();\n\t\t\tfaceValues.add(face);\n\t\t\t\n\t\t\t// can't select all cards\n\t\t\tif (thisCard.isLocked() || thisCard.getVisible()) {\n\t\t\t\tcontinue;\n\t\t\t} else if (firstSelectableCardPos == null) {\n\t\t\t\tfirstSelectableCardPos = card;\n\t\t\t}\n\t\t\t\n\t\t\t// if this is a different card, select the bad pair\n\t\t\tif (faceValues.get(firstSelectableCardPos) != face) {\n\t\t\t\tsolo.clickOnImage(firstSelectableCardPos);\n\t\t\t\tsolo.clickOnImage(card);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}",
"@Test\r\n public void testPlayer_getBoldStrategyCard_numeric_matchColorNotNumber() {\n player2 = new Player(\"Player Two\", true);\r\n player2.setHand(strategyHand.getAllCards());\r\n player2.getHand().discard(greenThree);\r\n player2.getHand().discard(yellowZero);\r\n assertTrue(player2.getBoldStrategyCard(yellowThree, yellowThree.getColor()).equals(yellowSix));\r\n }",
"public void disperse() {\t\t\n\t\tfor (int r = 0; r < rows; r++){\n\t\t\tfor (int c = 1; c < cols; c++){\n\t\t\t\tint sum = values[r+1][c-1] + values[r+1][c] + values[r+1][c+1];\n\t\t\t\tif(r < rows - fireLevel + 14){\n\t\t\t\t\tvalues[r][c] = (sum / 3) - 1;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tvalues[r][c] = (int)((sum / 3.0) - 0.0); \n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (values[r][c] < 0) values[r][c] = 0;\n\t\t\t\tg2.setColor(colors[values[r][c]]);\n\t\t\t\tif(values[r][c] > 5){\n\t\t\t\t\tg2.fillRect(c*res,r*res,res,res);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"void dropcard()\n{\nfor (int i=0;i<hc.size()-1;i++)\n\t{\n\tif(hc.get(i)==1||hc.get(i)==2)\n\t\tcontinue;\n\telse if((((hc.get(i))-3)/4)==(((hc.get(i+1))-3)/4))\n\t\t{hc.remove(i);\n\t\thc.remove(i);\n\t\ti--;}\t\n\t}\n}",
"@Test\n public void testShuffleGood() {\n System.out.println(\"shuffleGood\");\n Deck deck = new Deck();\n boolean shuffled = false;\n deck.shuffle();\n //we take out one card from the deck\n Card lastCard = deck.nextCard();\n //we take out 58 more cards\n for (int i =0 ; i<57;i++)\n {\n deck.nextCard();\n }\n //we take out the last card from the deck\n Card firstCard = deck.nextCard();\n \n //if both cards = the same value they were before being shuffled, then test will fail.\n if (lastCard.getValue() != CardType.WILDCARD )\n shuffled = true;\n else if (firstCard.getValue()!=CardType.ZERO)\n shuffled = true;\n \n //if either of the cards are different, that means the deck was shuffled and the test will pass\n assertEquals(true, shuffled);\n }",
"public void evaluateHand(){only public for testing\n //hand types will be\n //1 royal flush\n //2 straight flush\n //3 four of a kind\n //4 full house\n //5 flush\n //6 straight\n //7 three of a kind\n //8 two pair\n //9 pair\n //10 high card\n //hand secondary values will have to some how account for\n //the lead card of a flush or straight or the bigger pair\n //\n HandType = 0;\n\n //----------checking flush----------\n boolean flush = true;//will flip the vriable when proven wrong\n //if Hand.suites all equal\n for(Card c : Hand) {\n if (!c.getSuite().contains(Hand[0].getSuite())) {\n flush = false;\n }\n }\n //--Handtype = 5//flush\n if(flush){\n HandType=5;\n }\n\n //----------checking pair, two pair, boat,three of a kind, four of a kind----------\n int countmatches=0;\n HashMap<Integer, ArrayList<Card>> maskd = new HashMap<>();\n int[] mask = new int[5];\n int currentmask=1;\n maskd.put(0, new ArrayList<>());\n mask[0]=0;\n maskd.get(0).add(this.Hand[0]);\n //if any two hand.value equal\n for(int comp = 0; comp<Hand.length;comp++){//comparitor\n for(int check = comp+1; check<Hand.length;check++) {//checker\n //System.out.print(\"{\"+comp+check+\"}\");\n if(0==Hand[comp].compareTo(Hand[check])){\n //System.out.println(\"pair\"+Hand[comp]+Hand[check]);\n countmatches++;\n /*if(pairprimary==0&&!(pairprimary==Hand[check].getValue())){\n pairprimary=Hand[check].getValue();\n }else if(pairsecondary==0){\n pairsecondary=Hand[check].getValue();\n }//this wont work for boats\n */\n //create mask?\n if(mask[comp]==0){\n mask[comp]=currentmask;\n maskd.put(currentmask,new ArrayList<>());\n maskd.get(currentmask).add(this.Hand[comp]);\n currentmask++;\n if(maskd.get(0).contains(this.Hand[comp])){\n maskd.get(0).remove(this.Hand[comp]);\n }\n }\n mask[check]=mask[comp];\n if(!maskd.get(mask[comp]).contains(this.Hand[check])) {\n if(maskd.get(0).contains(this.Hand[check]))\n maskd.get(0).remove(this.Hand[check]);\n maskd.get(mask[comp]).add(this.Hand[check]);\n }\n continue;\n }\n if(!maskd.get(0).contains(this.Hand[check]))\n maskd.get(0).add(this.Hand[check]);\n }\n }\n\n //for(int m:maskd.keySet())\n // System.out.print(\"\"+m+\":\"+maskd.get(m));\n //System.out.println(\"\");\n\n if(HandType==0)\n switch (countmatches){ //basically i'm counting the collisions\n case 1: HandType=9;break;//one pair\n case 2: HandType=8;break;//two pair\n case 3: HandType=7;break;//triple\n case 4: HandType=4;break;//boat\n case 6: HandType=3;break;//four of a kind\n case 10: HandType=-1;break;//five of a kind\n }//reorder cards by mask?\n if(countmatches>0){\n Card[] newhand = new Card[5];\n int bigger = 0;\n if(currentmask==3) {//two pair boat\n //two pair\n if (maskd.get(1).get(0).getValue()\n > maskd.get(2).get(0).getValue()) {\n bigger = 1;\n } else {\n bigger = 2;\n }\n\n //boat\n if (maskd.get(1).size() == 3) {\n bigger = 1;\n }\n if (maskd.get(2).size() == 3) {\n bigger = 2;\n }\n }else {\n //one pair???\n bigger = 1;\n }\n\n for(int i = 0; i<5;i++){\n //if(maskd.containsKey(bigger)) {\n if(!maskd.get(bigger).isEmpty()) {\n newhand[i] = maskd.get(bigger).get(0);\n //if (maskd.get(bigger).size() > 0) {\n maskd.get(bigger).remove(0);\n //} else {\n // bigger = Math.abs(bigger - 3);\n //}\n }else{\n if(maskd.containsKey(Math.abs(bigger-3))){\n if(!maskd.get(Math.abs(bigger-3)).isEmpty()){\n bigger = Math.abs(bigger-3);\n }else{\n bigger = 0;\n }\n }else{\n bigger = 0;\n }\n i--;\n }\n //}\n\n }//end for loop\n\n //end pair bits\n\n //System.out.println(newhand);\n this.Hand=newhand;\n }//end reshuffle hand if statement\n //----------checking for straight----------\n //if first card is ace and second card is a 5, treat ace as one\n if(Hand[0].getValue()==14&&Hand[1].getValue()==5) {\n Hand[0] = new Card(\"Ace\", Hand[0].getSuite(), 1);\n //Hand[0].Value=1;\n this.sortHand();\n this.flipHand();\n }\n //go through hand and see if all 5 values are consecutive\n int n = Hand[0].getValue();\n boolean straight = true;\n for(int i = 1;i<Hand.length; i++){\n n--;\n if(!(Hand[i].getValue()==n)){\n straight=false;\n }\n }\n if(straight){\n //if above true\n //--if handtype = 5\n if(HandType==5) {\n //----if card1 is ace\n if (Hand[0].getValue() == 14) {\n //------handtype = 1 //royal flush\n HandType = 1;\n } else {\n //----else\n HandType=2;\n //------handtype = 2 //straight flush\n }\n }else {\n //--else //not a flush\n HandType=6;\n //----handtype = 6 //straight\n }\n }\n\n //----------checking high card----------\n //if handtype = 0\n if(HandType==0) {\n HandType=10;\n //--hand card = 10\n }\n }",
"private void updateLastCardDiscarded(){\r\n\t\tint x = 0;\r\n\t\twhile(this != game.getPlayer(x++)){} // find the nextPlayer\r\n\t\tx = x % game.getNumberOfPlayers();\r\n\t\tnextPlayer = game.getPlayer(x);\r\n\t\t\r\n\t\tif(latestRound != game.getRoundNumber()){ // if it's a new Round, reset\r\n\t\t\tpickedUpCards = new ArrayList<Card>();\r\n\t\t\tlastCardDiscarded = null;\r\n\t\t\tlatestRound = game.getRoundNumber();\r\n\t\t\t\r\n\t\t\tfor(int y = 0; y < game.getNumberOfPlayers(); y++){ // ?????\r\n\t\t\t\tif(game.getPlayer(y) != this && \r\n\t\t\t\t\t\t(getScore() >= game.getPlayer(y).getScore() || getPhase() > game.getPlayer(y).getPhase())){//????\r\n\t\t\t\t\tsetName(oldName);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tsetName(oldName + \"is#WINNING\"); // ?????\r\n\t\t}else if(lastCardDiscarded != null && Configuration.getTypeRequired(nextPlayer.getPhase(), 0) == Configuration.SET_PHASE){\r\n\t\t\tif(nextPlayer.drewFromDiscard())\r\n\t\t\t\tpickedUpCards.add(lastCardDiscarded); // add the card to picked up card if it was picked up \r\n\t\t}\r\n\t}",
"public void discard(){\n for(int i = 1 ; i <= 110 ; i++) cardDeck.remove(i);\n }",
"@Test\r\n public void testPlayer_getBoldStrategyCard_numeric_matchNumberNotColor() {\n player2 = new Player(\"Player Two\", true);\r\n player2.setHand(strategyHand.getAllCards());\r\n Card blueEight = new Card(Card.BLUE, Card.EIGHT, cvm);\r\n player2.getHand().discard(blueFour);\r\n player2.getHand().discard(yellowZero);\r\n Card redEight = new Card(Card.RED, Card.EIGHT, cvm);\r\n assertTrue(player2.getBoldStrategyCard(blueEight, yellowThree.getColor()).equals(redEight));\r\n }",
"private void reshuffleDiscardPile() {\n ICard topCard = discardPile.pop();\n\n drawPile.addAll(discardPile);\n Collections.shuffle(drawPile, rng);\n\n discardPile.clear();\n discardPile.add(topCard);\n }",
"private static Collection<Piece> getCorrectBluePieces() {\n\t\tfinal Collection<Piece> pieces = new ArrayList<Piece>();\n\t\tpieces.add(new Piece(PieceType.SERGEANT, PlayerColor.BLUE));\n\t\tpieces.add(new Piece(PieceType.SERGEANT, PlayerColor.BLUE));\n\t\tpieces.add(new Piece(PieceType.SERGEANT, PlayerColor.BLUE));\n\t\tpieces.add(new Piece(PieceType.LIEUTENANT, PlayerColor.BLUE));\n\t\tpieces.add(new Piece(PieceType.LIEUTENANT, PlayerColor.BLUE));\n\t\tpieces.add(new Piece(PieceType.LIEUTENANT, PlayerColor.BLUE));\n\t\tpieces.add(new Piece(PieceType.CAPTAIN, PlayerColor.BLUE));\n\t\tpieces.add(new Piece(PieceType.CAPTAIN, PlayerColor.BLUE));\n\t\tpieces.add(new Piece(PieceType.COLONEL, PlayerColor.BLUE));\n\t\tpieces.add(new Piece(PieceType.COLONEL, PlayerColor.BLUE));\n\t\tpieces.add(new Piece(PieceType.MARSHAL, PlayerColor.BLUE));\n\t\tpieces.add(new Piece(PieceType.FLAG, PlayerColor.BLUE));\n\t\treturn pieces;\n\t}",
"public Card chooseFromHand(String sign , String colorName){\n Scanner scanner = new Scanner(System.in);\n Card chosenCard = null;\n int cardIndex;\n do{\n System.out.println(\"which cart ? (-1 to pick up card from cardDeck) ?\");\n cardIndex =scanner.nextInt();\n// scanner.nextLine();\n if(cardIndex == -1){\n ArrayList<Card> playableCards = playableNormalCards(sign , colorName);\n if(playableCards.size() == 0){\n return null;\n }\n else {\n System.out.println(\"you still can play : \");\n for(Card card : playableCards){\n System.out.print(card + \" \");\n }\n System.out.println();\n }\n }\n else if(cardIndex<=0 ||cardIndex > hand.size()){\n System.out.println(\"not valid input\");\n System.out.println(\"please try again : \");\n }\n else if(hand.get(cardIndex-1).getSign().equals(\"B\")){\n chosenCard = hand.get(cardIndex -1);\n }\n else if((!(hand.get(cardIndex-1).getSign().equals(sign))) &&\n (!(hand.get(cardIndex-1).getColorName().equals(colorName)))){\n System.out.println(\"not playable card\");\n System.out.println(\"please try again : \");\n }\n else{\n chosenCard = hand.get(cardIndex - 1);\n }\n\n }while(cardIndex <= 0 || cardIndex > hand.size() || chosenCard == null);\n\n\n hand.remove(chosenCard);\n return chosenCard;\n }",
"@Test\n\t\tpublic void testGetColour() {\n\t\t\tgreenSix = new Card (Card.Colour.Green, 6);\n\t\t\tblueSix = new Card (Card.Colour.Blue, 6);\n\t\t\twild = new Card (Card.Wild.Wild);\n\t\t\twild_Draw4 = new Card (Card.Wild.WildDraw4);\n\t\t\tblueSkip = new Card(Card.Colour.Blue, Card.Action.Skip);\n\t\t\tredDraw2 = new Card(Card.Colour.Red, Card.Action.Draw2);\n\t\t\tgreenReverse = new Card (Card.Colour.Green, Card.Action.Reverse);\n\t\t\tassertEquals(\"black\", wild.getColour());\n\t\t\tassertEquals(\"black\", wild_Draw4.getColour());\n\t\t\tassertEquals(\"Blue\", blueSkip.getColour());\n\t\t\tassertEquals(\"Red\", redDraw2.getColour());\n\t\t\tassertEquals(\"Green\", greenReverse.getColour());\n\t\t}",
"void takeBack() {\n\tside ^= 1;\n\txside ^= 1;\n\tHistoryData h = histDat[--hply];\n\tpawnBits = h.pawnBits;\n\tpieceBits = h.pieceBits;\n\tBouger m = h.m;\n\tcastle = h.castle;\n\tep = h.ep;\n\tfifty = h.fifty;\n\tint from = m.getFrom();\n\tint to = m.getTo();\n\tcolor[from] = side;\n\tif ((m.bits & 32) != 0) {\n\tpiece[from] = PAWN;\n\tpieceMat[side] -= pieceValue[h.m.promote];\n\t} else {\n\tint thePiece = piece[to];\n\tif (thePiece == KING)\n\tkingSquare[side] = from;\n\tpiece[from] = thePiece;\n\t}\n\tif (h.capture == EMPTY) {\n\tcolor[to] = EMPTY;\n\tpiece[to] = EMPTY;\n\t} else {\n\tcolor[to] = xside;\n\tpiece[to] = h.capture;\n\tif (h.capture != PAWN)\n\tpieceMat[xside] += pieceValue[h.capture];\n\t}\n\tif ((m.bits & 2) != 0) {\n\tint cfrom, cto;\n\n\tswitch (to) {\n\tcase 62:\n\tcfrom = F1;\n\tcto = H1;\n\tbreak;\n\tcase 58:\n\tcfrom = D1;\n\tcto = A1;\n\tbreak;\n\tcase 6:\n\tcfrom = F8;\n\tcto = H8;\n\tbreak;\n\tcase 2:\n\tcfrom = D8;\n\tcto = A8;\n\tbreak;\n\tdefault: /* shouldn't get here */\n\tcfrom = -1;\n\tcto = -1;\n\tbreak;\n\t}\n\tcolor[cto] = side;\n\tpiece[cto] = ROOK;\n\tcolor[cfrom] = EMPTY;\n\tpiece[cfrom] = EMPTY;\n\t}\n\tif ((m.bits & 4) != 0) {\n\tif (side == LIGHT) {\n\tcolor[to + 8] = xside;\n\tpiece[to + 8] = PAWN;\n\t} else {\n\tcolor[to - 8] = xside;\n\tpiece[to - 8] = PAWN;\n\t}\n\t}\n\t}",
"private String findBestColor(ArrayList<String> missingPieces) {\n if(missingPieces.size() > 0) {\n String bestColor = \"\";\n int maxVolume = 0;\n for (int i = 0; i < missingPieces.size(); i++) {\n String colorKey = missingPieces.get(i);\n Block piece = new Block(colorKey);\n int volume = piece.getVolume();\n if (volume > maxVolume) {\n maxVolume = volume;\n bestColor = colorKey;\n }\n }\n return bestColor;\n } else return null;\n }",
"@Test\r\n public void testPlayer_getBoldStrategyCard_numeric_colorBeatsNumber() {\n\r\n player2 = new Player(\"Player Two\", true);\r\n player2.setHand(strategyHand.getAllCards());\r\n\r\n // pick a cpc that could return two possible options\r\n // and assert that the higher value card comes back\r\n\r\n // make a cpc that might return a yellow six or a red eight\r\n // assert the yellow comes back, even though the red eight has a higher value\r\n Card redSix = new Card(Card.RED, Card.SIX, cvm);\r\n assertTrue(player2.getBoldStrategyCard(redSix, redSix.getColor()).equals(yellowSix));\r\n }",
"public void randomizeColor() {\r\n\t\tArrayList<Integer> possibleColors = new ArrayList<Integer>();\r\n\t\tfor(int i = 1; i<=4; i++) {\r\n\t\t\tif(i!=colorType) { \r\n\t\t\t\tpossibleColors.add(i);\r\n\t\t\t}\r\n\t\t}\r\n\t\tcolorType = possibleColors.get((int) (Math.random()*3));\r\n\t\t\r\n\t}",
"public void speckle() {\n\t\tint r = (height / res) - 1;\n\t\tint c = (width / res);\n\t\tfor (int i = 0; i < c; i++)\t\t{\n\t\t\tint x = rng.nextInt(25);\t\t\t\n\t\t\tif (x == 0) { // 1/25 chance of changing bottom row pixel to black\t \n\t\t\t\tvalues[r][i] = color1;\t\t\t\t\n\t\t\t}\n\t\t\telse if (x == 1) { // 1/25 chance of changing bottom row pixel to white\n\t\t\t\tvalues[r][i] = color2;\n\t\t\t}\n\t\t\t// 23/25 chance of leaving bottom pixel alone\n\t\t}\n\t}",
"public void unsetChanceCardShuffle() {\n ChanceCardShuffle = false;\n }",
"private void mixDeck() {\n Random rnd = new Random();\n ArrayList<UnoCard> mixed = new ArrayList<UnoCard>();\n\n // mix it!\n for(int i = cards.size()-1; i>0;i--) {\n int index = rnd.nextInt(i+1);\n UnoCard helper = cards.get(index);\n cards.remove(index);\n mixed.add(helper);\n }\n\n // delete current arrayList\n cards = null;\n // set mixed cards to original carddeck\n cards = mixed;\n\n // paint cards again because order has changed\n for(UnoCard c : cards) {\n c.setContainer(deckPos);\n }\n\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 static void removeCurrentColors(){\n\t\tIterator<ArrayList<Peg>> itr = possibleCombinations.iterator();\n\t\twhile(itr.hasNext()){\n\t\t\tArrayList <Peg> victim=itr.next();\n\t\t\tfor(int i=0; i<aiGuess.size(); i++){\n\t\t\t\t\n\t\t\t\tif(victim.contains(aiGuess.get(i))){\n\t\t\t\t\titr.remove();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"protected void removeChosenCard(Board gameBoard, Card chosenCard) {\n Iterator<Card> it = myCards.iterator();\n Card tempgroundCard= gameBoard.getGroundCard();\n while (it.hasNext()) {\n Card tempCard = it.next();\n if (tempCard.equals(chosenCard)) {\n it.remove();\n // Card tempgroundCard=gameBoard.getGroundCard;\n if (tempgroundCard instanceof WildDrawCard\n || tempgroundCard instanceof ColorChangeCard) {// if the last ground card was Wild set\n // it black again\n gameBoard.getGroundCard().setColor(0);\n }\n gameBoard.setGroundCard(tempCard);\n gameBoard.addToStorage(tempCard);\n if (!(tempCard instanceof DrawCard) && !(tempCard instanceof WildDrawCard)) { // if the Card was't Draw\n gameBoard.resetDraw();\n }\n cardNumber = myCards.size();\n break;\n }\n }\n }",
"public void clearHand() {\n for (Component c : cardPane.getComponents()) {\n if (c instanceof Card) {\n cardPane.remove(c); //Removes all Cards from card panel\n }\n }\n busted = false; //Hand not busted\n values.clear(); //Removes all Integers from values\n values.add(0); //Sets initial value to 0\n updateValue(); //Updates value\n repaint(); //Redraws hand\n }",
"public void unsetChestCardShuffle() {\n ChanceCardShuffle = false;\n }",
"public void deal()\n\t{\n\t Random generator = new Random();\n\t int thisCard = generator.nextInt(52);\n\n\t face = faces[thisCard % 13];\n\t suit = suits[thisCard / 13];\n\n\t faceValue = thisCard %13;\n\t}",
"private void makeCards() {\n //make number cards(76 cards)\n for (int i = 0; i < 10; i++) {\n String s = i + \"\";\n cards.add(new NumberCard(s, Color.RED, i));\n cards.add(new NumberCard(s, Color.GREEN, i));\n cards.add(new NumberCard(s, Color.BLUE, i));\n cards.add(new NumberCard(s, Color.YELLOW, i));\n if(i > 0) {\n cards.add(new NumberCard(s, Color.RED, i));\n cards.add(new NumberCard(s, Color.GREEN, i));\n cards.add(new NumberCard(s, Color.BLUE, i));\n cards.add(new NumberCard(s, Color.YELLOW, i));\n }\n }\n\n //make wild cards(8 cards)⨁\n for (int i = 0; i < 4; i++) {\n cards.add(new WildCard(\"W\", Color.BLACK));\n cards.add(new WildDrawCard(\"W+4\", Color.BLACK));\n }\n\n //make reverse cards(8 cards)⤤⤦\n for (int i = 0; i < 2; i++) {\n cards.add(new ReverseCard(\"Rev\", Color.RED));\n cards.add(new ReverseCard(\"Rev\", Color.GREEN));\n cards.add(new ReverseCard(\"Rev\", Color.BLUE));\n cards.add(new ReverseCard(\"Rev\", Color.YELLOW));\n }\n\n //make draw cards(8 cards)⧉\n for (int i = 0; i < 2; i++) {\n cards.add(new Draw2Card(\"D+2\", Color.RED));\n cards.add(new Draw2Card(\"D+2\", Color.GREEN));\n cards.add(new Draw2Card(\"D+2\", Color.BLUE));\n cards.add(new Draw2Card(\"D+2\", Color.YELLOW));\n }\n\n //make skip cards(8 cards)🚫\n for (int i = 0; i < 2; i++) {\n cards.add(new SkipCard(\"Ski\", Color.RED));\n cards.add(new SkipCard(\"Ski\", Color.GREEN));\n cards.add(new SkipCard(\"Ski\", Color.BLUE));\n cards.add(new SkipCard(\"Ski\", Color.YELLOW));\n }\n //Shuffling cards list\n Collections.shuffle(cards);\n }",
"private java.util.List<Card> deal(java.util.List<Card> hand, int numCards) {\n for (int i = 0; i < numCards; ++i) {\n hand.add(removeTop(deck));\n }\n return hand;\n }",
"public void applyCard(Card card, String user){\n if (user.equals(\"player\")){\n if (card == null){\n //System.out.println(\"No card in this slot\");\n //System.out.println(\"Size of tempDeck: \" + playerTempDeck.size());\n } else{\n if(playerMana >= card.getManaCost()){\n updateMana(\"player\", -card.getManaCost());\n //Check if has enough gold, too. Make free cards have a worth of gold = 0.\n //playerGoldAmount -= card.getGoldCost(); //------------------------------------------------Implement this once it can be tested.\n\n if(card.getEffect().contains(\"A\")){ //attack\n //looks long, but it finds the index of the Attack symbol (\"A\") and adds one to it, so it'll find the value 5 if the input is \"A5\", anywhere on the string.\n //Allows for things such as \"A4D1\" in theory.\n updateHealth(\"enemy\", -Character.getNumericValue(card.getEffect().charAt(card.getEffect().indexOf(\"A\") + 1)), true);\n }\n if(card.getEffect().contains(\"D\")) { //Defend\n updateDefence(\"player\", Character.getNumericValue(card.getEffect().charAt(card.getEffect().indexOf(\"D\") + 1)));\n }\n\n //Discard the card just used, put into discarded pile.\n Integer index = playerHand.indexOf(card);\n discardedCards.add(card);\n //System.out.println(\"Current index is: \" + index);\n //System.out.println(\"At that index was: \" + playerHand.get(index));\n playerHand.set(index, null);\n\n\n //System.out.println(\"The deck is currently: \" + playerHand.toString());\n //playerHand.remove(card); //Doesn't work, shortens the size all together.\n drawCard(index);\n }\n }\n }\n\n else if (user.equals(\"enemy\")){\n if(enemyMana >= card.getManaCost()){\n updateMana(\"enemy\", -card.getManaCost());\n if(card.getEffect().contains(\"A\")){\n updateHealth(\"player\", -Character.getNumericValue(card.getEffect().charAt(card.getEffect().indexOf(\"A\") + 1)), true);\n }\n if(card.getEffect().contains(\"D\")) {\n updateDefence(\"enemy\", Character.getNumericValue(card.getEffect().charAt(card.getEffect().indexOf(\"D\") + 1)));\n }\n }\n }\n }",
"public void fakeCards(){\n this.drawPile = new ArrayList<>();\n drawPile.add(new RemoveActionCard(\"Fernsprechgerät\", (float) 0.5, 4, new SpecialActions(0,0,1) ));\n drawPile.add(new MovingCard(\"Millionärin\", 4, 5, 4, 99, new COLOR[]{COLOR.SAND}));\n drawPile.add(new RemoveMoveSellCard(\"Propellerflugzeug\", 4, 4, 4, 99, new COLOR[]{COLOR.SAND, COLOR.RIVER, COLOR.JUNGLE,COLOR.ENDFIELDJUNGLE,COLOR.ENDFIELDRIVER}));\n drawPile.add(new MovingCard(\"Ureinwohner\", (float) 0.5, 5, 99, 1, new COLOR[]{COLOR.BASECAMP, COLOR.RUBBLE, COLOR.JUNGLE, COLOR.SAND, COLOR.RIVER,COLOR.ENDFIELDJUNGLE,COLOR.ENDFIELDRIVER}));\n drawPile.add(new ActionCard(\"Wissenschaftlerin\", (float) 0.5, 4, new SpecialActions(1,1,0)));\n drawPile.add(new MovingCard(\"Pionier\", (float) 0.5, 5, 5, 99, new COLOR[]{COLOR.JUNGLE,COLOR.ENDFIELDJUNGLE}));\n drawPile.add(new ActionCard(\"Kartograph\", (float) 0.5, 4, new SpecialActions(2,0,0)));\n drawPile.add(new ActionCard(\"Kartograph\", (float) 0.5, 4, new SpecialActions(2,0,0)));\n Collections.shuffle(drawPile);\n }",
"public Card()\r\n {\r\n rand = new Random();\r\n value = rand.nextInt(28); \r\n // Assigning value\r\n if (value >= 14) // Check if value is greater than 14 then value = value - 14;\r\n value -= 14;\r\n // Assigning color\r\n rand = new Random();\r\n // Switch statement for assigning different colors\r\n switch(rand.nextInt(4) )\r\n {\r\n case 0: color = \"Red\"; \r\n break;\r\n case 1: color = \"Green\"; \r\n break;\r\n case 2: color = \"Blue\"; \r\n break;\r\n case 3: color = \"Yellow\"; \r\n break;\r\n }\r\n // If the card is a wild card and value is greater than or equal to 13 then none value is assigned to color variable\r\n if (value >= 13)\r\n color = \"none\";\r\n }",
"private void createShuffleAndAddCards() {\n //Creating all 108 cards and saving them into an arraylist\n ArrayList<Card> cards = new ArrayList<>();\n String[] colors = {\"red\", \"blue\", \"yellow\", \"green\"};\n for (String color : colors) {\n for (int i = 1; i < 10; i++) {\n for (int j = 0; j < 2; j++) {\n cards.add(new Card(\"Numeric\", color, i));\n }\n }\n cards.add(new Card(\"Numeric\", color, 0));\n for (int i = 0; i < 2; i++) {\n cards.add(new Card(\"Skip\", color, 20));\n cards.add(new Card(\"Draw2\", color, 20));\n cards.add(new Card(\"Reverse\", color, 20));\n }\n }\n for (int i = 0; i < 4; i++) {\n cards.add(new Card(\"WildDraw4\", \"none\", 50));\n cards.add(new Card(\"WildColorChanger\", \"none\", 50));\n }\n //shuffling cards and adding them into the storageCards main list\n Collections.shuffle(cards);\n for (Card card : cards) {\n storageCards.add(card);\n }\n cards.clear();\n }",
"private static Collection<Piece> getCorrectRedPieces() {\n\t\tfinal Collection<Piece> pieces = new ArrayList<Piece>();\n\t\tpieces.add(new Piece(PieceType.SERGEANT, PlayerColor.RED));\n\t\tpieces.add(new Piece(PieceType.SERGEANT, PlayerColor.RED));\n\t\tpieces.add(new Piece(PieceType.SERGEANT, PlayerColor.RED));\n\t\tpieces.add(new Piece(PieceType.LIEUTENANT, PlayerColor.RED));\n\t\tpieces.add(new Piece(PieceType.LIEUTENANT, PlayerColor.RED));\n\t\tpieces.add(new Piece(PieceType.LIEUTENANT, PlayerColor.RED));\n\t\tpieces.add(new Piece(PieceType.CAPTAIN, PlayerColor.RED));\n\t\tpieces.add(new Piece(PieceType.CAPTAIN, PlayerColor.RED));\n\t\tpieces.add(new Piece(PieceType.COLONEL, PlayerColor.RED));\n\t\tpieces.add(new Piece(PieceType.COLONEL, PlayerColor.RED));\n\t\tpieces.add(new Piece(PieceType.MARSHAL, PlayerColor.RED));\n\t\tpieces.add(new Piece(PieceType.FLAG, PlayerColor.RED));\n\t\treturn pieces;\n\t}",
"public boolean VerifyHumanChoice(int value){\n String card = handHuman.get(value);\n System.out.print(\"CARD IN VERIFY HUMAN\" + card);\n\n String firstLetter = Character.toString(card.charAt(0));\n String topFirstLetter = Character.toString(topCard.charAt(0));\n\n if(topCard.contains(\"8\")){\n //Can play any card ontop to determine suite\n topCard = card;\n return true;\n }\n\n if(card.contains(\"8\")){\n //valid because 8s are wild cards, human can place it\n topCard = card;\n return true;\n }\n\n //the cards match in suite, doesn't matter what it is\n else if(firstLetter.equals(topFirstLetter)){\n topCard = card;\n return true;\n }\n\n else{\n if(topFirstLetter.equals(\"c\")){\n String temp = topCard.substring(5, topCard.length());\n System.out.println(\"TEMP \" + temp);\n\n if(card.contains(temp)){\n topCard = card;\n return true;\n }\n\n }\n\n else if(topFirstLetter.equals(\"h\")){\n String temp = topCard.substring(6, topCard.length());\n System.out.println(\"TEMP \" + temp);\n\n if(card.contains(temp)){\n topCard = card;\n return true;\n }\n\n }\n\n else if(topFirstLetter.equals(\"d\")){\n String temp = topCard.substring(8, topCard.length());\n System.out.println(\"TEMP \" + temp);\n\n if(card.contains(temp)){\n topCard = card;\n return true;\n }\n\n }\n\n else if(topFirstLetter.equals(\"s\")){\n String temp = topCard.substring(6, topCard.length());\n System.out.println(\"TEMP \" + temp);\n\n if(card.contains(temp)){\n topCard = card;\n return true;\n }\n\n }\n }\n\n //You can't play this card\n return false;\n }",
"private void checkColors(){\r\n\t\tpaintCorner(RED);\r\n\t\tif(leftIsClear()){\r\n\t\t\tturnLeft();\r\n\t\t\tmove();\r\n\t\t\tif(cornerColorIs(null)){\r\n\t\t\t\tmoveBack();\r\n\t\t\t\tturnLeft();\r\n\t\t\t\tpaintCorner(GREEN);\r\n\t\t\t}else{\r\n\t\t\t\tmoveBack();\r\n\t\t\t\tturnLeft();\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(rightIsClear()){\r\n\t\t\tturnRight();\r\n\t\t\tmove();\r\n\t\t\tif(cornerColorIs(null)){\r\n\t\t\t\tmoveBack();\r\n\t\t\t\tturnRight();\r\n\t\t\t\tpaintCorner(GREEN);\r\n\t\t\t}else{\r\n\t\t\t\tmoveBack();\r\n\t\t\t\tturnRight();\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(frontIsClear()){\r\n\t\t\tmove();\r\n\t\t\tif(cornerColorIs(null)) {\r\n\t\t\t\tmoveBack();\r\n\t\t\t\tpaintCorner(GREEN);\r\n\t\t\t\tturnAround();\r\n\t\t\t}else{\r\n\t\t\t\tmoveBack();\r\n\t\t\t\tturnAround();\r\n\t\t\t}\r\n\t\t}\r\n\t\tmakeMove();\r\n\t}",
"public boolean CheckForUnwinnableCondition(){\n int humanSize = GetSizeOfHumanHand();\n int computerSize = GetSizeOfComputerHand();\n\n for(int i = 0; i < humanSize; i++) {\n //Human can play a card\n String card = handHuman.get(i);\n\n String firstLetter = Character.toString(card.charAt(0));\n String topFirstLetter = Character.toString(topCard.charAt(0));\n\n if (topCard.contains(\"8\")) {\n //Can play any card ontop to determine suite\n return true;\n }\n\n if (card.contains(\"8\")) {\n //valid because 8s are wild cards, human can place it\n return true;\n }\n\n //the cards match in suite, doesn't matter what it is\n else if (firstLetter.equals(topFirstLetter)) {\n return true;\n }\n\n else {\n if (topFirstLetter.equals(\"c\")) {\n String temp = topCard.substring(5, topCard.length());\n\n if (card.contains(temp)) {\n return true;\n }\n\n } else if (topFirstLetter.equals(\"h\")) {\n String temp = topCard.substring(6, topCard.length());\n\n if (card.contains(temp)) {\n return true;\n }\n\n } else if (topFirstLetter.equals(\"d\")) {\n String temp = topCard.substring(8, topCard.length());\n\n if (card.contains(temp)) {\n return true;\n }\n\n } else if (topFirstLetter.equals(\"s\")) {\n String temp = topCard.substring(6, topCard.length());\n\n if (card.contains(temp)) {\n return true;\n }\n }\n }\n }\n\n for(int i = 0; i < computerSize; i++){\n //Human can play a card\n String card = handComputer.get(i);\n\n String firstLetter = Character.toString(card.charAt(0));\n String topFirstLetter = Character.toString(topCard.charAt(0));\n\n if (topCard.contains(\"8\")) {\n //Can play any card ontop to determine suite\n return true;\n }\n\n if (card.contains(\"8\")) {\n //valid because 8s are wild cards, human can place it\n return true;\n }\n\n //the cards match in suite, doesn't matter what it is\n else if (firstLetter.equals(topFirstLetter)) {\n return true;\n }\n\n else {\n if (topFirstLetter.equals(\"c\")) {\n String temp = topCard.substring(5, topCard.length());\n\n if (card.contains(temp)) {\n return true;\n }\n\n } else if (topFirstLetter.equals(\"h\")) {\n String temp = topCard.substring(6, topCard.length());\n\n if (card.contains(temp)) {\n return true;\n }\n\n } else if (topFirstLetter.equals(\"d\")) {\n String temp = topCard.substring(8, topCard.length());\n\n if (card.contains(temp)) {\n return true;\n }\n\n } else if (topFirstLetter.equals(\"s\")) {\n String temp = topCard.substring(6, topCard.length());\n\n if (card.contains(temp)) {\n return true;\n }\n }\n }\n }\n\n //Human and computer can't play a card\n return false;\n }",
"void getArrangedDeck() {\n\t\t\t\t\n\t\tint strength = 1;\n\t\t\n\t\tfor(int index = 0; index < this.numberOfCards; index++) {\n\n\t\t\tif((index+1)%4==0) {\n\t\t\t\tthis.cardsInDeck[index].setColor('\\u2660');\n\t\t\t} else {\n\t\t\t\tif((index+2)%4==0) {\n\t\t\t\t\tthis.cardsInDeck[index].setColor('\\u2665');\n\t\t\t\t} else {\n\t\t\t\t\tif((index+3)%4==0) {\n\t\t\t\t\t\tthis.cardsInDeck[index].setColor('\\u2666');\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.cardsInDeck[index].setColor('\\u2663');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tthis.cardsInDeck[index].setStrength(strength);\n\t\t\tif((index+1) % 4 == 0){\n\t\t\t\tstrength++;\n\t\t\t}\n\t\t\t\n\t\t\tif (index >= 0 && index <= 3) {\n\t\t\t\tthis.cardsInDeck[index].setName(\"2\");\n\t\t\t}\n\t\t\tif (index >= 4 && index <= 7) {\n\t\t\t\tthis.cardsInDeck[index].setName(\"3\");\n\t\t\t}\n\t\t\tif (index >= 8 && index <= 11) {\n\t\t\t\tthis.cardsInDeck[index].setName(\"4\");\n\t\t\t}\n\t\t\tif (index >= 12 && index <= 15) {\n\t\t\t\tthis.cardsInDeck[index].setName(\"5\");\n\t\t\t}\n\t\t\tif (index >= 16 && index <= 19) {\n\t\t\t\tthis.cardsInDeck[index].setName(\"6\");\n\t\t\t}\n\t\t\tif (index >= 20 && index <= 23) {\n\t\t\t\tthis.cardsInDeck[index].setName(\"7\");\n\t\t\t}\n\t\t\tif (index >= 24 && index <= 27) {\n\t\t\t\tthis.cardsInDeck[index].setName(\"8\");\n\t\t\t}\n\t\t\tif (index >= 28 && index <= 31) {\n\t\t\t\tthis.cardsInDeck[index].setName(\"9\");\n\t\t\t}\n\t\t\tif (index >= 32 && index <= 35) {\n\t\t\t\tthis.cardsInDeck[index].setName(\"10\");\n\t\t\t}\n\t\t\tif (index >= 36 && index <= 39) {\n\t\t\t\tthis.cardsInDeck[index].setName(\"J\");\n\t\t\t}\n\t\t\tif (index >= 40 && index <= 43) {\n\t\t\t\tthis.cardsInDeck[index].setName(\"Q\");\n\t\t\t}\n\t\t\tif (index >= 44 && index <= 47) {\n\t\t\t\tthis.cardsInDeck[index].setName(\"K\");\n\t\t\t}\n\t\t\tif (index >= 48 && index <= 51) {\n\t\t\t\tthis.cardsInDeck[index].setName(\"A\");\n\t\t\t}\n\t\t\t\n\t\t}\n\t}",
"public void drawCard(Integer cardLocation){\n Random random = new Random();\n boolean isPlayerHandEmpty = false;\n Integer sizeOfPlayerHand = 4;\n //The reason for this is as follows: we are wanting to keep an array size of 4 consistent for playerHand, however\n //using the .remove() function actually shortens the size. Yet .set(index,null) is still counted as an element, hence\n //isEmpty does not work, and the size() is still 4.\n //Is this the most agile way to do this? I don't know, but this worked.\n\n for (Card s:playerHand){\n if(s == null){\n sizeOfPlayerHand--;\n }\n }\n if (sizeOfPlayerHand == 0){\n isPlayerHandEmpty = true;\n }\n\n\n\n if (playerTempDeck.size() > 0 && (sizeOfPlayerHand < 4 || playerHand.size() < 4)){\n //System.out.println(\"Adding cards from deck.\");\n\n Integer n = random.nextInt(playerTempDeck.size()); //0 to the number in the bracket. Pick a random card from the deck and use it here.\n playerHand.set(cardLocation, playerTempDeck.get(n));\n //System.out.println(\"Now the playerHand is: \" + playerHand.toString());\n //System.out.println(\"Size of deck: \" + playerTempDeck.size());\n //System.out.println(\"Trying to remove: \" + playerTempDeck.get(n).getEffect());\n playerTempDeck.remove(playerTempDeck.get(n));\n }\n\n if (playerTempDeck.size() == 0 && (isPlayerHandEmpty || playerHand.size() == 0)){ //deck is empty and no cards left to play, reshuffle.\n //System.out.println(\"Hand and deck are both empty!\");\n playerTempDeck.addAll(discardedCards);\n discardedCards.clear();\n drawCard(0);\n drawCard(1);\n drawCard(2);\n drawCard(3);\n }\n }",
"private void discardRestrictedCards()\n\t{\n\t\tif (playerList.size() == 2)\n\t\t{\n\t\t\tfor(Card card : restrictedCard2PlayerList)\n\t\t\t{\n\t\t\t\tswitch (card.getType())\n\t\t\t\t{\n\t\t\t\t\tcase GreenPlayerCard:\n\t\t\t\t\tcase BrownPlayerCard:\n\t\t\t\t\t\tCard playerCardMatch = board.getPlayerCardDeck().pickCardByID(card.getId());\n\t\t\t\t\t\tif (playerCardMatch != null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tboard.getDiscardDeck().addCard(playerCardMatch);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase CityAreaCard:\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase PersonalityCard:\n\t\t\t\t\t\tCard personalityCardMatch = board.getPersonalityCardDeck().pickCardByID(card.getId());\n\t\t\t\t\t\tif (personalityCardMatch != null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tboard.getDiscardDeck().addCard(personalityCardMatch);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase RandomEventCard:\n\t\t\t\t\t\tCard randomEventCardMatch = board.getRandomEventCardDeck().pickCardByID(card.getId());\n\t\t\t\t\t\tif (randomEventCardMatch != null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tboard.getDiscardDeck().addCard(randomEventCardMatch);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public void shufflePerfectly() {\n\n ArrayList<Card> topDeck = new ArrayList<Card>(), botDeck = new ArrayList<Card>();\n for (int i = cards.size()-1; i >= 0; i--) {\n Card shuffleCard = null;\n try {\n shuffleCard = cards.get(i);\n }\n catch (Exception e) {\n // If card does not exist\n }\n if (shuffleCard != null) {\n if (i >= cards.size() / 2) {\n topDeck.add(shuffleCard);\n }\n else {\n botDeck.add(shuffleCard);\n }\n }\n }\n int len;\n boolean equalStacks = false;\n Card extraCard = null;\n\n if (topDeck.size() == botDeck.size()) {\n equalStacks = true;\n len = topDeck.size();\n }\n else {\n if (topDeck.size()>botDeck.size()) {\n len = botDeck.size();\n extraCard = topDeck.get(topDeck.size()-1);\n }\n else {\n len = topDeck.size();\n extraCard = botDeck.get(botDeck.size()-1);\n }\n }\n\n ArrayList<Card> shuffledDeck = new ArrayList<Card>();\n\n for (int i = len-1; i >= 0; i--) {\n // Shuffle the cards\n shuffledDeck.add(botDeck.get(i));\n shuffledDeck.add(topDeck.get(i));\n\n }\n if (!equalStacks) {\n shuffledDeck.add(extraCard);\n }\n\n ArrayList<Card> newDeck = new ArrayList<Card>();\n\n for (int i = 0; i < shuffledDeck.size(); i++) {\n newDeck.add(shuffledDeck.get(i));\n }\n cards = newDeck;\n }",
"public void resolveEffect(Card playedCard, int row, int col)\r\n {\r\n char type = playedCard.getEffectType();\r\n char target = playedCard.getEffectTarget();\r\n \r\n //Temp variables for this method\r\n int validTarget;\r\n int[] choice = new int[2];\r\n \r\n switch(type)\r\n {\r\n case 'H': //DISCARD HAND\r\n boolean discard = true; //PLACEHOLDER, ASK USER IF THEY WISH TO DISCARD\r\n if(discard)\r\n {\r\n final int NEW_HAND = 7;\r\n \r\n if(playerTurn == 0)\r\n {\r\n red.discard();\r\n for(int i = 0; i < NEW_HAND; i++)\r\n red.draw();\r\n }\r\n else\r\n {\r\n blue.discard();\r\n for(int i = 0; i < NEW_HAND; i++)\r\n blue.draw();\r\n }\r\n }\r\n break;\r\n case 'D': //DRAW\r\n final int DRAW_THRESHOLD = 4;\r\n if(playerTurn == 0)\r\n {\r\n if(red.getHand().size() >= 4)\r\n {\r\n while(red.getHand().size() < 7)\r\n red.draw();\r\n }\r\n }\r\n else\r\n {\r\n if(blue.getHand().size() >= 4)\r\n {\r\n while(blue.getHand().size() < 7)\r\n blue.draw();\r\n }\r\n }\r\n break;\r\n case '0': //ZERO\r\n if(playerTurn == 0)\r\n validTarget = 1;\r\n else\r\n validTarget = 0;\r\n \r\n choice[0] = 0; //PLACEHOLDER, ASK USER FOR TARGET\r\n choice[1] = 0;\r\n while(gameBoard.tilePlayer(choice[0], choice[1]) != validTarget )\r\n //REPROMPT FOR CHOICE\r\n \r\n gameBoard.getTile(choice[0], choice[1]).addEffect(playedCard.getEffect());\r\n break;\r\n case '-': //SUBTRACT\r\n if(target == 'X') //ANY\r\n {\r\n choice[0] = 0; //PLACEHOLDER, ASK USER FOR TARGET\r\n choice[1] = 0;\r\n \r\n while(gameBoard.tilePlayer(choice[0], choice[1]) != -1)\r\n //REPROMPT FOR CHOICE\r\n \r\n gameBoard.getTile(choice[0], choice[1]).addEffect(playedCard.getEffect()); \r\n }\r\n if(target == 'O') //OPPONENT\r\n {\r\n if(playerTurn == 0)\r\n validTarget = 1;\r\n else\r\n validTarget = 0;\r\n\r\n choice[0] = 0; //PLACEHOLDER, ASK USER FOR TARGET\r\n choice[1] = 0;\r\n\r\n while(gameBoard.tilePlayer(choice[0], choice[1]) != validTarget )\r\n //REPROMPT FOR CHOICE\r\n\r\n gameBoard.getTile(choice[0], choice[1]).addEffect(playedCard.getEffect()); \r\n }\r\n case '+':\r\n if(target == 'X') //ANY\r\n {\r\n choice[0] = 0; //PLACEHOLDER, ASK USER FOR TARGET\r\n choice[1] = 0;\r\n \r\n while(gameBoard.tilePlayer(choice[0], choice[1]) != -1)\r\n //REPROMPT FOR CHOICE\r\n \r\n gameBoard.getTile(choice[0], choice[1]).addEffect(playedCard.getEffect()); \r\n }\r\n if(target == 'O') //OPPONENT\r\n {\r\n if(playerTurn == 0)\r\n validTarget = 1;\r\n else\r\n validTarget = 0;\r\n\r\n choice[0] = 0; //PLACEHOLDER, ASK USER FOR TARGET\r\n choice[1] = 0;\r\n\r\n while(gameBoard.tilePlayer(choice[0], choice[1]) != validTarget )\r\n //REPROMPT FOR CHOICE\r\n\r\n gameBoard.getTile(choice[0], choice[1]).addEffect(playedCard.getEffect()); \r\n }\r\n if(target == 'A') //ADJACENT\r\n {\r\n ArrayList<Tile> adj = gameBoard.getAdjacent(row, col);\r\n \r\n for(int i = 0; i < adj.size(); i++)\r\n adj.get(i).addEffect(playedCard.getEffect());\r\n }\r\n if(target == 'N')\r\n {\r\n ArrayList<Tile> nonadj = gameBoard.getNonAdjacent(row, col);\r\n\r\n for(int i = 0; i < nonadj.size(); i++)\r\n nonadj.get(i).addEffect(playedCard.getEffect());\r\n }\r\n break;\r\n case '*':\r\n if(target == 'X') //ANY\r\n {\r\n choice[0] = 0; //PLACEHOLDER, ASK USER FOR TARGET\r\n choice[1] = 0;\r\n \r\n while(gameBoard.tilePlayer(choice[0], choice[1]) != -1)\r\n //REPROMPT FOR CHOICE\r\n \r\n gameBoard.getTile(choice[0], choice[1]).addEffect(playedCard.getEffect()); \r\n }\r\n if(target == 'O') //OPPONENT\r\n {\r\n if(playerTurn == 0)\r\n validTarget = 1;\r\n else\r\n validTarget = 0;\r\n\r\n choice[0] = 0; //PLACEHOLDER, ASK USER FOR TARGET\r\n choice[1] = 0;\r\n\r\n while(gameBoard.tilePlayer(choice[0], choice[1]) != validTarget )\r\n //REPROMPT FOR CHOICE\r\n\r\n gameBoard.getTile(choice[0], choice[1]).addEffect(playedCard.getEffect()); \r\n }\r\n if(target == 'A') //ADJACENT\r\n {\r\n ArrayList<Tile> adj = gameBoard.getAdjacent(row, col);\r\n \r\n for(int i = 0; i < adj.size(); i++)\r\n adj.get(i).addEffect(playedCard.getEffect());\r\n }\r\n if(target == 'N')\r\n {\r\n ArrayList<Tile> nonadj = gameBoard.getNonAdjacent(row, col);\r\n\r\n for(int i = 0; i < nonadj.size(); i++)\r\n nonadj.get(i).addEffect(playedCard.getEffect());\r\n }\r\n break;\r\n }\r\n }",
"private Hand getStraight(Hand handToCheck){\n\t\tHand hand = new FiveCardHand(handToCheck); //Make copy of the object so original doesn't get modified\n\t\tlog.debug(\"getStraight(hand = \"+hand+\")\");\n\t\tif(hand == null){\n\t\t\tlog.debug(\"Hand was null. Returning null\");\n\t\t\treturn null;\n\t\t}\n\t\tArrayList<Card> cards = hand.getCards();\n\t\tif(cards == null){\n\t\t\tlog.debug(\"The ArrayList<Card> inside the Hand Object was NULL. Returning null\");\n\t\t\treturn null;\n\t\t}\n\t\tlog.trace(\"Number of cards in Hand: \"+cards.size());\n\t\tSet<CardNumber> set = new HashSet<CardNumber>(hand.getNumberValues());\n\t\tif(set.size()<5){\n\t\t\tlog.debug(\"Only \"+set.size()+\" unique numbers\");\n\t\t\treturn null;\n\t\t}\n\t\tList<CardNumber> sorted = CollectionHelper.asSortedList(set);\n\t\tlog.debug(\"Sorted Size = \"+sorted.size());\n\t\tHand numberInSequence = new FiveCardHand();\n\t\tif(sorted.size()>1){\n\t\t\t//Inch worm a long, adding hands as this will handle more than 5 cards\n\t\t\tnumberInSequence.addHand(hand.getSubHandHavingNumber(sorted.get(0)));\n\t\t\tfor(int i=1; i<sorted.size();i++){\n\t\t\t\tif(CardUtil.areCardNumbersSequential(sorted.get(i-1),sorted.get(i))){\n\t\t\t\t\tnumberInSequence.addHand(hand.getSubHandHavingNumber(sorted.get(i)));\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tnumberInSequence = hand.getSubHandHavingNumber(sorted.get(i));\n\t\t\t\t}\n\t\t\t}\n\t\t\t //Check wrap around, (example: Ace)\n\t\t\tCardNumber start = sorted.get(0);\n\t\t\tCardNumber end = sorted.get(sorted.size()-1);\n\t\t\tlog.debug(\"Checking wrap around case, if \"+start+\" and \"\n\t\t\t\t\t+end+\" are sequential\");\n\t\t\tif(CardUtil.areCardNumbersSequential(start,end)){\n\t\t\t\tlog.debug(\"Wrap around Ace in play\");\n\t\t\t\t//Add the Ace\n\t\t\t\tnumberInSequence.addHand(hand.getSubHandHavingNumber(sorted.get(0)));\n\t\t\t}\n\t\t}\n\t\tlog.debug(\"Number of cards in sequence: \"+numberInSequence.getCards().size());\n\t\tif(numberInSequence.getCards().size()>4){\n\t\t\treturn numberInSequence;\n\t\t}\n\t\treturn null;\n\t}",
"public void hinduShuffle()\r\n {\r\n List<Card> cut = new ArrayList<Card>();\r\n List<Card> cut2 = new ArrayList<Card>();\r\n List<Card> shuffledDeck = new ArrayList<Card>();\r\n int cutPoint = 0;\r\n int cutPoint2 = 0;\r\n for (int x = 0; x < SHUFFLE_COUNT; x++) {\r\n cutPoint = rand.nextInt( cards.size()-1 );\r\n cutPoint2 = rand.nextInt( cards.size() - cutPoint ) + cutPoint;\r\n for (int i = 0; i < cutPoint; i++) {\r\n cut.add(draw());\r\n }\r\n for (int i = cutPoint2; i < cards.size(); i++) {\r\n cut2.add(draw());\r\n }\r\n for (int i = 0; i < cut.size(); i++) {\r\n shuffledDeck.add(cut.remove(0));\r\n }\r\n for (int i = 0; i < cards.size(); i++) {\r\n shuffledDeck.add(cards.remove(0));\r\n }\r\n for (int i = 0; i < cut2.size(); i++) {\r\n shuffledDeck.add(cut2.remove(0));\r\n }\r\n cut = cards;\r\n cut.clear();\r\n cut2.clear();\r\n cards = shuffledDeck;\r\n }\r\n }",
"public void discardToDeck() {\n\t\tfor(int i=discardPile.size(); i>0; i--) {\n\t\t deck.add(discardPile.remove(0));\n\t\t}\n\t\tCollections.shuffle(deck);\n\t}",
"private Colors ingameColor() {\n\t\tList<Colors> colors = new ArrayList<Colors>();\n\t\tIterator<Sphere> it = this.spheres.iterator();\n\t\twhile (it.hasNext()) {\n\t\t\tSphere s = it.next();\n\t\t\tif (!colors.contains(s.color())) {\n\t\t\t\tcolors.add(s.color());\n\t\t\t}\n\t\t}\n\t\treturn colors.get(MathUtils.random(colors.size() - 1));\n\t}",
"private void checkHighCard(Player player) {\n\t\tplayer.setHandRank(HandRank.HIGH_CARD);\n\n\t\tfor (int i = 0, j = 6; i < hand.length; i++, j--)\n\t\t\thand[i] = player.getSevenCardsTempHand().get(j);\n\n\t\tplayer.setFiveCardsHand(hand);\n\t}",
"@Test(expected = TooManyDiscardsException.class)\n public void allow_discard_no_more_than_2_cards(){\n\n Deck deck = new Deck();\n Card card1 = new Card(3,2,5);\n Card card2 = new Card(2,7,1);\n Card card3 = new Card(2,7,1);\n deck.add(card1);\n deck.add(card2);\n deck.add(card3);\n Game game = new Game(deck);\n\n game.join(\"susan\");\n game.join(\"peter\");\n\n Card pickedCard1 = game.pickCard(\"susan\");\n game.discard(\"susan\");\n Card pickedCard2 = game.pickCard(\"susan\");\n game.discard(\"susan\");\n Card pickedCard3 = game.pickCard(\"susan\");\n game.discard(\"susan\");\n\n }",
"public void RemoveCardFromHuman(int value){\n handHuman.remove(value);\n }",
"@Test\n public void blackOnBarGettingBack() {\n\n game.move(Location.R1, Location.R3);\n game.move(Location.R3, Location.R4);\n game.nextTurn();\n assertTrue(game.move(Location.R6, Location.R4));\n assertEquals(1, game.getCount(Location.B_BAR));\n assertEquals(Color.RED, game.getColor(Location.R4));\n\n assertTrue(game.move(Location.R6, Location.R5));\n game.nextTurn();\n assertFalse(game.move(Location.R1, Location.R2));\n assertTrue(game.move(Location.B_BAR, Location.R3));\n assertTrue(game.move(Location.R1, Location.R5));\n }",
"@Test\n public void testNextCardGood() {\n System.out.println(\"nextCardGood\");\n Deck deck = new Deck();\n Card card = deck.nextCard();\n ////since the deck is unshuffled, that last card should be WILDCARD\n assertEquals(CardType.WILDCARD, card.getValue());\n }",
"@Test\n void negativeQuality() {\n Item[] items = new Item[]{new Item(\"noValue\", 2, 0)};\n GildedRose app = new GildedRose(items);\n app.updateQuality();\n\n assertEquals(0, app.items[0].quality, \"Quality shouldn't drop below 0\");\n }",
"public boolean blackCheck() {\n\t\treturn false;\n\t}",
"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}",
"@Test\n public void discardDrawFour() {\n this.reset();\n this.bps.startGame(this.fullDeck, false, 7, 3);\n assertEquals(this.drawCards, this.bps.getDrawCards());\n this.bps.discardDraw(0);\n assertNotEquals(this.drawCards, this.bps.getDrawCards());\n\n this.reset();\n this.bps.startGame(this.fullDeck, false, 7, 1);\n this.bps.discardDraw(0);\n ArrayList<Card> draw = new ArrayList<>();\n draw.add(h4);\n assertEquals(draw, this.bps.getDrawCards());\n }",
"private void reduce(int amount){\n while(colours.size() > amount){\n rgb curColour = colours.get(colours.size() - 1);\n double closest = -1;\n int id = -1;\n boolean notChanged = true;\n\n for(int i = 0; i < colours.size() - 1; i++){\n double dist = getDist(colours.get(i), curColour);\n if(dist < 0){\n colours.get(i).anotherFew(curColour.getAmount());\n notChanged = false;\n break;\n }else if(closest == -1 || dist < closest){\n closest = dist;\n id = i;\n }\n }\n if(notChanged){\n colours.get(id).anotherFew(curColour.getAmount());\n }\n colours.remove(colours.size() - 1);\n reinsert(id);\n }\n }",
"public void aceChanger() {\n\t\t// Two aces in hand before move has been made\n\t\tif (hand.numOfCards() == 2 && isBusted()) {\n\t\t\thandIterator = new HandIterator(hand.getCards());\n\t\t\tCard c = hand.getCards().get(0);\n\t\t\tCard newAce = new Card(1, \"A\", c.getCardSuit());\n\t\t\thand.addCard(newAce);\n\t\t\thand.remove(c);\n\t\t// Ace in hand and set to 11, and hand has busted\n\t\t} else if (checkForAce() && isBusted() && hand.numOfCards() > 2) {\n\t\t\thandIterator = new HandIterator(hand.getCards());\n\t\t\twhile (handIterator.hasNext()) {\n\t\t\t\tCard c = (Card) handIterator.next();\n\t\t\t\tif (c.getCardValue() == 11) {\n\t\t\t\t\thand.addCard(new Card(1, \"A\", c.getCardSuit()));\n\t\t\t\t\thand.remove(c);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t// Ace in hand and total hand value is < 21\n//\t\t} else if (checkForAce() && !isBusted()) {\n//\t\t\tprintHand();\n//\t\t\tif (hand.numOfAces() == 1) {\n//\t\t\t\thandIterator = new HandIterator(hand.getCards());\n//\t\t\t\tSystem.out.println(\"You have an Ace card in your hand. Do you \"\n//\t\t\t\t\t\t+ \"want to set the value to 1 or 11?\");\n//\t\t\t\tint ans = scan.nextInt();\n//\t\t\t\twhile (handIterator.hasNext()) {\n//\t\t\t\t\tCard c = (Card) handIterator.next();\n//\t\t\t\t\tif (c.getCardName().equals(\"A\")) {\n//\t\t\t\t\t\twhile (ans != 1 && ans != 11) {\n//\t\t\t\t\t\t\tSystem.out.println(\"Invalid input. Try again.\");\n//\t\t\t\t\t\t\tans = scan.nextInt();\n//\t\t\t\t\t\t}\n//\t\t\t\t\t\thand.addCard(new Card(ans, \"A\", c.getCardSuit()));\n//\t\t\t\t\t\thand.remove(c);\n//\t\t\t\t\t\treturn;\n//\t\t\t\t\t}\n//\t\t\t\t}\n//\t\t\t} else {\n//\t\t\t\thandIterator = new HandIterator(hand.getCards());\n//\t\t\t\tSystem.out.println(\"You have multiple Ace cards in your hand.\"\n//\t\t\t\t\t\t+ \" Which card do you want to set the value for?\"\n//\t\t\t\t\t\t+ \" (Select by appropriate card suit.) Type exit to\"\n//\t\t\t\t\t\t+ \" make no changes.\");\n//\t\t\t\tString suit = scan.next();\n//\t\t\t\tif (suit.equalsIgnoreCase(\"exit\")) {\n//\t\t\t\t\treturn;\n//\t\t\t\t}\n//\t\t\t\twhile (handIterator.hasNext()) {\n//\t\t\t\t\tCard c = (Card) handIterator.next();\n//\t\t\t\t\tif (c.getCardName().equals(\"A\") && \n//\t\t\t\t\t\t\tc.getCardSuit().equalsIgnoreCase(suit)) {\n//\t\t\t\t\t\tSystem.out.println(\"Do you want to set the value to 1\"\n//\t\t\t\t\t\t\t\t+ \" or 11?\");\n//\t\t\t\t\t\tint ans = scan.nextInt();\n//\t\t\t\t\t\thand.addCard(new Card(ans, \"A\", c.getCardSuit()));\n//\t\t\t\t\t\thand.remove(c);\n//\t\t\t\t\t\treturn;\n//\t\t\t\t\t}\n//\t\t\t\t}\n//\t\t\t}\n\t\t}\n\t}",
"public boolean play(DiscardPile discardPile, \n\t Stack<Card> drawPile, \n\t\t\t\t\t\t\t\t\t\t\tArrayList<Player> players)\n\t{\t\n\t\n\t\n\tSystem.out.println(\"Before playing: \" + this.hand.toString());\n\t\tboolean temp = false;\n\t\tString suitEight = \"xyz\";\n\t\n\t\tif ((discardPile.top()).getRank() == 4 && super.checker_4 == true){\n\t\t\tSystem.out.println();\n\t\t\tSystem.out.println(\"\\t _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \");\n\t\t\tSystem.out.println(\"\\t | skipping the turn.. :( |\");\n\t\t\tSystem.out.println(\"\\t -----------------------------\");\n\t\t\tSystem.out.println();\n\t\t\tSystem.out.println();\n\t\t\tsuper.checker_4 = false;\n\t\t\treturn false;\n\t\t\t\n\t\t\t}\n\t\n\t\n\t\n\t\n\t\n\t\n\t\t/* adding two cards */\n\t\t if ((discardPile.top()).getRank() == 2 && super.checker_2 == true){\n\t\t\t \n\t\t\t System.out.println();\n\t\t\t System.out.println(\"\\t _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \");\n\t\t\t System.out.println(\"\\t | twice the value added! |\");\n\t\t\t System.out.println(\"\\t -----------------------------\");\n\t\t\t System.out.println();\n\t\t\t System.out.println();\n\t\t\t \n\t\t\t \n\t\t\tthis.hand.add(drawPile.pop());\n\t\t\t this.hand.add(drawPile.pop());\n\t\t\ttemp = false;\n\t\t\tsuper.checker_2 = false;\n\t\t }\n\t\t\n\t\t\n\t\t \n\t\t\n\t\telse{\n\t\t\tint i = location_1(discardPile);\n\t\t\t\n\t\t\t\n\t\t\tif(i == -1){\n\t\t\t\tthis.hand.add(drawPile.pop());\n\t\t\t\tif( i == location_2(discardPile)){ \n\t\t\t\t\t//System.out.println(\"value is added!\");\n\t\t\t\t\t//System.out.println();\n\t\t\t\t\t//System.out.println();\n\t\t\t\t\n\t\t\t\t} else{\n\t\t\t\t\ti = location_2(discardPile);\n\t\t\t\t\t//System.out.println(\"HAHA! got it!\");\n\t\t\t\t\tdiscardPile.add(this.hand.remove(i));\n\t\t\t\t\ttemp = false;\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tif ((discardPile.top()).getRank() == 2 && super.checker_2 == false){\n\t\t\t\t\t\tsuper.checker_2 = true;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(discardPile.top().getRank() == 4 && super.checker_4 == false){\n\t\t\t\t\t\tsuper.checker_4 = true;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif ((discardPile.top()).getRank() == 8 && temp == false){\n\t\t\t\t\t\tsuitEight = this.wildEight(discardPile, drawPile, players);\n\t\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t\tSystem.out.println(\"\\t \\t ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\");\n\t\t\t\t\t\tSystem.out.println(\"\\t \\t \\t Changing the suit to: \" + suitEight);\n\t\t\t\t\t\tSystem.out.print(\"\\t \\t \\t Processing....\");\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\tSystem.out.println();\n\t\t\t\t\t\t(discardPile.top()).setSuit(suitEight);\n\t\t\t\t\t\tSystem.out.println(\"\\t \\t \\t draw pile : \" + drawPile.peek() );\n\t\t\t\t\t\tSystem.out.println(\"\\t \\t \\t discard pile : \" + discardPile.top() );\n\t\t\t\t\t\tSystem.out.println(\"\\t \\t ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\");\n\t\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tif( this.hand.size() == 0 ){\n\t\t\t\t\ttemp = true;\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\t\n\t\t\t} else{\n\t\t\t\tdiscardPile.add(this.hand.remove(i));\n\t\t\t\ttemp = false;\n\t\t\t\t\n\t\t\t\tif ((discardPile.top()).getRank() == 2 && super.checker_2 == false){\n\t\t\t\t\t\tsuper.checker_2 = true;\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(discardPile.top().getRank() == 4 && super.checker_4 == false){\n\t\t\t\t\tsuper.checker_4 = true;\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ((discardPile.top()).getRank() == 8 && temp == false){\n\t\t\t\t\t\tsuitEight = this.wildEight(discardPile, drawPile, players);\n\t\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t\tSystem.out.println(\"\\t \\t ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\");\n\t\t\t\t\t\tSystem.out.println(\"\\t \\t \\t Changing the suit to: \" + suitEight);\n\t\t\t\t\t\tSystem.out.print(\"\\t \\t \\t Processing....\");\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\tSystem.out.println();\n\t\t\t\t\t\t(discardPile.top()).setSuit(suitEight);\n\t\t\t\t\t\tSystem.out.println(\"\\t \\t \\t draw pile : \" + drawPile.peek() );\n\t\t\t\t\t\tSystem.out.println(\"\\t \\t \\t discard pile : \" + discardPile.top() );\n\t\t\t\t\t\tSystem.out.println(\"\\t \\t ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\");\n\t\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t\tSystem.out.println();\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\tif( this.hand.size() == 0 ){\n\t\t\t\t\ttemp = true;\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\n\n\t\t\n\t\t\n\t\n\t\tSystem.out.println(\"After Playing: \" + this.hand.toString());\n\t\tSystem.out.println();\n\t\treturn temp;\n\t\t\n\t\n\t}",
"private int demDoiThong(List<Card> bai) {\n List<Card> cards = new ArrayList<>() ;\n int max = 0;\n int count = 0;\n for (int i = 0; i < bai.size() - 1; i++) {\n if (bai.get(i).getId() >= 48) {\n break;\n }\n if (count == 0 && bai.get(i).getCardNumber() == bai.get(i + 1).getCardNumber()) {\n count = 1;\n if (cards.isEmpty()) {\n cards.add(bai.get(i));\n cards.add(bai.get(i + 1));\n }\n } else {\n if (count % 2 != 0) {\n if (bai.get(i).getCardNumber()== bai.get(i + 1).getCardNumber() - 1) {\n count++;\n } else if (bai.get(i).getCardNumber()!= bai.get(i + 1).getCardNumber()) {\n // valid = false;\n if (count > max) {\n max = count;\n }\n if(cards.size()<6){\n cards.clear();\n }\n count = 0;\n }\n } else {\n if (bai.get(i).getCardNumber()== bai.get(i + 1).getCardNumber()) {\n if(!cards.contains(bai.get(i))){\n cards.add(bai.get(i));\n }\n if(!cards.contains(bai.get(i+1))){\n cards.add(bai.get(i+1));\n }\n count++;\n } else {\n // valid = false;\n if (count > max) {\n max = count;\n }\n if(cards.size()<6){\n cards.clear();\n }\n count = 0;\n }\n }\n }\n }\n if (count > max) {\n max = count;\n }\n if (max >= 5) {\n this.specialCards.addAll(cards);\n }\n return (max + 1) / 2;\n }",
"public void cards() {\n\t\t\n\n\t\tboolean[] randomCards = new boolean[52];\n\n\t\t// choose 4 random distinct cards from the deck\n\t\tint count = 0;\n\t\tint card1 = 0;\n\t\tint card2 = 0;\n\t\tint card3 = 0;\n\t\tint card4 = 0;\n\n\t\twhile (count < 4) {// Display only four cards\n\n\t\t\tcard1 = ((int) (Math.random() * 12) + 1) + 1;// Ignore zero\n\t\t\tcard2 = ((int) (Math.random() * 12) + 1) + 1;// Ignore zero\n\t\t\tcard3 = ((int) (Math.random() * 12) + 1) + 1;// Ignore zero\n\t\t\tcard4 = ((int) (Math.random() * 12) + 1) + 1;// Ignore zero\n\n\t\t\tif ((randomCards[card1] = !randomCards[card2]) && (randomCards[card1] = !randomCards[card3])\n\t\t\t\t\t&& (randomCards[card1] = !randomCards[card4]) && (randomCards[card2] = !randomCards[card3])\n\t\t\t\t\t&& (randomCards[card2] = !randomCards[card4]) && (randomCards[card3] = !randomCards[card4])) {\n\n\t\t\t\tString[] cards = { \"clubs\", \"diamonds\", \"hearts\", \"spades\" };\n\n\t\t\t\tString name1 = cards[(int) (Math.random() * cards.length)];\n\t\t\t\tString name2 = cards[(int) (Math.random() * cards.length)];\n\t\t\t\tString name3 = cards[(int) (Math.random() * cards.length)];\n\t\t\t\tString name4 = cards[(int) (Math.random() * cards.length)];\n\n\t\t\t\tImage image1 = new Image(\"png/\" + (card1) + \"_of_\" + name1 + \".png\");\n\t\t\t\tImage image2 = new Image(\"png/\" + (card2) + \"_of_\" + name2 + \".png\");\n\t\t\t\tImage image3 = new Image(\"png/\" + (card3) + \"_of_\" + name3 + \".png\");\n\t\t\t\tImage image4 = new Image(\"png/\" + (card4) + \"_of_\" + name4 + \".png\");\n\n\t\t\t\timgCard1.setImage(image1);\n\t\t\t\timgCard2.setImage(image2);\n\t\t\t\timgCard3.setImage(image3);\n\t\t\t\timgCard4.setImage(image4);\n\n\t\t\t\tcount++;\n\n\t\t\t}\n\n\t\t}\n\n\t\tString cardOneValue = Integer.toString(card1);\n\t\tString cardTwoValue = Integer.toString(card2);\n\t\tString cardThreeValue = Integer.toString(card3);\n\t\tString cardFourValue = Integer.toString(card4);\n\t\tSystem.out.println(cardOneValue + \" - \" + cardTwoValue + \" - \" + cardThreeValue + \" - \" + cardFourValue);\n\t\tsetText.setText(cardOneValue +\" \"+ cardTwoValue +\" \"+ cardThreeValue +\" \"+ cardFourValue);\n\t\t\n\t\tint solution = 0; \n\t\tif(solution!=24) {\n\t\tfor(int limit = 0; limit < 25; limit++) {\n\t\t\n\t\t\t\tSystem.out.println(\"No\");\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(solution);\n\t\t\n\t}",
"@Test\n\tpublic void kingNotOnThroneBlackPieceDownWhiteCapture()\n\t{\n\t\tData d=new Data();\n\t\td.set(11,76);\n\t\td.set(9,68);\n\t\td.set(10,69);\n\t\td.set(0,75);\n\t\td.set(12,84);\n\t\td.set(31,72);\n\t\td.set(12,83);\n\t\tArrayList<Coordinate> test_arr=d.pieceLost(83);\n\t\tassertTrue(5==test_arr.get(0).getX() && 6==test_arr.get(0).getY());\n\t}",
"private void shuffleOnceRandom(){\n\t\t//You need to have a copy of the deck before you shuffled it so you can reference\n\t\t//It when you are trying to replace the new values\n\t\tList<Card> beforeShuffle = ourDeck.makeCopy().getCurrentDeck();\n\t\t//The topIndex tells us where we are in reference to the top half of the deck\n\t\t//Same with bottom this helps us reference the original deck to get whatever\n\t\t//Card we need and the deckIndex helps us put it in the correct spot\n\t\tint topIndex = 0, bottomIndex = ourDeck.getSize() / 2, deckIndex = 0;\n\t\t//These ints help us keep track of how many cards are left in each half\n\t\tint remainingTop = ourDeck.getSize() / 2, remainingBot = ourDeck.getSize() / 2;\n\t\tboolean shouldLoop = true;\n\t\t//This is the shuffling loop\n\t\twhile(shouldLoop){\n\t\t\t//This means the number coming from the specific deck which in this method is random\n\t\t\tint numTop = generator.nextInt(RAND_BOUND), numBot = generator.nextInt(RAND_BOUND);\n\t\t\t//After we determine the random number of cards we're using we have to do some checks\n\t\t\t//This means we wanted more than there was less therefore the stack is out\n\t\t\t//This is the stopping condition for the loop\n\t\t\tif(numTop >= remainingTop){\n\t\t\t\tnumTop = remainingTop;\n\t\t\t\tnumBot = remainingBot;\n\t\t\t\tshouldLoop = false;\n\t\t\t}\n\t\t\t\t\n\t\t\tif(numBot >= remainingBot){\n\t\t\t\tnumTop = remainingTop;\n\t\t\t\tnumBot = remainingBot;\n\t\t\t\tshouldLoop = false;\n\t\t\t}\n\t\t\t//This is where I replace the newCard into ourDeck\n\t\t\t//I iterate for the number of times we take from the top or bottom\n\t\t\tfor(int i = 1; i <= numTop; i++){\t\n\t\t\t\tCard newCard = beforeShuffle.get(topIndex);\t//I get the card we want to move\n\t\t\t\tourDeck.setCard(newCard, deckIndex);\t\t//Then I move it to the new deckIndex\n\t\t\t\ttopIndex++;\tdeckIndex++;\n\t\t\t}\n\t\t\tfor(int i = 1; i <= numBot; i++){\n\t\t\t\tCard newCard = beforeShuffle.get(bottomIndex);\n\t\t\t\tourDeck.setCard(newCard, deckIndex);\n\t\t\t\tbottomIndex++;\tdeckIndex++;\n\t\t\t}\n\t\t\tremainingTop = remainingTop - numTop;\n\t\t\tremainingBot = remainingBot - numBot;\n\t\t}\n\t}",
"void countCut() {\t\t\n\t\tint value = deckRear.cardValue;\n\t\tint i =0;\n\t\tCardNode prior = null;\n\t\tCardNode pointer = deckRear;\n\n\n\t\tif(deckRear.cardValue != 28 && deckRear.cardValue != 27){\n\t\t\twhile(i< value){\n\t\t\t\tpointer = pointer.next;\n\t\t\t\tprior = pointer.next;\n\t\t\t\ti++;\n\t\t\t}\n\n\t\t\t//finding the value of the second to last card\n\t\t\tint j =0;\n\t\t\tCardNode pointer2= deckRear;\n\t\t\twhile(j < 27){\n\t\t\t\tpointer2 = pointer2.next; \n\t\t\t\tj++;\n\t\t\t}\n\n\t\t\tCardNode temp = deckRear.next;\n\t\t\tdeckRear.next = prior;\n\t\t\tpointer2.next = temp;\n\t\t\tpointer.next = deckRear;\n\t\t}\t\n\t\tSystem.out.println(\"countcut\");\n\t\tprintList(deckRear);\n\t}",
"boolean similarColorTo(Card c);",
"@Test\r\n public void testPlayer_getBoldStrategyCard_higherLast_wild_wd4() {\n player2 = new Player(\"Player Two\", true);\r\n Hand hand = new Hand();\r\n player2.setHand(hand.getAllCards());\r\n player2.getHand().addCard(wild);\r\n assertTrue(player2.getBoldStrategyCard(yellowThree, yellowThree.getColor()).equals(wild));\r\n\r\n player2.getHand().discard(wild);\r\n player2.getHand().addCard(wildDrawFour);\r\n assertTrue(player2.getBoldStrategyCard(yellowThree, yellowThree.getColor()).equals(wildDrawFour));\r\n }",
"private static short eval_5cards(int[] hand)\n {\n int q = (hand[0] | hand[1] | hand[2] | hand[3] | hand[4]) >> 16;\n\n // This checks for any kind of Flushes\n if ((hand[0] & hand[1] & hand[2] & hand[3] & hand[4] & 0xf000) != 0)\n return flushes.get(q);\n\n // This checks for Straights and High Card hands\n if ( unique5.get(q) != 0)\n return unique5.get(q);\n\n // This performs a perfect-hash lookup for remaining possible hands\n long q1 = (hand[0] & 0xff) * (hand[1] & 0xff) * (hand[2] & 0xff) * (hand[3] & 0xff) * (hand[4] & 0xff);\n return hash_values.get((int)find_fast(q1));\n }",
"@Test\n\tpublic void kingNotOnThroneWhitePieceUpBlackCapture()\n\t{\n\t\tData d=new Data();\n\t\td.set(8,36);\n\t\td.set(6,28);\n\t\td.set(0,43);\n\t\td.set(18,19);\n\t\td.set(5,50);\n\t\td.set(13,39);\n\t\tArrayList<Coordinate> test_arr=d.pieceLost(39);\n\t\tassertTrue(5==test_arr.get(0).getX() && 4==test_arr.get(0).getY());\n\t}",
"public int[] hasNSequentially(int lengthOfHand) {//check for Ace case //need to NOT ALLOW DUPLICATES\n ArrayList<Card> handList = new ArrayList<Card>();\n int solution[] = {0, 0};//number in a row, lowest number of that\n boolean foundSomeNInAFow = false;\n int hasAce = 0;\n\n int usedNumbers[] = new int[13];//2,3,4,5,6,7,8,9,10,j,q,k,a --> THIS HANDLES THE ACE CASE\n for (int i = 0; i < lengthOfHand; i++) {//was\n usedNumbers[allCards[i].value - 2]++;//USED\n if (usedNumbers[allCards[i].value - 2] == 1) {//handles NOT having doubles of numbers like 2 3 4 4 5 \n handList.add(this.allCards[i]);\n if (this.allCards[i].value == 14) {\n Card c = new Card(1, this.allCards[i].suit);\n handList.add(0, c);//add to front..shifts elements to right\n }\n }\n }\n\n for (int i = 0; i < handList.size() - 4; i++) {//check for 5 in a row, //was - 4\n int val = handList.get(i).value;\n int counter = 0;\n for (int j = 0; j < 4; j++) {//was 4\n if (handList.get(j + i + 1).value == val + 1 + j) {\n counter++;\n } else {\n break;\n }\n if (counter == 4) {//was 4\n foundSomeNInAFow = true;\n solution[0] = 5;\n solution[1] = val;\n }\n }\n }\n\n if (foundSomeNInAFow == false) {\n for (int i = 0; i < handList.size() - 3; i++) {//check for 5 in a row, //was - 4\n int val = handList.get(i).value;\n int counter = 0;\n for (int j = 0; j < 3; j++) {\n if (handList.get(j + i + 1).value == val + 1 + j) {\n counter++;\n } else {\n break;\n }\n if (counter == 3) {\n // System.out.println(\"yes 4 sequentially\");\n foundSomeNInAFow = true;\n solution[0] = 4;\n solution[1] = val;\n }\n }\n }\n }\n\n if (foundSomeNInAFow == false) {\n for (int i = 0; i < handList.size() - 2; i++) {//check for 5 in a row, //was - 4\n int val = handList.get(i).value;\n int counter = 0;\n for (int j = 0; j < 2; j++) {\n if (handList.get(j + i + 1).value == val + 1 + j) {\n counter++;\n } else {\n break;\n }\n if (counter == 2) {\n // System.out.println(\"yes 3 sequentially\");\n foundSomeNInAFow = true;\n solution[0] = 3;\n solution[1] = val;\n }\n }\n }\n }\n\n if (foundSomeNInAFow == false) {\n for (int i = 0; i < handList.size() - 1; i++) {//check for 5 in a row, //was - 4\n int val = handList.get(i).value;\n int counter = 0;\n for (int j = 0; j < 1; j++) {\n if (handList.get(j + i + 1).value == val + 1 + j) {\n counter++;\n } else {\n break;\n }\n if (counter == 1) {\n //System.out.println(\"yes 2 sequentially\");\n foundSomeNInAFow = true;\n solution[0] = 2;\n solution[1] = val;\n\n }\n }\n }\n }\n\n return solution;//return at end that way if there is 2,3,5,7,8 it returns 7 8 not 2 3\n\n }",
"public void endTurn() {\r\n\t\tint num = this.hand.size();\r\n\t\tfor (int i = 0; i < num; i++) {\r\n\t\t\tthis.discard.add(this.hand.remove(0));\r\n\t\t}\r\n\t\tint gemHeight = (int) this.totalGemValue() / 3;\r\n\t\tthis.drawFromBag(5 + gemHeight);\r\n\t}",
"void tripleCut() {\n\t\tCardNode prev = null;\n\t\tCardNode pointer = deckRear.next; \n\n\n\t\twhile((pointer.cardValue != 27)&& (pointer.cardValue != 28) ){\n\t\t\tprev = pointer;\n\t\t\tpointer = pointer.next; \n\t\t}\n\n\n\t\tint target = 0;\n\t\tif(pointer.cardValue == 27){\n\t\t\ttarget = 28;\n\t\t}else{\n\t\t\ttarget= 27;\n\t\t}\n\n\t\tCardNode prior = null;\n\t\tCardNode pointer2 = deckRear; \n\n\t\twhile(pointer2.cardValue != target){\n\t\t\tprior = pointer2;\n\t\t\tpointer2= pointer2.next;\n\t\t} \n\n\t\tint head = deckRear.next.cardValue;\n\t\tint rear = deckRear.cardValue;\n\n\n\t\t//if head is joker and rear is not\n\t\tif((rear != 27 || rear!=28) && (head==27 || head==28)){\n\t\t\tCardNode temp = deckRear;\n\t\t\tdeckRear = pointer2;\n\t\t\tdeckRear.next= pointer2.next;\n\t\t\ttemp.next=pointer;\n\t\t\tprior.next=deckRear;\n\t\t}\n\t\tif((rear == 27 || rear==28) && (head!=27 || head!=28)){\n\t\t\tCardNode temp= deckRear.next;\n\t\t\tdeckRear= prev;\n\t\t\tdeckRear.next=pointer;\n\t\t\tpointer2.next=temp;\t\n\t\t}\n\t\tif(rear != 27 && rear!=28){\n\t\t\tif(head!=27 && head!=28){\n\t\t\t\tCardNode temp= deckRear;\n\t\t\t\tCardNode temp2 = deckRear.next;\n\t\t\t\tdeckRear=prev;\n\t\t\t\tdeckRear.next=pointer2.next;\n\t\t\t\ttemp.next=pointer;\n\t\t\t\tpointer2.next=temp2;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"triplecut\");\n\t\tprintList(deckRear);\n\n\t}",
"void refillCards() {\n if (this.gameDeck.isEmpty() && !this.wonDeck.isEmpty()) {\n this.wonDeck.shufffle();\n Deck temp = this.gameDeck;\n this.gameDeck = this.wonDeck;\n this.wonDeck = temp;\n\n }\n\n }",
"public void discardAll()\n\t{\n\t\thand = new Card[12];\n\t\tnumCards = 0;\n\t}",
"public static void hitCorrect()\n\t{\n\t\tplayersCards.add(deck.deal());\n\t\tcurrentValue();\n\t\tuserCardImg[playersCards.size()-1].setIcon(new ImageIcon(Gameplay.class.getResource(getCard(playersCards.get(playersCards.size()-1)))));\n\t\tresume();\n\t\tif(calculateHand(playersCards)>21 || playersCards.size()==4 || calculateHand(playersCards)==0)\n\t\t{\n\t\t\troundEnd();\n\t\t}\n\t\t\n\t}",
"@Test\n\tpublic void kingNotOnThroneWhitePieceRightBlackCapture()\n\t{\n\t\tData d=new Data();\n\t\td.set(11,106);\n\t\td.set(4,96);\n\t\td.set(3,64);\n\t\td.set(0,85);\n\t\td.set(7,53);\n\t\td.set(16,62);\n\t\td.set(3,63);\n\t\tArrayList<Coordinate> test_arr=d.pieceLost(63);\n\t\tassertTrue(6==test_arr.get(0).getX() && 5==test_arr.get(0).getY());\n\t}",
"private void initializeDeck() {\n drawPile.clear();\n\n for (ICard.Color color : ICard.Color.values()) {\n // Numbered cards\n drawPile.add(new NumberedCard(color, 0));\n for (int value = 1; value < 10; value++) {\n drawPile.add(new NumberedCard(color, value));\n drawPile.add(new NumberedCard(color, value));\n }\n\n // Special cards\n drawPile.add(new SkipCard(color));\n drawPile.add(new SkipCard(color));\n\n drawPile.add(new ReverseCard(color));\n drawPile.add(new ReverseCard(color));\n\n drawPile.add(new DrawTwoCard(color));\n drawPile.add(new DrawTwoCard(color));\n }\n\n for (int i = 0; i < 4; i++) {\n drawPile.add(new WildCard());\n drawPile.add(new WildFourCard());\n }\n }",
"public void useTurn(Card card) {\r\n\t\tif (card.cardColor.contains(CardColor.PURPLE) && this.purpleTurns != 0) {\r\n\t\t\tthis.purpleTurns--;\r\n\t\t} else if (card.cardColor.contains(CardColor.RED) && this.redTurns != 0) {\r\n\t\t\tthis.redTurns--;\r\n\t\t} else if (card.cardColor.contains(CardColor.BLUE)\r\n\t\t\t\t&& this.blueTurns != 0) {\r\n\t\t\tthis.blueTurns--;\r\n\t\t} else if (card.cardColor.contains(CardColor.BROWN)\r\n\t\t\t\t&& this.brownTurns != 0) {\r\n\t\t\tthis.brownTurns--;\r\n\t\t} else\r\n\t\t\tthis.blackTurns--;\r\n\t}",
"@Test\n\tpublic void kingNotOnThroneBlackPieceUpWhiteCapture()\n\t{\n\t\tData d=new Data();\n\t\td.set(8,43);\n\t\td.set(7,54);\n\t\td.set(5,27);\n\t\td.set(6,53);\n\t\td.set(0,42);\n\t\td.set(18,50);\n\t\td.set(5,39);\n\t\tArrayList<Coordinate> test_arr=d.pieceLost(39);\n\t\tassertTrue(5==test_arr.get(0).getX() && 4==test_arr.get(0).getY());\n\t}",
"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 }",
"@Test\n\tpublic void testQualityOver50SellInUnder0() {\n\t\tGildedRose inn = new GildedRose();\n\t\tinn.setItem(new Item(\"Aged Brie\", -11, 51));\n\t\tinn.oneDay();\n\t\t\n\t\t//access a list of items, get the quality of the one set\n\t\tList<Item> items = inn.getItems();\n\t\tint quality = items.get(0).getQuality();\n\t\t\n\t\t//assert quality remains the same\n\t\tassertEquals(\"Quality with quality 0 Brie\", 51, quality);\n\t}",
"public void antiClue(Card c) {\n\t\tnotPossible.add(c);\n\t}",
"public Deck() {\n cards = new LinkedList<Integer>();\n removedCards = new LinkedList<Integer>();\n \n int i, j;\n for (i = MIN_VALUE; i <= MAX_VALUE; i++) {\n for (j = 0; j <= NUM_SUITS; j++) {\n cards.add(i);\n }\n }\n }",
"@Test\n\tpublic void kingNotOnThroneWhitePieceLeftBlackCapture()\n\t{\n\t\tData d=new Data();\n\t\td.set(1,15);\n\t\td.set(5,27);\n\t\td.set(2,80);\n\t\td.set(0,37);\n\t\td.set(24,60);\n\t\td.set(2,59);\n\t\tArrayList<Coordinate> test_arr=d.pieceLost(59);\n\t\tassertTrue(4==test_arr.get(0).getX() && 5==test_arr.get(0).getY());\n\t}",
"public void deal(){\n // deal cards when game is started and game stage is 0\n // need to clear everything\n if(turn == 4){\n turn = 0;\n }\n player1Hand.clear();\n player2Hand.clear();\n player3Hand.clear();\n player4Hand.clear();\n kitty.clear();\n currentMiddle.clear();\n\n /**\n * External Citation\n * Date: 19 September 2019\n * Problem: Did not have a good way to shuffle array\n * Resource: Dr. Tribelhorn, https://www.geeksforgeeks.org/collections-shuffle-java-examples/\n * Solution: Tribelhorn informed us of the shuffle function, and\n * we used the code in this post as a resource\n */\n // shuffle deck\n Collections.shuffle(deck.cardDeck);\n\n // deal cards to each player\n // player 1's hand\n for (int i = 0; i < 5; i++) {\n player1Hand.add(i, deck.cardDeck.get(i));\n player2Hand.add(i, deck.cardDeck.get(5 + i));\n player3Hand.add(i, deck.cardDeck.get(10 + i));\n player4Hand.add(i, deck.cardDeck.get(15 + i));\n }\n\n for (int i = 0; i < 4; i++) {\n kitty.add(i, deck.cardDeck.get(20 + i));\n }\n kittyTop = kitty.get(0);\n middleCard = deck.cardDeck.get(20);\n middleCardSuit = middleCard.getSuit();\n\n // make middle card visible\n middleVisible = true;\n\n // change game state to 1\n gameStage++;\n }",
"public void shuffle() {\n List<Card> shuffledCards = new ArrayList<>(52);\n while (cards.size() > 0) {\n int index = random.nextInt(cards.size());\n shuffledCards.add(cards.remove(index));\n }\n cards = shuffledCards;\n }",
"private PlayingCard chooseCard(HeartsGraphics g){\t\t\n\t\tHearts.setCurrentPlayer(this);\n\t\t\n\t\tif(number != PLAYER_ONE){\n\t\t\t// A.I. code\n\t\t\tint index;\n\t\t\t\n\t\t\tRandom r = new Random();\n\t\t\tindex = r.nextInt(hand.size());\t\t\t\n\t\t\t\n\t\t\treturn hand.get(index);\t\t\t\n\t\t} else {\n\t\t\treturn getCard(g);\n\t\t}\t\t\n\t}",
"public void catchCard(){\r\n changePlace(deck);\r\n changePlace(hand);\r\n }",
"public void RandomizeTheDeck() {\r\n ArrayList<ArrayList<Card>> alalCopy = new ArrayList<>();\r\n int i, iRand;\r\n Random rand = new Random();\r\n \r\n // remove deck to the copy\r\n for( i=0; i<104; i++) {\r\n alalCopy.add( alalSets.get(i) );\r\n }\r\n alalSets.clear();\r\n \r\n // randomly copy them back as copy size gets smaller\r\n for( i=104; i>0; i-- ) {\r\n iRand = (int)rand.nextInt(i);\r\n alalSets.add( alalCopy.remove(iRand) );\r\n }\r\n }",
"public void findBestTwoCardHandName() {\n if (handContainsTheseTwoCards_With_AtLeastOneFromPlayerOriginalHand(14, 'x', 14) == true) {//aces, any suit\n bestHandFromCardsNickNameString = \"Pocket Rockets\";\n } else if (handContainsTheseTwoCards_With_AtLeastOneFromPlayerOriginalHand(13, 'y', 14) == true) {//king, then ace, same suit\n bestHandFromCardsNickNameString = \"Big Slick in a Suit\";\n } else if (handContainsTheseTwoCards_With_AtLeastOneFromPlayerOriginalHand(13, 'x', 14) == true) {\n bestHandFromCardsNickNameString = \"Full Auto\";\n } else if (handContainsTheseTwoCards_With_AtLeastOneFromPlayerOriginalHand(8, 'x', 14) == true) {\n bestHandFromCardsNickNameString = \"Dead Man's Hand\";\n } else if (handContainsTheseTwoCards_With_AtLeastOneFromPlayerOriginalHand(13, 'x', 13) == true) {\n bestHandFromCardsNickNameString = \"Cowboys King Kong\";\n } else if (handContainsTheseTwoCards_With_AtLeastOneFromPlayerOriginalHand(9, 'x', 14) == true) {\n bestHandFromCardsNickNameString = \"The Dog\";\n } else if (handContainsTheseTwoCards_With_AtLeastOneFromPlayerOriginalHand(12, 'x', 12) == true) {\n bestHandFromCardsNickNameString = \"Ladies\";\n } else if (handContainsTheseTwoCards_With_AtLeastOneFromPlayerOriginalHand(3, 'x', 12) == true) {\n bestHandFromCardsNickNameString = \"The Waiter\";\n } else if (handContainsTheseTwoCards_With_AtLeastOneFromPlayerOriginalHand(9, 'x', 9) == true) {\n bestHandFromCardsNickNameString = \"A German Dime\";\n } else if (allCards[0].value == allCards[1].value) {\n bestHandFromCardsNickNameString = \"Pocket Pair\";\n } else if (allCards[0].suit == allCards[1].suit) {\n bestHandFromCardsNickNameString = \"Flush Rush\";\n } else if (allCards[0].value == allCards[1].value + 1 || allCards[0].value + 1 == allCards[1].value || (allCards[0].value == 14 && allCards[1].value == 2) || (allCards[0].value == 2 && allCards[1].value == 14) ) {\n bestHandFromCardsNickNameString = \"Straight Bait\";\n } else if (allCards[0].value == 14 || allCards[1].value == 14) {\n bestHandFromCardsNickNameString = \"A Spike\";\n } else if (allCards[0].value == 13 || allCards[1].value == 13) {\n bestHandFromCardsNickNameString = \"A Dame\";\n } else if (allCards[0].value == 12 || allCards[1].value == 12) {\n bestHandFromCardsNickNameString = \"A Jackal\";\n } else if (allCards[0].value == 11 || allCards[1].value == 11) {\n bestHandFromCardsNickNameString = \"A Fishhook\";\n } else if (allCards[0].value == 10 || allCards[1].value == 10) {\n bestHandFromCardsNickNameString = \"A Sawbuck\";\n } else if (allCards[0].value == 9 || allCards[1].value == 9) {\n bestHandFromCardsNickNameString = \"Nina Ross\";\n } else {\n bestHandFromCardsNickNameString = \"Down on Your Luck\";\n }\n \n System.out.println(\"findBestTwoCardHandName---->>> \" + bestHandFromCardsNickNameString);\n\n }",
"@Test\n public void bestowCheckForCorrectCMC() {\n addCard(Zone.BATTLEFIELD, playerA, \"Island\", 7);\n // Enchantment Creature — Siren\n // 1/1\n // Bestow {5}{U}{U} (If you cast this card for its bestow cost, it's an Aura spell with enchant creature. It becomes a creature again if it's not attached to a creature.)\n // Flying\n // You control enchanted creature.\n // Enchanted creature gets +1/+1 and has flying.\n addCard(Zone.HAND, playerA, \"Hypnotic Siren\");\n // Instant {1}{U}\n // Counter target spell with converted mana cost 4 or greater.\n addCard(Zone.HAND, playerB, \"Disdainful Stroke\");\n addCard(Zone.BATTLEFIELD, playerB, \"Island\", 2);\n\n addCard(Zone.BATTLEFIELD, playerB, \"Silvercoat Lion\");\n\n // B can't cast counter spell due CMC\n castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, \"Hypnotic Siren using bestow\", \"Silvercoat Lion\");\n checkStackSize(\"after\", 1, PhaseStep.PRECOMBAT_MAIN, playerB, 1);\n checkPlayableAbility(\"after\", 1, PhaseStep.PRECOMBAT_MAIN, playerB, \"Cast Disdainful Stroke\", false);\n //castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, \"Disdainful Stroke\", \"Hypnotic Siren\");\n\n setStrictChooseMode(true);\n setStopAt(1, PhaseStep.BEGIN_COMBAT);\n execute();\n\n //\n assertHandCount(playerA, \"Hypnotic Siren\", 0);\n assertGraveyardCount(playerA, \"Hypnotic Siren\", 0);\n assertHandCount(playerB, \"Disdainful Stroke\", 1);\n assertPermanentCount(playerA, \"Hypnotic Siren\", 1);\n\n // because cast with bestow, Boon Satyr may not be tapped\n assertPermanentCount(playerA, \"Silvercoat Lion\", 1);\n assertPowerToughness(playerA, \"Silvercoat Lion\", 3, 3);\n\n }",
"@Override\r\n\tprotected int giveCardProtected(ArrayList<Card> hand) {\n\t\treturn getRandomCard(hand);\r\n\t}"
] | [
"0.6929497",
"0.6777335",
"0.6404627",
"0.6392811",
"0.6196544",
"0.6188261",
"0.6152748",
"0.6152217",
"0.61319226",
"0.6115167",
"0.6112326",
"0.60137045",
"0.59963053",
"0.5983302",
"0.5952558",
"0.59524596",
"0.58811337",
"0.5822539",
"0.57985216",
"0.57902145",
"0.5770457",
"0.5754772",
"0.57433206",
"0.5729983",
"0.57129705",
"0.56880355",
"0.5684464",
"0.5677506",
"0.56590295",
"0.562863",
"0.56212133",
"0.56195194",
"0.56167775",
"0.5606662",
"0.5597626",
"0.55974627",
"0.55895126",
"0.55826443",
"0.5581039",
"0.557914",
"0.55695385",
"0.5554592",
"0.5551476",
"0.5540683",
"0.55341226",
"0.55251473",
"0.5490422",
"0.54842454",
"0.5480124",
"0.54744726",
"0.5442116",
"0.54401404",
"0.5432165",
"0.5431631",
"0.5430969",
"0.5417837",
"0.5414048",
"0.54110515",
"0.5408095",
"0.54032344",
"0.5400916",
"0.5398692",
"0.5396074",
"0.5389216",
"0.53845346",
"0.5377374",
"0.53738666",
"0.5366214",
"0.535341",
"0.5342154",
"0.53367907",
"0.53352046",
"0.5329889",
"0.5324108",
"0.53226197",
"0.5317993",
"0.5313289",
"0.53073645",
"0.5307259",
"0.5302852",
"0.5300892",
"0.5298326",
"0.52889115",
"0.5288696",
"0.5288686",
"0.52810454",
"0.5278655",
"0.52774876",
"0.52735746",
"0.5272239",
"0.52710927",
"0.527079",
"0.52666664",
"0.52660567",
"0.5263122",
"0.5262523",
"0.5258408",
"0.5254934",
"0.5253896",
"0.52494985",
"0.5245813"
] | 0.0 | -1 |
this is a bit of a trivial test, asserting the strategy will return a wild or a wd4 if nothing else is present | @Test
public void testPlayer_getBoldStrategyCard_higherLast_wild_wd4() {
player2 = new Player("Player Two", true);
Hand hand = new Hand();
player2.setHand(hand.getAllCards());
player2.getHand().addCard(wild);
assertTrue(player2.getBoldStrategyCard(yellowThree, yellowThree.getColor()).equals(wild));
player2.getHand().discard(wild);
player2.getHand().addCard(wildDrawFour);
assertTrue(player2.getBoldStrategyCard(yellowThree, yellowThree.getColor()).equals(wildDrawFour));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\n public void testGetStrategy() throws Exception {\n System.out.println(\"*** Best Path Strategy Factory tests ****\");\n String type = \"ShortestPath\";\n BestPathFactory instance = BestPathFactory.getInstance();\n BestPathStrategy result = instance.GetStrategy(type);\n assertTrue(result instanceof ShortestPath);\n }",
"@Test\r\n void testAlwaysDefect() {\r\n AlwaysDefect testStrat = new AlwaysDefect();\r\n ArrayList<Character> testHistory = new ArrayList<>();\r\n assertEquals(testStrat.getDecision('n', testHistory, testHistory, 'n', 0), 'd', \r\n \"AlwaysDefect strategy not returning correct decision\");\r\n }",
"public Decision planWorst(Context context, Decision defaultDecision);",
"@Test\r\n public void testPlayer_getCautiousStrategyCardCard_higherFirst_wd4() {\n player2 = new Player(\"Player Two\", true);\r\n player2.setHand(strategyHand.getAllCards());\r\n\r\n // get rid of the wild so the wd4 is the most attractive option\r\n player2.getHand().discard(wild);\r\n assertTrue(player2.getCautiousStrategyCard(yellowThree, yellowThree.getColor()).equals(wildDrawFour));\r\n }",
"@Test\n public void bestowNighthowlerTest() {\n addCard(Zone.BATTLEFIELD, playerA, \"Mountain\", 4);\n // Instant - {2}{R}{R}\n // Chandra's Outrage deals 4 damage to target creature and 2 damage to that creature's controller.\n addCard(Zone.HAND, playerA, \"Chandra's Outrage\");\n\n // Enchantment Creature — Horror\n // 0/0\n // Bestow {2}{B}{B}\n // Nighthowler and enchanted creature each get +X/+X, where X is the number of creature cards in all graveyards.\n addCard(Zone.HAND, playerB, \"Nighthowler\");\n addCard(Zone.BATTLEFIELD, playerB, \"Swamp\", 4);\n // First strike\n // Whenever Alesha, Who Smiles at Death attacks, you may pay {W/B}{W/B}. If you do, return target creature card\n // with power 2 or less from your graveyard to the battlefield tapped and attacking.\n addCard(Zone.BATTLEFIELD, playerB, \"Alesha, Who Smiles at Death\"); // 3/2\n addCard(Zone.GRAVEYARD, playerB, \"Pillarfield Ox\");\n\n castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, \"Nighthowler using bestow\", \"Alesha, Who Smiles at Death\");\n\n // attacks by Alesha and return card on trigger\n attack(2, playerB, \"Alesha, Who Smiles at Death\");\n setChoice(playerB, true); // use trigger\n addTarget(playerB, \"Pillarfield Ox\"); // target card to return\n\n castSpell(2, PhaseStep.POSTCOMBAT_MAIN, playerA, \"Chandra's Outrage\", \"Alesha, Who Smiles at Death\");\n\n setStrictChooseMode(true);\n setStopAt(2, PhaseStep.END_TURN);\n execute();\n\n assertLife(playerB, 18); // -2 from Chandra's Outrage\n assertLife(playerA, 16); // -3 from attack Alesha with bestowed Nighthowler\n\n assertGraveyardCount(playerA, \"Chandra's Outrage\", 1);\n assertGraveyardCount(playerB, \"Alesha, Who Smiles at Death\", 1);\n assertPermanentCount(playerB, \"Nighthowler\", 1);\n assertPowerToughness(playerB, \"Nighthowler\", 2, 2);\n Permanent nighthowler = getPermanent(\"Nighthowler\", playerB);\n\n Assert.assertEquals(\"Nighthowler has to be a creature\", true, nighthowler.isCreature(currentGame));\n }",
"@Test\n public void bestowWithFusedSpell() {\n addCard(Zone.BATTLEFIELD, playerA, \"Mountain\", 2);\n /**\n * Cyclops of One-Eyed Pass {2}{R}{R} Creature - Cyclops 5/2\n */\n addCard(Zone.BATTLEFIELD, playerA, \"Cyclops of One-Eyed Pass\");\n\n /**\n * Nyxborn Rollicker {R} Enchantment Creature - Satyr 1/1 Bestow {1}{R}\n * (If you cast this card for its bestow cost, it's an Aura spell with\n * enchant creature. It becomes a creature again if it's not attached to\n * a creature.) Enchanted creature gets +1/+1.\n */\n addCard(Zone.HAND, playerA, \"Nyxborn Rollicker\");\n\n addCard(Zone.BATTLEFIELD, playerB, \"Swamp\", 3);\n addCard(Zone.BATTLEFIELD, playerB, \"Island\", 2);\n\n // Instant\n // Far {1}{U} Return target creature to its owner's hand.\n // Away {2}{B} Target player sacrifices a creature.\n // Fuse (You may cast one or both halves of this card from your hand.)\n addCard(Zone.HAND, playerB, \"Far // Away\");\n\n castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, \"Nyxborn Rollicker using bestow\", \"Cyclops of One-Eyed Pass\");\n\n castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerB, \"fused Far // Away\");\n addTarget(playerB, \"Cyclops of One-Eyed Pass\"); // Far\n addTarget(playerB, playerA); // Away\n addTarget(playerA, \"Nyxborn Rollicker\");\n\n setStrictChooseMode(true);\n setStopAt(1, PhaseStep.END_TURN);\n execute();\n\n assertHandCount(playerA, \"Cyclops of One-Eyed Pass\", 1);\n assertHandCount(playerB, 0);\n\n assertGraveyardCount(playerB, \"Far // Away\", 1);\n\n assertPermanentCount(playerA, \"Nyxborn Rollicker\", 0);\n assertGraveyardCount(playerA, \"Nyxborn Rollicker\", 1);\n\n }",
"@Test\r\n void testHardMajorityAlwaysDefect() {\r\n AlwaysDefect testStrat = new AlwaysDefect();\r\n HardMajority testStrat2 = new HardMajority();\r\n ArrayList<Integer> payoffs = new ArrayList<>(Arrays.asList(3, 5, 0, 1));\r\n Game game = new Game(testStrat, testStrat2, 3, payoffs);\r\n game.playGame();\r\n assertEquals(testStrat2.getPoints(), 3, \"HardMajority strategy not functioning correctly\");\r\n }",
"boolean supportsStrategy(String strategy);",
"@Test\n\tpublic void testWarm_DetailedThenTechnologyAverageElseAbort_FallbackNotNeeded() {\n\t\tEmissionModule emissionModule = setUpScenario(EmissionsConfigGroup.DetailedVsAverageLookupBehavior.tryDetailedThenTechnologyAverageElseAbort);\n\n\t\tdouble travelTimeOnLink = 21; //sec. approx freeSpeed of link12 is : (200 m) / (9.72.. m/s) approx 20.57 s\n\t\tMap<Pollutant, Double> warmEmissions = emissionModule.getWarmEmissionAnalysisModule().checkVehicleInfoAndCalculateWarmEmissions(vehicleFull, link, travelTimeOnLink);\n\n\t\tdouble expectedValue = 30.34984742; // = 200m * 151.7492371 g/km\n\t\tAssert.assertEquals( expectedValue, warmEmissions.get(Pollutant.CO2_TOTAL ), MatsimTestUtils.EPSILON );\n\t}",
"@Test\r\n void testHardTitForTat() {\r\n HardTitForTat testStrat = new HardTitForTat();\r\n PeriodicCD testStrat2 = new PeriodicCD();\r\n ArrayList<Integer> payoffs = new ArrayList<>(Arrays.asList(3, 5, 0, 1));\r\n ArrayList<Character> expected = new ArrayList<>(Arrays.asList('c', 'c', 'd'));\r\n Game game = new Game(testStrat, testStrat2, 3, payoffs);\r\n game.playGame();\r\n assertEquals(game.historyStrategy1, expected, \r\n \"HardTitForTat strategy not functioning correctly\");\r\n }",
"public void xxtest_oh_01() {\n String NS = \"http://www.idi.ntnu.no/~herje/ja/\";\n Resource[] expected = new Resource[] {\n ResourceFactory.createResource( NS+\"reiseliv.owl#Reiseliv\" ),\n ResourceFactory.createResource( NS+\"hotell.owl#Hotell\" ),\n ResourceFactory.createResource( NS+\"restaurant.owl#Restaurant\" ),\n ResourceFactory.createResource( NS+\"restaurant.owl#UteRestaurant\" ),\n ResourceFactory.createResource( NS+\"restaurant.owl#UteBadRestaurant\" ),\n ResourceFactory.createResource( NS+\"restaurant.owl#UteDoRestaurant\" ),\n ResourceFactory.createResource( NS+\"restaurant.owl#SkogRestaurant\" ),\n };\n \n test_oh_01scan( OntModelSpec.OWL_MEM, \"No inf\", expected );\n test_oh_01scan( OntModelSpec.OWL_MEM_MINI_RULE_INF, \"Mini rule inf\", expected );\n test_oh_01scan( OntModelSpec.OWL_MEM_RULE_INF, \"Full rule inf\", expected );\n test_oh_01scan( OntModelSpec.OWL_MEM_MICRO_RULE_INF, \"Micro rule inf\", expected );\n }",
"public Decision worstFor(Context context);",
"@Test\n public void bestowEnchantmentWillNotBeTapped() {\n addCard(Zone.BATTLEFIELD, playerA, \"Forest\", 6);\n addCard(Zone.BATTLEFIELD, playerA, \"Silent Artisan\");\n\n addCard(Zone.HAND, playerA, \"Boon Satyr\");\n\n // Enchantment {1}{W}\n // Creatures your opponents control enter the battlefield tapped.\n addCard(Zone.BATTLEFIELD, playerB, \"Imposing Sovereign\");\n\n castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, \"Boon Satyr using bestow\", \"Silent Artisan\");\n\n setStrictChooseMode(true);\n setStopAt(1, PhaseStep.END_TURN);\n execute();\n\n // because Boon Satyr is no creature on the battlefield, evolve may not trigger\n assertPermanentCount(playerA, \"Silent Artisan\", 1);\n assertPowerToughness(playerA, \"Silent Artisan\", 7, 7);\n // because cast with bestow, Boon Satyr may not be tapped\n assertTapped(\"Boon Satyr\", false);\n\n }",
"@ParameterizedTest\n @MethodSource(value = \"createEverythingGoals\")\n\tpublic void AC1MultiLevelled(Goal everythingGoal) {\n\t\tGame g1 = Game.createMockGame(everythingGoal, \"\"\n\t\t\t+ \"PS! \\n\"\n\t\t\t+ \"TE B_ \\n\"\n\t\t);\n\t\t\n\t\tg1.movePlayer(Direction.DOWN);\n\t\tg1.movePlayer(Direction.UP);\n\t\tg1.movePlayer(Direction.RIGHT);\n\t\t\n\t\tg1.swingSword(Direction.RIGHT);\n\t\t\n\t\tg1.movePlayer(Direction.DOWN);\n\t\tg1.movePlayer(Direction.RIGHT);\n\t\tg1.movePlayer(Direction.RIGHT);\n\t\t\n\t\tassertEquals(\"\"\n\t\t\t+ \" \\n\"\n\t\t\t+ \" E PB \\n\"\n\t\t\t, g1.getBoardString()\n\t\t);\n\t\t\n\t\tassertFalse(g1.getHasWon());\n\t\t\n\t\tg1.movePlayer(Direction.LEFT);\n\t\tg1.movePlayer(Direction.LEFT);\n\t\t\n\t\tassertTrue(g1.getHasWon());\n\t\t\n\t\tGame g2 = Game.createMockGame(everythingGoal, \"\"\n\t\t\t+ \"PS! \\n\"\n\t\t\t+ \"TE B_ E\\n\"\n\t\t);\n\t\t\n\t\tg2.movePlayer(Direction.DOWN);\n\t\tg2.movePlayer(Direction.UP);\n\t\tg2.movePlayer(Direction.RIGHT);\n\t\t\n\t\tg2.swingSword(Direction.RIGHT);\n\t\t\n\t\tg2.movePlayer(Direction.DOWN);\n\t\tg2.movePlayer(Direction.RIGHT);\n\t\tg2.movePlayer(Direction.RIGHT);\n\t\tg2.movePlayer(Direction.RIGHT);\n\t\t\n\t\tassertEquals(\"\"\n\t\t\t+ \" \\n\"\n\t\t\t+ \" E PBE\\n\"\n\t\t\t, g2.getBoardString()\n\t\t);\n\t\t\n\t\tg2.movePlayer(Direction.LEFT);\n\t\tg2.movePlayer(Direction.LEFT);\n\t\tg2.movePlayer(Direction.LEFT);\n\t\t\n\t\tassertEquals(\"\"\n\t\t\t+ \" \\n\"\n\t\t\t+ \" P _BE\\n\"\n\t\t\t, g2.getBoardString()\n\t\t);\n\t\t\n\t\tassertFalse(g2.getHasWon());\n\n\t\tg2.movePlayer(Direction.UP);\n\t\tg2.movePlayer(Direction.RIGHT);\n\t\tg2.movePlayer(Direction.RIGHT);\n\t\tg2.movePlayer(Direction.RIGHT);\n\t\tg2.movePlayer(Direction.RIGHT);\n\t\tg2.movePlayer(Direction.RIGHT);\n\t\tg2.movePlayer(Direction.DOWN);\n\t\tg2.movePlayer(Direction.LEFT);\n\n\t\tassertEquals(\"\"\n\t\t\t+ \" \\n\"\n\t\t\t+ \" E BPE\\n\"\n\t\t\t, g2.getBoardString()\n\t\t);\n\t\t\n\t\tassertFalse(g2.getHasWon());\n\n\t\tg2.movePlayer(Direction.RIGHT);\n\t\t\n\t\tassertTrue(g2.getHasWon());\n\t\n\t\tGame g3 = Game.createMockGame(everythingGoal, \"\"\n\t\t\t+ \"S! \\n\"\n\t\t\t+ \"BE \\n\"\n\t\t\t+ \"_T \\n\"\n\t\t\t, \"\"\n\t\t\t+ \"P \\n\"\n\t\t\t+ \" \\n\"\n\t\t\t+ \" \\n\"\n\t\t);\n\t\t\n\t\tg3.swingSword(Direction.RIGHT);\n\t\t\n\t\tg3.movePlayer(Direction.DOWN);\n\t\tg3.movePlayer(Direction.RIGHT);\n\t\tg3.movePlayer(Direction.DOWN);\n\t\t\n\t\tassertFalse(g3.getHasWon());\n\t\t\n\t\tg3.movePlayer(Direction.UP);\n\t\t\n\t\tassertTrue(g3.getHasWon());\n }",
"protected abstract boolean isSatisfiedBy(Design design, AUndertaking t);",
"@Test\n\tpublic void testWarm_DetailedThenTechnologyAverageThenAverageTable_FallbackToTechnology() {\n\t\tEmissionModule emissionModule = setUpScenario(EmissionsConfigGroup.DetailedVsAverageLookupBehavior.tryDetailedThenTechnologyAverageThenAverageTable);\n\n\t\tdouble travelTimeOnLink = 21; //sec. approx freeSpeed of link12 is : (200 m) / (9.72.. m/s) approx 20.57 s\n\t\tMap<Pollutant, Double> warmEmissions = emissionModule.getWarmEmissionAnalysisModule().checkVehicleInfoAndCalculateWarmEmissions(vehicleFallbackToTechnologyAverage, link, travelTimeOnLink);\n\n\t\tdouble expectedValue = 31.53711548; // = 200m * 157.6855774 g/km\n\t\tAssert.assertEquals( expectedValue, warmEmissions.get(Pollutant.CO2_TOTAL ), MatsimTestUtils.EPSILON );\n\t}",
"@Test\n\tpublic void testWarm_DetailedThenTechnologyAverageThenAverageTable_FallbackNotNeeded() {\n\t\tEmissionModule emissionModule = setUpScenario(EmissionsConfigGroup.DetailedVsAverageLookupBehavior.tryDetailedThenTechnologyAverageThenAverageTable);\n\n\t\tdouble travelTimeOnLink = 21; //sec. approx freeSpeed of link12 is : (200 m) / (9.72.. m/s) approx 20.57 s\n\t\tMap<Pollutant, Double> warmEmissions = emissionModule.getWarmEmissionAnalysisModule().checkVehicleInfoAndCalculateWarmEmissions(vehicleFull, link, travelTimeOnLink);\n\n\t\tdouble expectedValue = 30.34984742; // = 200m * 151.7492371 g/km\n\t\tAssert.assertEquals( expectedValue, warmEmissions.get(Pollutant.CO2_TOTAL ), MatsimTestUtils.EPSILON );\n\t}",
"@Test\n\tpublic void testSearchBasedOnRequest4() {\n\t\tsearchBasedOnRequestSetup();\n\t\t\n\t\tList<Suggestion> sugg = dm.searchBasedOnRequest(\"Flavorful\", null, true);\n\t\tassertTrue(sugg.size() == 0);\n\t}",
"@Test\r\n void testSoftMajorityAlwaysDefect() {\r\n AlwaysDefect testStrat = new AlwaysDefect();\r\n SoftMajority testStrat2 = new SoftMajority();\r\n ArrayList<Integer> payoffs = new ArrayList<>(Arrays.asList(3, 5, 0, 1));\r\n Game game = new Game(testStrat, testStrat2, 3, payoffs);\r\n game.playGame();\r\n assertEquals(testStrat2.getPoints(), 2, \"SoftMajority strategy not functioning correctly\");\r\n }",
"@Test\r\n void testSpitefulAlwaysDefect() {\r\n AlwaysDefect testStrat = new AlwaysDefect();\r\n Spiteful testStrat2 = new Spiteful();\r\n ArrayList<Integer> payoffs = new ArrayList<>(Arrays.asList(3, 5, 0, 1));\r\n Game game = new Game(testStrat, testStrat2, 3, payoffs);\r\n game.playGame();\r\n assertEquals(testStrat2.getPoints(), 2, \"Spiteful strategy not functioning correctly\");\r\n }",
"@Test\r\n public void testPlayer_setRandomStrategy_2() {\r\n player2 = new Player(\"\", true);\r\n player2.setRandomStrategy();\r\n String firstStrategy = player2.getStrategy();\r\n boolean strategyReplaced = false;\r\n // generate 20 random strategies and assert at least one of them comes back different.\r\n for(int i = 0; i < 20; i++) {\r\n player2.setRandomStrategy();\r\n if (!player2.getStrategy().equalsIgnoreCase(firstStrategy)) {\r\n strategyReplaced = true;\r\n }\r\n }\r\n assertTrue(strategyReplaced);\r\n }",
"@Override\r\n protected boolean checkApiLogic(Player ai, SpellAbility sa) {\n if (sa.isEntwine()) {\r\n return true;\r\n } \r\n\r\n final int num = Integer.parseInt(sa.hasParam(\"CharmNum\") ? sa.getParam(\"CharmNum\") : \"1\");\r\n final int min = sa.hasParam(\"MinCharmNum\") ? Integer.parseInt(sa.getParam(\"MinCharmNum\")) : num;\r\n boolean timingRight = sa.isTrigger(); //is there a reason to play the charm now?\r\n\r\n // Reset the chosen list otherwise it will be locked in forever by earlier calls\r\n sa.setChosenList(null);\r\n List<AbilitySub> choices = CharmEffect.makePossibleOptions(sa);\r\n List<AbilitySub> chosenList;\r\n \r\n if (!ai.equals(sa.getActivatingPlayer())) {\r\n // This branch is for \"An Opponent chooses\" Charm spells from Alliances\r\n // Current just choose the first available spell, which seem generally less disastrous for the AI.\r\n //return choices.subList(0, 1);\r\n chosenList = choices.subList(1, choices.size());\r\n } else if (\"Triskaidekaphobia\".equals(ComputerUtilAbility.getAbilitySourceName(sa))) {\r\n chosenList = chooseTriskaidekaphobia(choices, ai);\r\n } else {\r\n /*\r\n * The generic chooseOptionsAi uses canPlayAi() to determine good choices\r\n * which means most \"bonus\" effects like life-gain and random pumps will\r\n * usually not be chosen. This is designed to force the AI to only select\r\n * the best choice(s) since it does not actually know if it can pay for\r\n * \"bonus\" choices (eg. Entwine/Escalate).\r\n * chooseMultipleOptionsAi() uses \"AILogic$Good\" tags to manually identify\r\n * bonus choice(s) for the AI otherwise it might be too hard to ever fulfil\r\n * minimum choice requirements with canPlayAi() alone.\r\n */\r\n chosenList = min > 1 ? chooseMultipleOptionsAi(choices, ai, min)\r\n : chooseOptionsAi(choices, ai, timingRight, num, min, sa.hasParam(\"CanRepeatModes\"));\r\n }\r\n\r\n if (chosenList.isEmpty()) {\r\n if (timingRight) {\r\n // Set minimum choices for triggers where chooseMultipleOptionsAi() returns null\r\n chosenList = chooseOptionsAi(choices, ai, true, num, min, sa.hasParam(\"CanRepeatModes\"));\r\n } else {\r\n return false;\r\n }\r\n }\r\n sa.setChosenList(chosenList);\r\n\r\n // prevent run-away activations - first time will always return true\r\n return MyRandom.getRandom().nextFloat() <= Math.pow(.6667, sa.getActivationsThisTurn());\r\n }",
"@Test\n public void bestowEnchantmentBecomesCreature() {\n addCard(Zone.BATTLEFIELD, playerA, \"Plains\", 4);\n addCard(Zone.BATTLEFIELD, playerA, \"Silvercoat Lion\");\n addCard(Zone.HAND, playerA, \"Hopeful Eidolon\");\n\n addCard(Zone.BATTLEFIELD, playerB, \"Mountain\", 1);\n addCard(Zone.HAND, playerB, \"Lightning Bolt\");\n\n castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, \"Hopeful Eidolon using bestow\", \"Silvercoat Lion\");\n castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerB, \"Lightning Bolt\", \"Silvercoat Lion\");\n\n setStrictChooseMode(true);\n setStopAt(1, PhaseStep.END_TURN);\n execute();\n\n // because Boon Satyr is no creature on the battlefield, evolve may not trigger\n assertLife(playerA, 20);\n assertLife(playerB, 20);\n\n assertPermanentCount(playerA, \"Silvercoat Lion\", 0);\n assertPermanentCount(playerA, \"Hopeful Eidolon\", 1);\n assertPowerToughness(playerA, \"Hopeful Eidolon\", 1, 1);\n\n Permanent hopefulEidolon = getPermanent(\"Hopeful Eidolon\", playerA);\n Assert.assertTrue(\"Hopeful Eidolon has to be a creature but is not\", hopefulEidolon.isCreature(currentGame));\n Assert.assertTrue(\"Hopeful Eidolon has to be an enchantment but is not\", hopefulEidolon.isEnchantment(currentGame));\n\n }",
"@Test\n public void altijdWaar() {\n assertThat(\"Altijd waar\", 6, anyOf(even(), not(even())));\n }",
"@Test\r\n void testTitForTwoTats() {\r\n TitForTwoTats testStrat = new TitForTwoTats();\r\n AlwaysDefect testStrat2 = new AlwaysDefect();\r\n ArrayList<Integer> payoffs = new ArrayList<>(Arrays.asList(3, 5, 0, 1));\r\n ArrayList<Character> expected = new ArrayList<>(Arrays.asList('c', 'c', 'd', 'd'));\r\n Game game = new Game(testStrat, testStrat2, 4, payoffs);\r\n game.playGame();\r\n assertEquals(game.historyStrategy1, expected, \r\n \"TitForTwoTats strategy not functioning correctly\");\r\n }",
"@Test\n\tpublic void testLopDeweySchemeFlavors() \n\t{\n\t\tString id = \"deweyFlavors\";\n\t\tassertDeweyVolLopped(id);\n\t\tassertNoUnloppedDeweyVol1(id);\n\t\tassertNoUnloppedDeweyVol2(id);\n\t}",
"@Test\r\n\tpublic void testTournamentStrategiesConditions() {\r\n\t\tassertTrue(cl.checkTournamentStrategiesConditions(tags[4]));\r\n\t\tassertFalse(cl.checkTournamentStrategiesConditions(tags2[4]));\r\n\t}",
"public Direction[] takeDecision() {\n return this.randomDecision();\n }",
"@Test\n\tpublic void testWarm_DetailedThenTechnologyAverageElseAbort_FallbackToTechnologyAverage() {\n\t\tEmissionModule emissionModule = setUpScenario(EmissionsConfigGroup.DetailedVsAverageLookupBehavior.tryDetailedThenTechnologyAverageElseAbort);\n\n\t\tdouble travelTimeOnLink = 21; //sec. approx freeSpeed of link12 is : (200 m) / (9.72.. m/s) approx 20.57 s\n\t\tMap<Pollutant, Double> warmEmissions = emissionModule.getWarmEmissionAnalysisModule().checkVehicleInfoAndCalculateWarmEmissions(vehicleFallbackToTechnologyAverage, link, travelTimeOnLink);\n\n\t\tdouble expectedValue = 31.53711548; // = 200m * 157.6855774 g/km\n\t\tAssert.assertEquals( expectedValue, warmEmissions.get(Pollutant.CO2_TOTAL ), MatsimTestUtils.EPSILON );\n\t}",
"private WeightedSampler<String> getPossibleLethalActions(int team) {\n if (this.b.getCurrentPlayerTurn() != team || this.b.getWinner() != 0) {\n return null;\n }\n Player p = this.b.getPlayer(team);\n WeightedSampler<String> poss = new WeightedOrderedSampler<>();\n List<Minion> minions = this.b.getMinions(team, false, true).collect(Collectors.toList());\n for (Minion m : minions) {\n if (p.canUnleashCard(m)) {\n double totalWeight = UNLEASH_TOTAL_WEIGHT + UNLEASH_WEIGHT_PER_PRESENCE * m.getTotalEffectValueOf(e -> e.getPresenceValue(5));\n List<List<List<TargetList<?>>>> targetSearchSpace = new LinkedList<>();\n this.getPossibleListTargets(m.getUnleashTargetingSchemes(), new LinkedList<>(), targetSearchSpace);\n if (targetSearchSpace.isEmpty()) {\n targetSearchSpace.add(List.of());\n }\n for (List<List<TargetList<?>>> targets : targetSearchSpace) {\n poss.add(new UnleashMinionAction(p, m, targets).toString().intern(), totalWeight / targetSearchSpace.size());\n }\n }\n }\n if (this.b.getMinions(team * -1, false, true).anyMatch(m -> m.finalStats.get(Stat.WARD) > 0)) {\n // find ways to break through the wards\n for (Minion m : minions) {\n if (m.canAttack()) {\n double totalWeight = ATTACK_TOTAL_WEIGHT + ATTACK_WEIGHT_MULTIPLIER * m.finalStats.get(Stat.ATTACK);\n List<Minion> searchSpace = m.getAttackableTargets().collect(Collectors.toList());\n double weight = totalWeight / searchSpace.size();\n for (Minion target : searchSpace) {\n double overkillMultiplier = Math.pow(ATTACK_WEIGHT_OVERKILL_PENALTY, Math.max(0, m.finalStats.get(Stat.ATTACK) - target.health));\n poss.add(new OrderAttackAction(m, target).toString().intern(), overkillMultiplier * weight);\n }\n }\n }\n } else {\n // just go face\n this.b.getPlayer(team * -1).getLeader().ifPresent(l -> {\n for (Minion m : minions) {\n if (m.canAttack(l)) {\n double totalWeight = ATTACK_TOTAL_WEIGHT + ATTACK_WEIGHT_MULTIPLIER * m.finalStats.get(Stat.ATTACK);\n poss.add(new OrderAttackAction(m, l).toString().intern(), totalWeight);\n }\n }\n });\n }\n poss.add(new EndTurnAction(team).toString().intern(), END_TURN_WEIGHT);\n return poss;\n }",
"@Test\n public void test_shortcut_needed_bidirectional() {\n CHPreparationGraph graph = CHPreparationGraph.edgeBased(5, 4, (in, via, out) -> in == out ? 10 : 0);\n int edge = 0;\n graph.addEdge(0, 1, edge++, 10, 10);\n graph.addEdge(1, 2, edge++, 10, 10);\n graph.addEdge(2, 3, edge++, 10, 10);\n graph.addEdge(3, 4, edge++, 10, 10);\n graph.prepareForContraction();\n EdgeBasedWitnessPathSearcher searcher = new EdgeBasedWitnessPathSearcher(graph);\n searcher.initSearch(0, 1, 2, new EdgeBasedWitnessPathSearcher.Stats());\n double weight = searcher.runSearch(3, 6, 20.0, 100);\n assertTrue(Double.isInfinite(weight));\n }",
"@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 }",
"public IChoice losesAgainst();",
"@Test\n public void bestowEnchantmentDoesNotTriggerEvolve() {\n addCard(Zone.BATTLEFIELD, playerA, \"Forest\", 6);\n // Creature - Giant 3/5\n addCard(Zone.BATTLEFIELD, playerA, \"Silent Artisan\");\n\n addCard(Zone.HAND, playerA, \"Experiment One\");\n // Enchanted creature gets +4/+2.\n addCard(Zone.HAND, playerA, \"Boon Satyr\");\n\n castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, \"Experiment One\");\n castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, \"Boon Satyr using bestow\", \"Silent Artisan\");\n\n setStrictChooseMode(true);\n setStopAt(1, PhaseStep.END_TURN);\n execute();\n\n // because Boon Satyr is no creature on the battlefield, evolve may not trigger\n assertPermanentCount(playerA, \"Boon Satyr\", 1);\n Permanent boonSatyr = getPermanent(\"Boon Satyr\", playerA);\n Assert.assertTrue(\"Boon Satyr may not be a creature\", !boonSatyr.isCreature(currentGame));\n assertPermanentCount(playerA, \"Silent Artisan\", 1);\n assertPermanentCount(playerA, \"Experiment One\", 1);\n assertPowerToughness(playerA, \"Experiment One\", 1, 1);\n assertPowerToughness(playerA, \"Silent Artisan\", 7, 7);\n\n }",
"@Test\n\tpublic void happyCheck() {\n\t\tMoodAnalyser moodAnalyser;\n\n\t\tmoodAnalyser = new MoodAnalyser(null);\n\n\t\tString mood;\n\t\ttry {\n\t\t\tmood = moodAnalyser.analyseMood();\n\t\t\tAssert.assertEquals(\"HAPPY\", mood);\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(e);\n\t\t}\n\n\t}",
"public static String StrategyHints(Player Gamer, Player Dealer){\n\t String ReturnString = \"\";\n\t if(Gamer.Hand[0].getFace() != 1 && Gamer.Hand[1].getFace() != 1){\n\t\t// If the player has a hard hand (two starting cards with no aces)\n\t\t if(Gamer.Score <= 8){\n\t\t\t\tReturnString = Gamer.Name+\" should hit\";\n\t\t\t}\n\t\t\telse if(Gamer.Score == 9){\n\t\t\t\tif(Dealer.Score >= 3 && Dealer.Score <= 6){\n\t\t\t\t\tReturnString = Gamer.Name+\" should double\";\n\t\t\t }\n\t\t\t else{\n\t\t\t\t\tReturnString = Gamer.Name+\" should hit\";\n\t\t\t }\n\t\t\t}\n\t\t\telse if(Gamer.Score == 10){\n\t\t\t\tif(Dealer.Score >= 2 && Dealer.Score <= 9){\n\t\t\t\t\tReturnString = Gamer.Name+\" should double\";\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tReturnString = Gamer.Name+\" should hit\";\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(Gamer.Score == 11){\n\t\t\t\tif(Dealer.Score >= 2 && Dealer.Score <=10){\n\t\t\t\t\tReturnString = Gamer.Name+\" should double\";\n\t\t\t\t}\n\t\t\t\telse if(Dealer.Hand[1].getFace() == 1){\n\t\t\t\t\tReturnString = Gamer.Name+\" should hit\";\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(Gamer.Score == 12){\n\t\t\t\tif(Dealer.Score == 2 || Dealer.Score == 3){\n\t\t\t\t\tReturnString = Gamer.Name+\" should hit\";\n\t\t\t\t}\n\t\t\t\telse if(Dealer.Score >= 4 && Dealer.Score <= 6){\n\t\t\t\t\tReturnString = Gamer.Name+\" should stand\";\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tReturnString = Gamer.Name+\" should hit\";\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(Gamer.Score >= 13 && Gamer.Score <= 16){\n\t\t\t\tif(Dealer.Score >= 2 && Dealer.Score <= 6){\n\t\t\t\t\tReturnString = Gamer.Name+\" should stand\";\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tReturnString = Gamer.Name+\" should hit\";\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(Gamer.Score >= 17 && Gamer.Score <= 21){\n\t\t\t ReturnString = Gamer.Name+\" should stand\";\n\t\t\t}\n\t\t}\n\t\telse if((Gamer.Hand[0].getFace() == 1 && Gamer.Hand[1].getFace() != 1) \n\t\t\t|| (Gamer.Hand[0].getFace() != 1 && Gamer.Hand[1].getFace() == 1)){\n\t\t\t// If the player has a soft hand (one of the starting hands contains an ace)\n\t\t if(((Gamer.Hand[0].getFace() == 1 && Gamer.Hand[1].getFace() == 2) \n\t\t\t\t|| (Gamer.Hand[0].getFace() == 2 && Gamer.Hand[1].getFace() == 1)) \n\t\t\t\t|| ((Gamer.Hand[0].getFace() == 1 && Gamer.Hand[1].getFace() == 3) \n\t\t\t\t|| (Gamer.Hand[0].getFace() == 3 && Gamer.Hand[1].getFace() == 1))){\n\t\t\t // If you have an Ace 2 or Ace 3\n\t\t\t if(Dealer.Score == 5 || Dealer.Score == 6){\n\t\t\t\t\tReturnString = Gamer.Name+\" should double\";\n\t\t\t }\n\t\t\t else{\n\t\t\t\t\tReturnString = Gamer.Name+\" should hit\";\n\t\t\t }\n\t\t\t}\n\t\t\telse if(((Gamer.Hand[0].getFace() == 1 && Gamer.Hand[1].getFace() == 4) \n\t\t\t\t|| (Gamer.Hand[0].getFace() == 4 && Gamer.Hand[1].getFace() == 1)) \n\t\t\t\t|| ((Gamer.Hand[0].getFace() == 1 && Gamer.Hand[1].getFace() == 5) \n\t\t\t\t|| (Gamer.Hand[0].getFace() == 5 && Gamer.Hand[1].getFace() == 1))){\n\t\t\t // If you have an Ace 4 or Ace 5\n\t\t\t if(Dealer.Score >= 4 && Dealer.Score <= 6){\n\t\t\t\t\tReturnString = Gamer.Name+\" should double\";\n\t\t\t }\n\t\t\t else{\n\t\t\t\t\tReturnString = Gamer.Name+\" should hit\";\n\t\t\t } \n\t\t\t}\n\t\t\telse if((Gamer.Hand[0].getFace() == 1 && Gamer.Hand[1].getFace() == 6) \n\t\t\t\t|| (Gamer.Hand[0].getFace() == 6 && Gamer.Hand[1].getFace() == 1)){\n\t\t\t\t// If you have an Ace 6\n\t\t\t if(Dealer.Score >= 3 && Dealer.Score <= 6){\n\t\t\t\t\tReturnString = Gamer.Name+\" should double\";\n\t\t\t }\n\t\t\t else{\n\t\t\t\t\tReturnString = Gamer.Name+\" should hit\";\n\t\t\t }\n\t\t\t}\n\t\t\telse if((Gamer.Hand[0].getFace() == 1 && Gamer.Hand[1].getFace() == 7) \n\t\t\t\t|| (Gamer.Hand[0].getFace() == 7 && Gamer.Hand[1].getFace() == 1)){\n\t\t\t\t// If you have an Ace 7\n\t\t\t\tif(Dealer.Score == 2 || Dealer.Score == 7 || Dealer.Score == 8){\n\t\t\t\t\tReturnString = Gamer.Name+\" should stand\";\n\t\t\t\t}\n\t\t\t else if(Dealer.Score >= 3 && Dealer.Score <= 6){\n\t\t\t\t\tReturnString = Gamer.Name+\" should double\";\n\t\t\t }\n\t\t\t}\n\t\t\telse if(((Gamer.Hand[0].getFace() == 1 && Gamer.Hand[1].getFace() == 8) \n\t\t\t\t|| (Gamer.Hand[0].getFace() == 8 && Gamer.Hand[1].getFace() == 1)) \n\t\t\t\t|| ((Gamer.Hand[0].getFace() == 1 && Gamer.Hand[1].getFace() == 9) \n\t\t\t\t|| (Gamer.Hand[0].getFace() == 9 && Gamer.Hand[1].getFace() == 1))){\n\t\t\t\t// If you have an Ace 8 or Ace 9\n\t\t\t\tReturnString = Gamer.Name+\" should stand\"; \n\t\t\t}\n\t\t}\n\t\treturn ReturnString;\n\t}",
"@Override\r\n\tpublic boolean fight(String oponent) {\n\t\tint x = Critter.getRandomInt(1);\r\n\t\tif (x == 1) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"@Test\n public void testEnchantedChangedWithSongOfTheDryads() {\n // Enchantment Creature — Horror\n // 0/0\n // Bestow {2}{B}{B}\n // Nighthowler and enchanted creature each get +X/+X, where X is the number of creature cards in all graveyards.\n addCard(Zone.HAND, playerA, \"Nighthowler\");\n addCard(Zone.BATTLEFIELD, playerA, \"Swamp\", 4);\n addCard(Zone.BATTLEFIELD, playerA, \"Silvercoat Lion\"); // {1}{W} 2/2 creature\n\n addCard(Zone.GRAVEYARD, playerA, \"Pillarfield Ox\");\n addCard(Zone.GRAVEYARD, playerB, \"Pillarfield Ox\");\n\n // Enchant permanent\n // Enchanted permanent is a colorless Forest land.\n addCard(Zone.BATTLEFIELD, playerB, \"Forest\", 3);\n addCard(Zone.HAND, playerB, \"Song of the Dryads\"); // Enchantment Aura {2}{G}\n\n castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, \"Nighthowler using bestow\", \"Silvercoat Lion\");\n\n castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, \"Song of the Dryads\", \"Silvercoat Lion\");\n\n setStrictChooseMode(true);\n setStopAt(2, PhaseStep.BEGIN_COMBAT);\n execute();\n\n assertPermanentCount(playerB, \"Song of the Dryads\", 1);\n\n ManaOptions options = playerA.getAvailableManaTest(currentGame);\n Assert.assertEquals(\"Player should be able to create 1 green mana\", \"{G}\", options.getAtIndex(0).toString());\n\n assertPermanentCount(playerA, \"Nighthowler\", 1);\n assertPowerToughness(playerA, \"Nighthowler\", 2, 2);\n assertType(\"Nighthowler\", CardType.CREATURE, true);\n assertType(\"Nighthowler\", CardType.ENCHANTMENT, true);\n\n Permanent nighthowler = getPermanent(\"Nighthowler\");\n Assert.assertFalse(\"The unattached Nighthowler may not have the aura subtype.\", nighthowler.hasSubtype(SubType.AURA, currentGame));\n }",
"@Test\n public void should_ReturnTrue_When_DietRecommended(){\n double weight = 100.0;\n double height = 1.70;\n //when\n boolean recommended = BMICalculator.isDietRecommended(weight,height);\n //then\n assertTrue(recommended);\n }",
"@Test\r\n void testHardMajorityAlwaysCooperate() {\r\n AlwaysCooperate testStrat = new AlwaysCooperate();\r\n HardMajority testStrat2 = new HardMajority();\r\n ArrayList<Integer> payoffs = new ArrayList<>(Arrays.asList(3, 5, 0, 1));\r\n Game game = new Game(testStrat, testStrat2, 3, payoffs);\r\n game.playGame();\r\n assertEquals(testStrat2.getPoints(), 11, \"HardMajority strategy not functioning correctly\");\r\n }",
"@Test\n public void shouldPrioritiseAnnotatedSteps() {\n\n CandidateSteps steps1 = mock(Steps.class);\n CandidateSteps steps2 = mock(Steps.class);\n CandidateStep candidate1 = mock(CandidateStep.class);\n CandidateStep candidate2 = mock(CandidateStep.class);\n CandidateStep candidate3 = mock(CandidateStep.class);\n CandidateStep candidate4 = mock(CandidateStep.class);\n Step step1 = mock(Step.class);\n Step step2 = mock(Step.class);\n Step step3 = mock(Step.class);\n Step step4 = mock(Step.class);\n\n when(steps1.getSteps()).thenReturn(new CandidateStep[]{candidate1, candidate2});\n when(steps2.getSteps()).thenReturn(new CandidateStep[]{candidate3, candidate4});\n \n // all matching the same step string with different priorities\n String stepAsString = \"Given a step\";\n when(candidate1.matches(stepAsString)).thenReturn(true);\n when(candidate2.matches(stepAsString)).thenReturn(true);\n when(candidate3.matches(stepAsString)).thenReturn(true);\n when(candidate4.matches(stepAsString)).thenReturn(true);\n when(candidate1.getPriority()).thenReturn(1);\n when(candidate2.getPriority()).thenReturn(2);\n when(candidate3.getPriority()).thenReturn(3);\n when(candidate4.getPriority()).thenReturn(4);\n when(candidate1.createFrom(tableRow, stepAsString)).thenReturn(step1);\n when(candidate2.createFrom(tableRow, stepAsString)).thenReturn(step2);\n when(candidate3.createFrom(tableRow, stepAsString)).thenReturn(step3);\n when(candidate4.createFrom(tableRow, stepAsString)).thenReturn(step4);\n \n // When we create the series of steps for the core\n MarkUnmatchedStepsAsPending stepCreator = new MarkUnmatchedStepsAsPending();\n List<Step> steps = stepCreator.createStepsFrom(asList(steps1, steps2), new Scenario(asList(stepAsString)), tableRow\n );\n\n // Then the step with highest priority is returned\n ensureThat(step4, equalTo(steps.get(0)));\n }",
"@Test\n void testDisabledOnFailedAssumption(){\n assumeTrue(DayOfWeek.TUESDAY.equals(LocalDate.now().getDayOfWeek()));\n assertEquals(1, 2);\n }",
"@Test\n public void testStrategyPatterns() throws Exception {\n for (String s : validStrategyPatterns) {\n assertTrue(\"Didn't match '\" + s + \"'\",\n ZkResolver.strategyPattern.matcher(s).matches());\n }\n\n // Test input that should not match\n for (String s : validEndpointPatterns) {\n assertFalse(\"Matched '\" + s + \"'\",\n ZkResolver.strategyPattern.matcher(s).matches());\n }\n // Test input that should not match\n for (String s : validEndpointStrategyPatterns) {\n assertFalse(\"Matched '\" + s + \"'\",\n ZkResolver.endpointPattern.matcher(s).matches());\n }\n }",
"public Decision planBest(Context context, Decision defaultDecision);",
"@Test\r\n public void testPlayer_getDumbStrategyCard_differentWinners() {\r\n player2 = new Player(\"\", true);\r\n player2.setHand(strategyHand.getAllCards());\r\n boolean differentLegalCardFound = false;\r\n Card firstDiscard = player2.getDumbStrategyCard(yellowSix, yellowSix.getColor());\r\n for(int i = 0; i < 25; i++) {\r\n Card loopCard = player2.getDumbStrategyCard(yellowSix, yellowSix.getColor());\r\n if(!loopCard.equals(firstDiscard)) {\r\n differentLegalCardFound = true;\r\n }\r\n }\r\n assertTrue(differentLegalCardFound);\r\n }",
"Journey getExpectedJoruney();",
"@Test\n public void test_witness_bidirectional() {\n CHPreparationGraph graph = CHPreparationGraph.edgeBased(6, 6, (in, via, out) -> in == out ? 10 : 0);\n int edge = 0;\n graph.addEdge(0, 1, edge++, 10, 10);\n graph.addEdge(1, 2, edge++, 10, 10);\n graph.addEdge(2, 3, edge++, 20, 20);\n graph.addEdge(3, 4, edge++, 10, 10);\n graph.addEdge(1, 5, edge++, 10, 10);\n graph.addEdge(5, 3, edge++, 10, 10);\n graph.prepareForContraction();\n EdgeBasedWitnessPathSearcher searcher = new EdgeBasedWitnessPathSearcher(graph);\n searcher.initSearch(0, 1, 2, new EdgeBasedWitnessPathSearcher.Stats());\n double weight = searcher.runSearch(3, 6, 30.0, 100);\n assertEquals(20, weight, 1.e-6);\n }",
"public Decision bestFor(Context context);",
"@Test\r\n\tpublic void testFrontTimes() {\r\n//\t\tassertEquals(\"ChoCho\", WarmUpTwo.frontTimes)\r\n\t\tfail(\"Not yet implemented\");\r\n\t\t\r\n\t}",
"@Test\n public void testNextCardGood() {\n System.out.println(\"nextCardGood\");\n Deck deck = new Deck();\n Card card = deck.nextCard();\n ////since the deck is unshuffled, that last card should be WILDCARD\n assertEquals(CardType.WILDCARD, card.getValue());\n }",
"@Test\n public void defensiveStrategy_notBlocked() throws IOException {\n Board f0 = new Board(\"------\"\n + \"-C----\"\n + \"------\"\n + \"------\"\n + \"P-P---\"\n + \"------\");\n // nicht blockiert, daher selbe Bewertung fuer beide Strategien\n assertEquals(f0.evaluate(true), f0.evaluate(false));\n assertTrue(f0.evaluate(false) < 0);\n\n // ausgeglichene Vorteile beider Spieler\n Board f1 = new Board(\"C--P-P\"\n + \"-C----\"\n + \"------\"\n + \"------\"\n + \"------\"\n + \"------\");\n\n assertEquals(f1.evaluate(false), f1.evaluate(true));\n assertEquals(0, f1.evaluate(false));\n }",
"@Test\r\n void testMistrustAlwaysDefect() {\r\n AlwaysDefect testStrat = new AlwaysDefect();\r\n Mistrust testStrat2 = new Mistrust();\r\n ArrayList<Integer> payoffs = new ArrayList<>(Arrays.asList(3, 5, 0, 1));\r\n Game game = new Game(testStrat, testStrat2, 3, payoffs);\r\n game.playGame();\r\n assertEquals(testStrat2.getPoints(), 3, \"Mistrust strategy not functioning correctly\");\r\n }",
"public abstract boolean isSatisfied();",
"@Test\n public void test_shortcut_needed_basic() {\n CHPreparationGraph graph = CHPreparationGraph.edgeBased(5, 4, (in, via, out) -> in == out ? 10 : 0);\n int edge = 0;\n graph.addEdge(0, 1, edge++, 10, Double.POSITIVE_INFINITY);\n graph.addEdge(1, 2, edge++, 10, Double.POSITIVE_INFINITY);\n graph.addEdge(2, 3, edge++, 10, Double.POSITIVE_INFINITY);\n graph.addEdge(3, 4, edge++, 10, Double.POSITIVE_INFINITY);\n graph.prepareForContraction();\n EdgeBasedWitnessPathSearcher searcher = new EdgeBasedWitnessPathSearcher(graph);\n searcher.initSearch(0, 1, 2, new EdgeBasedWitnessPathSearcher.Stats());\n double weight = searcher.runSearch(3, 6, 20.0, 100);\n assertTrue(Double.isInfinite(weight));\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 }",
"public interface Strategy {\n /**\n * suggest next bid value according to current action status\n * @param auction - current auction status, must not be null\n * @return non-negative bid value according implementation less or equal than {@link Auction#getOwnCache()}\n */\n int nextBid(Auction auction);\n}",
"@Test\n public void bestowCheckForCorrectCMC() {\n addCard(Zone.BATTLEFIELD, playerA, \"Island\", 7);\n // Enchantment Creature — Siren\n // 1/1\n // Bestow {5}{U}{U} (If you cast this card for its bestow cost, it's an Aura spell with enchant creature. It becomes a creature again if it's not attached to a creature.)\n // Flying\n // You control enchanted creature.\n // Enchanted creature gets +1/+1 and has flying.\n addCard(Zone.HAND, playerA, \"Hypnotic Siren\");\n // Instant {1}{U}\n // Counter target spell with converted mana cost 4 or greater.\n addCard(Zone.HAND, playerB, \"Disdainful Stroke\");\n addCard(Zone.BATTLEFIELD, playerB, \"Island\", 2);\n\n addCard(Zone.BATTLEFIELD, playerB, \"Silvercoat Lion\");\n\n // B can't cast counter spell due CMC\n castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, \"Hypnotic Siren using bestow\", \"Silvercoat Lion\");\n checkStackSize(\"after\", 1, PhaseStep.PRECOMBAT_MAIN, playerB, 1);\n checkPlayableAbility(\"after\", 1, PhaseStep.PRECOMBAT_MAIN, playerB, \"Cast Disdainful Stroke\", false);\n //castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, \"Disdainful Stroke\", \"Hypnotic Siren\");\n\n setStrictChooseMode(true);\n setStopAt(1, PhaseStep.BEGIN_COMBAT);\n execute();\n\n //\n assertHandCount(playerA, \"Hypnotic Siren\", 0);\n assertGraveyardCount(playerA, \"Hypnotic Siren\", 0);\n assertHandCount(playerB, \"Disdainful Stroke\", 1);\n assertPermanentCount(playerA, \"Hypnotic Siren\", 1);\n\n // because cast with bestow, Boon Satyr may not be tapped\n assertPermanentCount(playerA, \"Silvercoat Lion\", 1);\n assertPowerToughness(playerA, \"Silvercoat Lion\", 3, 3);\n\n }",
"@Test\r\n void testProberFirst() {\r\n Prober testStrat = new Prober();\r\n AlwaysCooperate testStrat2 = new AlwaysCooperate();\r\n ArrayList<Integer> payoffs = new ArrayList<>(Arrays.asList(3, 5, 0, 1));\r\n ArrayList<Character> expected = new ArrayList<>(Arrays.asList('d', 'c', 'c', 'd', 'd'));\r\n Game game = new Game(testStrat, testStrat2, 5, payoffs);\r\n game.playGame();\r\n assertEquals(game.historyStrategy1, expected, \"Prober strategy not functioning correctly\");\r\n }",
"private void intelligentDecideMove() {\n\t\tMonster target=nearestEnemy();\r\n\t\tif(target!=null){\t\t\t\t//FIRST PRIORITY: pursue the target if it can be seen.\r\n\t\t\tswitchStates(PURSUIT);\r\n\t\t\ttargetTile=new Tile(target.currentTile);\r\n\t\t\t//saveMove();\r\n\t\t\tmonster.moveTowards(target);\r\n\t\t}\r\n\t\t\t\r\n\t\telse{\r\n\t\t\ttargetLostResponse();\r\n\t\t\t}\r\n\t}",
"GoalSpecification createGoalSpecification();",
"@Test\n\tpublic void NenHithoelStatsAndKeywordsAreCorrect() throws DecisionResultInvalidException, CardNotFoundException {\n\t\tGenericCardTestHelper scn = GetScenario();\n\n\t\tPhysicalCardImpl site8 = scn.GetFreepsSite(8);\n\n\t\tassertFalse(site8.getBlueprint().isUnique());\n\t\t//assertEquals(Side.FREE_PEOPLE, site8.getBlueprint().getSide());\n\t\t//assertEquals(Culture., card.getBlueprint().getCulture());\n\t\tassertEquals(CardType.SITE, site8.getBlueprint().getCardType());\n\t\t//assertEquals(Race.CREATURE, card.getBlueprint().getRace());\n\t\tassertTrue(scn.HasKeyword(site8, Keyword.RIVER)); // test for keywords as needed\n\t\tassertEquals(7, site8.getBlueprint().getTwilightCost());\n\t\t//assertEquals(, card.getBlueprint().getStrength());\n\t\t//assertEquals(, card.getBlueprint().getVitality());\n\t\t//assertEquals(, card.getBlueprint().getResistance());\n\t\t//assertEquals(Signet., card.getBlueprint().getSignet()); \n\t\tassertEquals(8, site8.getBlueprint().getSiteNumber()); // Change this to getAllyHomeSiteNumbers for allies\n\n\t}",
"@Test\n\tpublic void SecondforWinnerchecker() {\n\t\tString stringOfTestingWord = (\"neword\");\n\t\tboolean ExpectedResult = true;\n\t\tboolean MethodResult = object1.Winnerchecker(stringOfTestingWord);\n\t\tassertEquals(ExpectedResult, MethodResult);\n\t}",
"@Test\r\n void testProberSecond() {\r\n Prober testStrat = new Prober();\r\n PeriodicCD testStrat2 = new PeriodicCD();\r\n ArrayList<Integer> payoffs = new ArrayList<>(Arrays.asList(3, 5, 0, 1));\r\n ArrayList<Character> expected = new ArrayList<>(Arrays.asList('d', 'c', 'c', 'c', 'd'));\r\n Game game = new Game(testStrat, testStrat2, 5, payoffs);\r\n game.playGame();\r\n assertEquals(game.historyStrategy1, expected, \"Prober strategy not functioning correctly\");\r\n }",
"public int throwRandomStrategy(int[] fighter) {\n Random rnd = new Random();\n int defenseLimit = 3;\n//If little life left, he defends 50% of the blows\n if (fighter[LIFE] < 2) {\n defenseLimit = 1;\n }\n int accio = rnd.nextInt(10);\n if ((accio >= 0) && (accio < defenseLimit)) {\n return Combat.ATTACK;\n } else if ((defenseLimit >= 3) && (accio < 6)) {\n return Combat.DEFENSE;\n } else if ((accio >= 6) && (accio < 8)) {\n return Combat.CHEATING;\n } else {\n return Combat.MANEUVER;\n }\n }",
"public static int getStrategyChoice() {\r\n\t\tint strategy = -1;\r\n\t\tgetStrategyScanner = new Scanner(System.in);\r\n\t\tSystem.out.println(\"Choose the strategy of your opponent:\" +\r\n\t\t\t\t\"\\n\\t(\" + RANDOM + \") - Random player\" +\r\n\t\t\t\t\"\\n\\t(\" + DEFENSIVE + \") - Defensive player\" +\r\n\t\t\t\t\"\\n\\t(\" + SIDES + \") - To-the-Sides player player\");\r\n\t\twhile (strategy != RANDOM & strategy != DEFENSIVE\r\n\t\t\t\t& strategy != SIDES) {\r\n\t\t\tstrategy=getStrategyScanner.nextInt();\r\n\t\t}\r\n\t\treturn strategy;\r\n\t}",
"@Test\n public void determineWinnerNoRedMove()\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.P07, King.WHITE.withAgent(agentWhite));\n environment.placeToken(CheckersPosition.P03, Pawn.WHITE.withAgent(agentWhite));\n environment.placeToken(CheckersPosition.P02, Pawn.WHITE.withAgent(agentWhite));\n environment.placeToken(CheckersPosition.P12, Pawn.RED.withAgent(agentRed));\n environment.placeToken(CheckersPosition.P08, Pawn.RED.withAgent(agentRed));\n environment.placeToken(CheckersPosition.P04, King.RED.withAgent(agentRed));\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(agentWhite));\n }",
"@Test\n public void testWhoIsOnTurn() {\n Assertions.assertEquals('O', GameUtil.whoIsOnTurn(0), \"Test - 0 returns player O\");\n Assertions.assertEquals('X', GameUtil.whoIsOnTurn(1), \"Test - 1 returns player X\");\n Assertions.assertEquals('O', GameUtil.whoIsOnTurn(2), \"Test - 2 returns player O\");\n Assertions.assertEquals('X', GameUtil.whoIsOnTurn(3), \"Test - 3 returns player X\");\n Assertions.assertEquals('O', GameUtil.whoIsOnTurn(4), \"Test - 4 returns player O\");\n Assertions.assertEquals('X', GameUtil.whoIsOnTurn(5), \"Test - 5 returns player X\");\n Assertions.assertEquals('O', GameUtil.whoIsOnTurn(6), \"Test - 6 returns player O\");\n Assertions.assertEquals('X', GameUtil.whoIsOnTurn(7), \"Test - 7 returns player X\");\n Assertions.assertEquals('O', GameUtil.whoIsOnTurn(8), \"Test - 8 returns player O\");\n }",
"abstract int pregnancy();",
"@Test\n public void testWinner() {\n //creating a new country object\n Country l_country2 = new Country();\n l_country2.setD_continentIndex(1);\n l_country2.setD_countryIndex(3);\n l_country2.setD_countryName(\"nepal\");\n List<Country> l_countryList = d_gameData.getD_warMap().getD_continents().get(1).getD_countryList();\n l_countryList.add(l_country2);\n d_gameData.getD_warMap().getD_continents().get(1).setD_countryList(l_countryList);\n\n MapHandlingInterface l_map = new MapHandlingImpl();\n List<String> l_neighbour = d_gameData.getD_playerList().get(0).getD_ownedCountries().get(1).getD_neighbourCountries();\n l_neighbour.add(\"nepal\");\n d_gameData.getD_playerList().get(0).getD_ownedCountries().get(1).setD_neighbourCountries(l_neighbour);\n d_orderProcessor.processOrder(\"advance china nepal 3\".trim(), d_gameData);\n d_gameData.getD_playerList().get(0).issue_order();\n Order l_order = d_gameData.getD_playerList().get(0).next_order();\n assertEquals(true, l_order.executeOrder());\n assertEquals(d_gameData.getD_playerList().get(0).getD_ownedCountries().size(), l_map.getAvailableCountries(d_gameData.getD_warMap()).size());\n }",
"@Test\n \tpublic void testCheckingAccusation() {\n \t\t//Set answer\n \t\tSolution answer = new Solution(\"Colonel Mustard\", \"Knife\", \"Library\");\n \t\tSolution guess = new Solution(\"Colonel Mustard\", \"Knife\", \"Library\");\n \t\tgame.setAnswer(answer);\n \t\t//Check correct accusation\n \t\t//correct if it contains the correct person, weapon and room\n \t\tAssert.assertTrue(game.checkAccusation(guess));\n \t\t//Check false accusation\n \t\t//not correct if the room is wrong, or if the person is wrong, if the weapon is wrong, or if all three are wrong\n \t\t//wrong room\n \t\tguess = new Solution(\"Colonel Mustard\", \"Knife\", \"Billiards Room\");\n \t\tAssert.assertFalse(game.checkAccusation(guess));\n \t\t//wrong weapon\n \t\tguess = new Solution(\"Colonel Mustard\", \"Lead Pipe\", \"Library\");\n \t\tAssert.assertFalse(game.checkAccusation(guess));\n \t\t//wrong person\n \t\tguess = new Solution(\"Ms. Peacock\", \"Knife\", \"Library\");\n \t\tAssert.assertFalse(game.checkAccusation(guess));\n \t}",
"@Test\n public void test_chooseBadTargetOnSacrifice_WithoutTargets_AI() {\n addCard(Zone.HAND, playerA, \"Redcap Melee\", 1);\n addCard(Zone.BATTLEFIELD, playerA, \"Atarka Monument\", 1); // {T}: Add {R} or {G}.\n //\n addCard(Zone.BATTLEFIELD, playerB, \"Silvercoat Lion\", 1);\n\n castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, \"Redcap Melee\", \"Silvercoat Lion\");\n //addTarget(playerA, \"Mountain\"); no lands to sacrifice\n\n //setStrictChooseMode(true);\n setStopAt(1, PhaseStep.END_TURN);\n execute();\n\n assertGraveyardCount(playerA, \"Redcap Melee\", 1);\n assertGraveyardCount(playerB, \"Silvercoat Lion\", 1);\n }",
"@Test\n\tpublic void forWinnerchecker() {\n\t\tString stringOfTestingWord = (\"aword\");\n\t\tboolean ExpectedResult;\n\t\tExpectedResult = true;\n\t\tboolean MethodResult = object1.Winnerchecker(stringOfTestingWord);\n\t\tassertEquals(ExpectedResult, MethodResult);\n\t}",
"public void shouldUseReasoner() throws Exception {\n // Create our ontology manager in the usual way.\n OWLOntologyManager manager = OWLManager.createOWLOntologyManager();\n OWLOntology ont = load(manager);\n\n //df = manager.getOWLDataFactory();\n // We need to create an instance of OWLReasoner. An OWLReasoner provides\n // the basic query functionality that we need, for example the ability\n // obtain the subclasses of a class etc. To do this we use a reasoner\n // factory. Create a reasoner factory. In this case, we will use HermiT,\n // but we could also use FaCT++ (http://code.google.com/p/factplusplus/)\n // or Pellet(http://clarkparsia.com/pellet) Note that (as of 03 Feb\n // 2010) FaCT++ and Pellet OWL API 3.0.0 compatible libraries are\n // expected to be available in the near future). For now, we'll use\n // HermiT HermiT can be downloaded from http://hermit-reasoner.com Make\n // sure you get the HermiT library and add it to your class path. You\n // can then instantiate the HermiT reasoner factory: Comment out the\n // first line below and uncomment the second line below to instantiate\n // the HermiT reasoner factory. You'll also need to import the\n // org.semanticweb.HermiT.Reasoner package.\n OWLReasonerFactory reasonerFactory = new StructuralReasonerFactory();\n // OWLReasonerFactory reasonerFactory = new Reasoner.ReasonerFactory();\n // We'll now create an instance of an OWLReasoner (the implementation\n // being provided by HermiT as we're using the HermiT reasoner factory).\n // The are two categories of reasoner, Buffering and NonBuffering. In\n // our case, we'll create the buffering reasoner, which is the default\n // kind of reasoner. We'll also attach a progress monitor to the\n // reasoner. To do this we set up a configuration that knows about a\n // progress monitor. Create a console progress monitor. This will print\n // the reasoner progress out to the console.\n // ConsoleProgressMonitor progressMonitor = new\n // ConsoleProgressMonitor();\n // Specify the progress monitor via a configuration. We could also\n // specify other setup parameters in the configuration, and different\n // reasoners may accept their own defined parameters this way.\n // OWLReasonerConfiguration config = new SimpleConfiguration(\n // progressMonitor);\n // Create a reasoner that will reason over our ontology and its imports\n // closure. Pass in the configuration.\n // OWLReasoner reasoner = reasonerFactory.createReasoner(ont, config);\n OWLReasoner reasoner = reasonerFactory.createReasoner(ont);\n // Ask the reasoner to do all the necessary work now\n reasoner.precomputeInferences();\n // We can determine if the ontology is actually consistent (in this\n // case, it should be).\n boolean consistent = reasoner.isConsistent();\n System.out.println(\"Consistent: \" + consistent);\n // We can easily get a list of unsatisfiable classes. (A class is\n // unsatisfiable if it can't possibly have any instances). Note that the\n // getUnsatisfiableClasses method is really just a convenience method\n // for obtaining the classes that are equivalent to owl:Nothing.\n Node<OWLClass> bottomNode = reasoner.getUnsatisfiableClasses();\n // This node contains owl:Nothing and all the classes that are\n // equivalent to owl:Nothing - i.e. the unsatisfiable classes. We just\n // want to print out the unsatisfiable classes excluding owl:Nothing,\n // and we can used a convenience method on the node to get these\n Set<OWLClass> unsatisfiable = bottomNode.getEntitiesMinusBottom();\n if (!unsatisfiable.isEmpty()) {\n System.out.println(\"The following classes are unsatisfiable: \");\n for (OWLClass cls : unsatisfiable) {\n System.out.println(\" \" + cls);\n }\n } else {\n System.out.println(\"There are no unsatisfiable classes\");\n }\n // Now we want to query the reasoner for all descendants of Marsupial.\n // Vegetarians are defined in the ontology to be animals that don't eat\n // animals or parts of animals.\n OWLDataFactory fac = manager.getOWLDataFactory();\n // Get a reference to the vegetarian class so that we can as the\n // reasoner about it. The full IRI of this class happens to be:\n // <http://protege.stanford.edu/plugins/owl/owl-library/koala.owl#Marsupials>\n OWLClass marsupials = fac.getOWLClass(IRI.create(\n \"http://protege.stanford.edu/plugins/owl/owl-library/koala.owl#Marsupials\"));\n // Now use the reasoner to obtain the subclasses of Marsupials. We can\n // ask for the direct subclasses or all of the (proper)\n // subclasses. In this case we just want the direct ones\n // (which we specify by the \"true\" flag).\n NodeSet<OWLClass> subClses = reasoner.getSubClasses(marsupials, true);\n // The reasoner returns a NodeSet, which represents a set of Nodes. Each\n // node in the set represents a subclass of Marsupial. A node of\n // classes contains classes, where each class in the node is equivalent.\n // For example, if we asked for the subclasses of some class A and got\n // back a NodeSet containing two nodes {B, C} and {D}, then A would have\n // two proper subclasses. One of these subclasses would be equivalent to\n // the class D, and the other would be the class that is equivalent to\n // class B and class C. In this case, we don't particularly care about\n // the equivalences, so we will flatten this set of sets and print the\n // result\n Set<OWLClass> clses = subClses.getFlattened();\n for (OWLClass cls : clses) {\n System.out.println(\" \" + cls);\n }\n // We can easily\n // retrieve the instances of a class. In this example we'll obtain the\n // instances of the class Marsupials.\n NodeSet<OWLNamedIndividual> individualsNodeSet = reasoner.getInstances(marsupials, false);\n // The reasoner returns a NodeSet again. This time the NodeSet contains\n // individuals. Again, we just want the individuals, so get a flattened\n // set.\n Set<OWLNamedIndividual> individuals = individualsNodeSet.getFlattened();\n for (OWLNamedIndividual ind : individuals) {\n System.out.println(\" \" + ind);\n }\n // Again, it's worth noting that not all of the individuals that are\n // returned were explicitly stated to be marsupials. Finally, we can ask\n // for the property values (property assertions in OWL speak) for a\n // given\n // individual and property.\n // Let's get all properties for all individuals\n for (OWLNamedIndividual i : ont.getIndividualsInSignature()) {\n for (OWLObjectProperty p : ont.getObjectPropertiesInSignature()) {\n NodeSet<OWLNamedIndividual> individualValues = reasoner.getObjectPropertyValues(i, p);\n System.out.println(\"Vazio: \"+individualValues.isEmpty());\n Set<OWLNamedIndividual> values = individualValues.getFlattened();\n System.out.println(\"The property values for \"+p+\" for individual \"+i+\" are: \");\n for (OWLNamedIndividual ind : values) {\n System.out.println(\" \" + ind);\n }\n }\n }\n // Finally, let's print out the class hierarchy.\n Node<OWLClass> topNode = reasoner.getTopClassNode();\n print(topNode, reasoner, 0);\n\n\n }",
"@Test\n public void test7() throws Exception {\n try {\n tester.testOnInheritanceTree(Story7, testClass);\n Assert.fail();\n } catch (StoryTestException e) {\n Assert.assertEquals(\"Then A's z is Word or A's z is WORd or A's z is word or A's z is WOrd\", e.getSentence());\n Assert.assertEquals(2, e.getNumFail());\n List<String> expected = new LinkedList<>();\n expected.add(\"Word\");\n expected.add(\"WORd\");\n expected.add(\"word\");\n expected.add(\"WOrd\");\n Assert.assertEquals(expected, e.getStoryExpected());\n List<String> actual = new LinkedList<>();\n actual.add(\"WORD\");\n actual.add(\"WORD\");\n actual.add(\"WORD\");\n actual.add(\"WORD\");\n Assert.assertEquals(actual, e.getTestResult());\n }\n catch (ThenNotFoundException e) {\n Assert.fail();\n }\n }",
"public BDD ensureBDD(Object o) {\n if (o instanceof BDD) {\n return (BDD) o;\n }\n else if (o instanceof Long) {\n if (((Long) o).equals(new Long(0))) {\n return B.zero();\n }\n else {\n return B.one();\n }\n }\n else if (o instanceof String) {\n String s = parens(o);\n \n return presenceConditionManager.getVariableManager().getVariable(s);\n }\n else if (o instanceof Boolean) {\n Boolean b = (Boolean) o;\n \n if (b) {\n return B.one();\n }\n else {\n return B.zero();\n }\n }\n else {\n System.err.println(\"FATAL: ensureBDD, unforeseen type from evaluator\");\n System.err.println(o);\n System.err.println(o.getClass());\n System.exit(-1);\n \n return null;\n }\n }",
"@Test\n public void alienAttacksDefendedHuman() throws FileNotFoundException,\n URISyntaxException, DisconnectedException {\n // preparo il terreno\n MatchController matchController = new MatchController() {\n @Override\n public void initMatch(PartyController partyController)\n throws FileNotFoundException, URISyntaxException {\n this.partyController = partyController;\n this.match = new Match();\n this.turnController = new TurnController(this);\n ZoneFactory zf = new TemplateZoneFactory(\n EftaiosGame.DEFAULT_MAP);\n this.zoneController = new ZoneController(zf);\n }\n\n @Override\n public void checkEndGame() {\n }\n\n @Override\n protected void notifyAPlayerAbout(Player player, String about) {\n }\n\n @Override\n protected void showCardToParty(Card card) {\n }\n\n @Override\n protected void updateDeckView(Player player) {\n }\n\n @Override\n protected void sendMapVariationToPlayer(Player player, Sector sec,\n SectorHighlight highlight) {\n }\n\n @Override\n protected void sendViewModelToAPlayer(Player p, ViewModel content) {\n }\n };\n\n PlayerCard alien = new PlayerCard(PlayerRace.ALIEN, null);\n PlayerCard human = new PlayerCard(PlayerRace.HUMAN, null);\n Party party = new Party(\"test\", new EftaiosGame(), false);\n PartyController partyController = PartyController.createNewParty(party);\n party.addToParty(UUID.randomUUID(), \"player1\");\n party.addToParty(UUID.randomUUID(), \"player2\");\n List<Player> players = new ArrayList<Player>(party.getMembers()\n .keySet());\n Player player1 = players.get(0);\n Player player2 = players.get(1);\n player1.setIdentity(alien);\n player2.setIdentity(human);\n ItemCard defenseCard = new ItemCard(Item.DEFENSE);\n player2.getItemsDeck().getCards().add(defenseCard);\n\n matchController.initMatch(partyController);\n\n Turn turn = new Turn(player1, matchController.getMatch().getTurnCount());\n matchController.getTurnController().setTurn(turn);\n matchController.getTurnController().getTurn().setMustMove(false);\n HexPoint point = HexPoint.fromOffset(1, 1);\n Sector sec = new Sector(null, point);\n matchController.getZoneController().getCurrentZone()\n .movePlayer(player1, sec);\n matchController.getZoneController().getCurrentZone()\n .movePlayer(player2, sec);\n matchController.getTurnController().getTurn().setCanAttack(true);\n ActionRequest action = new ActionRequest(ActionType.ATTACK, null, null);\n // eseguo l'azione\n Attack atk = new Attack() {\n @Override\n protected void notifyInChatByCurrentPlayer(String what) {\n }\n\n @Override\n protected void notifyCurrentPlayerByServer(String what) {\n }\n };\n atk.initAction(matchController, action);\n if (atk.isValid())\n atk.processAction();\n // verifico gli esiti\n assertTrue(player1.getKillsCount() == 0);\n assertTrue(matchController.getZoneController().getCurrentZone()\n .getCell(player1).equals(sec));\n assertTrue(matchController.getZoneController().getCurrentZone()\n .getCell(player2).equals(sec));\n assertFalse(matchController.getMatch().getDeadPlayer()\n .contains(player2));\n assertTrue(matchController.getMatch().getDeadPlayer().size() == 0);\n assertTrue(matchController.getMatch().getItemsDeck().getBucket()\n .contains(defenseCard));\n assertTrue(matchController.getMatch().getItemsDeck().getBucket().size() == 1);\n assertFalse(player2.getItemsDeck().getCards().contains(defenseCard));\n\n }",
"@Override\npublic Action actionChoosed(Player joueur) {\n WarPlayer player = this.castPlayer(joueur);\n int index = ((WarStrategy)(player.getStrategy())).skipOrDeploy();\n Action action = new SkipAction(player);\n if (index == 0) {\n Army army = this.inputArmy(player);\n Tile tile = ((WarStrategy)player.getStrategy()).inputTileStrategy();\n if(army != null && tile != null) {\n if (army.getArmySize() > 3 && tile.equals(new MountainTile(0, 0, 1, 0))) {\n System.out.println(\" Army of size \" + army.getArmySize() + \" can't be deployed on a mountain tile ! \");\n player.addWarrior(army.getArmySize());\n } else {\n action = new WarActionDeploy(player, this.board, tile.getPosX(), tile.getPosY(), army);\n }\n } else if (army != null && tile == null) {\n player.addWarrior(army.getArmySize());\n }\n }\n return action;\n}",
"@Test\n\t/** Level 4 Thunderlord AD vs Thunderlord Arm Pen\n\t * Thunderlord + AD:\n\t * \t\t726.12 AD Dealt\n\t * \t\t47.59 AP Dealt\n\t * \t\tArmor Reduction: 88%\n\t * Thunderlord + Full Arm Pen Runes\n\t * \t\t632.02 AD Dealt\n\t * \t\t43 AP Dealt\n\t * \t\tArmor Reduction: 88%\n\t * \t\tFlat Armor Pen: 19.2\n\t */\n\tpublic void testThunderlordArmPen() {\n\t}",
"@Test\n\tpublic void multipleSolutionsTest(){\n\t\tDjikstrasMap m = new DjikstrasMap();\t//Creates new DjikstrasMap object\n\t\t\n\t\tm.addRoad(\"Guildford\", \"Portsmouth\", 20.5, \"M3\");\t//Adds a road from Guildford to portsmouth to the map\n m.addRoad(\"Portsmouth\", \"Guildford\", 20.5, \"M3\");\n \n m.addRoad(\"Guildford\", \"Winchester\", 20.5, \"A33\");\t//Adds a road from Guildford to winchester to the map\n m.addRoad(\"Winchester\", \"Guildford\", 20.5, \"A33\");\n \n m.addRoad(\"Winchester\", \"Fareham\", 20.5, \"M27\");\t//Adds a road from winchester to fareham to the map\n m.addRoad(\"Fareham\", \"Winchester\", 20.5, \"M27\");\n\t\t\n m.addRoad(\"Portsmouth\", \"Fareham\", 20.5, \"M25\");\t//Adds a road from fareham to portsmouth to the map\n m.addRoad(\"Fareham\", \"Portsmouth\", 20.5, \"M25\");\n \n m.findShortestPath(\"Fareham\");\t//Starts the algorithm to find the shortest path\n \n List<String> temp = new ArrayList<String>();\t//Holds the route plan\n temp = m.createRoutePlan(\"Guildford\");\t//Calls methods to assign the route plan to temp\n \n assertEquals(\"1. Take the M27 to Winchester\",temp.get(0));\t//tests that the different lines in the route plan are correct and that the algorithm did indeed take the shortest route\n assertEquals(\"2. Take the A33 to Guildford\", temp.get(1));\n assertEquals(\"\", temp.get(2));\n assertEquals(\"The Journey will take 41 hours and .00 minutes long.\", temp.get(3));\n assertEquals(\"\", temp.get(4));\n \n assertEquals(5, temp.size());\t//tests to see that the route plan is 5 line large as it should be\n\t}",
"@Test\r\n public void testCheckGIS() {\r\n System.out.println(\"checkGIS\");\r\n String word = \"crowd\";\r\n IwRepoDAOMarkLogicImplStud instance = new IwRepoDAOMarkLogicImplStud();\r\n boolean expResult = true;\r\n boolean result = instance.checkGIS(word);\r\n assertEquals(expResult, result);\r\n word = \"nevergoingtobeawordtotest\";\r\n expResult = false;\r\n result = instance.checkGIS(word);\r\n assertEquals(expResult, result);\r\n }",
"@Test\n public void alienAttacksUndefendedHuman() throws FileNotFoundException,\n URISyntaxException, DisconnectedException {\n // preparo il terreno\n MatchController matchController = new MatchController() {\n @Override\n public void initMatch(PartyController partyController)\n throws FileNotFoundException, URISyntaxException {\n this.partyController = partyController;\n this.match = new Match();\n this.turnController = new TurnController(this);\n ZoneFactory zf = new TemplateZoneFactory(\n EftaiosGame.DEFAULT_MAP);\n this.zoneController = new ZoneController(zf);\n }\n\n @Override\n public void checkEndGame() {\n }\n\n @Override\n protected void notifyAPlayerAbout(Player player, String about) {\n }\n\n @Override\n protected void showCardToParty(Card card) {\n }\n\n @Override\n protected void updateDeckView(Player player) {\n }\n\n @Override\n protected void sendMapVariationToPlayer(Player player, Sector sec,\n SectorHighlight highlight) {\n }\n\n @Override\n protected void sendViewModelToAPlayer(Player p, ViewModel content) {\n }\n };\n\n PlayerCard alien = new PlayerCard(PlayerRace.ALIEN, null);\n PlayerCard human = new PlayerCard(PlayerRace.HUMAN, null);\n Party party = new Party(\"test\", new EftaiosGame(), false);\n PartyController partyController = PartyController.createNewParty(party);\n party.addToParty(UUID.randomUUID(), \"player1\");\n party.addToParty(UUID.randomUUID(), \"player2\");\n List<Player> players = new ArrayList<Player>(party.getMembers()\n .keySet());\n Player player1 = players.get(0);\n Player player2 = players.get(1);\n player1.setIdentity(alien);\n player2.setIdentity(human);\n\n matchController.initMatch(partyController);\n\n Turn turn = new Turn(player1, matchController.getMatch().getTurnCount());\n matchController.getTurnController().setTurn(turn);\n matchController.getTurnController().getTurn().setMustMove(false);\n HexPoint point = HexPoint.fromOffset(1, 1);\n Sector sec = new Sector(null, point);\n matchController.getZoneController().getCurrentZone()\n .movePlayer(player1, sec);\n matchController.getZoneController().getCurrentZone()\n .movePlayer(player2, sec);\n matchController.getTurnController().getTurn().setCanAttack(true);\n ActionRequest action = new ActionRequest(ActionType.ATTACK, null, null);\n // eseguo l'azione\n Attack atk = new Attack() {\n @Override\n protected void notifyInChatByCurrentPlayer(String what) {\n }\n\n @Override\n protected void notifyCurrentPlayerByServer(String what) {\n }\n };\n atk.initAction(matchController, action);\n if (atk.isValid())\n atk.processAction();\n // verifico gli esiti\n assertTrue(player1.getKillsCount() == 1);\n assertTrue(matchController.getZoneController().getCurrentZone()\n .getCell(player1).equals(sec));\n assertTrue(matchController.getTurnController().getTurn().getCanAttack() == false);\n assertTrue(matchController.getZoneController().getCurrentZone()\n .getCell(player2) == matchController.endingSector);\n assertTrue(matchController.getMatch().getDeadPlayer().contains(player2));\n assertTrue(matchController.getMatch().getDeadPlayer().size() == 1);\n }",
"@Test\n void doEffectwhisper() {\n ArrayList<Player> pl = new ArrayList<>();\n AlphaGame g = new AlphaGame(1, pl,false, 8);\n WeaponFactory wf = new WeaponFactory(\"whisper\");\n Weapon w6 = new Weapon(\"whisper\", wf.getBooleans(), wf.getCosts(), wf.getRequestedNum(), wf.getApplier(), wf.getEffects(), wf.getDescriptions());\n WeaponDeck wd = new WeaponDeck();\n wd.addWeapon(w6);\n RealPlayer p = new RealPlayer('b', \"ciccia\");\n p.setPlayerPosition(Board.getSpawnpoint(2));\n p.getPh().drawWeapon(wd, w6.getName());\n RealPlayer victim = new RealPlayer('y', \"ciccia\");\n victim.setPlayerPosition(Board.getSpawnpoint('y'));\n ArrayList<Player> players = new ArrayList<>();\n players.add(victim);\n\n try{\n p.getPh().getWeaponDeck().getWeapon(w6.getName()).doEffect(\"base\", null, null, p, players, null);\n }catch (WrongValueException | WrongPlayerException | WrongSquareException e) { }\n\n assertTrue(victim.getPb().getMarkedDamages('b') == 1 && victim.getPb().countDamages() == 3);\n\n players.get(0).setPlayerPosition(Board.getSquare(7));\n try {\n p.getPh().getWeaponDeck().getWeapon(w6.getName()).doEffect(\"base\", null, null, p, players, null); //\"A choice of yours is wrong\"\n }catch (WrongValueException | WrongPlayerException | WrongSquareException e) { }\n }",
"@Test(expected=RuntimeException.class)\n\tpublic void testWarm_DetailedElseAbort_ShouldAbort1() {\n\t\tEmissionModule emissionModule = setUpScenario(EmissionsConfigGroup.DetailedVsAverageLookupBehavior.onlyTryDetailedElseAbort);\n\n\t\tdouble travelTimeOnLink = 21; //sec. approx freeSpeed of link12 is : (200 m) / (9.72.. m/s) approx 20.57 s\n\t\temissionModule.getWarmEmissionAnalysisModule().checkVehicleInfoAndCalculateWarmEmissions(vehicleFallbackToTechnologyAverage, link, travelTimeOnLink);\n\t}",
"@Test\n\tpublic void testWarm_DetailedThenTechnologyAverageThenAverageTable_FallbackToAverageTable() {\n\t\tEmissionModule emissionModule = setUpScenario(EmissionsConfigGroup.DetailedVsAverageLookupBehavior.tryDetailedThenTechnologyAverageThenAverageTable);\n\n\t\tdouble travelTimeOnLink = 21; //sec. approx freeSpeed of link12 is : (200 m) / (9.72.. m/s) approx 20.57 s\n\t\tMap<Pollutant, Double> warmEmissions = emissionModule.getWarmEmissionAnalysisModule().checkVehicleInfoAndCalculateWarmEmissions(vehicleFallbackToAverageTable, link, travelTimeOnLink);\n\n\t\tdouble expectedValue = 31.1947174; // = 200m * 155.973587 g/km\n\t\tAssert.assertEquals( expectedValue, warmEmissions.get(Pollutant.CO2_TOTAL ), MatsimTestUtils.EPSILON );\n\t}",
"@Test\r\n void testScoreBased() {\r\n ScoreBased testStrat = new ScoreBased();\r\n AlwaysCooperate testStrat2 = new AlwaysCooperate();\r\n ArrayList<Integer> payoffs = new ArrayList<>(Arrays.asList(3, 5, 0, 1));\r\n ArrayList<Character> expected = new ArrayList<>(Arrays.asList('d', 'd', 'c'));\r\n Game game = new Game(testStrat, testStrat2, 3, payoffs);\r\n game.playGame();\r\n assertEquals(game.historyStrategy1, expected, \"ScoreBased strategy not functioning correctly\");\r\n }",
"@Test\n\tpublic void AC1TestSimple() {\n\t\tGame g1 = Game.createMockGame(createTreasureAndPuzzleGoal(), \"\"\n\t\t\t+ \"_BPT\\n\"\n\t\t);\n\t\t\n\t\tassertFalse(g1.getHasWon());\n\t\t\n\t\tg1.movePlayer(Direction.RIGHT);\n\t\t\n\t\tassertFalse(g1.getHasWon());\n\t\t\n\t\tg1.movePlayer(Direction.LEFT);\n\t\tg1.movePlayer(Direction.LEFT);\n\t\t\n\t\tassertTrue(g1.getHasWon());\n\t\t\n\t\t\n\t\tGame g2 = Game.createMockGame(createTreasureAndPuzzleGoal(), \"\"\n\t\t\t+ \"_BPT\\n\"\n\t\t);\n\t\t\n\t\tassertFalse(g2.getHasWon());\n\n\t\tg2.movePlayer(Direction.LEFT);\n\t\t\n\t\tassertFalse(g2.getHasWon());\n\t\t\n\t\tg2.movePlayer(Direction.RIGHT);\n\t\tg2.movePlayer(Direction.RIGHT);\n\t\t\n\t\tassertTrue(g2.getHasWon());\n\t\t\n\t\t\n\t\tGame g3 = Game.createMockGame(createTreasureOrPuzzleGoal(), \"\"\n\t\t\t+ \"_BPT\\n\"\n\t\t);\n\t\t\n\t\tassertFalse(g3.getHasWon());\n\t\t\n\t\tg3.movePlayer(Direction.RIGHT);\n\t\t\n\t\tassertTrue(g3.getHasWon());\n\t\t\n\t\tGame g4 = Game.createMockGame(createTreasureOrPuzzleGoal(), \"\"\n\t\t\t+ \"_BPT\\n\"\n\t\t);\n\t\t\n\t\tassertFalse(g4.getHasWon());\n\t\t\n\t\tg4.movePlayer(Direction.LEFT);\n\t\t\n\t\tassertTrue(g4.getHasWon());\n\t}",
"@Test\n public void testAdvanceWithHighNumberOfArmies() {\n List<Country> l_countryList = d_gameData.getD_warMap().getD_continents().get(1).getD_countryList();\n l_countryList.add(d_gameData.getD_playerList().get(1).getD_ownedCountries().get(0));\n d_gameData.getD_playerList().get(0).getD_ownedCountries().get(0).getD_neighbourCountries().add(\"nepal\");\n d_gameData.getD_playerList().get(0).getD_ownedCountries().get(0).setD_noOfArmies(7);\n d_gameData.getD_playerList().get(1).getD_ownedCountries().get(0).setD_noOfArmies(3);\n d_orderProcessor.processOrder(\"advance india nepal 15\".trim(), d_gameData);\n d_gameData.getD_playerList().get(0).issue_order();\n Order l_order = d_gameData.getD_playerList().get(0).next_order();\n assertEquals(false, l_order.executeOrder());\n }",
"@Test\n void no_fall_through() {\n System.out.println(\"Result = \" + no_fall_through(\"TEST_1\"));\n System.out.println(\"Result = \" + no_fall_through(\"TEST_2\"));\n System.out.println(\"Result = \" + no_fall_through(\"TEST\"));\n }",
"@Test\n public void testAircraftPartNoApplicable787() throws Exception {\n\n String lTaskApplSqlLdesc = \"rootpart.part_no_oem = 787\";\n\n // verify on wing engine 777 is not applicable\n int lResult = execute( ON_WING_ENGINE_777, lTaskApplSqlLdesc );\n assertEquals( 0, lResult );\n\n // verify on wing engine 787 is applicable\n lResult = execute( ON_WING_ENGINE_787, lTaskApplSqlLdesc );\n assertEquals( 1, lResult );\n\n // verify off wing engine is not applicable\n lResult = execute( OFF_WING_ENGINE, lTaskApplSqlLdesc );\n assertEquals( 0, lResult );\n }",
"@Test\n public void testSingleRunWithUnsatisfiableConstraint() {\n System.out.println(\" - test single run with unsatisfiable constraint\");\n // add constraint\n problem.addMandatoryConstraint(new NeverSatisfiedConstraintStub());\n // single run\n System.out.format(\" - low temperature (T = %.7f)\\n\", LOW_TEMP);\n singleRunWithMaxRuntime(searchLowTemp, SINGLE_RUN_RUNTIME, MAX_RUNTIME_TIME_UNIT);\n System.out.format(\" - medium temperature (T = %.7f)\\n\", MED_TEMP);\n singleRunWithMaxRuntime(searchMedTemp, SINGLE_RUN_RUNTIME, MAX_RUNTIME_TIME_UNIT);\n System.out.format(\" - high temperature (T = %.7f)\\n\", HIGH_TEMP);\n singleRunWithMaxRuntime(searchHighTemp, SINGLE_RUN_RUNTIME, MAX_RUNTIME_TIME_UNIT);\n // verify\n assertNull(searchLowTemp.getBestSolution());\n assertNull(searchMedTemp.getBestSolution());\n assertNull(searchHighTemp.getBestSolution());\n }",
"@Test\n \tpublic void testDisprovingSuggestion() {\n \t\t//Set suggestion\n \t\tSolution suggestion = new Solution(\"Colonel Mustard\", \"Knife\", \"Library\");\n \t\tComputerPlayer computer1 = new ComputerPlayer();\n \t\tComputerPlayer computer2 = new ComputerPlayer();\n \t\tComputerPlayer computer3 = new ComputerPlayer();\n \t\tHumanPlayer human = new HumanPlayer();\n \t\tArrayList<Card> hand = new ArrayList<Card>();\n \t\tArrayList<ComputerPlayer> comps = new ArrayList<ComputerPlayer>();\n \t\t\n \t\t\n \t\t//ensure If a player (human or computer) has a card that's suggested, that card is \"shown\"\n \t\tCard mustardCard = new Card(\"Colonel Mustard\", Card.cardType.PERSON);\n \t\thand.add(mustardCard);\n \t\tcomputer1.setCards(hand);\n \t\tAssert.assertEquals(computer1.disproveSuggestion(suggestion), mustardCard);\n \t\t\n \t\t\n \t\t//ensure If the player has multiple cards that match, the card to be returned is selected randomly.\n \t\tCard knifeCard = new Card (\"Knife\", Card.cardType.WEAPON);\n \t\tCard libraryCard = new Card(\"Library\", Card.cardType.ROOM);\n \t\thand.add(knifeCard);\n \t\thand.add(libraryCard);\n \t\thuman.setCards(hand);\n \t\tint mustard = 0, knife = 0, library = 0;\n \t\t//make sure card is valid and counts how many times each card is returned\n \t\tfor(int i = 0; i < 100; i++) {\n \t\t\tCard disproved = human.disproveSuggestion(suggestion);\n \t\t\t\n \t\t\tif(disproved == mustardCard)\n \t\t\t\tmustard++;\n \t\t\telse if(disproved == knifeCard)\n \t\t\t\tknife++;\n \t\t\telse if(disproved == libraryCard)\n \t\t\t\tlibrary++;\n \t\t\telse\n \t\t\t\tfail(\"Invalid card returned\");\n \t\t}\n \t\t//makes sure every card is returned more than once\n \t\tAssert.assertTrue(mustard > 10);\n \t\tAssert.assertTrue(knife > 10);\n \t\tAssert.assertTrue(library > 10);\n \t\t\n \t\thuman.setCards(null);\n \t\tgame.setCurrentPlayer(game.getHuman());\n \t\t\t\n \t\t//ensure In the board game, disproving a suggestion starts with a player to the left of the person making the suggestion\n \t\thand.remove(mustardCard);\n \t\thand.remove(knifeCard);\n \t\tcomputer2.setCards(hand);\n \t\thand.remove(libraryCard);\n \t\thand.add(knifeCard);\n \t\tcomputer3.setCards(hand);\n \t\tcomps.add(computer1);\n \t\tcomps.add(computer2);\n \t\tcomps.add(computer3);\n \t\t\n \t\tint comp1 = 0, comp2 = 0, comp3 = 0;\n \t\tgame.setComputer(comps);\n \t\tfor(int i = 0; i < 100; i++) {\n \t\t\tCard returned = game.handleSuggestion(suggestion);\n \t\t\tif(returned == mustardCard)\n \t\t\t\tcomp1++;\n \t\t\telse if(returned == libraryCard)\n \t\t\t\tcomp2++;\n \t\t\telse if(returned == knifeCard)\n \t\t\t\tcomp3++;\n \t\t\telse\n \t\t\t\tfail(\"Invalid card returned\");\t\n \t\t}\n\t\t//Assert.assertTrue(comp1 > 10);\n\t\t//Assert.assertTrue(comp2 > 10);\n \t\tAssert.assertTrue(comp3 > 10);\n \t\t//ensure The player making the suggestion should not be queried\n \t\tgame.setCurrentPlayer(computer1);\n \t\tfor(int i = 0; i < 100; i++) {\n \t\t\tCard returned = game.handleSuggestion(suggestion);\n \t\t\tif(returned == mustardCard)\n \t\t\t\tfail(\"Suggesting player cannot return a card\");\t\n \t\t}\n \t}",
"@Test\r\n void testPeriodicDdc() {\r\n PeriodicDDC testStrat = new PeriodicDDC();\r\n AlwaysDefect testStrat2 = new AlwaysDefect();\r\n ArrayList<Integer> payoffs = new ArrayList<>(Arrays.asList(3, 5, 0, 1));\r\n ArrayList<Character> expected = new ArrayList<>(Arrays.asList('d', 'd', 'c'));\r\n Game game = new Game(testStrat, testStrat2, 3, payoffs);\r\n game.playGame();\r\n assertEquals(game.historyStrategy1, expected, \"PeriodicDDC strategy not functioning correctly\");\r\n }",
"private int computeBetterResponse(int player, GameObserver go) {\n int[] devOutcome = currentOutcome.clone();\n double aspirationPayoff = eGame.getPayoff(currentOutcome, player) + aspirationLevel;\n double bestPayoff = eGame.getPayoff(currentOutcome, player);\n int bestResponse = currentOutcome[player];\n\n ///System.out.println(\"Finding BR: \" + Arrays.toString(currentOutcome));\n\n // get the order in which to test best responses\n List<Integer> order = deviationTestOrder.getDeviationTestOrder(currentOutcome, player);\n\n// if (order.size() < nActs[player]-1) {\n// System.out.println(\"To few actions in order listing: \" + order.size());\n// }\n\n int itr = 0;\n for (int a : order) {\n // skip current action\n if (a == currentOutcome[player]) continue;\n devOutcome[player] = a;\n\n //System.out.println(\"Testing dev: \" + Arrays.toString(devOutcome));\n\n // check whether this profile is \"tabu\"\n if (tabu.getValue(devOutcome)) {\n //System.out.println(\"TABU\");\n continue;\n }\n\n // sample if necessary; flag not enough samples\n if (eGame.getNumSamples(devOutcome) == 0) {\n if (go.numObsLeft() <= 0) return NO_SAMPLES_FLAG;\n sampleAndUpdate(devOutcome, go);\n //System.out.println(\"SAMPLED\");\n }\n\n // check BR\n double devPayoff = eGame.getPayoff(devOutcome, player);\n\n// if (devPayoff > aspirationPayoff) {\n// //System.out.println(\"Aspiration met.\");\n// return a;\n// } else\n\n if (devPayoff > bestPayoff) {\n //System.out.println(\"Br, but not aspiration level\");\n bestPayoff = devPayoff;\n bestResponse = a;\n }\n\n itr++;\n if (itr > minDeviationsTested &&\n bestPayoff > aspirationPayoff) {\n return bestResponse;\n }\n\n }\n\n if (bestResponse != currentOutcome[player]) {\n //System.out.println(\"return non-aspiration BR\");\n return bestResponse;\n }\n //System.out.println(\"NO BR\");\n return NO_BR_FLAG;\n }",
"@Test\n public void endGameDetectionTrue() {\n logic.setDirection(1);\n for (int i = 0; i < 100; i++) {\n logic.eatFoodForTesting();\n logic.gameLogic();\n }\n assertFalse(logic.gameLogic());\n }",
"private WeightedSampler<String> getPossibleActions(int team) {\n if (this.b.getCurrentPlayerTurn() != team || this.b.getWinner() != 0) {\n return null;\n }\n Player p = this.b.getPlayer(team);\n WeightedSampler<String> poss = new WeightedRandomSampler<>();\n // playing cards & selecting targets\n List<Card> hand = p.getHand();\n for (Card c : hand) {\n if (p.canPlayCard(c)) {\n double totalWeight = PLAY_CARD_TOTAL_WEIGHT + PLAY_CARD_COST_WEIGHT_MULTIPLIER * c.finalStats.get(Stat.COST);\n List<List<List<TargetList<?>>>> targetSearchSpace = new LinkedList<>();\n this.getPossibleListTargets(c.getBattlecryTargetingSchemes(), new LinkedList<>(), targetSearchSpace);\n if (targetSearchSpace.isEmpty()) {\n targetSearchSpace.add(List.of());\n }\n if (c instanceof BoardObject) {\n double weightPerPos = totalWeight / (p.getPlayArea().size() + 1);\n // rip my branching factor lol\n for (int playPos = 0; playPos <= p.getPlayArea().size(); playPos++) {\n for (List<List<TargetList<?>>> targets : targetSearchSpace) {\n poss.add(new PlayCardAction(p, c, playPos, targets).toString().intern(), weightPerPos / targetSearchSpace.size());\n }\n }\n } else {\n // spells don't require positioning\n for (List<List<TargetList<?>>> targets : targetSearchSpace) {\n poss.add(new PlayCardAction(p, c, 0, targets).toString().intern(), totalWeight / targetSearchSpace.size());\n }\n }\n }\n }\n this.b.getMinions(team, false, true).forEachOrdered(m -> {\n // unleashing cards & selecting targets\n if (p.canUnleashCard(m)) {\n List<List<List<TargetList<?>>>> targetSearchSpace = new LinkedList<>();\n this.getPossibleListTargets(m.getUnleashTargetingSchemes(), new LinkedList<>(), targetSearchSpace);\n if (targetSearchSpace.isEmpty()) {\n targetSearchSpace.add(List.of());\n }\n for (List<List<TargetList<?>>> targets : targetSearchSpace) {\n poss.add(new UnleashMinionAction(p, m, targets).toString().intern(), UNLEASH_TOTAL_WEIGHT / targetSearchSpace.size());\n }\n }\n // minion attack\n if (m.canAttack()) {\n double totalWeight = ATTACK_TOTAL_WEIGHT + ATTACK_WEIGHT_MULTIPLIER * m.finalStats.get(Stat.ATTACK);\n double weight = totalWeight / m.getAttackableTargets().count();\n m.getAttackableTargets().forEachOrdered(target -> {\n double bonus = target instanceof Leader ? ATTACK_TARGET_LEADER_MULTIPLIER : 1;\n double overkillMultiplier = Math.pow(ATTACK_WEIGHT_OVERKILL_PENALTY, Math.max(0, m.finalStats.get(Stat.ATTACK) - target.health));\n poss.add(new OrderAttackAction(m, target).toString().intern(), overkillMultiplier * bonus * weight);\n });\n }\n });\n // ending turn\n poss.add(new EndTurnAction(team).toString().intern(), END_TURN_WEIGHT);\n return poss;\n }",
"protected IPlanningGoal selectGoal(){ \n List<IPlanningGoal> relevantGoals = representation.getRelevantGoals(body);\n \n //If we have failed to find plans for high priority goals and environment has not changed, lets try some \n //lower priority ones\n if(numFailuresSinceLastImportantEnvChange < relevantGoals.size()){\n return relevantGoals.get(numFailuresSinceLastImportantEnvChange);\n } else {\n //tried all relevant goals but all failed, lets try it once more\n representation.setMarker(body);\n numFailuresSinceLastImportantEnvChange = 0;\n return relevantGoals.get(0);\n }\n }",
"@Test\n public void determineWinnerNull()\n {\n // Setup.\n final CheckersGameInjector injector = new CheckersGameInjector();\n final CheckersAdjudicator adjudicator = injector.injectAdjudicator();\n\n // Run / Verify.\n assertNull(adjudicator.determineWinner(null));\n }",
"@Test\n void testWinnerOfTrickNotFollowingSuit() {\n Dealer testDealer = new Dealer();\n testDealer.initDealer();\n\n Bot botA = testDealer.getBotA();\n Bot botB = testDealer.getBotB();\n Bot botC = testDealer.getBotC();\n\n ArrayList<Card> botAHand, botBHand, botCHand = new ArrayList <Card>();\n\n // botAHand = new ArrayList <Card>();\n botAHand = new ArrayList <Card>();\n botBHand = new ArrayList <Card>();\n botCHand = new ArrayList <Card>();\n\n Card thrownCard = new Card(Suit.CLUBS,Rank.FOUR,true);\n \n Card cardA1 = new Card(Suit.CLUBS,Rank.ACE,true);\n\n Card cardB1 = new Card(Suit.DIAMONDS,Rank.ACE,true);\n\n Card cardC1 = new Card(Suit.SPADES,Rank.ACE,true);\n\n botAHand.add(cardA1);\n botBHand.add(cardB1);\n botCHand.add(cardC1);\n \n // botA.fillHandCards(botAHand);\n botA.fillHandCards(botAHand);\n botB.fillHandCards(botBHand);\n botC.fillHandCards(botCHand);\n\n testDealer.addToPlayedCards(thrownCard);\n \n Card cardToPlay = botA.playCard(thrownCard, 1);\n testDealer.addToPlayedCards(cardToPlay);\n Card largestPlayedCard = testDealer.getLargestCardFromTrick();\n\n cardToPlay = botB.playCard(largestPlayedCard, 2);\n testDealer.addToPlayedCards(cardToPlay);\n largestPlayedCard = testDealer.getLargestCardFromTrick();\n\n cardToPlay = botC.playCard(largestPlayedCard, 3);\n testDealer.addToPlayedCards(cardToPlay);\n\n // List<Card> allPlayedCards = testDealer.getPlayedCardsForTrick();\n assertEquals(\"botA\", testDealer.getWinnerOfTrick(testDealer.getPlayedCardsForTrick()));\n }",
"java.lang.String getHowToUse();",
"java.lang.String getHowToUse();"
] | [
"0.5947422",
"0.5746554",
"0.567555",
"0.5608408",
"0.55866796",
"0.55094403",
"0.54785794",
"0.54671353",
"0.5432169",
"0.54087454",
"0.53576374",
"0.5344885",
"0.52957827",
"0.52909136",
"0.5281941",
"0.52650976",
"0.5260335",
"0.52177256",
"0.52042735",
"0.5199455",
"0.51994264",
"0.51622015",
"0.5145129",
"0.51422864",
"0.51411676",
"0.51359034",
"0.51256454",
"0.51129556",
"0.5089293",
"0.5070002",
"0.5065836",
"0.5064406",
"0.5049707",
"0.50291383",
"0.502816",
"0.5011678",
"0.5004889",
"0.49942374",
"0.49791723",
"0.49750268",
"0.49639338",
"0.4962468",
"0.49563137",
"0.49546382",
"0.4954127",
"0.4948907",
"0.49369407",
"0.49363697",
"0.492619",
"0.49234083",
"0.49050704",
"0.48913273",
"0.48812154",
"0.4879149",
"0.4876823",
"0.4863513",
"0.486163",
"0.48593402",
"0.48449796",
"0.4842093",
"0.4842087",
"0.48319393",
"0.48288253",
"0.4828243",
"0.48279268",
"0.48231986",
"0.4806438",
"0.4806406",
"0.4797979",
"0.47962666",
"0.47713473",
"0.4771012",
"0.47679096",
"0.4767446",
"0.47646698",
"0.4762454",
"0.4761936",
"0.476131",
"0.47588685",
"0.4757879",
"0.47511217",
"0.47461134",
"0.4738919",
"0.47349465",
"0.4728463",
"0.47281173",
"0.4726663",
"0.47263914",
"0.47226053",
"0.47223628",
"0.47103164",
"0.47100717",
"0.4707776",
"0.470745",
"0.4705846",
"0.46997505",
"0.46948445",
"0.4694652",
"0.46813068",
"0.46813068"
] | 0.5401255 | 10 |
let the cpc be a yellow six, tempting the bold strategy with a perfect match but see if bold returns a yellow zero instead for color groups with size > 2 | @Test
public void testPlayer_getBoldStrategyCard_zeroColor() {
player2 = new Player("Player Two", true);
player2.setHand(strategyHand.getAllCards());
assertTrue(player2.getBoldStrategyCard(yellowSix, yellowSix.getColor()).equals(yellowZero));
// try again, but reduce the yellow color group to <= 2
player2.getHand().discard(yellowSix);
player2.getHand().discard(yellowReverse);
assertTrue(player2.getBoldStrategyCard(yellowOne, yellowSix.getColor()).equals(yellowOne));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"boolean similarColorTo(Card c);",
"@Test\r\n public void testPlayer_getBoldStrategyCard_numeric_colorBeatsNumber() {\n\r\n player2 = new Player(\"Player Two\", true);\r\n player2.setHand(strategyHand.getAllCards());\r\n\r\n // pick a cpc that could return two possible options\r\n // and assert that the higher value card comes back\r\n\r\n // make a cpc that might return a yellow six or a red eight\r\n // assert the yellow comes back, even though the red eight has a higher value\r\n Card redSix = new Card(Card.RED, Card.SIX, cvm);\r\n assertTrue(player2.getBoldStrategyCard(redSix, redSix.getColor()).equals(yellowSix));\r\n }",
"private void green(){\n\t\tthis.arretes_fG();\n\t\tthis.coins_fG();\n\t\tthis.coins_a1G();\n\t\tthis.coins_a2G();\n\t\tthis.aretes_aG();\n\t\tthis.cube[31] = \"G\";\n\t}",
"@Test\n public void testVictoryBlue(){\n for (Cell c: modelTest.grid) {\n if (c.getY() == 5)\n c.setColor(Color.BLUE);\n }\n\n modelTest.researchVictory(0,1);\n Color winnerTest = modelTest.getWinner();\n\n Assert.assertEquals(winnerTest,Color.BLUE);\n }",
"protected String comprobarColor(Colores color){\r\n if(getColor() == Colores.AZUL | getColor() == Colores.BLANCO | getColor() == Colores.GRIS | getColor() == Colores.NEGRO\r\n | getColor() == Colores.ROJO){\r\n return \"Color correcto\";\r\n }\r\n else{\r\n return \"Color erroneo\";\r\n }\r\n }",
"private int getCloseColor(int[] prgb) {\n \t\t\tfloat[] phsv = { 0, 0, 0 };\n \t\t\trgbToHsv(prgb[0], prgb[1], prgb[2], phsv);\n \t\t\t\n \t\t\tfloat hue = phsv[0];\n \t\t\tfloat val = phsv[2] * 100 / 256;\n \n \t\t\tint closest = -1;\n \n \t\t\tfinal int white = 15;\n \t\t\tfinal int black = 1;\n \t\t\tfinal int grey = 14;\n \t\t\t\n \t\t\tif (phsv[1] < (hue >= 30 && hue < 75 ? 0.66f : 0.33f)) {\n \t\t\t\tif (val >= 70) {\n \t\t\t\t\tclosest = white;\n \t\t\t\t} else if (val >= 10) {\n \t\t\t\t\t// dithering will take care of the rest\n \t\t\t\t\tclosest = grey;\n \t\t\t\t} else {\n \t\t\t\t\tclosest = black;\n \t\t\t\t}\n \t\t\t}\n \t\t\telse {\n \t\t\t\tclosest = getClosestColorByDistance(palette, firstColor, 16, prgb, 12);\n \t\t\t\t\n \t\t\t\t// see how the color matches\n \t\t\t\tif (closest == black) {\n \t\t\t\t\tif (phsv[1] > 0.9f) {\n \t\t\t\t\t\tif ((hue >= 75 && hue < 140) && (val >= 5 && val <= 33)) {\n \t\t\t\t\t\t\tclosest = 12;\n \t\t\t\t\t\t}\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t\t/*else {\n \t\t\t\t\tint rigid = rigidMatch(phsv, hue, val);\n \t\t\t\t\tif (phsv[1] < 0.5f && (rigid == 1 || rigid == 14 || rigid == 15)) {\n \t\t\t\t\t\tclosest = rigid;\n \t\t\t\t\t}\n \t\t\t\t}*/\n \t\t\t}\n \t\t\t\n \t\t\t//closest = rigidMatch(phsv, hue, val);\n \t\t\t\n \t\t\treturn closest;\n \t\t}",
"private void yellow(){\n\t\tthis.arretes_fY();\n\t\tthis.coins_fY();\n\t\tthis.coins_a1Y();\n\t\tthis.coins_a2Y();\n\t\tthis.aretes_aY();\n\t\tthis.cube[49] = \"Y\";\n\t}",
"int canon_600_color (int ratio[], int mar)\n{\n int clipped=0, target, miss;\n\n if (flash_used != 0.0) {\n if (ratio[1] < -104)\n { ratio[1] = -104; clipped = 1; }\n if (ratio[1] > 12)\n { ratio[1] = 12; clipped = 1; }\n } else {\n if (ratio[1] < -264 || ratio[1] > 461) return 2;\n if (ratio[1] < -50)\n { ratio[1] = -50; clipped = 1; }\n if (ratio[1] > 307)\n { ratio[1] = 307; clipped = 1; }\n }\n target = flash_used != 0.0 || ratio[1] < 197\n\t? -38 - (398 * ratio[1] >> 10)\n\t: -123 + (48 * ratio[1] >> 10);\n if (target - mar <= ratio[0] &&\n target + 20 >= ratio[0] && clipped == 0) return 0;\n miss = target - ratio[0];\n if ( Math.abs(miss) >= mar*4) return 2;\n if (miss < -20) miss = -20;\n if (miss > mar) miss = mar;\n ratio[0] = target - miss;\n return 1;\n}",
"public String ballColor(long r, long g, long b, long k) {\n if (r == 0 && g == 0) return COLOR.BLUE.toString();\n else if (r == 0 && b == 0) return COLOR.GREEN.toString();\n else if (g == 0 && b == 0) return COLOR.RED.toString();\n\n // min * 3 > k ==> in the min ranges\n // min * 3 < k ==> further calc\n long minVal = min(min(r, g), b);\n if (minVal != 0 && minVal * 3 > k) {\n long temp = k % 3;\n if (temp == 0) return COLOR.BLUE.toString();\n else if (temp == 1) return COLOR.RED.toString();\n else return COLOR.GREEN.toString();\n }\n\n // substract minVal each\n r -= minVal;\n g -= minVal;\n b -= minVal;\n k -= minVal * 3;\n if (k == 0) {\n return COLOR.BLUE.toString();\n }\n\n // check the rest two\n int maximum = 0, maxless = 0;\n if (r == 0) {\n if (g > b) {\n long min = min(g, b);\n if (min * 2 > k) {\n long temp = k % 2;\n if (temp == 0) return COLOR.BLUE.toString();\n else return COLOR.GREEN.toString();\n } else return COLOR.GREEN.toString();\n } else {\n // blue is larger\n long min = min(g, b);\n if (min * 2 > k) {\n long temp = k % 2;\n if (temp == 0) return COLOR.BLUE.toString();\n else return COLOR.GREEN.toString();\n } else return COLOR.BLUE.toString();\n }\n } else if (g == 0) {\n if (r > b) {\n long min = min(r, b);\n if (min * 2 > k) {\n long temp = k % 2;\n if (temp == 0) return COLOR.BLUE.toString();\n else return COLOR.RED.toString();\n } else return COLOR.RED.toString();\n } else {\n // blue is larger\n long min = min(r, b);\n if (min * 2 > k) {\n long temp = k % 2;\n if (temp == 0) return COLOR.BLUE.toString();\n else return COLOR.RED.toString();\n } else return COLOR.BLUE.toString();\n }\n } else {\n // b == 0\n if (r > g) {\n long min = min(r, g);\n if (min * 2 > k) {\n long temp = k % 2;\n if (temp == 0) return COLOR.GREEN.toString();\n else return COLOR.RED.toString();\n } else return COLOR.RED.toString();\n } else {\n long min = min(r, g);\n if (min * 2 > k) {\n long temp = k % 2;\n if (temp == 0) return COLOR.GREEN.toString();\n else return COLOR.RED.toString();\n } else return COLOR.GREEN.toString();\n }\n }\n\n }",
"private PrinterLabel highlightMatch(PrinterLabel label, Printer printer) {\n\t\t/* Matches array Index Reference:\n\t\t * \n\t\t * 0 = Tension\n\t\t * 1 = Compression\n\t\t * 2 = Impact\n\t\t * 3 = vendor\n\t\t * 4 = Range of Mats.\n\t\t * 5 = Tolerance\n\t\t * 6 = Finish\n\t\t */\n\t\tif(printer.getMatches()[0] > 0)\n\t\t{\n\t\t\tlabel.getTension().setForeground(highlight);\n\t\t}\n\t\tif(printer.getMatches()[1] > 0)\n\t\t{\n\t\t\tlabel.getCompression().setForeground(highlight);\n\t\t}\n\t\tif(printer.getMatches()[2] > 0)\n\t\t{\n\t\t\tlabel.getImpact().setForeground(highlight);\n\t\t}\n\t\tif(printer.getMatches()[3] > 0)\n\t\t{\n\t\t\tlabel.getVendor().setForeground(highlight);\n\t\t}\n\t\tif(printer.getMatches()[4] > 0)\n\t\t{\n\t\t\tlabel.getMaterials().setForeground(highlight);\n\t\t}\n\t\tif(printer.getMatches()[5] > 0)\n\t\t{\n\t\t\tlabel.getTolerance().setForeground(highlight);\n\t\t}\n\t\tif(printer.getMatches()[6] > 0)\n\t\t{\n\t\t\tlabel.getFinish().setForeground(highlight);\n\t\t}\n\t\treturn label;\n\t}",
"@Test\r\n public void testPlayer_getBoldStrategyCard_numeric_matchColorNotNumber() {\n player2 = new Player(\"Player Two\", true);\r\n player2.setHand(strategyHand.getAllCards());\r\n player2.getHand().discard(greenThree);\r\n player2.getHand().discard(yellowZero);\r\n assertTrue(player2.getBoldStrategyCard(yellowThree, yellowThree.getColor()).equals(yellowSix));\r\n }",
"String getColor();",
"private static String parseColor(String msg) {\n\t\tif (msg.contains(CS)) {\r\n\t\t\tmsg = msg.replaceAll(CS+\"a\", \"<span style=\\\"color: #8afb17\\\">\")\r\n\t\t\t .replace(CS+\"b\", \"<span style=\\\"color: #00ffff\\\">\")\r\n\t\t\t .replace(CS+\"c\", \"<span style=\\\"color: #e55451\\\">\")\r\n\t\t\t .replace(CS+\"d\", \"<span style=\\\"color: #ff55ff\\\">\")\r\n\t\t\t .replace(CS+\"e\", \"<span style=\\\"color: #fff380\\\">\")\r\n\t\t\t .replace(CS+\"f\", \"<span style=\\\"color: #ffffff\\\">\")\r\n\t\t\t .replace(CS+\"1\", \"<span style=\\\"color: #0000a0\\\">\")\r\n\t\t\t .replace(CS+\"2\", \"<span style=\\\"color: #348017\\\">\")\r\n\t\t\t .replace(CS+\"3\", \"<span style=\\\"color: #008080\\\">\")\r\n\t\t\t .replace(CS+\"4\", \"<span style=\\\"color: #9f000f\\\">\")\r\n\t\t\t .replace(CS+\"5\", \"<span style=\\\"color: #6c2dc7\\\">\")\r\n\t\t\t .replace(CS+\"6\", \"<span style=\\\"color: #d4a017\\\">\")\r\n\t\t\t .replace(CS+\"7\", \"<span style=\\\"color: #837e7c\\\">\")\r\n\t\t\t .replace(CS+\"8\", \"<span style=\\\"color: #555555\\\">\")\r\n\t\t\t .replace(CS+\"9\", \"<span style=\\\"color: #1f45fc\\\">\")\r\n\t\t\t .replace(CS+\"0\", \"<span style=\\\"color: #000000\\\">\")\r\n\t\t\t .replace(CS+\"l\", \"<span style=\\\"font-weight: bold\\\">\") //bold\r\n\t\t\t .replace(CS+\"o\", \"<span style=\\\"font-style: italic\\\">\") //italics\r\n\t\t\t .replace(CS+\"r\", \"<span style=\\\"font-weight: normal; font-style: normal\\\">\"); //normal text\r\n\t\t\tnumCloseSpans = msg.split(CS).length - 1;\r\n\t\t} else {\r\n\t\t\t//nothing\r\n\t\t}\r\n\t\treturn msg;\r\n\t}",
"private void blue(){\n\t\tthis.arretes_fB();\n\t\tthis.coins_fB();\n\t\tthis.coins_a1B();\n\t\tthis.coins_a2B();\n\t\tthis.aretes_aB();\n\t\tthis.cube[22] = \"B\";\n\t}",
"public boolean testColourcomponents(EIfcpixeltexture type) throws SdaiException;",
"@Test //TEST EIGHT\n void testLowercaseBlueColor()\n {\n Rabbit_RegEx rabbit_color = new Rabbit_RegEx();\n rabbit_color.setIsBaby(true);\n rabbit_color.setWeight(2);\n rabbit_color.setAge(4);\n rabbit_color.setColor(\"blue\");\n String expected = \"Is the rabbit a baby?: true\\n\" +\n \"How old is the rabbit?: 4 weeks\\n\" +\n \"Weight: 2.0 in ounces\\n\" +\n \"Color: blue\";\n assertEquals(expected, rabbit_color.toString());\n }",
"public int getColoredProbesCount(int colorIndex);",
"int getMaximalReplaceDistance(int usedColors);",
"public boolean checkColoring(int[] ccolor){\n // \tfor(int i = 0; i < ccolor.length; i++){\n //\t System.out.println(Arrays.toString(ccolor));\n \t//}\n for(int i = 0; i < ccolor.length; i++){\n for(int w = 0; w < ccolor.length; w++){\n \t//System.out.println(i + \",\" + w);\n if(hasEdge(i,w) && (ccolor[i] == ccolor[w])){\n \t//System.out.println(i + \",false\" + w);\n return false;\n }\n }\n }\n return true;\n }",
"@Test\n @Tag(\"bm1000\")\n public void testBLEND() {\n CuteNetlibCase.doTest(\"BLEND.SIF\", \"-3.0812149846E+01\", null, NumberContext.of(7, 4));\n }",
"@Test //TEST FOUR\n void testLowercaseBlackColor()\n {\n Rabbit_RegEx rabbit_color = new Rabbit_RegEx();\n rabbit_color.setIsBaby(true);\n rabbit_color.setWeight(2);\n rabbit_color.setAge(4);\n rabbit_color.setColor(\"black\");\n String expected = \"Is the rabbit a baby?: true\\n\" +\n \"How old is the rabbit?: 4 weeks\\n\" +\n \"Weight: 2.0 in ounces\\n\" +\n \"Color: black\";\n assertEquals(expected, rabbit_color.toString());\n }",
"private static int mixSigColor(int c1, int c2, int ratio) {//0~100\r\n return 0xff & (((c2 * ratio) + (c1 * (100 - ratio))) / 100);\r\n }",
"void testColorChecker(Tester t) {\r\n initData();\r\n Cell topLeft = (Cell) this.game7.indexHelp(0, 0);\r\n Cell topRight = (Cell) this.game7.indexHelp(1, 0);\r\n Cell botLeft = (Cell) this.game7.indexHelp(0, 1);\r\n Cell botRight = (Cell) this.game7.indexHelp(1, 1);\r\n t.checkExpect(topLeft.flooded, true);\r\n t.checkExpect(topRight.flooded, false);\r\n t.checkExpect(botLeft.flooded, false);\r\n t.checkExpect(botRight.flooded, false);\r\n\r\n topRight.colorChecker(topLeft.color);\r\n t.checkExpect(topRight.flooded, true);\r\n t.checkExpect(botRight.flooded, true);\r\n t.checkExpect(botLeft.flooded, false);\r\n t.checkExpect(topLeft.flooded, true);\r\n }",
"private void colorDetermine(PGraphics pg) {\r\n\t\tfloat depth = getDepth();\r\n\t\t\r\n\t\tif (depth < THRESHOLD_INTERMEDIATE) {\r\n\t\t\tpg.fill(255, 255, 0);\r\n\t\t}\r\n\t\telse if (depth < THRESHOLD_DEEP) {\r\n\t\t\tpg.fill(0, 0, 255);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tpg.fill(255, 0, 0);\r\n\t\t}\r\n\t}",
"private void colorDetermine(PGraphics pg) {\n\t\tif(this.getDepth() < 70){\n\t\t\tpg.fill(255,255,0);\n\t\t}else if(this.getDepth() >= 70 && this.getDepth() < 300){\n\t\t\tpg.fill(0, 0, 255);\n\t\t}else if(this.getDepth() >= 300){\n\t\t\tpg.fill(255, 0, 0);\n\t\t}\n\t}",
"public char getColor();",
"public abstract void colorChecker(Color c);",
"@Test\n public void testColorCodeExtraction() {\n String text = \"§aHello §b§oWhat's up?\";\n\n String colorResult = stringUtils.extractColorCodes(text).toString();\n String styleResult = stringUtils.extractStyleCodes(text).toString();\n\n Assert.assertEquals(\"[§a, §b]\", colorResult);\n Assert.assertEquals(\"[§o]\", styleResult);\n }",
"public boolean threeColorable(){\n if(checkColoring(color))return true;//check when all vertex are painted in one same color 0.\n int p=1;\n int max=(int)Math.pow(3, size);//counting in base 3, max will have 3^n possible coloring solution\n while(p<max){\n color[0]++;//count one for each time\n int i=0;\n while(color[i]>2){//deal with carry\n color[i] = 0;\n i = i+1;\n color[i]++;\n }\n \n // if(checkColoring(color)){\n //\tSystem.out.println(\"Print true\");\n // }\n if(checkColoring(color))return true;//check the current color solution; if it works, return true\n p++;\n }\n return false;//if not find a solution,means not 3 colorable,return false\n }",
"public abstract BossColor getColor();",
"@Test //TEST THREE\n void testUppercaseBlackColor()\n {\n Rabbit_RegEx rabbit_color = new Rabbit_RegEx();\n rabbit_color.setIsBaby(true);\n rabbit_color.setWeight(2);\n rabbit_color.setAge(4);\n rabbit_color.setColor(\"Black\");\n String expected = \"Is the rabbit a baby?: true\\n\" +\n \"How old is the rabbit?: 4 weeks\\n\" +\n \"Weight: 2.0 in ounces\\n\" +\n \"Color: Black\";\n assertEquals(expected, rabbit_color.toString());\n }",
"public boolean isFullyExplored();",
"abstract public void colorize(TCell c);",
"void ciff_block_1030()\n{\n int key[] = new int[2];\n key[0] = 0x410;\n key[1] = 0x45f3;\n int i, bpp, row, col, vbits=0;\n long bitbuf=0;\n\n get2();\n if ((get4()) != 0x80008 || get4()==0) return;\n bpp = get2();\n if (bpp != 10 && bpp != 12) return;\n for (i=row=0; row < 8; row++)\n for (col=0; col < 8; col++) {\n if (vbits < bpp) {\n\tbitbuf = bitbuf << 16 | (get2() ^ key[i++ & 1]);\n\tvbits += 16;\n }\n white[row][col] = ( char)( bitbuf << (LONG_BIT - vbits) >> (LONG_BIT - bpp));\n vbits -= bpp;\n }\n}",
"@Test\r\n public void testPlayer_getBoldStrategyCard_numeric_matchNumberNotColor() {\n player2 = new Player(\"Player Two\", true);\r\n player2.setHand(strategyHand.getAllCards());\r\n Card blueEight = new Card(Card.BLUE, Card.EIGHT, cvm);\r\n player2.getHand().discard(blueFour);\r\n player2.getHand().discard(yellowZero);\r\n Card redEight = new Card(Card.RED, Card.EIGHT, cvm);\r\n assertTrue(player2.getBoldStrategyCard(blueEight, yellowThree.getColor()).equals(redEight));\r\n }",
"private int checkGreenColorProduct() {\r\n if (product == null) {\r\n return -1;\r\n } else {\r\n if (!product.isSafeFood()) {\r\n return Color.RED;\r\n }\r\n if (userHalal && !product.isHalal() || userKashir && !product.isKashir() ||\r\n userVegetarian && !product.isVegetarian() || userVegan && !product.isVegan()) {\r\n return Color.RED;\r\n }\r\n if (userSoy && product.isSoy() || userFish && product.isFish() ||\r\n userEggs && product.isEggs() || userGluten && product.isGluten() ||\r\n userLactose && product.isLactose() || userNuts && product.isNuts()) {\r\n return Color.RED;\r\n }\r\n return Color.GREEN;\r\n }\r\n }",
"private int getCloseColor(int[] prgb) {\n \t\t\tfloat[] phsv = { 0, 0, 0 };\n \t\t\trgbToHsv(prgb[0], prgb[1], prgb[2], phsv);\n \t\t\treturn phsv[2] < 64 ? fg : bg;\n \t\t}",
"private String findBestColor(ArrayList<String> missingPieces) {\n if(missingPieces.size() > 0) {\n String bestColor = \"\";\n int maxVolume = 0;\n for (int i = 0; i < missingPieces.size(); i++) {\n String colorKey = missingPieces.get(i);\n Block piece = new Block(colorKey);\n int volume = piece.getVolume();\n if (volume > maxVolume) {\n maxVolume = volume;\n bestColor = colorKey;\n }\n }\n return bestColor;\n } else return null;\n }",
"private int getCloseColor(int[] prgb) {\n \t\t\t\n \t\t\treturn getClosestColorByDistance(palette, firstColor, numColors, prgb, -1);\n \t\t}",
"private String comprobarColor(String color) {\r\n String colores[] = { \"blanco\", \"negro\", \"rojo\", \"azul\", \"gris\" };\r\n boolean encontrado = false;\r\n for (int i = 0; i < colores.length && !encontrado; i++) {\r\n if (colores[i].equals(color)) {\r\n encontrado = true;\r\n }\r\n }\r\n if (encontrado) {\r\n this.color = color;\r\n } else {\r\n this.color = COLOR_POR_DEFECTO;\r\n }\r\n return this.color;\r\n }",
"public String getColorString();",
"@Test //TEST SIX\n void testLowercaseBlackOtterColor()\n {\n Rabbit_RegEx rabbit_color = new Rabbit_RegEx();\n rabbit_color.setIsBaby(true);\n rabbit_color.setWeight(2);\n rabbit_color.setAge(4);\n rabbit_color.setColor(\"black otter\");\n String expected = \"Is the rabbit a baby?: true\\n\" +\n \"How old is the rabbit?: 4 weeks\\n\" +\n \"Weight: 2.0 in ounces\\n\" +\n \"Color: black otter\";\n assertEquals(expected, rabbit_color.toString());\n }",
"abstract String getColor();",
"public String seeColor(String str) {\r\n if (str.startsWith(\"red\")) {\r\n return \"red\";\r\n }\r\n if (str.startsWith(\"blue\")) {\r\n return \"blue\";\r\n }\r\n\r\n return \"\";\r\n }",
"@Test\n public void testVictoryRed(){\n for (Cell c: modelTest.grid) {\n if (c.getX() == 6)\n c.setColor(Color.RED);\n }\n\n modelTest.researchVictory(1,0);\n Color winnerTest = modelTest.getWinner();\n\n Assert.assertEquals(winnerTest,Color.RED);\n }",
"Integer getTxtColor();",
"@Test\n @Tag(\"slow\")\n @Tag(\"unstable\")\n public void testGREENBEA() {\n CuteNetlibCase.doTest(\"GREENBEA.SIF\", \"-1.74990012991E+03\", \"-1.74990012991E+03\", NumberContext.of(7, 4));\n }",
"private void colorizeCrown() {\n\t\tfor (Class c : this.crown) {\n\t\t\tif (c.getColor() != null) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\tboolean colorized = false;\n\n\t\t\tAdaptation[] superAdapt = new Adaptation[0];\n\t\t\tif(c.getSuperClasses().size() > 0) {\n\t\t\t\tsuperAdapt = c.getSuperClasses().get(0)\n\t\t\t\t\t.getAdaptationsTable();\n\t\t\t} else {\n\t\t\t\tc.setColor(0);\n\t\t\t\tcolorized = true;\n\t\t\t}\n\t\t\t\n\n\t\t\t\n\t\t\tfor (int i = 0; i < superAdapt.length; i++) {\n\t\t\t\tif (superAdapt[i] == null) {\n\t\t\t\t\tc.setColor(i);\n\t\t\t\t\tcolorized = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!colorized) {\n\t\t\t\tc.setColor(c.getSuperClasses().get(0).getColor() + 1);\n\t\t\t}\n\n\t\t\t// Computation is based on classe's parents discovery\n\t\t\tcomputeAdaptations(c);\n\t\t}\n\t}",
"PRColor occupiedBy() {\n return c;\n }",
"public void testCOLOUR2() throws Exception {\n\t\tObject retval = execLexer(\"COLOUR\", 121, \"sable\", false);\n\t\tObject actual = examineExecResult(org.antlr.gunit.gUnitParser.OK, retval);\n\t\tObject expecting = \"OK\";\n\n\t\tassertEquals(\"testing rule \"+\"COLOUR\", expecting, actual);\n\t}",
"String getColour(int winningNumber);",
"private String calculateColourBoard(int col, int row) {\n // ORANGE\n if (col == 0 && row == 0 ||\n col == 1 && row == 1 ||\n col == 2 && row == 2 ||\n col == 3 && row == 3 ||\n col == 4 && row == 4 ||\n col == 5 && row == 5 ||\n col == 6 && row == 6 ||\n col == 7 && row == 7) {\n return \"#FFA500\";\n }\n\n // BLUE\n if (col == 1 && row == 0 ||\n col == 4 && row == 1 ||\n col == 7 && row == 2 ||\n col == 2 && row == 3 ||\n col == 5 && row == 4 ||\n col == 0 && row == 5 ||\n col == 3 && row == 6 ||\n col == 6 && row == 7) {\n return \"#0000FF\";\n }\n\n // PURPLE\n if (col == 2 && row == 0 ||\n col == 7 && row == 1 ||\n col == 4 && row == 2 ||\n col == 1 && row == 3 ||\n col == 6 && row == 4 ||\n col == 3 && row == 5 ||\n col == 0 && row == 6 ||\n col == 5 && row == 7) {\n return \"#7D3C98\";\n }\n\n // PINK\n if (col == 3 && row == 0 ||\n col == 2 && row == 1 ||\n col == 1 && row == 2 ||\n col == 0 && row == 3 ||\n col == 7 && row == 4 ||\n col == 6 && row == 5 ||\n col == 5 && row == 6 ||\n col == 4 && row == 7) {\n return \"#FFB6C1\";\n }\n\n // YELLOW\n if (col == 4 && row == 0 ||\n col == 5 && row == 1 ||\n col == 6 && row == 2 ||\n col == 7 && row == 3 ||\n col == 0 && row == 4 ||\n col == 1 && row == 5 ||\n col == 2 && row == 6 ||\n col == 3 && row == 7) {\n return \"#FFFF00\";\n }\n\n // RED\n if (col == 5 && row == 0 ||\n col == 0 && row == 1 ||\n col == 3 && row == 2 ||\n col == 6 && row == 3 ||\n col == 1 && row == 4 ||\n col == 4 && row == 5 ||\n col == 7 && row == 6 ||\n col == 2 && row == 7) {\n return \"#FF0000\";\n }\n\n // GREEN\n if (col == 6 && row == 0 ||\n col == 3 && row == 1 ||\n col == 0 && row == 2 ||\n col == 5 && row == 3 ||\n col == 2 && row == 4 ||\n col == 7 && row == 5 ||\n col == 4 && row == 6 ||\n col == 1 && row == 7) {\n return \"#008000\";\n }\n\n // BROWN\n if (col == 7 && row == 0 ||\n col == 6 && row == 1 ||\n col == 5 && row == 2 ||\n col == 4 && row == 3 ||\n col == 3 && row == 4 ||\n col == 2 && row == 5 ||\n col == 1 && row == 6 ||\n col == 0 && row == 7) {\n return \"#641E16\";\n }\n\n\n return \"meh\";\n }",
"private void colorizeCore() {\n\n\t\tfor (Class c : this.core) {\n\n\t\t\tint color = 0;\n\t\t\tboolean colored = false;\n\n\t\t\t// Get conflict graph\n\t\t\tHashSet<Class> relatedTo = c.getRelatedTo();\n\t\t\tif (this.conflictGraph.containsKey(c)) {\n\t\t\t\tfor (Class rel : this.conflictGraph.get(c)) {\n\t\t\t\t\trelatedTo.add(rel);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Lookup for a free color\n\t\t\twhile (!colored) {\n\n\t\t\t\tboolean colorBusy = false;\n\t\t\t\tfor (Class rel : relatedTo) {\n\t\t\t\t\tif (rel.getColor() != null && rel.getColor() == color)\n\t\t\t\t\t\tcolorBusy = true;\n\t\t\t\t}\n\n\t\t\t\tif (!colorBusy) {\n\t\t\t\t\tc.setColor(color);\n\t\t\t\t\tcolored = true;\n\t\t\t\t} else {\n\t\t\t\t\tcolor++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tcomputeAdaptations(c);\n\t\t}\n\t}",
"@Test //TEST SEVEN\n void testUppercaseBlueColor()\n {\n Rabbit_RegEx rabbit_color = new Rabbit_RegEx();\n rabbit_color.setIsBaby(true);\n rabbit_color.setWeight(2);\n rabbit_color.setAge(4);\n rabbit_color.setColor(\"Blue\");\n String expected = \"Is the rabbit a baby?: true\\n\" +\n \"How old is the rabbit?: 4 weeks\\n\" +\n \"Weight: 2.0 in ounces\\n\" +\n \"Color: Blue\";\n assertEquals(expected, rabbit_color.toString());\n }",
"public static void main(String[] args) {\n\t\tString x = \"rgb(40, 116, 240)\";\r\n\t\tString[] ar1 = {\"(\",\")\",\",\"};\r\n\t\tfor (int i = 0; i < ar1.length; i++) {\r\n\t\t\tx = x.replace(ar1[i], \" \");\t\t\r\n\t\t}\r\n\t\t\r\n\t\tString[] ans = x.split(\" \");\r\n\t\tint color = Integer.parseInt(ans[ans.length-1]);\r\n\t\tif(color>133 && color<250){\r\n\t\t\tSystem.out.println(\"The Text color is BLUE\");\r\n\t\t}\r\n\t\tSystem.out.println(color);\r\n\t}",
"public boolean isBlue(Color c){\n\t\treturn ( (c.getRed() <= ts.getBlue_r()) && (c.getBlue() > ts.getBlue_b()) && (c.getGreen() <= ts.getBlue_g()));\n\t}",
"private void red(){\n\t\tthis.arretes_fR();\n\t\tthis.coins_fR();\n\t\tthis.coins_a1R();\n\t\tthis.coins_a2R();\n\t\tthis.aretes_aR();\n\t\tthis.cube[13] = \"R\";\n\t}",
"private int optimizeForNColorsAndRebuildPalette(BufferedImage img, IMapColor mapColor) {\n \t\t\n \t\tint maxDist = 0;\n \t\tmaxDist = mapColor.getMinimalPaletteDistance();\n \n \t\tHistogram hist = new Histogram(img);\n \t\tint interestingColors = 0;\n \t\tint mappedColors = 0;\n \t\t\n \t\tint mostInterestingColors = 0;\n \t\t\n \t\t//int total = img.getWidth() * img.getHeight();\n \t\t\n \t\t//for (int mask = 4; mask < 7; mask++) {\n \t\t\tmappedColors = hist.generate(mapColor, maxDist, 0);\n \t\t\tinterestingColors = hist.size();\n \t\t\tif (interestingColors > mostInterestingColors)\n \t\t\t\tmostInterestingColors = interestingColors;\n \t\t\tSystem.out.println(\"For mask \" + Integer.toHexString(0) \n \t\t\t\t\t+\"; # interesting = \" + interestingColors\n \t\t\t\t\t+\"; # mapped = \" + mappedColors);\n \t\t\t//if (interestingColors <= 256)\n \t\t\t//\tbreak;\n \t\t\t//if (mappedColors > total / 2)\n \t\t\t//\tbreak;\n \t\t//} \n \t\t\n \t\tint usedColors = Math.min(mapColor.getNumColors(), interestingColors);\n \t\t\n \t\tSystem.out.println(\"interestingColors=\"+interestingColors\n \t\t\t\t+\"; usedColors=\"+usedColors\n \t\t\t\t+\"; mappedColors=\" + mappedColors);\n \t\t\n \t\tint replaceDist = mapColor.getMaximalReplaceDistance(mostInterestingColors);\n \n \t\tint[] paletteSelections = new int[usedColors];\n \t\t\n \t\tif (mapColor.getNumColors() >= 16) {\n \t\t\tselectExponential(interestingColors, usedColors, paletteSelections);\n \t\t} else {\n \t\t\tselectNovelColors(mapColor, hist, interestingColors, usedColors, paletteSelections);\n \t\t}\n \t\t\n \t\tfor (int c = 0; c < usedColors; c++) {\n \t\t\tint idx = hist.getColorIndex(paletteSelections[c]);\n \t\t\tint r = (idx>>6) & 0x7;\n \t\t\tint g = (idx>>3) & 0x7;\n \t\t\tint b = (idx>>0) & 0x7;\n \t\t\tcanvas.setGRB333(c, g, r, b);\n \t\t\t\n \t\t\treplaceColor(img, hist, idx, rgb8ToPixel(thePalette[c]), replaceDist);\n \t\t}\n \t\t\n \t\t\n \t\treturn maxDist;\n \t}",
"private static String getColorString(int index) {\n switch (index) {\n case 0: return \"None\";\n case 1: case 6: return \"Orange\";\n case 2: case 7: return \"Green\";\n case 3: return \"Blue\";\n case 4: case 14: return \"Yellow\";\n case 8: return \"Black\";\n default: return \"not a color\";\n }\n }",
"public int getColor();",
"public int getColor();",
"public Bishop(String color) {//True is white, false is black\n\t\tsuper(color);\n\n\t}",
"public boolean MatchColor(){\n boolean result = false;\n String gameData;\n gameData = DriverStation.getInstance().getGameSpecificMessage();\n if(gameData.length() > 0)\n {\n switch (gameData.charAt(0))\n {\n case 'B' :\n //Blue case code\n result = StopPanelWithColor(kRedTarget);\n break;\n case 'G' :\n //Green case code\n result = StopPanelWithColor(kYellowTarget);\n break; \n case 'R' :\n //Red case code\n result = StopPanelWithColor(kBlueTarget);\n break;\n case 'Y' :\n //Yellow case code\n result = StopPanelWithColor(kGreenTarget);\n break;\n default :\n //This is corrupt data\n break;\n }\n } else {\n //Code for no data received yet\n }\n return result;\n }",
"@Test //TEST FIVE\n void testUppercaseBlackOtterColor()\n {\n Rabbit_RegEx rabbit_color = new Rabbit_RegEx();\n rabbit_color.setIsBaby(true);\n rabbit_color.setWeight(2);\n rabbit_color.setAge(4);\n rabbit_color.setColor(\"Black Otter\");\n String expected = \"Is the rabbit a baby?: true\\n\" +\n \"How old is the rabbit?: 4 weeks\\n\" +\n \"Weight: 2.0 in ounces\\n\" +\n \"Color: Black Otter\";\n assertEquals(expected, rabbit_color.toString());\n }",
"public int getColoredExperimentsCount(int colorIndex);",
"public void testCOLOUR5() throws Exception {\n\t\tObject retval = execLexer(\"COLOUR\", 124, \"purpure\", false);\n\t\tObject actual = examineExecResult(org.antlr.gunit.gUnitParser.OK, retval);\n\t\tObject expecting = \"OK\";\n\n\t\tassertEquals(\"testing rule \"+\"COLOUR\", expecting, actual);\n\t}",
"double greenPercentage();",
"private void traverseBayeredPatternFullSizeRGB() {\n\n for (int x = 0; x < originalImageHeight -1; x++){\n for (int y = 1; y < originalImageWidth -1; y++){\n Point position = new Point(x,y);\n int absolutePosition = getAbsolutPixelPosition(position);\n\n PixelType pixelType = null;\n\n if (x%2 == 0 && y%2 == 0) pixelType = PixelType.GREEN_TOPRED;\n if (x%2 == 0 && y%2 == 1) pixelType = PixelType.BLUE;\n if (x%2 == 1 && y%2 == 0) pixelType = PixelType.RED;\n if (x%2 == 1 && y%2 == 1) pixelType = PixelType.GREEN_TOPBLUE;\n\n fullSizePixRGB[absolutePosition] = getFullSizeRGB(new Point(x,y),pixelType);\n }\n }\n }",
"public void testCOLOUR3() throws Exception {\n\t\tObject retval = execLexer(\"COLOUR\", 122, \"vert\", false);\n\t\tObject actual = examineExecResult(org.antlr.gunit.gUnitParser.OK, retval);\n\t\tObject expecting = \"OK\";\n\n\t\tassertEquals(\"testing rule \"+\"COLOUR\", expecting, actual);\n\t}",
"String getColour();",
"public char identifyColor(Mat in)\r\n\t{\r\n\t\t//Mat blue = new Mat(in.rows(), in.cols(), CvType.CV_8UC1);\r\n\t\t//Mat green = new Mat(in.rows(), in.cols(), CvType.CV_8UC1);\r\n\t\t//Mat red = new Mat(in.rows(), in.cols(), CvType.CV_8UC1);\r\n\t\t\r\n\t\t//split the channels of the image\r\n\t\tMat blue = new Mat(); // default is CV_8UC3\r\n\t\tMat green = new Mat();\r\n\t\tMat red = new Mat();\r\n\t\tList<Mat> channels = new ArrayList<Mat>(3);\r\n\t\tCore.split(in, channels);\r\n\t\tblue = channels.get(0); // makes all 3 CV_8UC1\r\n\t\tgreen = channels.get(1);\r\n\t\tred = channels.get(2);\r\n\t\t//System.out.println(blue.toString());\r\n\t\t\r\n\t\t// add the intensities\r\n\t\tMat intensity = new Mat(in.rows(), in.cols(), CvType.CV_32F);\r\n\t\t//Mat mask = new Mat();\r\n\t\tCore.add(blue, green, intensity);//, mask, CvType.CV_32F);\r\n\t\tCore.add(intensity, red, intensity);//, mask, CvType.CV_32F);\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t// not sure if correct from here to ...\r\n\t\t\r\n\t\t\r\n\t\tMat inten = new Mat();\r\n\t\tCore.divide(intensity, Scalar.all(3.0), inten);\r\n\t\t//System.out.println(intensity.toString());\r\n\t\t//Core.divide(3.0, intensity, inten);\r\n\t\t// if intensity = intensity / 3.0; means element-wise division\r\n\t\t// use intensity.muls(Mat m)\r\n\t\t// so make new Mat m of same size that has each element of 1/3\r\n\t\t\r\n\t\t/*\r\n\t\t * or\r\n\t\t * About per-element division you can use Core.divide()\r\n\r\n\t\t\tCore.divide(A,Scalar.all(d), B);\r\n\t\t\t\r\n\t\t\tIt's equivalent to B=A/d\r\n\t\t */\r\n\t\t\r\n\t\t// find normalized values\r\n\t\tMat bnorm = new Mat();\r\n\t\tMat gnorm = new Mat();\r\n\t\tMat rnorm = new Mat();\r\n\t\t//blue.convertTo(blue, CvType.CV_32F);\r\n\t\t//green.convertTo(green, CvType.CV_32F);\r\n\t\t//red.convertTo(red, CvType.CV_32F);\r\n\t\t\r\n\t\tCore.divide(blue, inten, bnorm);\r\n\t\tCore.divide(green, inten, gnorm);\r\n\t\tCore.divide(red, inten, rnorm);\r\n\t\t\r\n\t\t\r\n\t\t// find average norm values\r\n\t\tScalar val = new Scalar(0);\r\n\t\tval = Core.mean(bnorm);\r\n\t\tString value[] = val.toString().split(\",\");\r\n\t\tString s = value[0].substring(1);\r\n\t\tdouble bavg = Double.parseDouble(s);\r\n\t\tval = Core.mean(gnorm);\r\n\t\tString value1[] = val.toString().split(\",\");\r\n\t\tString s1 = value1[0].substring(1);\r\n\t\tdouble gavg = Double.parseDouble(s1);\r\n\t\tval = Core.mean(rnorm);\r\n\t\tString value2[] = val.toString().split(\",\");\r\n\t\tString s2 = value2[0].substring(1);\r\n\t\tdouble ravg = Double.parseDouble(s2);\r\n\t\t\r\n\t\t\r\n\t\t// ... here\r\n\t\t\r\n\t\t\r\n\t\t//original values\r\n\t\t/*\r\n\t\t// define the reference color values\r\n\t\t//double RED[] = {0.4, 0.5, 1.8};\r\n\t\t//double GREEN[] = {1.0, 1.2, 1.0};\r\n\t\tdouble BLUE[] = {1.75, 1.0, 0.5};\r\n\t\t//double YELLOW[] = {0.82, 1.7, 1.7};\r\n\t\tdouble ORANGE[] = {0.2, 1.0, 2.0};\r\n\t\tdouble WHITE[] = {2.0, 1.7, 1.7};\r\n\t\t//double BLACK[] = {0.0, 0.3, 0.3};\r\n\t\t*/\r\n\t\t\r\n\t\t\r\n\t\t// define the reference color values\r\n\t\t//double RED[] = {0.4, 0.5, 1.8};\r\n\t\t//double GREEN[] = {1.0, 1.2, 1.0};\r\n\t\tdouble BLUE[] = {1.75, 1.0, 0.5};\r\n\t\t//double YELLOW[] = {0.82, 1.7, 1.7};\r\n\t\tdouble ORANGE[] = {0.2, 1.0, 2.0};\r\n\t\tdouble WHITE[] = {2.0, 1.7, 1.7};\r\n\t\t//double BLACK[] = {0.0, 0.3, 0.3};\r\n\t\t\r\n\t\t// compute the square error relative to the reference color values\r\n\t\t//double minError = 3.0;\r\n\t\tdouble minError = 2.0;\r\n\t\tdouble errorSqr;\r\n\t\tchar bestFit = 'x';\r\n\t\t\r\n\t\t\r\n\t\t//test++;\r\n\t\t//System.out.print(\"\\n\\n\" + test + \"\\n\\n\");\r\n\t\t\r\n\t\t\r\n\t\t// check BLUE fitness\r\n\t\terrorSqr = normSqr(BLUE[0], BLUE[1], BLUE[2], bavg, gavg, ravg);\r\n\t\tSystem.out.println(\"Blue: \" + errorSqr);\r\n\t\tif(errorSqr < minError)\r\n\t\t{\r\n\t\t\tminError = errorSqr;\r\n\t\t\tbestFit = COLOR_BLUE;\r\n\t\t}\r\n\t\t// check ORANGE fitness\r\n\t\terrorSqr = normSqr(ORANGE[0], ORANGE[1], ORANGE[2], bavg, gavg, ravg);\r\n\t\tSystem.out.println(\"Orange: \" + errorSqr);\r\n\t\tif(errorSqr < minError)\r\n\t\t{\r\n\t\t\tminError = errorSqr;\r\n\t\t\tbestFit = COLOR_ORANGE;\r\n\t\t}\r\n\t\t// check WHITE fitness\r\n\t\terrorSqr = normSqr(WHITE[0], WHITE[1], WHITE[2], bavg, gavg, ravg);\r\n\t\tSystem.out.println(\"White: \" + errorSqr);\r\n\t\tif(errorSqr < minError)\r\n\t\t{\r\n\t\t\tminError = errorSqr;\r\n\t\t\tbestFit = COLOR_WHITE;\r\n\t\t}\r\n\t\t// check BLACK fitness\r\n\t\t/*errorSqr = normSqr(BLACK[0], BLACK[1], BLACK[2], bavg, gavg, ravg);\r\n\t\tSystem.out.println(\"Black: \" + errorSqr);\r\n\t\tif(errorSqr < minError)\r\n\t\t{\r\n\t\t\tminError = errorSqr;\r\n\t\t\tbestFit = COLOR_BLACK;\r\n\t\t}*/\r\n\t\t\r\n\t\t// return the best fit color label\r\n\t\treturn bestFit;\r\n\t}",
"public boolean testFillstyles(EIfcfillareastyle type) throws SdaiException;",
"@Test //TEST TEN\n void testLowercaseBlueOtterColor()\n {\n Rabbit_RegEx rabbit_color = new Rabbit_RegEx();\n rabbit_color.setIsBaby(true);\n rabbit_color.setWeight(2);\n rabbit_color.setAge(4);\n rabbit_color.setColor(\"blue otter\");\n String expected = \"Is the rabbit a baby?: true\\n\" +\n \"How old is the rabbit?: 4 weeks\\n\" +\n \"Weight: 2.0 in ounces\\n\" +\n \"Color: blue otter\";\n assertEquals(expected, rabbit_color.toString());\n }",
"@Test\r\n public void testPlayer_getCautiousStrategyCardCard_numeric_matchColorNotNumber() {\n player2 = new Player(\"Player Two\", true);\r\n player2.setHand(strategyHand.getAllCards());\r\n\r\n // let the cpc be a yellow three\r\n // get rid of all non-numeric cards and the green three so the yellow six is the most attractive option\r\n player2.getHand().discard(wild);\r\n player2.getHand().discard(wildDrawFour);\r\n player2.getHand().discard(yellowReverse);\r\n player2.getHand().discard(redDrawTwo);\r\n player2.getHand().discard(greenThree);\r\n\r\n assertTrue(player2.getCautiousStrategyCard(yellowThree, yellowThree.getColor()).equals(yellowSix));\r\n }",
"boolean labelColor(String mode);",
"@Test //TEST TWELVE\n void testLowercaseBlueSteelColor()\n {\n Rabbit_RegEx rabbit_color = new Rabbit_RegEx();\n rabbit_color.setIsBaby(true);\n rabbit_color.setWeight(2);\n rabbit_color.setAge(4);\n rabbit_color.setColor(\"blue steel\");\n String expected = \"Is the rabbit a baby?: true\\n\" +\n \"How old is the rabbit?: 4 weeks\\n\" +\n \"Weight: 2.0 in ounces\\n\" +\n \"Color: blue steel\";\n assertEquals(expected, rabbit_color.toString());\n }",
"int getContactColor();",
"boolean isFalseColor();",
"private String getColor(String tagName) {\n if (labelColor.containsKey(tagName)) {\n return labelColor.get(tagName);\n } else {\n Random random = new Random();\n // create a big random number - maximum is ffffff (hex) = 16777215 (dez)\n int nextInt = random.nextInt(256 * 256 * 256);\n // format it as hexadecimal string (with hashtag and leading zeros)\n String colorCode = String.format(\"#%06x\", nextInt);\n labelColor.put(tagName, colorCode);\n return labelColor.get(tagName);\n }\n }",
"public void testCOLOUR6() throws Exception {\n\t\tObject retval = execLexer(\"COLOUR\", 125, \"or\", false);\n\t\tObject actual = examineExecResult(org.antlr.gunit.gUnitParser.FAIL, retval);\n\t\tObject expecting = \"FAIL\";\n\n\t\tassertEquals(\"testing rule \"+\"COLOUR\", expecting, actual);\n\t}",
"public void testCOLOUR4() throws Exception {\n\t\tObject retval = execLexer(\"COLOUR\", 123, \"azure\", false);\n\t\tObject actual = examineExecResult(org.antlr.gunit.gUnitParser.OK, retval);\n\t\tObject expecting = \"OK\";\n\n\t\tassertEquals(\"testing rule \"+\"COLOUR\", expecting, actual);\n\t}",
"int getColour();",
"@Test\n public void testColorCodeReplacement() {\n String text = \"§aWelcome §eto §7our §6Server§9!\";\n Assert.assertEquals(\"Welcome to our Server!\", stringUtils.removeFormattingCodes(text));\n }",
"public Color calculateColor(Color bGColor)\n\t{\n\t\tint hRed = clamp((int) ((PreferenceStore.getColor(PreferenceStore.Preference.LINENUMBERFG).getRed() + bGColor.getRed()*1)/2), 0, 255);\n\t\tint hGreen = clamp((int) ((PreferenceStore.getColor(PreferenceStore.Preference.LINENUMBERFG).getGreen() + bGColor.getGreen()*1)/2), 0, 255);\n\t\tint hBlue = clamp((int) ((PreferenceStore.getColor(PreferenceStore.Preference.LINENUMBERFG).getBlue() + bGColor.getBlue()*1)/2),0 ,255);\n\t\t\n\t\tfloat[] hsbValues = new float[3];\n\t\tColor.RGBtoHSB(hRed, hGreen, hBlue, hsbValues);\n\t\tif(hsbValues[0] == 0 && hsbValues[1] == 0){\n\t\t\thsbValues[1] += 100;\n\t\t}\n\t\tint range = MAXKEY - MINKEY + 1;\n\t\tint index = (key-STARTKEY);\n\t\tif(index < 0){\n\t\t\tindex += range;\n\t\t}\n\t\tfloat increment = 1.0f/((float)range);\n\t\t\n\t\tfor(int i = 0; i < index; i ++){\n\t\t\thsbValues[0] = (hsbValues[0]+increment)%1;\n\t\t}\n\t\t\n\t\tColor highlight = new Color(Color.HSBtoRGB(hsbValues[0], hsbValues[1], hsbValues[2]));\n\t\t\n\t\treturn highlight;\n\t}",
"abstract public String getColor();",
"abstract public String getColor();",
"public void colorText() {\r\n String theColor = textShape.getText();\r\n if (theColor.contains(\"blue\")) {\r\n textShape.setForegroundColor(Color.BLUE);\r\n }\r\n else if (theColor.contains(\"red\")) {\r\n textShape.setForegroundColor(Color.RED);\r\n }\r\n else {\r\n textShape.setForegroundColor(Color.BLACK);\r\n }\r\n }",
"public boolean isRed(Color c, int GB){\n\t\treturn ( (c.getRed() > ts.getBall_r()) && (c.getBlue() <= ts.getBall_b()) && (c.getGreen() <= ts.getBall_g()) && GB < 60 );\n\t}",
"private Color detectColor(String c){\n switch (c){\n case \"RED\": return Color.RED;\n case \"BLUE\": return Color.BLUE;\n case \"YELLOW\": return Color.YELLOW;\n case \"GREEN\": return Color.GREEN;\n case \"WHITE\": return Color.WHITE;\n case \"BLACK\": return Color.BLACK;\n case \"CYAN\": return Color.CYAN;\n case \"ORANGE\": return Color.ORANGE;\n case \"MAGENTA\": return Color.MAGENTA;\n case \"PINK\": return Color.PINK;\n default: return null;\n }\n }",
"public static boolean isTopCornersPermutated2(Cube cube){\n\t\tint counter = 0;\n\t\tint sameColorVal = 88; //Shared color value\n\t\tint diffColorVal = 88;\n\n // TODO: do this with a set\n\t\tif(cube.getSquare (1, 0, 0) == cube.getSquare(0, 0, 0) && cube.getSquare(1, 0, 0) != 5){\n\t\t\tcounter++;\n\t\t\tsameColorVal = cube.getSquare(1, 0, 0);\n\t\t}\n\t\tif(cube.getSquare (1, 0, 0) == cube.getSquare(5, 0, 0) &&\n cube.getSquare(1, 0, 0) != 5){\n\t\t\tcounter++;\n\t\t\tsameColorVal = cube.getSquare(1, 0, 0);\n\t\t}\n\t\tif(cube.getSquare (1, 0, 0) == cube.getSquare(3, 0, 2) &&\n cube.getSquare(1, 0, 0) != 5){\n\t\t\tcounter++;\n\t\t\tsameColorVal = cube.getSquare(1, 0, 0);\n\t\t}\n\t\tif(cube.getSquare (0, 0, 2) == cube.getSquare(0, 0, 0) &&\n cube.getSquare(0, 0, 2) != 5){\n\t\t\tcounter++;\n\t\t\tsameColorVal = cube.getSquare(0, 0, 2);\n\t\t}\n\t\tif(cube.getSquare (0, 0, 2) == cube.getSquare(5, 0, 0) &&\n cube.getSquare(0, 0, 2) != 5){\n\t\t\tcounter++;\n\t\t\tsameColorVal = cube.getSquare(0, 0, 2);\n\t\t}\n\t\tif(cube.getSquare (0, 0, 2) == cube.getSquare(3, 0, 2) &&\n cube.getSquare(0, 0, 2) != 5){\n\t\t\tcounter++;\n\t\t\tsameColorVal = cube.getSquare(0, 0, 2);\n\t\t}\n\t\tif(cube.getSquare (5, 2, 0) == cube.getSquare(0, 0, 0) &&\n cube.getSquare(5, 2, 0) != 5){\n\t\t\tcounter++;\n\t\t\tsameColorVal = cube.getSquare(5, 2, 0);\n\t\t}\n\t\tif(cube.getSquare (5, 2, 0) == cube.getSquare(5, 0, 0) &&\n cube.getSquare(5, 2, 0) != 5){\n\t\t\tcounter++;\n\t\t\tsameColorVal = cube.getSquare(5, 2, 0);\n\t\t}\n\t\tif(cube.getSquare (5, 2, 0) == cube.getSquare(3, 0, 2) &&\n cube.getSquare(5, 2, 0) != 5){\n\t\t\tcounter++;\n\t\t\tsameColorVal = cube.getSquare(5, 2, 0);\n\t\t}\n\n\t\tif(counter == 1){\n // change to just grab opposite value\n\t\t\tif(cube.getSquare (1, 0, 0) != 5 && cube.getSquare(1, 0, 0) !=\n sameColorVal) diffColorVal = cube.getSquare(1, 0, 0);\n\t\t\telse if (cube.getSquare (0, 0, 2) != 5 && cube.getSquare(0, 0, 2) !=\n sameColorVal) diffColorVal = cube.getSquare(0, 0, 2);\n\t\t\telse if (cube.getSquare (5, 2, 0) != 5 && cube.getSquare(5, 2, 0) !=\n sameColorVal) diffColorVal = cube.getSquare(5, 2, 0);\n\n\t\t\tif(sameColorVal+1 == diffColorVal || sameColorVal-3 == diffColorVal){ //Checks if diffColorVal is to the right of sameColorVal\n\t\t\t\tcounter++;\n\t\t\t\tsameColorVal = diffColorVal;\n\t\t\t\tif(cube.getSquare (1, 0, 2) != 5 && cube.getSquare(1, 0, 2)\n !=sameColorVal) diffColorVal=cube.getSquare(1, 0, 2);\n\t\t\t\telse if (cube.getSquare (5, 2, 2) != 5 && cube.getSquare(5, 2,\n 2) !=sameColorVal) diffColorVal=cube.getSquare (5, 2, 2);\n\t\t\t\telse if (cube.getSquare (2, 0, 0) != 5 && cube.getSquare(2, 0,\n 0) !=sameColorVal) diffColorVal=cube.getSquare (2, 0, 0); \n\n\t\t\t\tif(sameColorVal+1 == diffColorVal || sameColorVal-3 == diffColorVal){\n\t\t\t\t\tcounter++;\n\t\t\t\t\tsameColorVal = diffColorVal;\n\t\t\t\t\tif(cube.getSquare (2, 0, 2) != 5 && cube.getSquare(2, 0, 2)\n !=sameColorVal) diffColorVal=cube.getSquare (2, 0, 2);\n\t\t\t\t\telse if (cube.getSquare (5, 0, 2) != 5 && cube.getSquare(5,\n 0, 2) !=sameColorVal) diffColorVal=cube.getSquare (5, 0, 2);\n\t\t\t\t\telse if (cube.getSquare (3, 0, 0) != 5 && cube.getSquare(3,\n 0, 0) !=sameColorVal) diffColorVal=cube.getSquare (3, 0, 0); \n\n\t\t\t\t\tif(sameColorVal+1 == diffColorVal || sameColorVal-3 == diffColorVal){\n\t\t\t\t\t\tcounter++;\n\t\t\t\t\t\tsameColorVal = diffColorVal;\n\t\t\t\t\t\tif(cube.getSquare (3, 0, 2) != 5 && cube.getSquare(3, 0,\n 2) !=sameColorVal) diffColorVal=cube.getSquare (3,\n 0, 2);\n\t\t\t\t\t\telse if (cube.getSquare (0, 0, 0) != 5 &&\n cube.getSquare(0, 0, 0) !=sameColorVal)\n diffColorVal=cube.getSquare (0, 0, 0);\n\t\t\t\t\t\telse if (cube.getSquare (5, 0, 0) != 5 &&\n cube.getSquare(5, 0, 0) !=sameColorVal)\n diffColorVal=cube.getSquare (5, 0, 0);\n\n\t\t\t\t\t\tif(sameColorVal+1 == diffColorVal || sameColorVal-3 == diffColorVal){\n\t\t\t\t\t\t\tcounter++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn (counter == 5);\n\t}",
"public boolean isGreen()\n {\n // TODO: replace this line with your code\n }",
"int getNumColors();",
"@Override\n\tprotected char getColor(int position) {\n\t\treturn color;\n\t}",
"@Test //TEST ELEVEN\n void testUppercaseBlueSteelColor()\n {\n Rabbit_RegEx rabbit_color = new Rabbit_RegEx();\n rabbit_color.setIsBaby(true);\n rabbit_color.setWeight(2);\n rabbit_color.setAge(4);\n rabbit_color.setColor(\"Blue Steel\");\n String expected = \"Is the rabbit a baby?: true\\n\" +\n \"How old is the rabbit?: 4 weeks\\n\" +\n \"Weight: 2.0 in ounces\\n\" +\n \"Color: Blue Steel\";\n assertEquals(expected, rabbit_color.toString());\n }",
"@Override\n public Boolean colisionoCon(MH gr) {\n return true;\n }",
"public void testCOLOUR7() throws Exception {\n\t\tObject retval = execLexer(\"COLOUR\", 126, \"blue\", false);\n\t\tObject actual = examineExecResult(org.antlr.gunit.gUnitParser.FAIL, retval);\n\t\tObject expecting = \"FAIL\";\n\n\t\tassertEquals(\"testing rule \"+\"COLOUR\", expecting, actual);\n\t}",
"private primitives.Color AdaptiveDiffusedAndGlossyRec(Point3D centerP, double WidthAndHeight, double minCubeSize, Point3D pIntersection,Vector Vright,Vector Vup , Vector normal, int direction, int level , double k, double ktr, List<Point3D> prePoints) throws Exception {\r\n List<Point3D> nextCenterPList = new LinkedList<Point3D>();\r\n List<Point3D> cornersList = new LinkedList<Point3D>();\r\n List<primitives.Color> colorList = new LinkedList<primitives.Color>();\r\n Point3D tempCorner;\r\n GeoPoint gp;\r\n Ray tempRay;\r\n for (int i = -1; i <= 1; i += 2)\r\n for (int j = -1; j <= 1; j += 2) {\r\n tempCorner = centerP.add(Vright.scale(i * WidthAndHeight / 2)).add(Vup.scale(j * WidthAndHeight / 2));\r\n cornersList.add(tempCorner);\r\n if (prePoints == null || !isInList(prePoints, tempCorner)) {\r\n tempRay = new Ray(pIntersection, tempCorner.subtract(pIntersection), normal);\r\n if ((normal.dotProduct(tempRay.getDir()) < 0 && direction == 1) || (normal.dotProduct(tempRay.getDir()) > 0 && direction == -1)) {\r\n nextCenterPList.add(centerP.add(Vright.scale(i * WidthAndHeight / 4)).add(Vup.scale(j * WidthAndHeight / 4)));\r\n gp = findClosestIntersection(tempRay);\r\n if (gp == null)\r\n colorList.add(scene.background);\r\n else {\r\n colorList.add(calcColor(gp, tempRay, level - 1, k));\r\n } \r\n }\r\n \r\n }\r\n }\r\n\r\n if (nextCenterPList == null || nextCenterPList.size() == 0) {\r\n return primitives.Color.BLACK;\r\n }\r\n\r\n\r\n if (WidthAndHeight < minCubeSize * 2) {\r\n primitives.Color sumColor = primitives.Color.BLACK;\r\n for (primitives.Color color : colorList) {\r\n sumColor = sumColor.add(color);\r\n }\r\n return sumColor.reduce(colorList.size());\r\n }\r\n\r\n\r\n boolean isAllEquals = true;\r\n primitives.Color tempColor = colorList.get(0);\r\n for (primitives.Color color : colorList) {\r\n if (!tempColor.isAlmostEquals(color))\r\n isAllEquals = false;\r\n }\r\n if (isAllEquals && colorList.size() > 1)\r\n return tempColor;\r\n\r\n\r\n tempColor = primitives.Color.BLACK;\r\n for (Point3D center : nextCenterPList) {\r\n tempColor = tempColor.add(AdaptiveDiffusedAndGlossyRec(center, WidthAndHeight / 2, minCubeSize, pIntersection, Vright, Vup, normal, direction, level, k, ktr, cornersList));\r\n }\r\n return tempColor.reduce(nextCenterPList.size());\r\n }",
"public void speckle() {\n\t\tint r = (height / res) - 1;\n\t\tint c = (width / res);\n\t\tfor (int i = 0; i < c; i++)\t\t{\n\t\t\tint x = rng.nextInt(25);\t\t\t\n\t\t\tif (x == 0) { // 1/25 chance of changing bottom row pixel to black\t \n\t\t\t\tvalues[r][i] = color1;\t\t\t\t\n\t\t\t}\n\t\t\telse if (x == 1) { // 1/25 chance of changing bottom row pixel to white\n\t\t\t\tvalues[r][i] = color2;\n\t\t\t}\n\t\t\t// 23/25 chance of leaving bottom pixel alone\n\t\t}\n\t}",
"public Color choixCouleur(String s) {\n\t\tif(s.equals(\"ROUGE\")) return Color.RED;\n\t\telse if(s.equals(\"VERT\")) return Color.GREEN;\n\t\telse if(s.equals(\"BLEU\")) return Color.BLUE;\n\t\telse if(s.equals(\"ROSE\")) return Color.PINK;\n\t\telse if(s.equals(\"BLANC\")) return Color.WHITE;\n\t\telse if(s.equals(\"VIOLET\")) return Color.PURPLE;\n\t\telse if(s.equals(\"JAUNE\")) return Color.YELLOW;\n\t\telse if(s.equals(\"ORANGE\")) return Color.ORANGE;\n\t\telse if(s.equals(\"MARRON\")) return Color.BROWN;\n\t\telse if(s.equals(\"GRIS\")) return Color.GREY;\n\t\telse if(s.equals(\"ROUGE\")) return Color.RED;\n\t\telse return Color.BLACK;\n\t}",
"@Test\n public void testVicrotyFullGrid(){\n for (Cell c: modelTest.grid) {\n if (c.getY() == 5)\n c.setColor(Color.BLUE);\n }\n\n modelTest.researchVictory(0,1);\n boolean vicrotyTest = modelTest.getVictory();\n // On a rempli la grille de cellule bleu, on test également la victoire du bleu\n Color winnerTest = modelTest.getWinner();\n\n Assert.assertEquals(vicrotyTest,true);\n Assert.assertEquals(winnerTest,Color.BLUE);\n }"
] | [
"0.6076347",
"0.58510387",
"0.5758325",
"0.5720445",
"0.57082903",
"0.5696643",
"0.56854737",
"0.56517327",
"0.5650239",
"0.56448",
"0.5623824",
"0.5615885",
"0.5614362",
"0.5592548",
"0.5583053",
"0.5579335",
"0.55692744",
"0.5560362",
"0.5552144",
"0.55389714",
"0.55387515",
"0.55050457",
"0.54954314",
"0.54911506",
"0.54809195",
"0.5451885",
"0.5451136",
"0.54435194",
"0.54314",
"0.5429252",
"0.54160464",
"0.5402197",
"0.53967446",
"0.5386653",
"0.5361488",
"0.5360514",
"0.53595287",
"0.5354692",
"0.53532267",
"0.5335093",
"0.5334257",
"0.53131074",
"0.53075147",
"0.52797735",
"0.5265805",
"0.5256169",
"0.52559215",
"0.52551883",
"0.5242089",
"0.5240215",
"0.52359223",
"0.52201676",
"0.5216202",
"0.52096283",
"0.5207407",
"0.5195432",
"0.51921725",
"0.51895046",
"0.5189381",
"0.5165957",
"0.5165957",
"0.51537526",
"0.5152247",
"0.5151509",
"0.51469475",
"0.51464087",
"0.5142421",
"0.5129183",
"0.5128092",
"0.512163",
"0.51186824",
"0.51183635",
"0.511486",
"0.5104256",
"0.5099436",
"0.5094582",
"0.50876635",
"0.5087289",
"0.50813746",
"0.5080967",
"0.5070662",
"0.5070476",
"0.5070123",
"0.5068509",
"0.5068396",
"0.5068396",
"0.5067885",
"0.5065677",
"0.506352",
"0.50489557",
"0.50424176",
"0.503962",
"0.50381356",
"0.50374913",
"0.5027004",
"0.5023643",
"0.50164866",
"0.5015992",
"0.50133306",
"0.50104964"
] | 0.6098093 | 0 |
make sure the cautious strategy gets rid of higher value cards first when there are other legal lower value cards in the hand. | @Test
public void testPlayer_getCautiousStrategyCardCard_higherFirst_wd4() {
player2 = new Player("Player Two", true);
player2.setHand(strategyHand.getAllCards());
// get rid of the wild so the wd4 is the most attractive option
player2.getHand().discard(wild);
assertTrue(player2.getCautiousStrategyCard(yellowThree, yellowThree.getColor()).equals(wildDrawFour));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void makeHigh() {\n Collections.sort(this.cards, Card.COMPARE_BY_VALUE);\n ArrayList<String> validHand = new ArrayList<>();\n for(int i = this.cards.size() - 5; i < this.cards.size(); i++)\n validHand.add(this.cards.get(i).toString());\n this.cardHand = new CardHand(validHand.toArray(new String[0]));\n }",
"void dropcard3()\n{\nfor (int i=0;i<numberofhc()-1;i++)\n\t{\n\tint judgeA = (getcard(i)-3)/4;\n\t\n\tif(judgeA==12)\n\t\t{\n\t\tif(getcard(i)==54 && getcard(i+1)==54) //if the player has 2 SA, he/she can drop both\n\t\t\t{\n\t\t\tremove(i);\n\t\t\tremove(i);\n\t\t\ti--;\n\t\t\t}\n\t\telse if(getcard(i)==51 && getcard(i+1)==52) //if the player has CA and DA, he/she can drop both\n\t\t\t{\n\t\t\tremove(i);\n\t\t\tremove(i);\n\t\t\ti--;\n\t\t\t}\n\t\telse if(getcard(i)==51 && getcard(i+1)==53) //if the player has CA and HA, he/she can drop both\n\t\t\t{\n\t\t\tremove(i);\n\t\t\tremove(i);\n\t\t\ti--;\n\t\t\t}\n\t\telse if(getcard(i)==52 && getcard(i+1)==53) //if the player has DA and HA, he/she can drop both\n\t\t\t{\n\t\t\tremove(i);\n\t\t\tremove(i);\n\t\t\ti--;\n\t\t\t}\n\t\t}\n\telse\n\t\t{if((((getcard(i))-3)/4)==(((getcard(i+1))-3)/4))\n\t\t\t{remove(i);\n\t\t\tremove(i);\n\t\t\ti--;}}\n\t}\n\t}",
"private void makeTrips() {\n int highestThree, firstKicker, secondKicker;\n highestThree = firstKicker = secondKicker = -1;\n for (Integer key : this.cardOccurrence.keySet()) {\n int value = this.cardOccurrence.get(key);\n if(value == 3 && value > highestThree)\n highestThree = key;\n else {\n if(key > firstKicker) {\n secondKicker = firstKicker;\n firstKicker = key;\n }\n else if(key > secondKicker)\n secondKicker = key;\n }\n }\n\n //Go through Cards ArrayList to get the actual cards pertaining\n ArrayList<String> validHand = new ArrayList<>();\n for(int i = 0; i < this.cards.size(); i++) {\n Card c = this.cards.get(i);\n if(c.sameValue(highestThree))\n validHand.add(c.toString());\n else if(c.sameValue(firstKicker) || c.sameValue(secondKicker))\n validHand.add(c.toString());\n }\n this.cardHand = new CardHand(validHand.toArray(new String[0]));\n }",
"public void aceChanger() {\n\t\t// Two aces in hand before move has been made\n\t\tif (hand.numOfCards() == 2 && isBusted()) {\n\t\t\thandIterator = new HandIterator(hand.getCards());\n\t\t\tCard c = hand.getCards().get(0);\n\t\t\tCard newAce = new Card(1, \"A\", c.getCardSuit());\n\t\t\thand.addCard(newAce);\n\t\t\thand.remove(c);\n\t\t// Ace in hand and set to 11, and hand has busted\n\t\t} else if (checkForAce() && isBusted() && hand.numOfCards() > 2) {\n\t\t\thandIterator = new HandIterator(hand.getCards());\n\t\t\twhile (handIterator.hasNext()) {\n\t\t\t\tCard c = (Card) handIterator.next();\n\t\t\t\tif (c.getCardValue() == 11) {\n\t\t\t\t\thand.addCard(new Card(1, \"A\", c.getCardSuit()));\n\t\t\t\t\thand.remove(c);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t// Ace in hand and total hand value is < 21\n//\t\t} else if (checkForAce() && !isBusted()) {\n//\t\t\tprintHand();\n//\t\t\tif (hand.numOfAces() == 1) {\n//\t\t\t\thandIterator = new HandIterator(hand.getCards());\n//\t\t\t\tSystem.out.println(\"You have an Ace card in your hand. Do you \"\n//\t\t\t\t\t\t+ \"want to set the value to 1 or 11?\");\n//\t\t\t\tint ans = scan.nextInt();\n//\t\t\t\twhile (handIterator.hasNext()) {\n//\t\t\t\t\tCard c = (Card) handIterator.next();\n//\t\t\t\t\tif (c.getCardName().equals(\"A\")) {\n//\t\t\t\t\t\twhile (ans != 1 && ans != 11) {\n//\t\t\t\t\t\t\tSystem.out.println(\"Invalid input. Try again.\");\n//\t\t\t\t\t\t\tans = scan.nextInt();\n//\t\t\t\t\t\t}\n//\t\t\t\t\t\thand.addCard(new Card(ans, \"A\", c.getCardSuit()));\n//\t\t\t\t\t\thand.remove(c);\n//\t\t\t\t\t\treturn;\n//\t\t\t\t\t}\n//\t\t\t\t}\n//\t\t\t} else {\n//\t\t\t\thandIterator = new HandIterator(hand.getCards());\n//\t\t\t\tSystem.out.println(\"You have multiple Ace cards in your hand.\"\n//\t\t\t\t\t\t+ \" Which card do you want to set the value for?\"\n//\t\t\t\t\t\t+ \" (Select by appropriate card suit.) Type exit to\"\n//\t\t\t\t\t\t+ \" make no changes.\");\n//\t\t\t\tString suit = scan.next();\n//\t\t\t\tif (suit.equalsIgnoreCase(\"exit\")) {\n//\t\t\t\t\treturn;\n//\t\t\t\t}\n//\t\t\t\twhile (handIterator.hasNext()) {\n//\t\t\t\t\tCard c = (Card) handIterator.next();\n//\t\t\t\t\tif (c.getCardName().equals(\"A\") && \n//\t\t\t\t\t\t\tc.getCardSuit().equalsIgnoreCase(suit)) {\n//\t\t\t\t\t\tSystem.out.println(\"Do you want to set the value to 1\"\n//\t\t\t\t\t\t\t\t+ \" or 11?\");\n//\t\t\t\t\t\tint ans = scan.nextInt();\n//\t\t\t\t\t\thand.addCard(new Card(ans, \"A\", c.getCardSuit()));\n//\t\t\t\t\t\thand.remove(c);\n//\t\t\t\t\t\treturn;\n//\t\t\t\t\t}\n//\t\t\t\t}\n//\t\t\t}\n\t\t}\n\t}",
"@Test\r\n public void testPlayer_getCautiousStrategyCardCard_higherFirst_drawTwo() {\n player2 = new Player(\"Player Two\", true);\r\n player2.setHand(strategyHand.getAllCards());\r\n\r\n // let the cpc be a red nine\r\n // get rid of the wild and wd4 cards so the red draw two is the most attractive option\r\n player2.getHand().discard(wild);\r\n player2.getHand().discard(wildDrawFour);\r\n Card redNine = new Card(Card.RED, Card.NINE, cvm);\r\n assertTrue(player2.getCautiousStrategyCard(redNine, redNine.getColor()).equals(redDrawTwo));\r\n }",
"public void discard(){\n for(int i = 1 ; i <= 110 ; i++) cardDeck.remove(i);\n }",
"public void applyCard(Card card, String user){\n if (user.equals(\"player\")){\n if (card == null){\n //System.out.println(\"No card in this slot\");\n //System.out.println(\"Size of tempDeck: \" + playerTempDeck.size());\n } else{\n if(playerMana >= card.getManaCost()){\n updateMana(\"player\", -card.getManaCost());\n //Check if has enough gold, too. Make free cards have a worth of gold = 0.\n //playerGoldAmount -= card.getGoldCost(); //------------------------------------------------Implement this once it can be tested.\n\n if(card.getEffect().contains(\"A\")){ //attack\n //looks long, but it finds the index of the Attack symbol (\"A\") and adds one to it, so it'll find the value 5 if the input is \"A5\", anywhere on the string.\n //Allows for things such as \"A4D1\" in theory.\n updateHealth(\"enemy\", -Character.getNumericValue(card.getEffect().charAt(card.getEffect().indexOf(\"A\") + 1)), true);\n }\n if(card.getEffect().contains(\"D\")) { //Defend\n updateDefence(\"player\", Character.getNumericValue(card.getEffect().charAt(card.getEffect().indexOf(\"D\") + 1)));\n }\n\n //Discard the card just used, put into discarded pile.\n Integer index = playerHand.indexOf(card);\n discardedCards.add(card);\n //System.out.println(\"Current index is: \" + index);\n //System.out.println(\"At that index was: \" + playerHand.get(index));\n playerHand.set(index, null);\n\n\n //System.out.println(\"The deck is currently: \" + playerHand.toString());\n //playerHand.remove(card); //Doesn't work, shortens the size all together.\n drawCard(index);\n }\n }\n }\n\n else if (user.equals(\"enemy\")){\n if(enemyMana >= card.getManaCost()){\n updateMana(\"enemy\", -card.getManaCost());\n if(card.getEffect().contains(\"A\")){\n updateHealth(\"player\", -Character.getNumericValue(card.getEffect().charAt(card.getEffect().indexOf(\"A\") + 1)), true);\n }\n if(card.getEffect().contains(\"D\")) {\n updateDefence(\"enemy\", Character.getNumericValue(card.getEffect().charAt(card.getEffect().indexOf(\"D\") + 1)));\n }\n }\n }\n }",
"private void checkHighCard(Player player) {\n\t\tplayer.setHandRank(HandRank.HIGH_CARD);\n\n\t\tfor (int i = 0, j = 6; i < hand.length; i++, j--)\n\t\t\thand[i] = player.getSevenCardsTempHand().get(j);\n\n\t\tplayer.setFiveCardsHand(hand);\n\t}",
"public void unsetChanceCardShuffle() {\n ChanceCardShuffle = false;\n }",
"static int getComputerCard(Card playerCard) {\n //The computer will iterate through different possible cards it might choose to play.\n //This represents a chosen card at any given time.\n Card possibleCard = null;\n //The position in the computer's hand where the possibleCard is stored.\n int cardPosition = 0;\n //True if the computer has a card of higher value than the player's.\n boolean hasHigherCard = false;\n //Iterate through the computer's hand, trying to find a card higher than the player's\n for (int i = 0; i < highCardGame.getHand(0).getNumCards(); i++) {\n if (playerCard.compareTo(highCardGame.getHand(0).inspectCard(i)) < 0) {\n //The computer has a higher card.\n if (possibleCard != null) {\n //If this card is lower than the possible card, but can still beat the player, then replace possible card.\n if (possibleCard.compareTo(highCardGame.getHand(0).inspectCard(i)) > 0) {\n possibleCard = new Card(highCardGame.getHand(0).inspectCard(i));\n cardPosition = i;\n }\n } else {\n //If the computer has not yet chosen a possible card, choose this one.\n possibleCard = new Card(highCardGame.getHand(0).inspectCard(i));\n hasHigherCard = true;\n cardPosition = i;\n }\n }\n }\n if (!hasHigherCard) {\n //If the computer does not have a card that can beat the player, then feed the lowest card\n //that the computer has to the player.\n for (int i = 0; i < highCardGame.getHand(0).getNumCards(); i++)\n if (playerCard.compareTo(highCardGame.getHand(0).inspectCard(i)) >= 0) {\n if (possibleCard != null) {\n if (possibleCard.compareTo(highCardGame.getHand(0).inspectCard(i)) > 0) {\n possibleCard = new Card(highCardGame.getHand(0).inspectCard(i));\n cardPosition = i;\n }\n } else {\n possibleCard = highCardGame.getHand(0).inspectCard(i);\n cardPosition = i;\n }\n }\n }\n return cardPosition;\n }",
"public void deal()\n\t{\n\t Random generator = new Random();\n\t int thisCard = generator.nextInt(52);\n\n\t face = faces[thisCard % 13];\n\t suit = suits[thisCard / 13];\n\n\t faceValue = thisCard %13;\n\t}",
"@Test\r\n public void testPlayer_getDumbStrategyCard_differentWinners() {\r\n player2 = new Player(\"\", true);\r\n player2.setHand(strategyHand.getAllCards());\r\n boolean differentLegalCardFound = false;\r\n Card firstDiscard = player2.getDumbStrategyCard(yellowSix, yellowSix.getColor());\r\n for(int i = 0; i < 25; i++) {\r\n Card loopCard = player2.getDumbStrategyCard(yellowSix, yellowSix.getColor());\r\n if(!loopCard.equals(firstDiscard)) {\r\n differentLegalCardFound = true;\r\n }\r\n }\r\n assertTrue(differentLegalCardFound);\r\n }",
"public void RemoveCardFromHuman(int value){\n handHuman.remove(value);\n }",
"void dropcard()\n{\nfor (int i=0;i<hc.size()-1;i++)\n\t{\n\tif(hc.get(i)==1||hc.get(i)==2)\n\t\tcontinue;\n\telse if((((hc.get(i))-3)/4)==(((hc.get(i+1))-3)/4))\n\t\t{hc.remove(i);\n\t\thc.remove(i);\n\t\ti--;}\t\n\t}\n}",
"public void unsetChestCardShuffle() {\n ChanceCardShuffle = false;\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 java.util.List<Card> deal(java.util.List<Card> hand, int numCards) {\n for (int i = 0; i < numCards; ++i) {\n hand.add(removeTop(deck));\n }\n return hand;\n }",
"public void RemoveCardFromComputer(int value){\n handComputer.remove(value);\n }",
"private void discardRestrictedCards()\n\t{\n\t\tif (playerList.size() == 2)\n\t\t{\n\t\t\tfor(Card card : restrictedCard2PlayerList)\n\t\t\t{\n\t\t\t\tswitch (card.getType())\n\t\t\t\t{\n\t\t\t\t\tcase GreenPlayerCard:\n\t\t\t\t\tcase BrownPlayerCard:\n\t\t\t\t\t\tCard playerCardMatch = board.getPlayerCardDeck().pickCardByID(card.getId());\n\t\t\t\t\t\tif (playerCardMatch != null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tboard.getDiscardDeck().addCard(playerCardMatch);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase CityAreaCard:\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase PersonalityCard:\n\t\t\t\t\t\tCard personalityCardMatch = board.getPersonalityCardDeck().pickCardByID(card.getId());\n\t\t\t\t\t\tif (personalityCardMatch != null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tboard.getDiscardDeck().addCard(personalityCardMatch);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase RandomEventCard:\n\t\t\t\t\t\tCard randomEventCardMatch = board.getRandomEventCardDeck().pickCardByID(card.getId());\n\t\t\t\t\t\tif (randomEventCardMatch != null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tboard.getDiscardDeck().addCard(randomEventCardMatch);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"private void updateLastCardDiscarded(){\r\n\t\tint x = 0;\r\n\t\twhile(this != game.getPlayer(x++)){} // find the nextPlayer\r\n\t\tx = x % game.getNumberOfPlayers();\r\n\t\tnextPlayer = game.getPlayer(x);\r\n\t\t\r\n\t\tif(latestRound != game.getRoundNumber()){ // if it's a new Round, reset\r\n\t\t\tpickedUpCards = new ArrayList<Card>();\r\n\t\t\tlastCardDiscarded = null;\r\n\t\t\tlatestRound = game.getRoundNumber();\r\n\t\t\t\r\n\t\t\tfor(int y = 0; y < game.getNumberOfPlayers(); y++){ // ?????\r\n\t\t\t\tif(game.getPlayer(y) != this && \r\n\t\t\t\t\t\t(getScore() >= game.getPlayer(y).getScore() || getPhase() > game.getPlayer(y).getPhase())){//????\r\n\t\t\t\t\tsetName(oldName);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tsetName(oldName + \"is#WINNING\"); // ?????\r\n\t\t}else if(lastCardDiscarded != null && Configuration.getTypeRequired(nextPlayer.getPhase(), 0) == Configuration.SET_PHASE){\r\n\t\t\tif(nextPlayer.drewFromDiscard())\r\n\t\t\t\tpickedUpCards.add(lastCardDiscarded); // add the card to picked up card if it was picked up \r\n\t\t}\r\n\t}",
"@Override\r\n\tprotected int giveCardProtected(ArrayList<Card> hand) {\n\t\treturn getRandomCard(hand);\r\n\t}",
"@Test\n public void bestowCheckForCorrectCMC() {\n addCard(Zone.BATTLEFIELD, playerA, \"Island\", 7);\n // Enchantment Creature — Siren\n // 1/1\n // Bestow {5}{U}{U} (If you cast this card for its bestow cost, it's an Aura spell with enchant creature. It becomes a creature again if it's not attached to a creature.)\n // Flying\n // You control enchanted creature.\n // Enchanted creature gets +1/+1 and has flying.\n addCard(Zone.HAND, playerA, \"Hypnotic Siren\");\n // Instant {1}{U}\n // Counter target spell with converted mana cost 4 or greater.\n addCard(Zone.HAND, playerB, \"Disdainful Stroke\");\n addCard(Zone.BATTLEFIELD, playerB, \"Island\", 2);\n\n addCard(Zone.BATTLEFIELD, playerB, \"Silvercoat Lion\");\n\n // B can't cast counter spell due CMC\n castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, \"Hypnotic Siren using bestow\", \"Silvercoat Lion\");\n checkStackSize(\"after\", 1, PhaseStep.PRECOMBAT_MAIN, playerB, 1);\n checkPlayableAbility(\"after\", 1, PhaseStep.PRECOMBAT_MAIN, playerB, \"Cast Disdainful Stroke\", false);\n //castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, \"Disdainful Stroke\", \"Hypnotic Siren\");\n\n setStrictChooseMode(true);\n setStopAt(1, PhaseStep.BEGIN_COMBAT);\n execute();\n\n //\n assertHandCount(playerA, \"Hypnotic Siren\", 0);\n assertGraveyardCount(playerA, \"Hypnotic Siren\", 0);\n assertHandCount(playerB, \"Disdainful Stroke\", 1);\n assertPermanentCount(playerA, \"Hypnotic Siren\", 1);\n\n // because cast with bestow, Boon Satyr may not be tapped\n assertPermanentCount(playerA, \"Silvercoat Lion\", 1);\n assertPowerToughness(playerA, \"Silvercoat Lion\", 3, 3);\n\n }",
"public void evaluateHand(){only public for testing\n //hand types will be\n //1 royal flush\n //2 straight flush\n //3 four of a kind\n //4 full house\n //5 flush\n //6 straight\n //7 three of a kind\n //8 two pair\n //9 pair\n //10 high card\n //hand secondary values will have to some how account for\n //the lead card of a flush or straight or the bigger pair\n //\n HandType = 0;\n\n //----------checking flush----------\n boolean flush = true;//will flip the vriable when proven wrong\n //if Hand.suites all equal\n for(Card c : Hand) {\n if (!c.getSuite().contains(Hand[0].getSuite())) {\n flush = false;\n }\n }\n //--Handtype = 5//flush\n if(flush){\n HandType=5;\n }\n\n //----------checking pair, two pair, boat,three of a kind, four of a kind----------\n int countmatches=0;\n HashMap<Integer, ArrayList<Card>> maskd = new HashMap<>();\n int[] mask = new int[5];\n int currentmask=1;\n maskd.put(0, new ArrayList<>());\n mask[0]=0;\n maskd.get(0).add(this.Hand[0]);\n //if any two hand.value equal\n for(int comp = 0; comp<Hand.length;comp++){//comparitor\n for(int check = comp+1; check<Hand.length;check++) {//checker\n //System.out.print(\"{\"+comp+check+\"}\");\n if(0==Hand[comp].compareTo(Hand[check])){\n //System.out.println(\"pair\"+Hand[comp]+Hand[check]);\n countmatches++;\n /*if(pairprimary==0&&!(pairprimary==Hand[check].getValue())){\n pairprimary=Hand[check].getValue();\n }else if(pairsecondary==0){\n pairsecondary=Hand[check].getValue();\n }//this wont work for boats\n */\n //create mask?\n if(mask[comp]==0){\n mask[comp]=currentmask;\n maskd.put(currentmask,new ArrayList<>());\n maskd.get(currentmask).add(this.Hand[comp]);\n currentmask++;\n if(maskd.get(0).contains(this.Hand[comp])){\n maskd.get(0).remove(this.Hand[comp]);\n }\n }\n mask[check]=mask[comp];\n if(!maskd.get(mask[comp]).contains(this.Hand[check])) {\n if(maskd.get(0).contains(this.Hand[check]))\n maskd.get(0).remove(this.Hand[check]);\n maskd.get(mask[comp]).add(this.Hand[check]);\n }\n continue;\n }\n if(!maskd.get(0).contains(this.Hand[check]))\n maskd.get(0).add(this.Hand[check]);\n }\n }\n\n //for(int m:maskd.keySet())\n // System.out.print(\"\"+m+\":\"+maskd.get(m));\n //System.out.println(\"\");\n\n if(HandType==0)\n switch (countmatches){ //basically i'm counting the collisions\n case 1: HandType=9;break;//one pair\n case 2: HandType=8;break;//two pair\n case 3: HandType=7;break;//triple\n case 4: HandType=4;break;//boat\n case 6: HandType=3;break;//four of a kind\n case 10: HandType=-1;break;//five of a kind\n }//reorder cards by mask?\n if(countmatches>0){\n Card[] newhand = new Card[5];\n int bigger = 0;\n if(currentmask==3) {//two pair boat\n //two pair\n if (maskd.get(1).get(0).getValue()\n > maskd.get(2).get(0).getValue()) {\n bigger = 1;\n } else {\n bigger = 2;\n }\n\n //boat\n if (maskd.get(1).size() == 3) {\n bigger = 1;\n }\n if (maskd.get(2).size() == 3) {\n bigger = 2;\n }\n }else {\n //one pair???\n bigger = 1;\n }\n\n for(int i = 0; i<5;i++){\n //if(maskd.containsKey(bigger)) {\n if(!maskd.get(bigger).isEmpty()) {\n newhand[i] = maskd.get(bigger).get(0);\n //if (maskd.get(bigger).size() > 0) {\n maskd.get(bigger).remove(0);\n //} else {\n // bigger = Math.abs(bigger - 3);\n //}\n }else{\n if(maskd.containsKey(Math.abs(bigger-3))){\n if(!maskd.get(Math.abs(bigger-3)).isEmpty()){\n bigger = Math.abs(bigger-3);\n }else{\n bigger = 0;\n }\n }else{\n bigger = 0;\n }\n i--;\n }\n //}\n\n }//end for loop\n\n //end pair bits\n\n //System.out.println(newhand);\n this.Hand=newhand;\n }//end reshuffle hand if statement\n //----------checking for straight----------\n //if first card is ace and second card is a 5, treat ace as one\n if(Hand[0].getValue()==14&&Hand[1].getValue()==5) {\n Hand[0] = new Card(\"Ace\", Hand[0].getSuite(), 1);\n //Hand[0].Value=1;\n this.sortHand();\n this.flipHand();\n }\n //go through hand and see if all 5 values are consecutive\n int n = Hand[0].getValue();\n boolean straight = true;\n for(int i = 1;i<Hand.length; i++){\n n--;\n if(!(Hand[i].getValue()==n)){\n straight=false;\n }\n }\n if(straight){\n //if above true\n //--if handtype = 5\n if(HandType==5) {\n //----if card1 is ace\n if (Hand[0].getValue() == 14) {\n //------handtype = 1 //royal flush\n HandType = 1;\n } else {\n //----else\n HandType=2;\n //------handtype = 2 //straight flush\n }\n }else {\n //--else //not a flush\n HandType=6;\n //----handtype = 6 //straight\n }\n }\n\n //----------checking high card----------\n //if handtype = 0\n if(HandType==0) {\n HandType=10;\n //--hand card = 10\n }\n }",
"private Hand getStraight(Hand handToCheck){\n\t\tHand hand = new FiveCardHand(handToCheck); //Make copy of the object so original doesn't get modified\n\t\tlog.debug(\"getStraight(hand = \"+hand+\")\");\n\t\tif(hand == null){\n\t\t\tlog.debug(\"Hand was null. Returning null\");\n\t\t\treturn null;\n\t\t}\n\t\tArrayList<Card> cards = hand.getCards();\n\t\tif(cards == null){\n\t\t\tlog.debug(\"The ArrayList<Card> inside the Hand Object was NULL. Returning null\");\n\t\t\treturn null;\n\t\t}\n\t\tlog.trace(\"Number of cards in Hand: \"+cards.size());\n\t\tSet<CardNumber> set = new HashSet<CardNumber>(hand.getNumberValues());\n\t\tif(set.size()<5){\n\t\t\tlog.debug(\"Only \"+set.size()+\" unique numbers\");\n\t\t\treturn null;\n\t\t}\n\t\tList<CardNumber> sorted = CollectionHelper.asSortedList(set);\n\t\tlog.debug(\"Sorted Size = \"+sorted.size());\n\t\tHand numberInSequence = new FiveCardHand();\n\t\tif(sorted.size()>1){\n\t\t\t//Inch worm a long, adding hands as this will handle more than 5 cards\n\t\t\tnumberInSequence.addHand(hand.getSubHandHavingNumber(sorted.get(0)));\n\t\t\tfor(int i=1; i<sorted.size();i++){\n\t\t\t\tif(CardUtil.areCardNumbersSequential(sorted.get(i-1),sorted.get(i))){\n\t\t\t\t\tnumberInSequence.addHand(hand.getSubHandHavingNumber(sorted.get(i)));\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tnumberInSequence = hand.getSubHandHavingNumber(sorted.get(i));\n\t\t\t\t}\n\t\t\t}\n\t\t\t //Check wrap around, (example: Ace)\n\t\t\tCardNumber start = sorted.get(0);\n\t\t\tCardNumber end = sorted.get(sorted.size()-1);\n\t\t\tlog.debug(\"Checking wrap around case, if \"+start+\" and \"\n\t\t\t\t\t+end+\" are sequential\");\n\t\t\tif(CardUtil.areCardNumbersSequential(start,end)){\n\t\t\t\tlog.debug(\"Wrap around Ace in play\");\n\t\t\t\t//Add the Ace\n\t\t\t\tnumberInSequence.addHand(hand.getSubHandHavingNumber(sorted.get(0)));\n\t\t\t}\n\t\t}\n\t\tlog.debug(\"Number of cards in sequence: \"+numberInSequence.getCards().size());\n\t\tif(numberInSequence.getCards().size()>4){\n\t\t\treturn numberInSequence;\n\t\t}\n\t\treturn null;\n\t}",
"public boolean playCard(Cards card, Players player) {\n boolean higher = false;\n int compare = 0;\n if (playedCards.size() == 0 || this.playAgain(player)) { //to check if it is a new game or this is a new round\n if (card instanceof TrumpCards) { //to check if the first played card is a supertrump card\n setCategory(((TrumpCards) card).cardEffect());\n }\n higher = true;\n } else {\n if (card instanceof NormCards) { //to check if the played card is a normal card\n if (getLastCard() instanceof NormCards) { //to check whether the last played card is a normal card or a supertrump card\n if (category.equals(\"H\")) {\n Float now = new Float(((NormCards) card).getHardness());\n Float last = new Float(((NormCards) getLastCard()).getHardness());\n compare = now.compareTo(last);\n } else if (category.equals(\"S\")) {\n Float now = new Float(((NormCards) card).getSpecGravity());\n Float last = new Float(((NormCards) getLastCard()).getSpecGravity());\n compare = now.compareTo(last);\n } else if (category.equals(\"C\")) {\n Float now = new Float(((NormCards) card).getCleavageValue());\n Float last = new Float(((NormCards) getLastCard()).getCleavageValue());\n compare = now.compareTo(last);\n } else if (category.equals(\"CA\")) {\n Float now = new Float(((NormCards) card).getCrustalAbunVal());\n Float last = new Float(((NormCards) getLastCard()).getCrustalAbunVal());\n compare = now.compareTo(last);\n } else if (category.equals(\"EV\")) {\n Float now = new Float(((NormCards) card).getEcoValueValue());\n Float last = new Float(((NormCards) getLastCard()).getEcoValueValue());\n compare = now.compareTo(last);\n\n }\n if (compare > 0) {\n higher = true;\n } else {\n System.out.println(\"The selected card does not has higher value!\");\n }\n } else { //or else, the last played card is a supertrump card\n higher = true;\n }\n } else { //or else, the played is a supertrump card\n setCategory(((TrumpCards) card).cardEffect());\n higher = true;\n }\n }\n return higher;\n }",
"private int highCard() {\n\t\tint highCard = 0;\n\t\tfor (int counter = 0; counter < Constants.HAND_SIZE; counter++) {\n\t\t\tif (hand[counter].getValueIndex() > highCard) {\n\t\t\t\thighCard = hand[counter].getValueIndex();\n\t\t\t}\n\t\t}\n\t\tresult.setPrimaryValuePos(highCard);\n\t\treturn highCard;\n\t}",
"public void sortByValue() {\n\t\tArrayList<Card> newHand = new ArrayList<Card>();\n\t\twhile (this.cardsInhand.size() > 0) {\n\t\t\tint pos = 0; // Position of minimal card.\n\t\t\tCard c = this.cardsInhand.get(0); // Minimal card.\n\t\t\tfor (int i = 1; i < this.cardsInhand.size(); i++) {\n\t\t\t\tCard c1 = this.cardsInhand.get(i);\n\t\t\t\tif (c1.getValue() < c.getValue() || (c1.getValue() == c.getValue() && c1.getSuit() < c.getSuit())) {\n\t\t\t\t\tpos = i;\n\t\t\t\t\tc = c1;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.cardsInhand.remove(pos);\n\t\t\tnewHand.add(c);\n\t\t}\n\t\tthis.cardsInhand = newHand;\n\t}",
"@Test\r\n public void testPlayer_getCautiousStrategyCardCard_numeric_matchNumberNotColor() {\n player2 = new Player(\"Player Two\", true);\r\n player2.setHand(strategyHand.getAllCards());\r\n\r\n // let the cpc be a blue eight\r\n Card blueEight = new Card(Card.BLUE, Card.EIGHT, cvm);\r\n\r\n // get rid of all non-numeric cards and the blue four so the red eight is the most attractive option\r\n player2.getHand().discard(wild);\r\n player2.getHand().discard(wildDrawFour);\r\n player2.getHand().discard(yellowReverse);\r\n player2.getHand().discard(redDrawTwo);\r\n player2.getHand().discard(blueFour);\r\n\r\n Card redEight = new Card(Card.RED, Card.EIGHT, cvm);\r\n\r\n assertTrue(player2.getCautiousStrategyCard(blueEight, yellowThree.getColor()).equals(redEight));\r\n }",
"private void revertMortgage(ArrayList<PropertyCard> cards) {\n\t\tfor(PropertyCard c: cards) {\n\t\t\tc.outOfMortgage();\n\t\t}\n\t}",
"for (Card ca : deck) {\n\t\tif (ca.suit == 'c') {\n\t\t\tdeck.remove(ca);\n\t\t}\n\t}",
"public void removeFromHand(int card) {\n\t\tString [] temp = new String[hand.length];//make new temp array for hand\n\t\tint internalCounter = 0;//keeps track of next available index\n\t\tfor(int i = 0; i < hand.length; ++i){//loop through whole hand\n\t\t if( i != card ){//if the current card is not equal to the desired card\n\t\t temp[internalCounter] = hand[i];//add the current card to the array in the lowest available slot\n\t\t internalCounter++;//increase available index\n\t\t }\n\t\t}\n\t\ttemp[temp.length-1] = null;//make last slot null\n\t\tString [] temp2 = new String[temp.length-1];//new temp array to shorten the hand to exclude null entries\n\t\tfor (int j = 0; j < temp2.length; j++) {//loop through the new temp array\n\t\t\tif (temp[j] != null) {//if the slot in the first temp array isn't null\n\t\t\t\ttemp2[j] = temp[j];//add the card to the shortened temp array\n\t\t\t}\n\t\t}\n\t\thand = temp2;//make the hand equal to the shortened hand\n\t}",
"@Test\n public void testShuffleGood() {\n System.out.println(\"shuffleGood\");\n Deck deck = new Deck();\n boolean shuffled = false;\n deck.shuffle();\n //we take out one card from the deck\n Card lastCard = deck.nextCard();\n //we take out 58 more cards\n for (int i =0 ; i<57;i++)\n {\n deck.nextCard();\n }\n //we take out the last card from the deck\n Card firstCard = deck.nextCard();\n \n //if both cards = the same value they were before being shuffled, then test will fail.\n if (lastCard.getValue() != CardType.WILDCARD )\n shuffled = true;\n else if (firstCard.getValue()!=CardType.ZERO)\n shuffled = true;\n \n //if either of the cards are different, that means the deck was shuffled and the test will pass\n assertEquals(true, shuffled);\n }",
"public void dealerAskCard() {\n int dealerScore = this.getDealerHand().getActualValue();\n while (dealerScore < 17) {\n Card card = this.deck.deal(this.getDealerHand());\n dealerScore = this.getDealerHand().getActualValue();\n }\n }",
"private void badMatch() {\n\t\tArrayList<Integer> faceValues = new ArrayList<Integer>();\n\t\tInteger firstSelectableCardPos = null;\n\t\t\n\t\tfor (int card = 0; card < CARDS_SUM; card++) {\n\t\t\tPlayingCard thisCard = ((PlayingCard) getActivity().findViewById(solo.getImage(card).getId()));\n\t\t\t\n\t\t\t// cheat by finding card face without turning card over\n\t\t\tint face = thisCard.getCard();\n\t\t\tfaceValues.add(face);\n\t\t\t\n\t\t\t// can't select all cards\n\t\t\tif (thisCard.isLocked() || thisCard.getVisible()) {\n\t\t\t\tcontinue;\n\t\t\t} else if (firstSelectableCardPos == null) {\n\t\t\t\tfirstSelectableCardPos = card;\n\t\t\t}\n\t\t\t\n\t\t\t// if this is a different card, select the bad pair\n\t\t\tif (faceValues.get(firstSelectableCardPos) != face) {\n\t\t\t\tsolo.clickOnImage(firstSelectableCardPos);\n\t\t\t\tsolo.clickOnImage(card);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}",
"void dealTheCards();",
"@Test\n\tpublic void testQualityOver50SellInUnder0() {\n\t\tGildedRose inn = new GildedRose();\n\t\tinn.setItem(new Item(\"Aged Brie\", -11, 51));\n\t\tinn.oneDay();\n\t\t\n\t\t//access a list of items, get the quality of the one set\n\t\tList<Item> items = inn.getItems();\n\t\tint quality = items.get(0).getQuality();\n\t\t\n\t\t//assert quality remains the same\n\t\tassertEquals(\"Quality with quality 0 Brie\", 51, quality);\n\t}",
"@Test\n public void discardIfCannot() {\n gm.setPlayerInfo(clientPlayer3);\n gm.setThisPlayerIndex(clientPlayer3.getPlayerIndex());\n dc.increaseAmount(ResourceType.ORE);\n dc.increaseAmount(ResourceType.ORE);\n dc.increaseAmount(ResourceType.WOOD);\n assertEquals(2, getAmounts().getOfType(ResourceType.ORE));\n assertEquals(1, getAmounts().getOfType(ResourceType.WOOD));\n Player p = model.getPlayer(clientPlayer3.getPlayerIndex());\n when(robberFacade.canDiscard(dc.getDiscardAmount(), p)).thenReturn(false);\n dc.discard();\n // This verifies that the robberFacade.discard is only called once instead of twice\n verify(robberFacade, atMost(1)).discard(dc.getDiscardAmount(), p);\n\n }",
"public Card dealCard()\n {\n Card errorReturn = new Card('E', Card.Suit.spades); // in rare cases\n\n if (topCard == 0)\n return errorReturn;\n else\n return cards[--topCard];\n }",
"public void ArrangeSuits() {\n if (mCardCount > 0) {\n \tCard card;\n \tCard orderedCards[];\n \torderedCards = new Card[mCardCount];\n \tint iValue;\n \tint iOrder[];\n \tint iCount = 0;\n \tiOrder = new int [mCardCount];\n \tint iMinValue = Card.HEARTS * 13 + Card.KING;\n \tiOrder[0] = iMinValue;\n \tfor (int i = 0; i < mCardCount; i++){\n \t\tcard = mCard[i];\n \t\tiValue = card.GetSuit()*13 + card.GetValue();\n \t\tiCount = 0;\n \t\t// See where the card value comes in the pecking order\n \t\twhile (iValue > iOrder[iCount]){\n \t\t\tiCount++;\n \t\t}\n \t\t// It goes here, so move everything else along one\n \t\tfor (int j = mCardCount-1; j > iCount; j--)\n \t\t\tiOrder[j] = iOrder[j-1];\n \t\tiOrder[iCount] = iValue;\n \t}\n \t\n \tfor (int i = 0; i < mCardCount; i++){\n \t\tfor (int j = 0; j < mCardCount; j++){\n \t\tcard = mCard[j];\n \t\tiValue = card.GetSuit()*13 + card.GetValue(); \t\t\t\n \t\t\tif (iValue == iOrder[i]){\n \t\t\t\torderedCards[i] = mCard[j];\n \t\t\t\tbreak;\n \t\t\t}\n \t\t}\n \t}\n \tfor (int i = 0; i < mCardCount; i++){\n \t\tmCard[i] = orderedCards[i];\n \t} \t\n }\n }",
"public boolean VerifyHumanChoice(int value){\n String card = handHuman.get(value);\n System.out.print(\"CARD IN VERIFY HUMAN\" + card);\n\n String firstLetter = Character.toString(card.charAt(0));\n String topFirstLetter = Character.toString(topCard.charAt(0));\n\n if(topCard.contains(\"8\")){\n //Can play any card ontop to determine suite\n topCard = card;\n return true;\n }\n\n if(card.contains(\"8\")){\n //valid because 8s are wild cards, human can place it\n topCard = card;\n return true;\n }\n\n //the cards match in suite, doesn't matter what it is\n else if(firstLetter.equals(topFirstLetter)){\n topCard = card;\n return true;\n }\n\n else{\n if(topFirstLetter.equals(\"c\")){\n String temp = topCard.substring(5, topCard.length());\n System.out.println(\"TEMP \" + temp);\n\n if(card.contains(temp)){\n topCard = card;\n return true;\n }\n\n }\n\n else if(topFirstLetter.equals(\"h\")){\n String temp = topCard.substring(6, topCard.length());\n System.out.println(\"TEMP \" + temp);\n\n if(card.contains(temp)){\n topCard = card;\n return true;\n }\n\n }\n\n else if(topFirstLetter.equals(\"d\")){\n String temp = topCard.substring(8, topCard.length());\n System.out.println(\"TEMP \" + temp);\n\n if(card.contains(temp)){\n topCard = card;\n return true;\n }\n\n }\n\n else if(topFirstLetter.equals(\"s\")){\n String temp = topCard.substring(6, topCard.length());\n System.out.println(\"TEMP \" + temp);\n\n if(card.contains(temp)){\n topCard = card;\n return true;\n }\n\n }\n }\n\n //You can't play this card\n return false;\n }",
"public int[] hasNSequentially(int lengthOfHand) {//check for Ace case //need to NOT ALLOW DUPLICATES\n ArrayList<Card> handList = new ArrayList<Card>();\n int solution[] = {0, 0};//number in a row, lowest number of that\n boolean foundSomeNInAFow = false;\n int hasAce = 0;\n\n int usedNumbers[] = new int[13];//2,3,4,5,6,7,8,9,10,j,q,k,a --> THIS HANDLES THE ACE CASE\n for (int i = 0; i < lengthOfHand; i++) {//was\n usedNumbers[allCards[i].value - 2]++;//USED\n if (usedNumbers[allCards[i].value - 2] == 1) {//handles NOT having doubles of numbers like 2 3 4 4 5 \n handList.add(this.allCards[i]);\n if (this.allCards[i].value == 14) {\n Card c = new Card(1, this.allCards[i].suit);\n handList.add(0, c);//add to front..shifts elements to right\n }\n }\n }\n\n for (int i = 0; i < handList.size() - 4; i++) {//check for 5 in a row, //was - 4\n int val = handList.get(i).value;\n int counter = 0;\n for (int j = 0; j < 4; j++) {//was 4\n if (handList.get(j + i + 1).value == val + 1 + j) {\n counter++;\n } else {\n break;\n }\n if (counter == 4) {//was 4\n foundSomeNInAFow = true;\n solution[0] = 5;\n solution[1] = val;\n }\n }\n }\n\n if (foundSomeNInAFow == false) {\n for (int i = 0; i < handList.size() - 3; i++) {//check for 5 in a row, //was - 4\n int val = handList.get(i).value;\n int counter = 0;\n for (int j = 0; j < 3; j++) {\n if (handList.get(j + i + 1).value == val + 1 + j) {\n counter++;\n } else {\n break;\n }\n if (counter == 3) {\n // System.out.println(\"yes 4 sequentially\");\n foundSomeNInAFow = true;\n solution[0] = 4;\n solution[1] = val;\n }\n }\n }\n }\n\n if (foundSomeNInAFow == false) {\n for (int i = 0; i < handList.size() - 2; i++) {//check for 5 in a row, //was - 4\n int val = handList.get(i).value;\n int counter = 0;\n for (int j = 0; j < 2; j++) {\n if (handList.get(j + i + 1).value == val + 1 + j) {\n counter++;\n } else {\n break;\n }\n if (counter == 2) {\n // System.out.println(\"yes 3 sequentially\");\n foundSomeNInAFow = true;\n solution[0] = 3;\n solution[1] = val;\n }\n }\n }\n }\n\n if (foundSomeNInAFow == false) {\n for (int i = 0; i < handList.size() - 1; i++) {//check for 5 in a row, //was - 4\n int val = handList.get(i).value;\n int counter = 0;\n for (int j = 0; j < 1; j++) {\n if (handList.get(j + i + 1).value == val + 1 + j) {\n counter++;\n } else {\n break;\n }\n if (counter == 1) {\n //System.out.println(\"yes 2 sequentially\");\n foundSomeNInAFow = true;\n solution[0] = 2;\n solution[1] = val;\n\n }\n }\n }\n }\n\n return solution;//return at end that way if there is 2,3,5,7,8 it returns 7 8 not 2 3\n\n }",
"public void discardAll()\n\t{\n\t\thand = new Card[12];\n\t\tnumCards = 0;\n\t}",
"private final void flipBonusCard() {\n\t\tstate.setBonusCard(deck.removeTopCard());\n\t}",
"public void deal(){\n // deal cards when game is started and game stage is 0\n // need to clear everything\n if(turn == 4){\n turn = 0;\n }\n player1Hand.clear();\n player2Hand.clear();\n player3Hand.clear();\n player4Hand.clear();\n kitty.clear();\n currentMiddle.clear();\n\n /**\n * External Citation\n * Date: 19 September 2019\n * Problem: Did not have a good way to shuffle array\n * Resource: Dr. Tribelhorn, https://www.geeksforgeeks.org/collections-shuffle-java-examples/\n * Solution: Tribelhorn informed us of the shuffle function, and\n * we used the code in this post as a resource\n */\n // shuffle deck\n Collections.shuffle(deck.cardDeck);\n\n // deal cards to each player\n // player 1's hand\n for (int i = 0; i < 5; i++) {\n player1Hand.add(i, deck.cardDeck.get(i));\n player2Hand.add(i, deck.cardDeck.get(5 + i));\n player3Hand.add(i, deck.cardDeck.get(10 + i));\n player4Hand.add(i, deck.cardDeck.get(15 + i));\n }\n\n for (int i = 0; i < 4; i++) {\n kitty.add(i, deck.cardDeck.get(20 + i));\n }\n kittyTop = kitty.get(0);\n middleCard = deck.cardDeck.get(20);\n middleCardSuit = middleCard.getSuit();\n\n // make middle card visible\n middleVisible = true;\n\n // change game state to 1\n gameStage++;\n }",
"@Test\n void pass3CardsRound99(){\n Dealer testDealer = new Dealer();\n testDealer.initDealer();\n testDealer.setRoundCount(99);\n \n List<Card> heartHand, spadeHand, clubHand, diamondHand,userPassedCards;\n\n heartHand = new ArrayList<Card>();\n spadeHand = new ArrayList<Card>();\n clubHand = new ArrayList<Card>();\n diamondHand = new ArrayList<Card>();\n userPassedCards = new ArrayList<Card>();\n \n userPassedCards.add(new Card(Suit.DIAMONDS, Rank.ACE, true));\n userPassedCards.add(new Card(Suit.DIAMONDS, Rank.KING, true));\n userPassedCards.add(new Card(Suit.DIAMONDS, Rank.QUEEN, true));\n\n \n for(Card c:userPassedCards) {\n c.setOwnerOfCard(\"user\");\n }\n\n for (Rank rank : Rank.values()) {\n heartHand.add(new Card(Suit.HEARTS, rank, true));\n }\n\n for (Rank rank : Rank.values()) {\n spadeHand.add(new Card(Suit.SPADES, rank, true));\n }\n\n for (Rank rank : Rank.values()) {\n clubHand.add(new Card(Suit.CLUBS, rank, true));\n }\n\n for (Rank rank : Rank.values()) {\n diamondHand.add(new Card(Suit.DIAMONDS, rank, true));\n }\n \n testDealer.getBotA().fillHandCards(heartHand);\n testDealer.getBotB().fillHandCards(spadeHand);\n testDealer.getBotC().fillHandCards(clubHand);\n testDealer.getUser().fillHandCards(diamondHand);\n\n testDealer.distributePassedCards(userPassedCards);\n\n assertEquals(13, testDealer.getUserHandCards().size());\n assertEquals(13, testDealer.getBotA().getHandCards().size());\n assertEquals(13, testDealer.getBotB().getHandCards().size());\n assertEquals(13, testDealer.getBotC().getHandCards().size());\n\n assertEquals(\"QUEEN of CLUBS[pickable by botA]\", testDealer.getBotA().getHandCards().get(0).toString());\n assertEquals(\"KING of CLUBS[pickable by botA]\", testDealer.getBotA().getHandCards().get(1).toString());\n assertEquals(\"ACE of CLUBS[pickable by botA]\", testDealer.getBotA().getHandCards().get(2).toString());\n\n assertEquals(\"QUEEN of DIAMONDS[pickable by botB]\", testDealer.getBotB().getHandCards().get(0).toString());\n assertEquals(\"KING of DIAMONDS[pickable by botB]\", testDealer.getBotB().getHandCards().get(1).toString());\n assertEquals(\"ACE of DIAMONDS[pickable by botB]\", testDealer.getBotB().getHandCards().get(2).toString());\n\n assertEquals(\"QUEEN of HEARTS[pickable by botC]\", testDealer.getBotC().getHandCards().get(10).toString());\n assertEquals(\"KING of HEARTS[pickable by botC]\", testDealer.getBotC().getHandCards().get(11).toString());\n assertEquals(\"ACE of HEARTS[pickable by botC]\", testDealer.getBotC().getHandCards().get(12).toString());\n\n assertEquals(\"QUEEN of SPADES[pickable by user]\", testDealer.getUser().getHandCards().get(10).toString());\n assertEquals(\"KING of SPADES[pickable by user]\", testDealer.getUser().getHandCards().get(11).toString());\n assertEquals(\"ACE of SPADES[pickable by user]\", testDealer.getUser().getHandCards().get(12).toString());\n }",
"@Override\n void pickCard() {\n\n boolean suitFound = false; // true if player has the suit\n Card cardToBeat; // strongest card on pile\n Card pickedCard = null; // card to throw\n ArrayList<Card> cardsToChooseFrom = new ArrayList<Card>();\n char trump = pitchTable.getTrump();\n\n // find the strongest card on pile\n cardToBeat = pitchTable.getCardToBeat();\n\n // if pile is empty\n if (cardToBeat == null){\n // pick the strongest non trump card\n for (Card card : hand)\n if (card.suit != trump)\n if ((pickedCard == null) || (pickedCard.rank < card.rank))\n pickedCard = card;\n\n // if non trump card not found (means all cards are trump)\n // then pick the strongest card\n if (pickedCard == null)\n for (Card card : hand)\n if ((pickedCard == null) || (pickedCard.rank < card.rank))\n pickedCard = card;\n }\n else { // means leading suit is set already\n // check if player has suit\n for (Card card : hand) {\n if (card.suit == pitchTable.getLeadingSuit())\n suitFound = true;\n }\n\n // if player does not have suit he can play any card\n if (!suitFound)\n cardsToChooseFrom = hand;\n else // if player has suit then cardsToChooseFrom = allowed cards\n for (Card card : hand)\n if ((card.suit == pitchTable.getLeadingSuit()) ||\n card.suit == pitchTable.getTrump())\n cardsToChooseFrom.add(card);\n }\n\n // try to take the trick with the lowest winning card\n // if no winning card then throw the lowest you have\n\n // (trying to take the trick)\n // if card not picked yet\n // then find the lowest card that has the suit and is higher than cardToBeat\n if (pickedCard == null)\n for (Card card : cardsToChooseFrom)\n if ((cardToBeat.suit == card.suit) && (cardToBeat.rank < card.rank))\n if ((pickedCard == null) || (pickedCard.rank > card.rank))\n pickedCard = card;\n\n // (trying to take the trick)\n // if card not picked yet and cardToBeat is not trump\n // then find the lowest trump\n if ((pickedCard == null) && (cardToBeat.suit != trump))\n for (Card card : cardsToChooseFrom)\n if (card.suit == trump)\n if ((pickedCard == null) || (pickedCard.rank > card.rank))\n pickedCard = card;\n\n // (trying to throw the lowest)\n // if still no card picked (means player cannot take the trick)\n // then throw the lowest non trump\n if (pickedCard == null)\n for (Card card : cardsToChooseFrom)\n if (card.suit != trump)\n if ((pickedCard == null) || (pickedCard.rank > card.rank))\n pickedCard = card;\n\n // (trying to throw the lowest)\n // if still no card picked (means all allowed cards are trump)\n // then throw the lowest trump\n if (pickedCard == null)\n for (Card card : cardsToChooseFrom)\n if ((pickedCard == null) || (pickedCard.rank > card.rank))\n pickedCard = card;\n\n if (pickedCard == null)\n System.out.println(\"Error: picked card still null\");\n\n pitchTable.putOnPile(pickedCard);\n hand.remove(pickedCard);\n\n }",
"void refillCards() {\n if (this.gameDeck.isEmpty() && !this.wonDeck.isEmpty()) {\n this.wonDeck.shufffle();\n Deck temp = this.gameDeck;\n this.gameDeck = this.wonDeck;\n this.wonDeck = temp;\n\n }\n\n }",
"public boolean CheckForUnwinnableCondition(){\n int humanSize = GetSizeOfHumanHand();\n int computerSize = GetSizeOfComputerHand();\n\n for(int i = 0; i < humanSize; i++) {\n //Human can play a card\n String card = handHuman.get(i);\n\n String firstLetter = Character.toString(card.charAt(0));\n String topFirstLetter = Character.toString(topCard.charAt(0));\n\n if (topCard.contains(\"8\")) {\n //Can play any card ontop to determine suite\n return true;\n }\n\n if (card.contains(\"8\")) {\n //valid because 8s are wild cards, human can place it\n return true;\n }\n\n //the cards match in suite, doesn't matter what it is\n else if (firstLetter.equals(topFirstLetter)) {\n return true;\n }\n\n else {\n if (topFirstLetter.equals(\"c\")) {\n String temp = topCard.substring(5, topCard.length());\n\n if (card.contains(temp)) {\n return true;\n }\n\n } else if (topFirstLetter.equals(\"h\")) {\n String temp = topCard.substring(6, topCard.length());\n\n if (card.contains(temp)) {\n return true;\n }\n\n } else if (topFirstLetter.equals(\"d\")) {\n String temp = topCard.substring(8, topCard.length());\n\n if (card.contains(temp)) {\n return true;\n }\n\n } else if (topFirstLetter.equals(\"s\")) {\n String temp = topCard.substring(6, topCard.length());\n\n if (card.contains(temp)) {\n return true;\n }\n }\n }\n }\n\n for(int i = 0; i < computerSize; i++){\n //Human can play a card\n String card = handComputer.get(i);\n\n String firstLetter = Character.toString(card.charAt(0));\n String topFirstLetter = Character.toString(topCard.charAt(0));\n\n if (topCard.contains(\"8\")) {\n //Can play any card ontop to determine suite\n return true;\n }\n\n if (card.contains(\"8\")) {\n //valid because 8s are wild cards, human can place it\n return true;\n }\n\n //the cards match in suite, doesn't matter what it is\n else if (firstLetter.equals(topFirstLetter)) {\n return true;\n }\n\n else {\n if (topFirstLetter.equals(\"c\")) {\n String temp = topCard.substring(5, topCard.length());\n\n if (card.contains(temp)) {\n return true;\n }\n\n } else if (topFirstLetter.equals(\"h\")) {\n String temp = topCard.substring(6, topCard.length());\n\n if (card.contains(temp)) {\n return true;\n }\n\n } else if (topFirstLetter.equals(\"d\")) {\n String temp = topCard.substring(8, topCard.length());\n\n if (card.contains(temp)) {\n return true;\n }\n\n } else if (topFirstLetter.equals(\"s\")) {\n String temp = topCard.substring(6, topCard.length());\n\n if (card.contains(temp)) {\n return true;\n }\n }\n }\n }\n\n //Human and computer can't play a card\n return false;\n }",
"@Test\n \tpublic void testDisprovingSuggestion() {\n \t\t//Set suggestion\n \t\tSolution suggestion = new Solution(\"Colonel Mustard\", \"Knife\", \"Library\");\n \t\tComputerPlayer computer1 = new ComputerPlayer();\n \t\tComputerPlayer computer2 = new ComputerPlayer();\n \t\tComputerPlayer computer3 = new ComputerPlayer();\n \t\tHumanPlayer human = new HumanPlayer();\n \t\tArrayList<Card> hand = new ArrayList<Card>();\n \t\tArrayList<ComputerPlayer> comps = new ArrayList<ComputerPlayer>();\n \t\t\n \t\t\n \t\t//ensure If a player (human or computer) has a card that's suggested, that card is \"shown\"\n \t\tCard mustardCard = new Card(\"Colonel Mustard\", Card.cardType.PERSON);\n \t\thand.add(mustardCard);\n \t\tcomputer1.setCards(hand);\n \t\tAssert.assertEquals(computer1.disproveSuggestion(suggestion), mustardCard);\n \t\t\n \t\t\n \t\t//ensure If the player has multiple cards that match, the card to be returned is selected randomly.\n \t\tCard knifeCard = new Card (\"Knife\", Card.cardType.WEAPON);\n \t\tCard libraryCard = new Card(\"Library\", Card.cardType.ROOM);\n \t\thand.add(knifeCard);\n \t\thand.add(libraryCard);\n \t\thuman.setCards(hand);\n \t\tint mustard = 0, knife = 0, library = 0;\n \t\t//make sure card is valid and counts how many times each card is returned\n \t\tfor(int i = 0; i < 100; i++) {\n \t\t\tCard disproved = human.disproveSuggestion(suggestion);\n \t\t\t\n \t\t\tif(disproved == mustardCard)\n \t\t\t\tmustard++;\n \t\t\telse if(disproved == knifeCard)\n \t\t\t\tknife++;\n \t\t\telse if(disproved == libraryCard)\n \t\t\t\tlibrary++;\n \t\t\telse\n \t\t\t\tfail(\"Invalid card returned\");\n \t\t}\n \t\t//makes sure every card is returned more than once\n \t\tAssert.assertTrue(mustard > 10);\n \t\tAssert.assertTrue(knife > 10);\n \t\tAssert.assertTrue(library > 10);\n \t\t\n \t\thuman.setCards(null);\n \t\tgame.setCurrentPlayer(game.getHuman());\n \t\t\t\n \t\t//ensure In the board game, disproving a suggestion starts with a player to the left of the person making the suggestion\n \t\thand.remove(mustardCard);\n \t\thand.remove(knifeCard);\n \t\tcomputer2.setCards(hand);\n \t\thand.remove(libraryCard);\n \t\thand.add(knifeCard);\n \t\tcomputer3.setCards(hand);\n \t\tcomps.add(computer1);\n \t\tcomps.add(computer2);\n \t\tcomps.add(computer3);\n \t\t\n \t\tint comp1 = 0, comp2 = 0, comp3 = 0;\n \t\tgame.setComputer(comps);\n \t\tfor(int i = 0; i < 100; i++) {\n \t\t\tCard returned = game.handleSuggestion(suggestion);\n \t\t\tif(returned == mustardCard)\n \t\t\t\tcomp1++;\n \t\t\telse if(returned == libraryCard)\n \t\t\t\tcomp2++;\n \t\t\telse if(returned == knifeCard)\n \t\t\t\tcomp3++;\n \t\t\telse\n \t\t\t\tfail(\"Invalid card returned\");\t\n \t\t}\n\t\t//Assert.assertTrue(comp1 > 10);\n\t\t//Assert.assertTrue(comp2 > 10);\n \t\tAssert.assertTrue(comp3 > 10);\n \t\t//ensure The player making the suggestion should not be queried\n \t\tgame.setCurrentPlayer(computer1);\n \t\tfor(int i = 0; i < 100; i++) {\n \t\t\tCard returned = game.handleSuggestion(suggestion);\n \t\t\tif(returned == mustardCard)\n \t\t\t\tfail(\"Suggesting player cannot return a card\");\t\n \t\t}\n \t}",
"public void catchCard(){\r\n changePlace(deck);\r\n changePlace(hand);\r\n }",
"public void clearHand() {\n for (Component c : cardPane.getComponents()) {\n if (c instanceof Card) {\n cardPane.remove(c); //Removes all Cards from card panel\n }\n }\n busted = false; //Hand not busted\n values.clear(); //Removes all Integers from values\n values.add(0); //Sets initial value to 0\n updateValue(); //Updates value\n repaint(); //Redraws hand\n }",
"@Test(expected = TooManyDiscardsException.class)\n public void allow_discard_no_more_than_2_cards(){\n\n Deck deck = new Deck();\n Card card1 = new Card(3,2,5);\n Card card2 = new Card(2,7,1);\n Card card3 = new Card(2,7,1);\n deck.add(card1);\n deck.add(card2);\n deck.add(card3);\n Game game = new Game(deck);\n\n game.join(\"susan\");\n game.join(\"peter\");\n\n Card pickedCard1 = game.pickCard(\"susan\");\n game.discard(\"susan\");\n Card pickedCard2 = game.pickCard(\"susan\");\n game.discard(\"susan\");\n Card pickedCard3 = game.pickCard(\"susan\");\n game.discard(\"susan\");\n\n }",
"private int GetBestCard(Card[] card) {\n\t int iPos = 0;\n\t int iWeightTemp = 0;\n\t int iWeight[] = new int[8];\n\t for (int i = 0; i < 8; i++){\n\t\t iWeight[i] = -1;\n\t }\n\t // For each selectable card, work out a weight, the highest weight is the one selected.\n\t // The weight is worked out by the distance another of the players cards is from playable ones, with no playable cards in between\n\t Card myCard, nextCard;\n\t for (int i = 0; i < 8; i++){\n\t\t if (card[i] != null){\n\t\t\t // if card value > 7\n\t\t\t if (card[i].GetValue() > 7){\n\t\t\t\t // do you have cards that are higher than this card\n\t\t\t\t myCard = card[i];\n\t\t\t\t iWeightTemp = 0;\n\t\t\t \tfor (int j = 0; j < mCardCount; j++){\n\t\t\t \t\tnextCard = mCard[j];\n\t\t\t \t\tif (nextCard != null && nextCard.GetSuit() == myCard.GetSuit() && nextCard.GetValue() > myCard.GetValue()){\n\t\t\t \t\t\tif (nextCard.GetValue() - myCard.GetValue() > iWeightTemp)\n\t\t\t \t\t\t\tiWeightTemp = nextCard.GetValue() - myCard.GetValue();\n\t\t\t \t\t\tmyCard = nextCard;\n\t\t\t \t\t}\n\t\t\t \t}\n\t\t\t \tiWeight[i] = iWeightTemp;\n\t\t\t \t\t\n\t\t\t }\n\t\t\t if (card[i].GetValue() < 7){\n\t\t\t\t // do you have cards that are lower than this card\n\t\t\t\t myCard = card[i];\n\t\t\t\t iWeightTemp = 0;\n\t\t\t \tfor (int j = mCardCount-1; j >=0; j--){\n\t\t\t \t\tnextCard = mCard[j];\n\t\t\t \t\tif (nextCard != null && nextCard.GetSuit() == myCard.GetSuit() && nextCard.GetValue() < myCard.GetValue()){\n\t\t\t \t\t\tif (myCard.GetValue() - nextCard.GetValue() > iWeightTemp)\n\t\t\t \t\t\t\tiWeightTemp = myCard.GetValue() - nextCard.GetValue();\n\t\t\t \t\t\tmyCard = nextCard;\n\t\t\t \t\t}\n\t\t\t \t}\n\t\t\t \tiWeight[i] = iWeightTemp;\n\t\t\t \t\t\n\t\t\t }\t\n\t\t\t if (card[i].GetValue() == 7){\n\t\t\t\t // do you have cards that are in this suit\n\t\t\t\t myCard = card[i];\n\t\t\t\t int iWeightTemp1;\n\t\t\t\t iWeightTemp = 0;\n\t\t\t\t iWeightTemp1 = 0;\n\t\t\t\t // do you have cards that are higher than this card\n\t\t\t \tfor (int j = 0; j < mCardCount; j++){\n\t\t\t \t\tnextCard = mCard[j];\n\t\t\t \t\tif (nextCard != null && nextCard.GetSuit() == myCard.GetSuit() && nextCard.GetValue() > myCard.GetValue()){\n\t\t\t \t\t\tif (nextCard.GetValue() - myCard.GetValue() > iWeightTemp)\n\t\t\t \t\t\t\tiWeightTemp = nextCard.GetValue() - myCard.GetValue();\n\t\t\t \t\t\tmyCard = nextCard;\n\t\t\t \t\t}\n\t\t\t \t}\n\t\t\t \tmyCard = card[i];\n\t\t\t \t// do you have cards that are lower than this card\n\t\t\t \tfor (int j = mCardCount-1; j >=0; j--){\n\t\t\t \t\tnextCard = mCard[j];\n\t\t\t \t\tif (nextCard != null && nextCard.GetSuit() == myCard.GetSuit() && nextCard.GetValue() < myCard.GetValue()){\n\t\t\t \t\t\tif (myCard.GetValue() - nextCard.GetValue() > iWeightTemp1)\n\t\t\t \t\t\t\tiWeightTemp1 = myCard.GetValue() - nextCard.GetValue();\n\t\t\t \t\t\tmyCard = nextCard;\n\t\t\t \t\t}\n\t\t\t \t} \t\n\t\t\t \tiWeight[i] = iWeightTemp + iWeightTemp1;\n\t\t\t \t\t\n\t\t\t }\t\t\t \n\t\t }\n\t\t \t \n\t }\n\t boolean bLoopAceKing = true;\n\t int iMaxTemp = 0;\n\t int iMaxCount = 0;\t\n\t int[] iMaxs;\n\t iMaxs = new int[8];\n\t while (bLoopAceKing){\n\t\t for (int i = 0; i < 8; i++){\n\t\t\t if (iWeight[i] >= iMaxTemp){\n\t\t\t\t if (iWeight[i] == iMaxTemp){\n\t\t\t\t\t iMaxs[iMaxCount] = i;\n\t\t\t\t\t iMaxCount++;\n\t\t\t\t }\n\t\t\t\t else {\n\t\t\t\t\t iMaxTemp = iWeight[i];\n\t\t\t\t\t iMaxs = new int[8];\n\t\t\t\t\t iMaxCount = 0;\n\t\t\t\t\t iMaxs[iMaxCount] = i;\n\t\t\t\t\t iMaxCount++;\n\t\t\t\t }\t\t\t \n\t\t\t }\t \n\t\t }\n\t\t boolean bAceKing = false;\n\t\t // If the top weight is zero, meaning your options don't help you, then play the one that is closest to ace/king\n\t\t if (iMaxTemp == 0 && iMaxCount > 1){\n\t\t\t for (int k = 0; k < iMaxCount; k++){\n\t\t\t\t\t iWeight[iMaxs[k]] = Math.abs(card[iMaxs[k]].GetValue()-7);\n\t\t\t\t\t bAceKing = true;\t\t\t\t \n\t\t\t } \t\t \n\t\t }\n\t\t if (bAceKing){\n\t\t\t bLoopAceKing = true;\n\t\t\t iMaxs = new int[8];\n\t\t\t iMaxTemp = 0;\n\t\t\t iMaxCount = 0;\t\t\t \n\t\t }\n\t\t else \n\t\t\t bLoopAceKing = false;\n\t }\n\t if (iMaxCount == 1)\n\t\t iPos = iMaxs[iMaxCount-1];\n\t else {\n\t\t Random generator = new Random();\n\t\t int randomIndex = generator.nextInt( iMaxCount );\n\t\t iPos = iMaxs[randomIndex];\n\t }\n\t\t \n\t return iPos;\n\t \n }",
"public TrainCard usedCard(){\n TrainCard removedCard = cardDeck.remove(0);\n return removedCard;\n }",
"private void reshuffleDiscardPile() {\n ICard topCard = discardPile.pop();\n\n drawPile.addAll(discardPile);\n Collections.shuffle(drawPile, rng);\n\n discardPile.clear();\n discardPile.add(topCard);\n }",
"private void dealCards(){\n\t\tfor(int k = 0; k <2;k++){\n\t\t\tfor(int i = 0; i < Players.size();i++){\n\t\t\t\tPlayers.get(i).addCardToHand(gameDeck.dealCard());\n\t\t\t}\n\t\t}\n\t\t\n\t setChanged();\n\t notifyObservers(\"CardsDealed\");\n\t}",
"void bust() {\n\t\t_loses++;\n\t\t//_money -= _bet;\n\t\tclearHand();\n\t\t_bet = 0;\n\t}",
"public void ComputerUpdateTopCard(int value){\n topCard = handComputer.get(value);\n }",
"public void findBestTwoCardHandName() {\n if (handContainsTheseTwoCards_With_AtLeastOneFromPlayerOriginalHand(14, 'x', 14) == true) {//aces, any suit\n bestHandFromCardsNickNameString = \"Pocket Rockets\";\n } else if (handContainsTheseTwoCards_With_AtLeastOneFromPlayerOriginalHand(13, 'y', 14) == true) {//king, then ace, same suit\n bestHandFromCardsNickNameString = \"Big Slick in a Suit\";\n } else if (handContainsTheseTwoCards_With_AtLeastOneFromPlayerOriginalHand(13, 'x', 14) == true) {\n bestHandFromCardsNickNameString = \"Full Auto\";\n } else if (handContainsTheseTwoCards_With_AtLeastOneFromPlayerOriginalHand(8, 'x', 14) == true) {\n bestHandFromCardsNickNameString = \"Dead Man's Hand\";\n } else if (handContainsTheseTwoCards_With_AtLeastOneFromPlayerOriginalHand(13, 'x', 13) == true) {\n bestHandFromCardsNickNameString = \"Cowboys King Kong\";\n } else if (handContainsTheseTwoCards_With_AtLeastOneFromPlayerOriginalHand(9, 'x', 14) == true) {\n bestHandFromCardsNickNameString = \"The Dog\";\n } else if (handContainsTheseTwoCards_With_AtLeastOneFromPlayerOriginalHand(12, 'x', 12) == true) {\n bestHandFromCardsNickNameString = \"Ladies\";\n } else if (handContainsTheseTwoCards_With_AtLeastOneFromPlayerOriginalHand(3, 'x', 12) == true) {\n bestHandFromCardsNickNameString = \"The Waiter\";\n } else if (handContainsTheseTwoCards_With_AtLeastOneFromPlayerOriginalHand(9, 'x', 9) == true) {\n bestHandFromCardsNickNameString = \"A German Dime\";\n } else if (allCards[0].value == allCards[1].value) {\n bestHandFromCardsNickNameString = \"Pocket Pair\";\n } else if (allCards[0].suit == allCards[1].suit) {\n bestHandFromCardsNickNameString = \"Flush Rush\";\n } else if (allCards[0].value == allCards[1].value + 1 || allCards[0].value + 1 == allCards[1].value || (allCards[0].value == 14 && allCards[1].value == 2) || (allCards[0].value == 2 && allCards[1].value == 14) ) {\n bestHandFromCardsNickNameString = \"Straight Bait\";\n } else if (allCards[0].value == 14 || allCards[1].value == 14) {\n bestHandFromCardsNickNameString = \"A Spike\";\n } else if (allCards[0].value == 13 || allCards[1].value == 13) {\n bestHandFromCardsNickNameString = \"A Dame\";\n } else if (allCards[0].value == 12 || allCards[1].value == 12) {\n bestHandFromCardsNickNameString = \"A Jackal\";\n } else if (allCards[0].value == 11 || allCards[1].value == 11) {\n bestHandFromCardsNickNameString = \"A Fishhook\";\n } else if (allCards[0].value == 10 || allCards[1].value == 10) {\n bestHandFromCardsNickNameString = \"A Sawbuck\";\n } else if (allCards[0].value == 9 || allCards[1].value == 9) {\n bestHandFromCardsNickNameString = \"Nina Ross\";\n } else {\n bestHandFromCardsNickNameString = \"Down on Your Luck\";\n }\n \n System.out.println(\"findBestTwoCardHandName---->>> \" + bestHandFromCardsNickNameString);\n\n }",
"public static void main(String[] args) {\n Hand hand1 = new Hand();\n\n hand1.add(new Card(2, Card.SPADES));\n hand1.add(new Card(14, Card.CLUBS));\n hand1.add(new Card(12, Card.HEARTS));\n hand1.add(new Card(2, Card.CLUBS));\n\n hand1.sort();\n\n Hand hand2 = new Hand();\n\n hand2.add(new Card(11, Card.DIAMONDS));\n hand2.add(new Card(11, Card.CLUBS));\n hand2.add(new Card(11, Card.HEARTS));\n\n int comparison = hand1.compareTo(hand2);\n\n if (comparison < 0) {\n System.out.println(\"the most valuable hand contains the cards\");\n hand2.print();\n } else if (comparison > 0) {\n System.out.println(\"the most valuable hand contains the cards\");\n hand1.print();\n } else {\n System.out.println(\"the hands are equally valuable\");\n }\n\n System.out.println(\"\");\n System.out.println(\"_________________________\");\n System.out.println(\"\");\n\n Card cardTest1 = new Card(3, Card.SPADES);\n Card cardTest2 = new Card(3, Card.SPADES);\n\n SortAgainstSuitAndValue sorter = new SortAgainstSuitAndValue();\n int sortingVar = sorter.compare(cardTest1, cardTest2);\n\n if (sortingVar < 0) {\n System.out.println(\"The highest card is:\" + cardTest1);\n } else if (sortingVar > 0) {\n System.out.println(\"The highest card is:\" + cardTest2);\n } else if (sortingVar == 0) {\n System.out.println(\"The cards are the same.\");\n }\n\n Hand hand = new Hand();\n\n hand.add(new Card(12, Card.HEARTS));\n hand.add(new Card(4, Card.CLUBS));\n hand.add(new Card(2, Card.DIAMONDS));\n hand.add(new Card(14, Card.CLUBS));\n hand.add(new Card(7, Card.HEARTS));\n hand.add(new Card(2, Card.CLUBS));\n\n hand.sortAgainstSuit();\n\n //hand.print();\n }",
"public void shufflePerfectly() {\n\n ArrayList<Card> topDeck = new ArrayList<Card>(), botDeck = new ArrayList<Card>();\n for (int i = cards.size()-1; i >= 0; i--) {\n Card shuffleCard = null;\n try {\n shuffleCard = cards.get(i);\n }\n catch (Exception e) {\n // If card does not exist\n }\n if (shuffleCard != null) {\n if (i >= cards.size() / 2) {\n topDeck.add(shuffleCard);\n }\n else {\n botDeck.add(shuffleCard);\n }\n }\n }\n int len;\n boolean equalStacks = false;\n Card extraCard = null;\n\n if (topDeck.size() == botDeck.size()) {\n equalStacks = true;\n len = topDeck.size();\n }\n else {\n if (topDeck.size()>botDeck.size()) {\n len = botDeck.size();\n extraCard = topDeck.get(topDeck.size()-1);\n }\n else {\n len = topDeck.size();\n extraCard = botDeck.get(botDeck.size()-1);\n }\n }\n\n ArrayList<Card> shuffledDeck = new ArrayList<Card>();\n\n for (int i = len-1; i >= 0; i--) {\n // Shuffle the cards\n shuffledDeck.add(botDeck.get(i));\n shuffledDeck.add(topDeck.get(i));\n\n }\n if (!equalStacks) {\n shuffledDeck.add(extraCard);\n }\n\n ArrayList<Card> newDeck = new ArrayList<Card>();\n\n for (int i = 0; i < shuffledDeck.size(); i++) {\n newDeck.add(shuffledDeck.get(i));\n }\n cards = newDeck;\n }",
"public int trickWinner(){\n Card.NUMBER one = player1Play.getValue();\n Card.NUMBER two = player2Play.getValue();\n Card.NUMBER three = player3Play.getValue();\n Card.NUMBER four = player4Play.getValue();\n Card.SUIT oneSuit = player1Play.getSuit();\n Card.SUIT twoSuit = player2Play.getSuit();\n Card.SUIT threeSuit = player3Play.getSuit();\n Card.SUIT fourSuit = player4Play.getSuit();\n int[] value = new int[4];\n value[0] = Card.getValsVal(one, oneSuit, currentTrumpSuit);\n value[1] = Card.getValsVal(two, twoSuit, currentTrumpSuit);\n value[2] = Card.getValsVal(three, threeSuit, currentTrumpSuit);\n value[3] = Card.getValsVal(four, fourSuit, currentTrumpSuit);\n if(player1Play.getSuit() == firstPlayedSuit && firstPlayedSuit != currentTrumpSuit && value[0] != 7){\n value[0] += 10;\n }\n if(player2Play.getSuit() == firstPlayedSuit && firstPlayedSuit != currentTrumpSuit && value[0] != 7){\n value[1] += 10;\n }\n if(player3Play.getSuit() == firstPlayedSuit && firstPlayedSuit != currentTrumpSuit && value[0] != 7){\n value[2] += 10;\n }\n if(player4Play.getSuit() == firstPlayedSuit && firstPlayedSuit != currentTrumpSuit && value[0] != 7){\n value[3] += 10;\n }\n if(player1Play.getSuit() == currentTrumpSuit || value[0] == 7){\n value[0] += 20;\n }\n if(player2Play.getSuit() == currentTrumpSuit || value[1] == 7){\n value[1] += 20;\n }\n if(player3Play.getSuit() == currentTrumpSuit || value[2] == 7){\n value[2] += 20;\n }\n if(player4Play.getSuit() == currentTrumpSuit || value[3] == 7){\n value[3] += 20;\n }\n int winner = 0;\n int winVal = 0;\n for(int i = 0; i < 4; i++){\n if(value[i] > winVal){\n winVal = value[i];\n winner = i;\n }\n }\n return winner;\n }",
"public Card dealCard() {\n if (deck.size() == 52) {\n shuffle();\n }\n Card temp;\n temp = deck.get(0);\n remove(0);\n return temp;\n }",
"private static short eval_5cards(int[] hand)\n {\n int q = (hand[0] | hand[1] | hand[2] | hand[3] | hand[4]) >> 16;\n\n // This checks for any kind of Flushes\n if ((hand[0] & hand[1] & hand[2] & hand[3] & hand[4] & 0xf000) != 0)\n return flushes.get(q);\n\n // This checks for Straights and High Card hands\n if ( unique5.get(q) != 0)\n return unique5.get(q);\n\n // This performs a perfect-hash lookup for remaining possible hands\n long q1 = (hand[0] & 0xff) * (hand[1] & 0xff) * (hand[2] & 0xff) * (hand[3] & 0xff) * (hand[4] & 0xff);\n return hash_values.get((int)find_fast(q1));\n }",
"@Test\n\tpublic void testQualityWithSellInUnder0Concert() {\n\t\tGildedRose inn = new GildedRose();\n\t\tinn.setItem(new Item(\"Backstage passes to a TAFKAL80ETC concert\", -1, 100));\n\t\tinn.oneDay();\n\t\t\n\t\t//access a list of items, get the quality of the one set\n\t\tList<Item> items = inn.getItems();\n\t\tint quality = items.get(0).getQuality();\n\t\t\n\t\t//assert quality has decreased to 0\n\t\tassertEquals(\"Quality with sellIn under 0 concert passes\", 0, quality);\n\t}",
"private int demDoiThong(List<Card> bai) {\n List<Card> cards = new ArrayList<>() ;\n int max = 0;\n int count = 0;\n for (int i = 0; i < bai.size() - 1; i++) {\n if (bai.get(i).getId() >= 48) {\n break;\n }\n if (count == 0 && bai.get(i).getCardNumber() == bai.get(i + 1).getCardNumber()) {\n count = 1;\n if (cards.isEmpty()) {\n cards.add(bai.get(i));\n cards.add(bai.get(i + 1));\n }\n } else {\n if (count % 2 != 0) {\n if (bai.get(i).getCardNumber()== bai.get(i + 1).getCardNumber() - 1) {\n count++;\n } else if (bai.get(i).getCardNumber()!= bai.get(i + 1).getCardNumber()) {\n // valid = false;\n if (count > max) {\n max = count;\n }\n if(cards.size()<6){\n cards.clear();\n }\n count = 0;\n }\n } else {\n if (bai.get(i).getCardNumber()== bai.get(i + 1).getCardNumber()) {\n if(!cards.contains(bai.get(i))){\n cards.add(bai.get(i));\n }\n if(!cards.contains(bai.get(i+1))){\n cards.add(bai.get(i+1));\n }\n count++;\n } else {\n // valid = false;\n if (count > max) {\n max = count;\n }\n if(cards.size()<6){\n cards.clear();\n }\n count = 0;\n }\n }\n }\n }\n if (count > max) {\n max = count;\n }\n if (max >= 5) {\n this.specialCards.addAll(cards);\n }\n return (max + 1) / 2;\n }",
"@Test\n public void decreaseWithDiscardLessThan4() {\n gm.setPlayerInfo(clientPlayer4);\n gm.setThisPlayerIndex(clientPlayer4.getPlayerIndex());\n for (ResourceType type : ResourceType.values()) {\n assertEquals(0, getAmounts().getOfType(type));\n }\n assertFalse(dc.getMaxDiscard() >= 4);\n dc.increaseAmount(ResourceType.ORE);\n assertEquals(0, getAmounts().getOfType(ResourceType.ORE));\n dc.decreaseAmount(ResourceType.ORE);\n assertEquals(0, getAmounts().getOfType(ResourceType.ORE));\n }",
"public Card play7(){\n Scanner scanner = new Scanner(System.in);\n Card chosenCard = null;\n int cardIndex;\n do{\n System.out.println(\"which card ? (it should be 7 )\");\n cardIndex = scanner.nextInt();\n// scanner.nextLine();\n if(cardIndex<=0 || cardIndex > hand.size()){\n System.out.println(\"not valid input\");\n System.out.println(\"please try again : \");\n }\n else if((!(hand.get(cardIndex-1).getSign().equals(\"7\")))){\n System.out.println(\"! it is not a seven card !\");\n System.out.println(\"please try again : \");\n }\n else{\n chosenCard = hand.get(cardIndex - 1);\n }\n\n }while(cardIndex <= 0 || cardIndex > hand.size() || chosenCard == null);\n\n\n hand.remove(chosenCard);\n return chosenCard;\n\n\n }",
"public Card chooseFromHand(String sign , String colorName){\n Scanner scanner = new Scanner(System.in);\n Card chosenCard = null;\n int cardIndex;\n do{\n System.out.println(\"which cart ? (-1 to pick up card from cardDeck) ?\");\n cardIndex =scanner.nextInt();\n// scanner.nextLine();\n if(cardIndex == -1){\n ArrayList<Card> playableCards = playableNormalCards(sign , colorName);\n if(playableCards.size() == 0){\n return null;\n }\n else {\n System.out.println(\"you still can play : \");\n for(Card card : playableCards){\n System.out.print(card + \" \");\n }\n System.out.println();\n }\n }\n else if(cardIndex<=0 ||cardIndex > hand.size()){\n System.out.println(\"not valid input\");\n System.out.println(\"please try again : \");\n }\n else if(hand.get(cardIndex-1).getSign().equals(\"B\")){\n chosenCard = hand.get(cardIndex -1);\n }\n else if((!(hand.get(cardIndex-1).getSign().equals(sign))) &&\n (!(hand.get(cardIndex-1).getColorName().equals(colorName)))){\n System.out.println(\"not playable card\");\n System.out.println(\"please try again : \");\n }\n else{\n chosenCard = hand.get(cardIndex - 1);\n }\n\n }while(cardIndex <= 0 || cardIndex > hand.size() || chosenCard == null);\n\n\n hand.remove(chosenCard);\n return chosenCard;\n }",
"@Test\n void pass3CardsRound2(){\n Dealer testDealer = new Dealer();\n testDealer.initDealer();\n testDealer.setRoundCount(2);\n \n List<Card> heartHand, spadeHand, clubHand, diamondHand,userPassedCards;\n\n heartHand = new ArrayList<Card>();\n spadeHand = new ArrayList<Card>();\n clubHand = new ArrayList<Card>();\n diamondHand = new ArrayList<Card>();\n userPassedCards = new ArrayList<Card>();\n \n userPassedCards.add(new Card(Suit.DIAMONDS, Rank.ACE, true));\n userPassedCards.add(new Card(Suit.DIAMONDS, Rank.KING, true));\n userPassedCards.add(new Card(Suit.DIAMONDS, Rank.QUEEN, true));\n\n \n for(Card c:userPassedCards) {\n c.setOwnerOfCard(\"user\");\n }\n\n for (Rank rank : Rank.values()) {\n heartHand.add(new Card(Suit.HEARTS, rank, true));\n }\n\n for (Rank rank : Rank.values()) {\n spadeHand.add(new Card(Suit.SPADES, rank, true));\n }\n\n for (Rank rank : Rank.values()) {\n clubHand.add(new Card(Suit.CLUBS, rank, true));\n }\n\n for (Rank rank : Rank.values()) {\n diamondHand.add(new Card(Suit.DIAMONDS, rank, true));\n }\n \n testDealer.getBotA().fillHandCards(heartHand);\n testDealer.getBotB().fillHandCards(spadeHand);\n testDealer.getBotC().fillHandCards(clubHand);\n testDealer.getUser().fillHandCards(diamondHand);\n\n testDealer.distributePassedCards(userPassedCards);\n\n assertEquals(13, testDealer.getUserHandCards().size());\n assertEquals(13, testDealer.getBotA().getHandCards().size());\n assertEquals(13, testDealer.getBotB().getHandCards().size());\n assertEquals(13, testDealer.getBotC().getHandCards().size());\n\n assertEquals(\"QUEEN of SPADES[pickable by botA]\", testDealer.getBotA().getHandCards().get(0).toString());\n assertEquals(\"KING of SPADES[pickable by botA]\", testDealer.getBotA().getHandCards().get(1).toString());\n assertEquals(\"ACE of SPADES[pickable by botA]\", testDealer.getBotA().getHandCards().get(2).toString());\n\n assertEquals(\"QUEEN of CLUBS[pickable by botB]\", testDealer.getBotB().getHandCards().get(0).toString());\n assertEquals(\"KING of CLUBS[pickable by botB]\", testDealer.getBotB().getHandCards().get(1).toString());\n assertEquals(\"ACE of CLUBS[pickable by botB]\", testDealer.getBotB().getHandCards().get(2).toString());\n System.out.println(testDealer.getBotC().getHandCards());\n assertEquals(\"QUEEN of DIAMONDS[pickable by botC]\", testDealer.getBotC().getHandCards().get(10).toString());\n assertEquals(\"KING of DIAMONDS[pickable by botC]\", testDealer.getBotC().getHandCards().get(11).toString());\n assertEquals(\"ACE of DIAMONDS[pickable by botC]\", testDealer.getBotC().getHandCards().get(12).toString());\n System.out.println(testDealer.getUser().getHandCards());\n assertEquals(\"QUEEN of HEARTS[pickable by user]\", testDealer.getUser().getHandCards().get(10).toString());\n assertEquals(\"KING of HEARTS[pickable by user]\", testDealer.getUser().getHandCards().get(11).toString());\n assertEquals(\"ACE of HEARTS[pickable by user]\", testDealer.getUser().getHandCards().get(12).toString());\n }",
"@Test\n void pass3CardsRound3(){\n Dealer testDealer = new Dealer();\n testDealer.initDealer();\n testDealer.setRoundCount(3);\n \n List<Card> heartHand, spadeHand, clubHand, diamondHand,userPassedCards;\n\n heartHand = new ArrayList<Card>();\n spadeHand = new ArrayList<Card>();\n clubHand = new ArrayList<Card>();\n diamondHand = new ArrayList<Card>();\n userPassedCards = new ArrayList<Card>();\n \n userPassedCards.add(new Card(Suit.DIAMONDS, Rank.ACE, true));\n userPassedCards.add(new Card(Suit.DIAMONDS, Rank.KING, true));\n userPassedCards.add(new Card(Suit.DIAMONDS, Rank.QUEEN, true));\n\n \n for(Card c:userPassedCards) {\n c.setOwnerOfCard(\"user\");\n }\n\n for (Rank rank : Rank.values()) {\n heartHand.add(new Card(Suit.HEARTS, rank, true));\n }\n\n for (Rank rank : Rank.values()) {\n spadeHand.add(new Card(Suit.SPADES, rank, true));\n }\n\n for (Rank rank : Rank.values()) {\n clubHand.add(new Card(Suit.CLUBS, rank, true));\n }\n\n for (Rank rank : Rank.values()) {\n diamondHand.add(new Card(Suit.DIAMONDS, rank, true));\n }\n \n testDealer.getBotA().fillHandCards(heartHand);\n testDealer.getBotB().fillHandCards(spadeHand);\n testDealer.getBotC().fillHandCards(clubHand);\n testDealer.getUser().fillHandCards(diamondHand);\n\n testDealer.distributePassedCards(userPassedCards);\n\n assertEquals(13, testDealer.getUserHandCards().size());\n assertEquals(13, testDealer.getBotA().getHandCards().size());\n assertEquals(13, testDealer.getBotB().getHandCards().size());\n assertEquals(13, testDealer.getBotC().getHandCards().size());\n\n assertEquals(\"QUEEN of CLUBS[pickable by botA]\", testDealer.getBotA().getHandCards().get(0).toString());\n assertEquals(\"KING of CLUBS[pickable by botA]\", testDealer.getBotA().getHandCards().get(1).toString());\n assertEquals(\"ACE of CLUBS[pickable by botA]\", testDealer.getBotA().getHandCards().get(2).toString());\n\n assertEquals(\"QUEEN of DIAMONDS[pickable by botB]\", testDealer.getBotB().getHandCards().get(0).toString());\n assertEquals(\"KING of DIAMONDS[pickable by botB]\", testDealer.getBotB().getHandCards().get(1).toString());\n assertEquals(\"ACE of DIAMONDS[pickable by botB]\", testDealer.getBotB().getHandCards().get(2).toString());\n\n assertEquals(\"QUEEN of HEARTS[pickable by botC]\", testDealer.getBotC().getHandCards().get(10).toString());\n assertEquals(\"KING of HEARTS[pickable by botC]\", testDealer.getBotC().getHandCards().get(11).toString());\n assertEquals(\"ACE of HEARTS[pickable by botC]\", testDealer.getBotC().getHandCards().get(12).toString());\n\n assertEquals(\"QUEEN of SPADES[pickable by user]\", testDealer.getUser().getHandCards().get(10).toString());\n assertEquals(\"KING of SPADES[pickable by user]\", testDealer.getUser().getHandCards().get(11).toString());\n assertEquals(\"ACE of SPADES[pickable by user]\", testDealer.getUser().getHandCards().get(12).toString());\n }",
"private void prepareDeal(){\n\t\tdeck.shuffle();\n\t\tplayers.clear(); //Remove any possible rubbish\n\t\tfor(Player p : seatPlayers){\n\t\t\tif(p != null){\n\t\t\t\tList<BlackjackHand> hands = new ArrayList<>();\n\t\t\t\tBlackjackHand hand = new BlackjackHandPlayer();\n\t\t\t\thands.add(hand);\n\t\t\t\thistoricalActions.put(hand, new ArrayList<>());\n\t\t\t\tplayers.put(p, hands);\n\t\t\t}\n\t\t}\n\t\tdealerHand = new BlackjackHandDealer();\n\t}",
"public void discardToDeck() {\n\t\tfor(int i=discardPile.size(); i>0; i--) {\n\t\t deck.add(discardPile.remove(0));\n\t\t}\n\t\tCollections.shuffle(deck);\n\t}",
"public Card removeCard(){\n Card temp = pile[0]; //removes top card. putting placement card to avoid null pointer\n for(int i = 0; i < pilePlace; i++){ //shifts cards\n pile[i] = pile[i+1];\n }\n pilePlace--;\n return temp;\n\n }",
"public static void main(String[] args) throws StackFullException, StackEmptyException {\n\t try {\n\t DiscardPile<Card> discardPile1 = null; \n\t\tdiscardPile1 = new DiscardPile<Card>(52, 0);// max is 52\n\t\tdiscardPile1.push(new Card(8));\n\t\tdiscardPile1.push(new Card(32));\n\t\tdiscardPile1.push(new Card(48));\t\t\n\t\tdiscardPile1.push(new Card(2));\n\t\tdiscardPile1.push(new Card(17));\n\t\tdiscardPile1.push(new Card(20)); //removeTopCard should remove all that's above\n\t\tdiscardPile1.push(new Card(25));\n\t\tdiscardPile1.push(new Card(50));\n\t\tdiscardPile1.push(new Card(19));\n\t\tdiscardPile1.push(new Card(41)); //10 Cards that must be popped\n\t\tSystem.out.println(\"*********************************************************************************\"); \n\t\tCollections.reverse(discardPile1);\n\t\tfor(Card comi : discardPile1) { //for loop for objects\n\t\t\tSystem.out.println(comi);\n\t\t\t}\t\t\t\n\t }\n\t catch (StackFullException SFE) {\n\t System.out.println(\"StackFullException: \" + SFE.getMessage());\n}\n\t try {\n\t\t\tDiscardPile<Card> discardPile = null; \n\t\t\tdiscardPile = new DiscardPile<Card>(52, 0);\n\t\t\tdiscardPile.push(new Card(8));\n\t\t\tdiscardPile.push(new Card(32));\n\t\t\tdiscardPile.push(new Card(48));\t\t\n\t\t\tdiscardPile.push(new Card(2));\n\t\t\tdiscardPile.push(new Card(17));\n\t\t\tdiscardPile.push(new Card(20)); //removeTopCard should remove all that's above\n\t\t\tdiscardPile.push(new Card(25));\n\t\t\tdiscardPile.push(new Card(50));\n\t\t\tdiscardPile.push(new Card(19));\n\t\t\tdiscardPile.push(new Card(41)); //10 Cards that must be popped\n\t\t\t \n\t\t\tSystem.out.println(\"*********************************************************************************\"); \n\t\t\t\n\t\t\tCard[] cardArr = discardPile.removeTopCard(new Card(20));\n\t\t\tfor(Card co : cardArr) { //for loop for objects\n\t\t\t\tSystem.out.println(co);\n\t\t\t\t}\t\t\n\t\t\tSystem.out.println(\"*********************************************************************************\"); \n\n\t\t }\n\t\t catch (StackFullException SFE) {\n\t\t \tSystem.out.println(\"StackFullException: \" + SFE.getMessage());\n\t\t }\n\t\t catch (StackEmptyException SEE) {\n\t\t \tSystem.out.println(\"StackFullException: \" + SEE.getMessage());\n\t\t }\n\t try {\n\t\t\tDiscardPile<Card> discardPile = null; \n\t\t\tdiscardPile = new DiscardPile<Card>(52, 0);\n\t\t\tdiscardPile.push(new Card(8));\n\t\t\tdiscardPile.push(new Card(32));\n\t\t\tdiscardPile.push(new Card(48));\t\t\n\t\t\tdiscardPile.push(new Card(2));\n\t\t\tdiscardPile.push(new Card(17));\n\t\t\tdiscardPile.push(new Card(20)); //removeTopCard should remove all that's above\n\t\t\tdiscardPile.push(new Card(25));\n\t\t\tdiscardPile.push(new Card(50));\n\t\t\tdiscardPile.push(new Card(19));\n\t\t\tdiscardPile.push(new Card(41)); //10 Cards that must be popped\n\t\t\t \n\t\t\t\n\t\t\tCard[] cardArr = discardPile.removeTopCard(new Card(50));\n\t\t\tfor(Card co : cardArr) { //for loop for objects\n\t\t\t\tSystem.out.println(co);\n\t\t\t\t}\t\t\n\t\t\tSystem.out.println(\"*********************************************************************************\"); \n\n\t\t }\n\t\t catch (StackFullException SFE) {\n\t\t \tSystem.out.println(\"StackFullException: \" + SFE.getMessage());\n\t\t }\n\t\t catch (StackEmptyException SEE) {\n\t\t \tSystem.out.println(\"StackFullException: \" + SEE.getMessage());\n\t\t }\n\n}",
"private int highestPossibleValue(List<Card> cards) {\n int value = 0;\n int assCounter = 0;\n\n // Calculate the value without taking * into account\n for (Card card : cards) {\n value += card.getValue();\n if (card.getName().equals(\"*\")) assCounter++;\n }\n\n // Subtracts value of *\n for (int i = 0; i < assCounter; i++) {\n if (value <= 21)\n break;\n value -= 10;\n }\n\n return value;\n }",
"@Test\n void testWinnerOfTrickNotFollowingSuit() {\n Dealer testDealer = new Dealer();\n testDealer.initDealer();\n\n Bot botA = testDealer.getBotA();\n Bot botB = testDealer.getBotB();\n Bot botC = testDealer.getBotC();\n\n ArrayList<Card> botAHand, botBHand, botCHand = new ArrayList <Card>();\n\n // botAHand = new ArrayList <Card>();\n botAHand = new ArrayList <Card>();\n botBHand = new ArrayList <Card>();\n botCHand = new ArrayList <Card>();\n\n Card thrownCard = new Card(Suit.CLUBS,Rank.FOUR,true);\n \n Card cardA1 = new Card(Suit.CLUBS,Rank.ACE,true);\n\n Card cardB1 = new Card(Suit.DIAMONDS,Rank.ACE,true);\n\n Card cardC1 = new Card(Suit.SPADES,Rank.ACE,true);\n\n botAHand.add(cardA1);\n botBHand.add(cardB1);\n botCHand.add(cardC1);\n \n // botA.fillHandCards(botAHand);\n botA.fillHandCards(botAHand);\n botB.fillHandCards(botBHand);\n botC.fillHandCards(botCHand);\n\n testDealer.addToPlayedCards(thrownCard);\n \n Card cardToPlay = botA.playCard(thrownCard, 1);\n testDealer.addToPlayedCards(cardToPlay);\n Card largestPlayedCard = testDealer.getLargestCardFromTrick();\n\n cardToPlay = botB.playCard(largestPlayedCard, 2);\n testDealer.addToPlayedCards(cardToPlay);\n largestPlayedCard = testDealer.getLargestCardFromTrick();\n\n cardToPlay = botC.playCard(largestPlayedCard, 3);\n testDealer.addToPlayedCards(cardToPlay);\n\n // List<Card> allPlayedCards = testDealer.getPlayedCardsForTrick();\n assertEquals(\"botA\", testDealer.getWinnerOfTrick(testDealer.getPlayedCardsForTrick()));\n }",
"private void InitializeComputerHand(){\n for(int i = 0; i < 7; i++){\n //Add to the computer\n handComputer.add(deck.get(i));\n }\n\n for(int i = 6; i >= 0; i--){\n deck.remove(i);\n }\n }",
"@Test\n void pass3CardsRound1(){\n Dealer testDealer = new Dealer();\n testDealer.initDealer();\n testDealer.setRoundCount(1);\n \n List<Card> heartHand, spadeHand, clubHand, diamondHand,userPassedCards;\n\n heartHand = new ArrayList<Card>();\n spadeHand = new ArrayList<Card>();\n clubHand = new ArrayList<Card>();\n diamondHand = new ArrayList<Card>();\n userPassedCards = new ArrayList<Card>();\n \n userPassedCards.add(new Card(Suit.DIAMONDS, Rank.ACE, true));\n userPassedCards.add(new Card(Suit.DIAMONDS, Rank.KING, true));\n userPassedCards.add(new Card(Suit.DIAMONDS, Rank.QUEEN, true));\n\n for(Card c:userPassedCards) {\n c.setOwnerOfCard(\"user\");\n }\n\n for (Rank rank : Rank.values()) {\n heartHand.add(new Card(Suit.HEARTS, rank, true));\n }\n\n for (Rank rank : Rank.values()) {\n spadeHand.add(new Card(Suit.SPADES, rank, true));\n }\n\n for (Rank rank : Rank.values()) {\n clubHand.add(new Card(Suit.CLUBS, rank, true));\n }\n\n for (Rank rank : Rank.values()) {\n diamondHand.add(new Card(Suit.DIAMONDS, rank, true));\n }\n \n testDealer.getBotA().fillHandCards(heartHand);\n testDealer.getBotB().fillHandCards(spadeHand);\n testDealer.getBotC().fillHandCards(clubHand);\n testDealer.getUser().fillHandCards(diamondHand);\n\n testDealer.distributePassedCards(userPassedCards);\n\n assertEquals(13, testDealer.getUserHandCards().size());\n assertEquals(13, testDealer.getBotA().getHandCards().size());\n assertEquals(13, testDealer.getBotB().getHandCards().size());\n assertEquals(13, testDealer.getBotC().getHandCards().size());\n\n assertEquals(\"QUEEN of DIAMONDS[pickable by botA]\", testDealer.getBotA().getHandCards().get(0).toString());\n assertEquals(\"KING of DIAMONDS[pickable by botA]\", testDealer.getBotA().getHandCards().get(1).toString());\n assertEquals(\"ACE of DIAMONDS[pickable by botA]\", testDealer.getBotA().getHandCards().get(2).toString());\n\n assertEquals(\"QUEEN of HEARTS[pickable by botB]\", testDealer.getBotB().getHandCards().get(10).toString());\n assertEquals(\"KING of HEARTS[pickable by botB]\", testDealer.getBotB().getHandCards().get(11).toString());\n assertEquals(\"ACE of HEARTS[pickable by botB]\", testDealer.getBotB().getHandCards().get(12).toString());\n\n assertEquals(\"QUEEN of SPADES[pickable by botC]\", testDealer.getBotC().getHandCards().get(10).toString());\n assertEquals(\"KING of SPADES[pickable by botC]\", testDealer.getBotC().getHandCards().get(11).toString());\n assertEquals(\"ACE of SPADES[pickable by botC]\", testDealer.getBotC().getHandCards().get(12).toString());\n System.out.println(testDealer.getUser().getHandCards());\n System.out.println();\n assertEquals(\"QUEEN of CLUBS[pickable by user]\", testDealer.getUser().getHandCards().get(0).toString());\n assertEquals(\"KING of CLUBS[pickable by user]\", testDealer.getUser().getHandCards().get(1).toString());\n assertEquals(\"ACE of CLUBS[pickable by user]\", testDealer.getUser().getHandCards().get(2).toString());\n }",
"@Override\n public Card playCard() {\n List<Card> rank1 = new ArrayList<>();\n List<Card> rank2 = new ArrayList<>();\n List<Card> rank3 = new ArrayList<>();\n List<Card> rank4 = new ArrayList<>();\n for (Card card : cardsInHand) {\n if (card.getRank().equals(Card.Rank.EIGHT)) {\n rank1.add(card);\n break;\n } else if (card.getSuit().equals(idealSuit)\n && card.getRank().equals(idealRank)\n && (topCard.getSuit().equals(card.getSuit())\n || topCard.getRank().equals(card.getRank()))) {\n rank2.add(card);\n } else if ((card.getSuit().equals(idealSuit) || card.getRank().equals(idealRank))\n && (topCard.getSuit().equals(card.getSuit())\n || topCard.getRank().equals(card.getRank()))) {\n rank3.add(card);\n } else if (topCard.getSuit().equals(card.getSuit())\n || topCard.getRank().equals(card.getRank())) {\n rank4.add(card);\n }\n }\n List<List<Card>> playPossibilities = new ArrayList<>(Arrays.asList(rank1, rank2, rank3, rank4));\n for (List<Card> list : playPossibilities) {\n if (list.size() > 0) {\n cardsInHand.remove(list.get(0));\n return list.get(0);\n }\n }\n // This method will never return null if shouldDrawCard() is called beforehand.\n return null;\n }",
"@Test\r\n public void testPlayer_getCautiousStrategyCardCard_numeric_matchColorNotNumber() {\n player2 = new Player(\"Player Two\", true);\r\n player2.setHand(strategyHand.getAllCards());\r\n\r\n // let the cpc be a yellow three\r\n // get rid of all non-numeric cards and the green three so the yellow six is the most attractive option\r\n player2.getHand().discard(wild);\r\n player2.getHand().discard(wildDrawFour);\r\n player2.getHand().discard(yellowReverse);\r\n player2.getHand().discard(redDrawTwo);\r\n player2.getHand().discard(greenThree);\r\n\r\n assertTrue(player2.getCautiousStrategyCard(yellowThree, yellowThree.getColor()).equals(yellowSix));\r\n }",
"@Test\n void negativeQuality() {\n Item[] items = new Item[]{new Item(\"noValue\", 2, 0)};\n GildedRose app = new GildedRose(items);\n app.updateQuality();\n\n assertEquals(0, app.items[0].quality, \"Quality shouldn't drop below 0\");\n }",
"private Pair[] bribeCalculateBag(final int maxCards,\n final HashMap<String, Integer> association) {\n final int minMoney = 5;\n final int maxBagSize = 3;\n if (getInventory().getMoney() < minMoney || numberOfIllegals(association) == 0) {\n return calculateBag(maxCards, association);\n }\n Pair[] result;\n if (numberOfIllegals(association) <= 2 || getInventory().getMoney() < minMoney * 2) {\n getInventory().getBagToGive().setBribe(minMoney);\n getInventory().setMoney(getInventory().getMoney() - minMoney);\n int duplicate = findIllegal(association);\n removeOneAsset(findIllegal(association));\n if (duplicate == findIllegal(association)) {\n result = new Pair[1];\n result[0] = new Pair<>(findIllegal(association), 2);\n getInventory().setNumberOfDeclared(2);\n } else {\n if (findIllegal(association) == -1) {\n result = new Pair[1];\n result[0] = new Pair<>(duplicate, 1);\n getInventory().setNumberOfDeclared(1);\n } else {\n result = new Pair[2];\n result[0] = new Pair<>(duplicate, 1);\n result[1] = new Pair<>(findIllegal(association), 1);\n getInventory().setNumberOfDeclared(2);\n }\n }\n removeOneAsset(findIllegal(association));\n getInventory().setDeclaredAssets(0);\n return result;\n } else {\n getInventory().getBagToGive().setBribe(minMoney * 2);\n getInventory().setMoney(getInventory().getMoney() - (minMoney * 2));\n int contor = maxCards - 1;\n final int contorStart = contor;\n int[] resultAux = new int[maxBagSize];\n getInventory().setDeclaredAssets(0);\n while (contor > 0 && findIllegal(association) != -1) {\n resultAux[findIllegal(association) % maxBagSize]++;\n removeOneAsset(findIllegal(association));\n contor--;\n }\n getInventory().setNumberOfDeclared(contorStart - contor);\n getInventory().setDeclaredAssets(0);\n contor = 0;\n for (int it : resultAux) {\n if (it != 0) {\n contor++;\n }\n }\n result = new Pair[contor];\n if (contor == maxBagSize) {\n result = new Pair[maxBagSize];\n result[0] = new Pair<>(association.get(\"Silk\"), resultAux[1]);\n result[1] = new Pair<>(association.get(\"Pepper\"), resultAux[2]);\n result[2] = new Pair<>(association.get(\"Barrel\"), resultAux[0]);\n } else {\n if (contor == 1) {\n result = new Pair[1];\n if (resultAux[0] > 0) {\n result[0] = new Pair<>(association.get(\"Barrel\"), resultAux[0]);\n }\n if (resultAux[1] > 0) {\n result[0] = new Pair<>(association.get(\"Silk\"), resultAux[1]);\n }\n if (resultAux[2] > 0) {\n result[0] = new Pair<>(association.get(\"Pepper\"), resultAux[2]);\n }\n } else {\n result = new Pair[2];\n int i = 0;\n if (resultAux[0] > 0) {\n result[i] = new Pair<>(association.get(\"Barrel\"), resultAux[0]);\n i++;\n }\n if (resultAux[1] > 0) {\n result[i] = new Pair<>(association.get(\"Silk\"), resultAux[1]);\n i++;\n }\n if (resultAux[2] > 0) {\n result[i] = new Pair<>(association.get(\"Pepper\"), resultAux[2]);\n }\n }\n }\n return result;\n }\n\n }",
"public void drawCard(Integer cardLocation){\n Random random = new Random();\n boolean isPlayerHandEmpty = false;\n Integer sizeOfPlayerHand = 4;\n //The reason for this is as follows: we are wanting to keep an array size of 4 consistent for playerHand, however\n //using the .remove() function actually shortens the size. Yet .set(index,null) is still counted as an element, hence\n //isEmpty does not work, and the size() is still 4.\n //Is this the most agile way to do this? I don't know, but this worked.\n\n for (Card s:playerHand){\n if(s == null){\n sizeOfPlayerHand--;\n }\n }\n if (sizeOfPlayerHand == 0){\n isPlayerHandEmpty = true;\n }\n\n\n\n if (playerTempDeck.size() > 0 && (sizeOfPlayerHand < 4 || playerHand.size() < 4)){\n //System.out.println(\"Adding cards from deck.\");\n\n Integer n = random.nextInt(playerTempDeck.size()); //0 to the number in the bracket. Pick a random card from the deck and use it here.\n playerHand.set(cardLocation, playerTempDeck.get(n));\n //System.out.println(\"Now the playerHand is: \" + playerHand.toString());\n //System.out.println(\"Size of deck: \" + playerTempDeck.size());\n //System.out.println(\"Trying to remove: \" + playerTempDeck.get(n).getEffect());\n playerTempDeck.remove(playerTempDeck.get(n));\n }\n\n if (playerTempDeck.size() == 0 && (isPlayerHandEmpty || playerHand.size() == 0)){ //deck is empty and no cards left to play, reshuffle.\n //System.out.println(\"Hand and deck are both empty!\");\n playerTempDeck.addAll(discardedCards);\n discardedCards.clear();\n drawCard(0);\n drawCard(1);\n drawCard(2);\n drawCard(3);\n }\n }",
"public void antiClue(Card c) {\n\t\tnotPossible.add(c);\n\t}",
"@Override\n\tboolean isValid(){\n\t\tif(size()==5) {\n\t\t\tint suite = getCard(0).suit;\n\t\t\tfor(int i = 1 ; i< size(); i++) {\n\t\t\t\tif(getCard(i).suit != suite) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tsort();\n\t\t\tint currRank = (getCard(0).rank +11)%13;\n\t\t\tfor(int i=0; i<size(); i++) {\n\t\t\t\tif((getCard(i).rank+11)%13 != currRank) return false;\n\t\t\t\tcurrRank++;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}",
"private void shuffleOnceRandom(){\n\t\t//You need to have a copy of the deck before you shuffled it so you can reference\n\t\t//It when you are trying to replace the new values\n\t\tList<Card> beforeShuffle = ourDeck.makeCopy().getCurrentDeck();\n\t\t//The topIndex tells us where we are in reference to the top half of the deck\n\t\t//Same with bottom this helps us reference the original deck to get whatever\n\t\t//Card we need and the deckIndex helps us put it in the correct spot\n\t\tint topIndex = 0, bottomIndex = ourDeck.getSize() / 2, deckIndex = 0;\n\t\t//These ints help us keep track of how many cards are left in each half\n\t\tint remainingTop = ourDeck.getSize() / 2, remainingBot = ourDeck.getSize() / 2;\n\t\tboolean shouldLoop = true;\n\t\t//This is the shuffling loop\n\t\twhile(shouldLoop){\n\t\t\t//This means the number coming from the specific deck which in this method is random\n\t\t\tint numTop = generator.nextInt(RAND_BOUND), numBot = generator.nextInt(RAND_BOUND);\n\t\t\t//After we determine the random number of cards we're using we have to do some checks\n\t\t\t//This means we wanted more than there was less therefore the stack is out\n\t\t\t//This is the stopping condition for the loop\n\t\t\tif(numTop >= remainingTop){\n\t\t\t\tnumTop = remainingTop;\n\t\t\t\tnumBot = remainingBot;\n\t\t\t\tshouldLoop = false;\n\t\t\t}\n\t\t\t\t\n\t\t\tif(numBot >= remainingBot){\n\t\t\t\tnumTop = remainingTop;\n\t\t\t\tnumBot = remainingBot;\n\t\t\t\tshouldLoop = false;\n\t\t\t}\n\t\t\t//This is where I replace the newCard into ourDeck\n\t\t\t//I iterate for the number of times we take from the top or bottom\n\t\t\tfor(int i = 1; i <= numTop; i++){\t\n\t\t\t\tCard newCard = beforeShuffle.get(topIndex);\t//I get the card we want to move\n\t\t\t\tourDeck.setCard(newCard, deckIndex);\t\t//Then I move it to the new deckIndex\n\t\t\t\ttopIndex++;\tdeckIndex++;\n\t\t\t}\n\t\t\tfor(int i = 1; i <= numBot; i++){\n\t\t\t\tCard newCard = beforeShuffle.get(bottomIndex);\n\t\t\t\tourDeck.setCard(newCard, deckIndex);\n\t\t\t\tbottomIndex++;\tdeckIndex++;\n\t\t\t}\n\t\t\tremainingTop = remainingTop - numTop;\n\t\t\tremainingBot = remainingBot - numBot;\n\t\t}\n\t}",
"public Deck() {\n cards = new LinkedList<Integer>();\n removedCards = new LinkedList<Integer>();\n \n int i, j;\n for (i = MIN_VALUE; i <= MAX_VALUE; i++) {\n for (j = 0; j <= NUM_SUITS; j++) {\n cards.add(i);\n }\n }\n }",
"public void processStandardECard(ErgebnisLOSCard card) {\n\t\tswitch(card.getId()) {\n\t\tcase 1:\n\t\t\tcurrent.raiseScore(20);\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tcurrent.raiseScore(10);\n\t\t\tgetLeftNeighbor().raiseScore(20);\n\t\t\tbreak;\n\t\tcase 4:\n\t\t\traiseScoreOfEveryPlayer(10);\n\t\t\tbreak;\n\t\tcase 5:\n\t\t\tcurrent.raiseScore(10);\n\t\t\tbreak;\n\t\tcase 6:\n\t\t\tbreak;\n\t\tcase 7:\n\t\t\tcurrent.raiseScore(30);\n\t\t\tbreak;\n\t\tcase 8:\n\t\t\tbreak;\n\t\tcase 9:\n\t\t\tcurrent.raiseScore(20);\n\t\t\tbreak;\n\t\tcase 11:\n\t\t\tgetLeftNeighbor().raiseScore(10);\n\t\t\tgetRightNeigbour().raiseScore(10);\n\t\t\tbreak;\n\t\tcase (12):\n\t\tcase (13):\n\t\tcase (14):\n\t\t\tcurrent.raiseScore(10);\n\t\t\tbreak;\n\t\tcase (15):\n\t\tcase (16):\n\t\tcase (17):\n\t\t\tbreak;\n\t\tcase (18):\n\t\t\tcurrent.raiseScore(30);\n\t\t\tbreak;\n\t\tcase (19):\n\t\t\tcurrent.raiseScore(20);\n\t\t\tbreak;\n\t\tcase (20):\n\t\t\tcurrent.raiseScore(50);\n\t\t\tbreak;\n\t\tcase (21):\n\t\t\tgetRightNeigbour().lowerScore(50);\n\t\t\tcurrent.raiseScore(50);\n\t\t\tbreak;\n\t\tcase (22):\n\t\t\tcurrent.raiseScore(20);\n\t\t\tbreak;\n\t\tcase (23):\n\t\t\tbreak;\n\t\tcase (25):\n\t\t\tcurrent.raiseScore(20);\n\t\t\tbreak;\n\t\tcase (26):\n\t\tcase (27):\n\t\tcase (28):\n\t\tcase (29):\n\t\tcase (30):\n\t\tcase (31):\n\t\t\tcurrent.raiseScore(10);\n\t\tcase (32):\n\t\t\tcurrent.raiseScore(30);\n\t\tcase (33):\n\t\t\tcurrent.raiseScore(20);\n\t\tcase (34):\n\t\t\tcurrent.raiseScore(20);\n\t\t\tgetRightNeigbour().raiseScore(10);\n\t\tcase (35):\n\t\t\tcurrent.raiseScore(20);\n\t\tcase (36):{\n\t\t\tif(!projectsAvailable.isEmpty()) {\n\t\t\t\topenUpProject(drawProject());\t\t\t\t\n\t\t\t}\n\t\t\telse current.raiseScore(30);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase (37):\n\t\t\tcurrent.raiseScore(20);\n\t\t\tbreak;\n\t\tcase (38):\n\t\t\tcurrent.raiseScore(10);\n\t\t\tbreak;\n\t\tcase (39):\n\t\t\tcurrent.raiseScore(10);\n\t\t\traiseScoreSecondRightNeighbor(10);\n\t\t\tbreak;\n\t\tcase (40):\n\t\t\tcurrent.raiseScore(20);\n\t\t\tbreak;\n\t\tcase (41):\n\t\t\tcurrent.raiseScore(10);\n\t\t\tbreak;\n\t\tcase (43):\n\t\t\tcurrent.lowerScore(20);\n\t\t\tgetRightNeigbour().raiseScore(20);\n\t\t\tbreak;\n\t\tcase (44):\n\t\tcase (45):\n\t\t\tcurrent.raiseScore(20);\n\t\t\tbreak;\n\t\tcase (46):\n\t\t\traiseScoreOfEveryPlayer(10);\n\t\t\tbreak;\n\t\tcase (48):\n\t\t\tcurrent.raiseScore(20);\n\t\tcase (50):\n\t\t\tbreak;\n\t\tcase (52):\n\t\t\tcurrent.raiseScore(20);\n\t\t\tbreak;\n\t\tcase (54):\n\t\t\tcurrent.raiseScore(50);\n\t\t\tbreak;\n\t\tcase (55):\n\t\t\tcurrent.raiseScore(10);\n\t\t\tbreak;\n\t\t}\n\t}",
"public void dealCardsToPile()\n {\n // Set the first initial computer card to display\n computerCard = highCardGame.getCardFromDeck();\n\n // Sets the first initial player card\n playerCard = highCardGame.getCardFromDeck();\n }",
"@Test\n\tpublic void testQuality0SellInUnder0() {\n\t\tGildedRose inn = new GildedRose();\n\t\tinn.setItem(new Item(\"Sulfuras, Hand of Ragnaros\", -11, 0));\n\t\tinn.oneDay();\n\t\t\n\t\t//access a list of items, get the quality of the one set\n\t\tList<Item> items = inn.getItems();\n\t\tint quality = items.get(0).getQuality();\n\t\t\n\t\t//assert quality remains the same\n\t\tassertEquals(\"Quality with quality 0 Sulfuras\", 0, quality);\n\t}",
"public boolean play(DiscardPile discardPile, \n\t Stack<Card> drawPile, \n\t\t\t\t\t\t\t\t\t\t\tArrayList<Player> players)\n\t{\t\n\t\n\t\n\tSystem.out.println(\"Before playing: \" + this.hand.toString());\n\t\tboolean temp = false;\n\t\tString suitEight = \"xyz\";\n\t\n\t\tif ((discardPile.top()).getRank() == 4 && super.checker_4 == true){\n\t\t\tSystem.out.println();\n\t\t\tSystem.out.println(\"\\t _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \");\n\t\t\tSystem.out.println(\"\\t | skipping the turn.. :( |\");\n\t\t\tSystem.out.println(\"\\t -----------------------------\");\n\t\t\tSystem.out.println();\n\t\t\tSystem.out.println();\n\t\t\tsuper.checker_4 = false;\n\t\t\treturn false;\n\t\t\t\n\t\t\t}\n\t\n\t\n\t\n\t\n\t\n\t\n\t\t/* adding two cards */\n\t\t if ((discardPile.top()).getRank() == 2 && super.checker_2 == true){\n\t\t\t \n\t\t\t System.out.println();\n\t\t\t System.out.println(\"\\t _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \");\n\t\t\t System.out.println(\"\\t | twice the value added! |\");\n\t\t\t System.out.println(\"\\t -----------------------------\");\n\t\t\t System.out.println();\n\t\t\t System.out.println();\n\t\t\t \n\t\t\t \n\t\t\tthis.hand.add(drawPile.pop());\n\t\t\t this.hand.add(drawPile.pop());\n\t\t\ttemp = false;\n\t\t\tsuper.checker_2 = false;\n\t\t }\n\t\t\n\t\t\n\t\t \n\t\t\n\t\telse{\n\t\t\tint i = location_1(discardPile);\n\t\t\t\n\t\t\t\n\t\t\tif(i == -1){\n\t\t\t\tthis.hand.add(drawPile.pop());\n\t\t\t\tif( i == location_2(discardPile)){ \n\t\t\t\t\t//System.out.println(\"value is added!\");\n\t\t\t\t\t//System.out.println();\n\t\t\t\t\t//System.out.println();\n\t\t\t\t\n\t\t\t\t} else{\n\t\t\t\t\ti = location_2(discardPile);\n\t\t\t\t\t//System.out.println(\"HAHA! got it!\");\n\t\t\t\t\tdiscardPile.add(this.hand.remove(i));\n\t\t\t\t\ttemp = false;\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tif ((discardPile.top()).getRank() == 2 && super.checker_2 == false){\n\t\t\t\t\t\tsuper.checker_2 = true;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(discardPile.top().getRank() == 4 && super.checker_4 == false){\n\t\t\t\t\t\tsuper.checker_4 = true;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif ((discardPile.top()).getRank() == 8 && temp == false){\n\t\t\t\t\t\tsuitEight = this.wildEight(discardPile, drawPile, players);\n\t\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t\tSystem.out.println(\"\\t \\t ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\");\n\t\t\t\t\t\tSystem.out.println(\"\\t \\t \\t Changing the suit to: \" + suitEight);\n\t\t\t\t\t\tSystem.out.print(\"\\t \\t \\t Processing....\");\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\tSystem.out.println();\n\t\t\t\t\t\t(discardPile.top()).setSuit(suitEight);\n\t\t\t\t\t\tSystem.out.println(\"\\t \\t \\t draw pile : \" + drawPile.peek() );\n\t\t\t\t\t\tSystem.out.println(\"\\t \\t \\t discard pile : \" + discardPile.top() );\n\t\t\t\t\t\tSystem.out.println(\"\\t \\t ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\");\n\t\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tif( this.hand.size() == 0 ){\n\t\t\t\t\ttemp = true;\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\t\n\t\t\t} else{\n\t\t\t\tdiscardPile.add(this.hand.remove(i));\n\t\t\t\ttemp = false;\n\t\t\t\t\n\t\t\t\tif ((discardPile.top()).getRank() == 2 && super.checker_2 == false){\n\t\t\t\t\t\tsuper.checker_2 = true;\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(discardPile.top().getRank() == 4 && super.checker_4 == false){\n\t\t\t\t\tsuper.checker_4 = true;\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ((discardPile.top()).getRank() == 8 && temp == false){\n\t\t\t\t\t\tsuitEight = this.wildEight(discardPile, drawPile, players);\n\t\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t\tSystem.out.println(\"\\t \\t ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\");\n\t\t\t\t\t\tSystem.out.println(\"\\t \\t \\t Changing the suit to: \" + suitEight);\n\t\t\t\t\t\tSystem.out.print(\"\\t \\t \\t Processing....\");\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\tSystem.out.println();\n\t\t\t\t\t\t(discardPile.top()).setSuit(suitEight);\n\t\t\t\t\t\tSystem.out.println(\"\\t \\t \\t draw pile : \" + drawPile.peek() );\n\t\t\t\t\t\tSystem.out.println(\"\\t \\t \\t discard pile : \" + discardPile.top() );\n\t\t\t\t\t\tSystem.out.println(\"\\t \\t ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\");\n\t\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t\tSystem.out.println();\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\tif( this.hand.size() == 0 ){\n\t\t\t\t\ttemp = true;\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\n\n\t\t\n\t\t\n\t\n\t\tSystem.out.println(\"After Playing: \" + this.hand.toString());\n\t\tSystem.out.println();\n\t\treturn temp;\n\t\t\n\t\n\t}",
"public void dealCards() {\n for(int i=0; i < 5; i++) { \n for(PokerPlayer player : players) {\n player.takeCard(deck.draw());\n }\n }\n }",
"public boolean hasBlackjack() {\n\t\treturn this.hand.countValue().lower(22) == 21;\n\t}",
"@Test\r\n public void testHasAtLeastTwoPlayableCards() {\n Player player2 = new Player(\"Three Playable Cards Test\", true);\r\n Hand threePlayableCardsHand = strategyHand;\r\n player2.setHand(threePlayableCardsHand.getAllCards());\r\n\r\n // Make it harder to find playable cards:\r\n player2.getHand().discard(new Card(Card.COLORLESS, Card.WILD, cvm));\r\n player2.getHand().discard(new Card(Card.COLORLESS, Card.WILD_DRAW_FOUR, cvm));\r\n\r\n Card currentPlayedCard_1 = new Card(Card.YELLOW, Card.ONE, cvm);\r\n assertTrue(player2.hasAtLeastTwoPlayableCards(currentPlayedCard_1, Card.BLUE));\r\n\r\n Card currentPlayedCard_2 = new Card(Card.BLUE, Card.SEVEN, cvm);\r\n assertFalse(player2.hasAtLeastTwoPlayableCards(currentPlayedCard_2, Card.BLUE));\r\n }",
"public boolean isFlush(){\n \r\n if(haveSameSuit(cards)){\r\n handValue = cards.get(cards.size()-1).getValue();\r\n return true;\r\n }\r\n \r\n return false;\r\n }",
"@Test\n void pass3CardsRound4(){\n Dealer testDealer = new Dealer();\n testDealer.initDealer();\n testDealer.setRoundCount(4);\n \n List<Card> heartHand, spadeHand, clubHand, diamondHand,userPassedCards;\n\n heartHand = new ArrayList<Card>();\n spadeHand = new ArrayList<Card>();\n clubHand = new ArrayList<Card>();\n diamondHand = new ArrayList<Card>();\n userPassedCards = new ArrayList<Card>();\n \n userPassedCards.add(new Card(Suit.DIAMONDS, Rank.ACE, true));\n userPassedCards.add(new Card(Suit.DIAMONDS, Rank.KING, true));\n userPassedCards.add(new Card(Suit.DIAMONDS, Rank.QUEEN, true));\n\n \n for(Card c:userPassedCards) {\n c.setOwnerOfCard(\"user\");\n }\n\n for (Rank rank : Rank.values()) {\n heartHand.add(new Card(Suit.HEARTS, rank, true));\n }\n\n for (Rank rank : Rank.values()) {\n spadeHand.add(new Card(Suit.SPADES, rank, true));\n }\n\n for (Rank rank : Rank.values()) {\n clubHand.add(new Card(Suit.CLUBS, rank, true));\n }\n\n for (Rank rank : Rank.values()) {\n diamondHand.add(new Card(Suit.DIAMONDS, rank, true));\n }\n \n testDealer.getBotA().fillHandCards(heartHand);\n testDealer.getBotB().fillHandCards(spadeHand);\n testDealer.getBotC().fillHandCards(clubHand);\n testDealer.getUser().fillHandCards(diamondHand);\n\n testDealer.distributePassedCards(userPassedCards);\n\n assertEquals(13, testDealer.getUserHandCards().size());\n assertEquals(13, testDealer.getBotA().getHandCards().size());\n assertEquals(13, testDealer.getBotB().getHandCards().size());\n assertEquals(13, testDealer.getBotC().getHandCards().size());\n\n assertEquals(\"TWO of HEARTS[pickable by botA]\", testDealer.getBotA().getHandCards().get(0).toString());\n assertEquals(\"THREE of HEARTS[pickable by botA]\", testDealer.getBotA().getHandCards().get(1).toString());\n assertEquals(\"FOUR of HEARTS[pickable by botA]\", testDealer.getBotA().getHandCards().get(2).toString());\n\n assertEquals(\"TWO of SPADES[pickable by botB]\", testDealer.getBotB().getHandCards().get(0).toString());\n assertEquals(\"THREE of SPADES[pickable by botB]\", testDealer.getBotB().getHandCards().get(1).toString());\n assertEquals(\"FOUR of SPADES[pickable by botB]\", testDealer.getBotB().getHandCards().get(2).toString());\n\n assertEquals(\"QUEEN of CLUBS[pickable by botC]\", testDealer.getBotC().getHandCards().get(10).toString());\n assertEquals(\"KING of CLUBS[pickable by botC]\", testDealer.getBotC().getHandCards().get(11).toString());\n assertEquals(\"ACE of CLUBS[pickable by botC]\", testDealer.getBotC().getHandCards().get(12).toString());\n\n assertEquals(\"QUEEN of DIAMONDS[pickable by user]\", testDealer.getUser().getHandCards().get(10).toString());\n assertEquals(\"KING of DIAMONDS[pickable by user]\", testDealer.getUser().getHandCards().get(11).toString());\n assertEquals(\"ACE of DIAMONDS[pickable by user]\", testDealer.getUser().getHandCards().get(12).toString());\n }",
"private int flushValue() {\n int flushValue = 0;\n if (inSameSuit()) {\n flushValue += 4;\n \n char firstCardSuit = cards[0].charAt(1);\n char StartCardSuit = cards[cards.length-1].charAt(1);\n \n if(firstCardSuit==StartCardSuit){\n flushValue +=1;\n }\n } \n return flushValue;\n }",
"public Bag getGreedyBag() {\r\n bag = super.getBag();\r\n List<Integer> auxiliarHand = new LinkedList<Integer>(hand);\r\n\r\n for (int i = 0; i < bag.getCardsIds().size(); i++) {\r\n if (auxiliarHand.contains(bag.getCardsIds().get(i))) {\r\n auxiliarHand.remove(bag.getCardsIds().get(i));\r\n }\r\n }\r\n\r\n if (this.roundNumber % 2 == 0) {\r\n highestProfitIllegalCard = 0;\r\n if (bag.getCards().size() < MAX_CARDS_IN_BAG) {\r\n for (Integer cardId : auxiliarHand) {\r\n if (cardId > MAX_LEGAL_INDEX\r\n && goodsFactory.getGoodsById(cardId).getProfit()\r\n > goodsFactory.getGoodsById(highestProfitIllegalCard).getProfit()) {\r\n highestProfitIllegalCard = cardId;\r\n }\r\n }\r\n if (highestProfitIllegalCard != 0\r\n && (coins - goodsFactory\r\n .getGoodsById(highestProfitIllegalCard)\r\n .getPenalty()) > 0) {\r\n bag.addCard(goodsFactory.getGoodsById(highestProfitIllegalCard));\r\n }\r\n }\r\n }\r\n return bag;\r\n }",
"public void sortHand(){\n\t\thand.sort(PlayingCard.PlayingCardComparator_ACEHIGH);\n\t}"
] | [
"0.69807875",
"0.6687522",
"0.6444543",
"0.6421975",
"0.63321817",
"0.62753564",
"0.61993456",
"0.6163325",
"0.6161017",
"0.6152925",
"0.609701",
"0.6084212",
"0.60724443",
"0.6030475",
"0.6026662",
"0.6003614",
"0.5984277",
"0.59827626",
"0.59821963",
"0.5974949",
"0.59517413",
"0.5950988",
"0.59451085",
"0.5942425",
"0.5936605",
"0.5926871",
"0.5916887",
"0.5915172",
"0.5914296",
"0.58946234",
"0.58854884",
"0.58604294",
"0.58600974",
"0.58468753",
"0.5838135",
"0.58312696",
"0.58222365",
"0.5821411",
"0.5819304",
"0.58171886",
"0.5810631",
"0.5810263",
"0.5809316",
"0.58085954",
"0.57977706",
"0.5797408",
"0.5786973",
"0.57572883",
"0.5757142",
"0.5756491",
"0.57531804",
"0.5751156",
"0.5748498",
"0.573452",
"0.5731259",
"0.5729877",
"0.5722032",
"0.57108665",
"0.5700451",
"0.56866467",
"0.56796473",
"0.5677234",
"0.56751794",
"0.56665254",
"0.5656079",
"0.5652332",
"0.56503826",
"0.5641552",
"0.56414384",
"0.5628393",
"0.5616677",
"0.5607509",
"0.5599346",
"0.5598769",
"0.5597379",
"0.55956936",
"0.5594642",
"0.5588654",
"0.55863357",
"0.5576409",
"0.55715376",
"0.5568037",
"0.5566803",
"0.5565522",
"0.55576664",
"0.55509484",
"0.55292356",
"0.5527966",
"0.5525375",
"0.5519842",
"0.55093116",
"0.5508969",
"0.5503688",
"0.55030924",
"0.5498005",
"0.54942983",
"0.5492839",
"0.5489357",
"0.5483759",
"0.5483359"
] | 0.6380108 | 4 |
make sure the cautious strategy gets rid of higher value cards first when there are other legal lower value cards in the hand. | @Test
public void testPlayer_getCautiousStrategyCardCard_higherFirst_drawTwo() {
player2 = new Player("Player Two", true);
player2.setHand(strategyHand.getAllCards());
// let the cpc be a red nine
// get rid of the wild and wd4 cards so the red draw two is the most attractive option
player2.getHand().discard(wild);
player2.getHand().discard(wildDrawFour);
Card redNine = new Card(Card.RED, Card.NINE, cvm);
assertTrue(player2.getCautiousStrategyCard(redNine, redNine.getColor()).equals(redDrawTwo));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void makeHigh() {\n Collections.sort(this.cards, Card.COMPARE_BY_VALUE);\n ArrayList<String> validHand = new ArrayList<>();\n for(int i = this.cards.size() - 5; i < this.cards.size(); i++)\n validHand.add(this.cards.get(i).toString());\n this.cardHand = new CardHand(validHand.toArray(new String[0]));\n }",
"void dropcard3()\n{\nfor (int i=0;i<numberofhc()-1;i++)\n\t{\n\tint judgeA = (getcard(i)-3)/4;\n\t\n\tif(judgeA==12)\n\t\t{\n\t\tif(getcard(i)==54 && getcard(i+1)==54) //if the player has 2 SA, he/she can drop both\n\t\t\t{\n\t\t\tremove(i);\n\t\t\tremove(i);\n\t\t\ti--;\n\t\t\t}\n\t\telse if(getcard(i)==51 && getcard(i+1)==52) //if the player has CA and DA, he/she can drop both\n\t\t\t{\n\t\t\tremove(i);\n\t\t\tremove(i);\n\t\t\ti--;\n\t\t\t}\n\t\telse if(getcard(i)==51 && getcard(i+1)==53) //if the player has CA and HA, he/she can drop both\n\t\t\t{\n\t\t\tremove(i);\n\t\t\tremove(i);\n\t\t\ti--;\n\t\t\t}\n\t\telse if(getcard(i)==52 && getcard(i+1)==53) //if the player has DA and HA, he/she can drop both\n\t\t\t{\n\t\t\tremove(i);\n\t\t\tremove(i);\n\t\t\ti--;\n\t\t\t}\n\t\t}\n\telse\n\t\t{if((((getcard(i))-3)/4)==(((getcard(i+1))-3)/4))\n\t\t\t{remove(i);\n\t\t\tremove(i);\n\t\t\ti--;}}\n\t}\n\t}",
"private void makeTrips() {\n int highestThree, firstKicker, secondKicker;\n highestThree = firstKicker = secondKicker = -1;\n for (Integer key : this.cardOccurrence.keySet()) {\n int value = this.cardOccurrence.get(key);\n if(value == 3 && value > highestThree)\n highestThree = key;\n else {\n if(key > firstKicker) {\n secondKicker = firstKicker;\n firstKicker = key;\n }\n else if(key > secondKicker)\n secondKicker = key;\n }\n }\n\n //Go through Cards ArrayList to get the actual cards pertaining\n ArrayList<String> validHand = new ArrayList<>();\n for(int i = 0; i < this.cards.size(); i++) {\n Card c = this.cards.get(i);\n if(c.sameValue(highestThree))\n validHand.add(c.toString());\n else if(c.sameValue(firstKicker) || c.sameValue(secondKicker))\n validHand.add(c.toString());\n }\n this.cardHand = new CardHand(validHand.toArray(new String[0]));\n }",
"public void aceChanger() {\n\t\t// Two aces in hand before move has been made\n\t\tif (hand.numOfCards() == 2 && isBusted()) {\n\t\t\thandIterator = new HandIterator(hand.getCards());\n\t\t\tCard c = hand.getCards().get(0);\n\t\t\tCard newAce = new Card(1, \"A\", c.getCardSuit());\n\t\t\thand.addCard(newAce);\n\t\t\thand.remove(c);\n\t\t// Ace in hand and set to 11, and hand has busted\n\t\t} else if (checkForAce() && isBusted() && hand.numOfCards() > 2) {\n\t\t\thandIterator = new HandIterator(hand.getCards());\n\t\t\twhile (handIterator.hasNext()) {\n\t\t\t\tCard c = (Card) handIterator.next();\n\t\t\t\tif (c.getCardValue() == 11) {\n\t\t\t\t\thand.addCard(new Card(1, \"A\", c.getCardSuit()));\n\t\t\t\t\thand.remove(c);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t// Ace in hand and total hand value is < 21\n//\t\t} else if (checkForAce() && !isBusted()) {\n//\t\t\tprintHand();\n//\t\t\tif (hand.numOfAces() == 1) {\n//\t\t\t\thandIterator = new HandIterator(hand.getCards());\n//\t\t\t\tSystem.out.println(\"You have an Ace card in your hand. Do you \"\n//\t\t\t\t\t\t+ \"want to set the value to 1 or 11?\");\n//\t\t\t\tint ans = scan.nextInt();\n//\t\t\t\twhile (handIterator.hasNext()) {\n//\t\t\t\t\tCard c = (Card) handIterator.next();\n//\t\t\t\t\tif (c.getCardName().equals(\"A\")) {\n//\t\t\t\t\t\twhile (ans != 1 && ans != 11) {\n//\t\t\t\t\t\t\tSystem.out.println(\"Invalid input. Try again.\");\n//\t\t\t\t\t\t\tans = scan.nextInt();\n//\t\t\t\t\t\t}\n//\t\t\t\t\t\thand.addCard(new Card(ans, \"A\", c.getCardSuit()));\n//\t\t\t\t\t\thand.remove(c);\n//\t\t\t\t\t\treturn;\n//\t\t\t\t\t}\n//\t\t\t\t}\n//\t\t\t} else {\n//\t\t\t\thandIterator = new HandIterator(hand.getCards());\n//\t\t\t\tSystem.out.println(\"You have multiple Ace cards in your hand.\"\n//\t\t\t\t\t\t+ \" Which card do you want to set the value for?\"\n//\t\t\t\t\t\t+ \" (Select by appropriate card suit.) Type exit to\"\n//\t\t\t\t\t\t+ \" make no changes.\");\n//\t\t\t\tString suit = scan.next();\n//\t\t\t\tif (suit.equalsIgnoreCase(\"exit\")) {\n//\t\t\t\t\treturn;\n//\t\t\t\t}\n//\t\t\t\twhile (handIterator.hasNext()) {\n//\t\t\t\t\tCard c = (Card) handIterator.next();\n//\t\t\t\t\tif (c.getCardName().equals(\"A\") && \n//\t\t\t\t\t\t\tc.getCardSuit().equalsIgnoreCase(suit)) {\n//\t\t\t\t\t\tSystem.out.println(\"Do you want to set the value to 1\"\n//\t\t\t\t\t\t\t\t+ \" or 11?\");\n//\t\t\t\t\t\tint ans = scan.nextInt();\n//\t\t\t\t\t\thand.addCard(new Card(ans, \"A\", c.getCardSuit()));\n//\t\t\t\t\t\thand.remove(c);\n//\t\t\t\t\t\treturn;\n//\t\t\t\t\t}\n//\t\t\t\t}\n//\t\t\t}\n\t\t}\n\t}",
"@Test\r\n public void testPlayer_getCautiousStrategyCardCard_higherFirst_wd4() {\n player2 = new Player(\"Player Two\", true);\r\n player2.setHand(strategyHand.getAllCards());\r\n\r\n // get rid of the wild so the wd4 is the most attractive option\r\n player2.getHand().discard(wild);\r\n assertTrue(player2.getCautiousStrategyCard(yellowThree, yellowThree.getColor()).equals(wildDrawFour));\r\n }",
"public void discard(){\n for(int i = 1 ; i <= 110 ; i++) cardDeck.remove(i);\n }",
"public void applyCard(Card card, String user){\n if (user.equals(\"player\")){\n if (card == null){\n //System.out.println(\"No card in this slot\");\n //System.out.println(\"Size of tempDeck: \" + playerTempDeck.size());\n } else{\n if(playerMana >= card.getManaCost()){\n updateMana(\"player\", -card.getManaCost());\n //Check if has enough gold, too. Make free cards have a worth of gold = 0.\n //playerGoldAmount -= card.getGoldCost(); //------------------------------------------------Implement this once it can be tested.\n\n if(card.getEffect().contains(\"A\")){ //attack\n //looks long, but it finds the index of the Attack symbol (\"A\") and adds one to it, so it'll find the value 5 if the input is \"A5\", anywhere on the string.\n //Allows for things such as \"A4D1\" in theory.\n updateHealth(\"enemy\", -Character.getNumericValue(card.getEffect().charAt(card.getEffect().indexOf(\"A\") + 1)), true);\n }\n if(card.getEffect().contains(\"D\")) { //Defend\n updateDefence(\"player\", Character.getNumericValue(card.getEffect().charAt(card.getEffect().indexOf(\"D\") + 1)));\n }\n\n //Discard the card just used, put into discarded pile.\n Integer index = playerHand.indexOf(card);\n discardedCards.add(card);\n //System.out.println(\"Current index is: \" + index);\n //System.out.println(\"At that index was: \" + playerHand.get(index));\n playerHand.set(index, null);\n\n\n //System.out.println(\"The deck is currently: \" + playerHand.toString());\n //playerHand.remove(card); //Doesn't work, shortens the size all together.\n drawCard(index);\n }\n }\n }\n\n else if (user.equals(\"enemy\")){\n if(enemyMana >= card.getManaCost()){\n updateMana(\"enemy\", -card.getManaCost());\n if(card.getEffect().contains(\"A\")){\n updateHealth(\"player\", -Character.getNumericValue(card.getEffect().charAt(card.getEffect().indexOf(\"A\") + 1)), true);\n }\n if(card.getEffect().contains(\"D\")) {\n updateDefence(\"enemy\", Character.getNumericValue(card.getEffect().charAt(card.getEffect().indexOf(\"D\") + 1)));\n }\n }\n }\n }",
"private void checkHighCard(Player player) {\n\t\tplayer.setHandRank(HandRank.HIGH_CARD);\n\n\t\tfor (int i = 0, j = 6; i < hand.length; i++, j--)\n\t\t\thand[i] = player.getSevenCardsTempHand().get(j);\n\n\t\tplayer.setFiveCardsHand(hand);\n\t}",
"public void unsetChanceCardShuffle() {\n ChanceCardShuffle = false;\n }",
"static int getComputerCard(Card playerCard) {\n //The computer will iterate through different possible cards it might choose to play.\n //This represents a chosen card at any given time.\n Card possibleCard = null;\n //The position in the computer's hand where the possibleCard is stored.\n int cardPosition = 0;\n //True if the computer has a card of higher value than the player's.\n boolean hasHigherCard = false;\n //Iterate through the computer's hand, trying to find a card higher than the player's\n for (int i = 0; i < highCardGame.getHand(0).getNumCards(); i++) {\n if (playerCard.compareTo(highCardGame.getHand(0).inspectCard(i)) < 0) {\n //The computer has a higher card.\n if (possibleCard != null) {\n //If this card is lower than the possible card, but can still beat the player, then replace possible card.\n if (possibleCard.compareTo(highCardGame.getHand(0).inspectCard(i)) > 0) {\n possibleCard = new Card(highCardGame.getHand(0).inspectCard(i));\n cardPosition = i;\n }\n } else {\n //If the computer has not yet chosen a possible card, choose this one.\n possibleCard = new Card(highCardGame.getHand(0).inspectCard(i));\n hasHigherCard = true;\n cardPosition = i;\n }\n }\n }\n if (!hasHigherCard) {\n //If the computer does not have a card that can beat the player, then feed the lowest card\n //that the computer has to the player.\n for (int i = 0; i < highCardGame.getHand(0).getNumCards(); i++)\n if (playerCard.compareTo(highCardGame.getHand(0).inspectCard(i)) >= 0) {\n if (possibleCard != null) {\n if (possibleCard.compareTo(highCardGame.getHand(0).inspectCard(i)) > 0) {\n possibleCard = new Card(highCardGame.getHand(0).inspectCard(i));\n cardPosition = i;\n }\n } else {\n possibleCard = highCardGame.getHand(0).inspectCard(i);\n cardPosition = i;\n }\n }\n }\n return cardPosition;\n }",
"public void deal()\n\t{\n\t Random generator = new Random();\n\t int thisCard = generator.nextInt(52);\n\n\t face = faces[thisCard % 13];\n\t suit = suits[thisCard / 13];\n\n\t faceValue = thisCard %13;\n\t}",
"@Test\r\n public void testPlayer_getDumbStrategyCard_differentWinners() {\r\n player2 = new Player(\"\", true);\r\n player2.setHand(strategyHand.getAllCards());\r\n boolean differentLegalCardFound = false;\r\n Card firstDiscard = player2.getDumbStrategyCard(yellowSix, yellowSix.getColor());\r\n for(int i = 0; i < 25; i++) {\r\n Card loopCard = player2.getDumbStrategyCard(yellowSix, yellowSix.getColor());\r\n if(!loopCard.equals(firstDiscard)) {\r\n differentLegalCardFound = true;\r\n }\r\n }\r\n assertTrue(differentLegalCardFound);\r\n }",
"public void RemoveCardFromHuman(int value){\n handHuman.remove(value);\n }",
"void dropcard()\n{\nfor (int i=0;i<hc.size()-1;i++)\n\t{\n\tif(hc.get(i)==1||hc.get(i)==2)\n\t\tcontinue;\n\telse if((((hc.get(i))-3)/4)==(((hc.get(i+1))-3)/4))\n\t\t{hc.remove(i);\n\t\thc.remove(i);\n\t\ti--;}\t\n\t}\n}",
"public void unsetChestCardShuffle() {\n ChanceCardShuffle = false;\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 java.util.List<Card> deal(java.util.List<Card> hand, int numCards) {\n for (int i = 0; i < numCards; ++i) {\n hand.add(removeTop(deck));\n }\n return hand;\n }",
"private void discardRestrictedCards()\n\t{\n\t\tif (playerList.size() == 2)\n\t\t{\n\t\t\tfor(Card card : restrictedCard2PlayerList)\n\t\t\t{\n\t\t\t\tswitch (card.getType())\n\t\t\t\t{\n\t\t\t\t\tcase GreenPlayerCard:\n\t\t\t\t\tcase BrownPlayerCard:\n\t\t\t\t\t\tCard playerCardMatch = board.getPlayerCardDeck().pickCardByID(card.getId());\n\t\t\t\t\t\tif (playerCardMatch != null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tboard.getDiscardDeck().addCard(playerCardMatch);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase CityAreaCard:\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase PersonalityCard:\n\t\t\t\t\t\tCard personalityCardMatch = board.getPersonalityCardDeck().pickCardByID(card.getId());\n\t\t\t\t\t\tif (personalityCardMatch != null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tboard.getDiscardDeck().addCard(personalityCardMatch);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase RandomEventCard:\n\t\t\t\t\t\tCard randomEventCardMatch = board.getRandomEventCardDeck().pickCardByID(card.getId());\n\t\t\t\t\t\tif (randomEventCardMatch != null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tboard.getDiscardDeck().addCard(randomEventCardMatch);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public void RemoveCardFromComputer(int value){\n handComputer.remove(value);\n }",
"private void updateLastCardDiscarded(){\r\n\t\tint x = 0;\r\n\t\twhile(this != game.getPlayer(x++)){} // find the nextPlayer\r\n\t\tx = x % game.getNumberOfPlayers();\r\n\t\tnextPlayer = game.getPlayer(x);\r\n\t\t\r\n\t\tif(latestRound != game.getRoundNumber()){ // if it's a new Round, reset\r\n\t\t\tpickedUpCards = new ArrayList<Card>();\r\n\t\t\tlastCardDiscarded = null;\r\n\t\t\tlatestRound = game.getRoundNumber();\r\n\t\t\t\r\n\t\t\tfor(int y = 0; y < game.getNumberOfPlayers(); y++){ // ?????\r\n\t\t\t\tif(game.getPlayer(y) != this && \r\n\t\t\t\t\t\t(getScore() >= game.getPlayer(y).getScore() || getPhase() > game.getPlayer(y).getPhase())){//????\r\n\t\t\t\t\tsetName(oldName);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tsetName(oldName + \"is#WINNING\"); // ?????\r\n\t\t}else if(lastCardDiscarded != null && Configuration.getTypeRequired(nextPlayer.getPhase(), 0) == Configuration.SET_PHASE){\r\n\t\t\tif(nextPlayer.drewFromDiscard())\r\n\t\t\t\tpickedUpCards.add(lastCardDiscarded); // add the card to picked up card if it was picked up \r\n\t\t}\r\n\t}",
"@Override\r\n\tprotected int giveCardProtected(ArrayList<Card> hand) {\n\t\treturn getRandomCard(hand);\r\n\t}",
"@Test\n public void bestowCheckForCorrectCMC() {\n addCard(Zone.BATTLEFIELD, playerA, \"Island\", 7);\n // Enchantment Creature — Siren\n // 1/1\n // Bestow {5}{U}{U} (If you cast this card for its bestow cost, it's an Aura spell with enchant creature. It becomes a creature again if it's not attached to a creature.)\n // Flying\n // You control enchanted creature.\n // Enchanted creature gets +1/+1 and has flying.\n addCard(Zone.HAND, playerA, \"Hypnotic Siren\");\n // Instant {1}{U}\n // Counter target spell with converted mana cost 4 or greater.\n addCard(Zone.HAND, playerB, \"Disdainful Stroke\");\n addCard(Zone.BATTLEFIELD, playerB, \"Island\", 2);\n\n addCard(Zone.BATTLEFIELD, playerB, \"Silvercoat Lion\");\n\n // B can't cast counter spell due CMC\n castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, \"Hypnotic Siren using bestow\", \"Silvercoat Lion\");\n checkStackSize(\"after\", 1, PhaseStep.PRECOMBAT_MAIN, playerB, 1);\n checkPlayableAbility(\"after\", 1, PhaseStep.PRECOMBAT_MAIN, playerB, \"Cast Disdainful Stroke\", false);\n //castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, \"Disdainful Stroke\", \"Hypnotic Siren\");\n\n setStrictChooseMode(true);\n setStopAt(1, PhaseStep.BEGIN_COMBAT);\n execute();\n\n //\n assertHandCount(playerA, \"Hypnotic Siren\", 0);\n assertGraveyardCount(playerA, \"Hypnotic Siren\", 0);\n assertHandCount(playerB, \"Disdainful Stroke\", 1);\n assertPermanentCount(playerA, \"Hypnotic Siren\", 1);\n\n // because cast with bestow, Boon Satyr may not be tapped\n assertPermanentCount(playerA, \"Silvercoat Lion\", 1);\n assertPowerToughness(playerA, \"Silvercoat Lion\", 3, 3);\n\n }",
"public void evaluateHand(){only public for testing\n //hand types will be\n //1 royal flush\n //2 straight flush\n //3 four of a kind\n //4 full house\n //5 flush\n //6 straight\n //7 three of a kind\n //8 two pair\n //9 pair\n //10 high card\n //hand secondary values will have to some how account for\n //the lead card of a flush or straight or the bigger pair\n //\n HandType = 0;\n\n //----------checking flush----------\n boolean flush = true;//will flip the vriable when proven wrong\n //if Hand.suites all equal\n for(Card c : Hand) {\n if (!c.getSuite().contains(Hand[0].getSuite())) {\n flush = false;\n }\n }\n //--Handtype = 5//flush\n if(flush){\n HandType=5;\n }\n\n //----------checking pair, two pair, boat,three of a kind, four of a kind----------\n int countmatches=0;\n HashMap<Integer, ArrayList<Card>> maskd = new HashMap<>();\n int[] mask = new int[5];\n int currentmask=1;\n maskd.put(0, new ArrayList<>());\n mask[0]=0;\n maskd.get(0).add(this.Hand[0]);\n //if any two hand.value equal\n for(int comp = 0; comp<Hand.length;comp++){//comparitor\n for(int check = comp+1; check<Hand.length;check++) {//checker\n //System.out.print(\"{\"+comp+check+\"}\");\n if(0==Hand[comp].compareTo(Hand[check])){\n //System.out.println(\"pair\"+Hand[comp]+Hand[check]);\n countmatches++;\n /*if(pairprimary==0&&!(pairprimary==Hand[check].getValue())){\n pairprimary=Hand[check].getValue();\n }else if(pairsecondary==0){\n pairsecondary=Hand[check].getValue();\n }//this wont work for boats\n */\n //create mask?\n if(mask[comp]==0){\n mask[comp]=currentmask;\n maskd.put(currentmask,new ArrayList<>());\n maskd.get(currentmask).add(this.Hand[comp]);\n currentmask++;\n if(maskd.get(0).contains(this.Hand[comp])){\n maskd.get(0).remove(this.Hand[comp]);\n }\n }\n mask[check]=mask[comp];\n if(!maskd.get(mask[comp]).contains(this.Hand[check])) {\n if(maskd.get(0).contains(this.Hand[check]))\n maskd.get(0).remove(this.Hand[check]);\n maskd.get(mask[comp]).add(this.Hand[check]);\n }\n continue;\n }\n if(!maskd.get(0).contains(this.Hand[check]))\n maskd.get(0).add(this.Hand[check]);\n }\n }\n\n //for(int m:maskd.keySet())\n // System.out.print(\"\"+m+\":\"+maskd.get(m));\n //System.out.println(\"\");\n\n if(HandType==0)\n switch (countmatches){ //basically i'm counting the collisions\n case 1: HandType=9;break;//one pair\n case 2: HandType=8;break;//two pair\n case 3: HandType=7;break;//triple\n case 4: HandType=4;break;//boat\n case 6: HandType=3;break;//four of a kind\n case 10: HandType=-1;break;//five of a kind\n }//reorder cards by mask?\n if(countmatches>0){\n Card[] newhand = new Card[5];\n int bigger = 0;\n if(currentmask==3) {//two pair boat\n //two pair\n if (maskd.get(1).get(0).getValue()\n > maskd.get(2).get(0).getValue()) {\n bigger = 1;\n } else {\n bigger = 2;\n }\n\n //boat\n if (maskd.get(1).size() == 3) {\n bigger = 1;\n }\n if (maskd.get(2).size() == 3) {\n bigger = 2;\n }\n }else {\n //one pair???\n bigger = 1;\n }\n\n for(int i = 0; i<5;i++){\n //if(maskd.containsKey(bigger)) {\n if(!maskd.get(bigger).isEmpty()) {\n newhand[i] = maskd.get(bigger).get(0);\n //if (maskd.get(bigger).size() > 0) {\n maskd.get(bigger).remove(0);\n //} else {\n // bigger = Math.abs(bigger - 3);\n //}\n }else{\n if(maskd.containsKey(Math.abs(bigger-3))){\n if(!maskd.get(Math.abs(bigger-3)).isEmpty()){\n bigger = Math.abs(bigger-3);\n }else{\n bigger = 0;\n }\n }else{\n bigger = 0;\n }\n i--;\n }\n //}\n\n }//end for loop\n\n //end pair bits\n\n //System.out.println(newhand);\n this.Hand=newhand;\n }//end reshuffle hand if statement\n //----------checking for straight----------\n //if first card is ace and second card is a 5, treat ace as one\n if(Hand[0].getValue()==14&&Hand[1].getValue()==5) {\n Hand[0] = new Card(\"Ace\", Hand[0].getSuite(), 1);\n //Hand[0].Value=1;\n this.sortHand();\n this.flipHand();\n }\n //go through hand and see if all 5 values are consecutive\n int n = Hand[0].getValue();\n boolean straight = true;\n for(int i = 1;i<Hand.length; i++){\n n--;\n if(!(Hand[i].getValue()==n)){\n straight=false;\n }\n }\n if(straight){\n //if above true\n //--if handtype = 5\n if(HandType==5) {\n //----if card1 is ace\n if (Hand[0].getValue() == 14) {\n //------handtype = 1 //royal flush\n HandType = 1;\n } else {\n //----else\n HandType=2;\n //------handtype = 2 //straight flush\n }\n }else {\n //--else //not a flush\n HandType=6;\n //----handtype = 6 //straight\n }\n }\n\n //----------checking high card----------\n //if handtype = 0\n if(HandType==0) {\n HandType=10;\n //--hand card = 10\n }\n }",
"private Hand getStraight(Hand handToCheck){\n\t\tHand hand = new FiveCardHand(handToCheck); //Make copy of the object so original doesn't get modified\n\t\tlog.debug(\"getStraight(hand = \"+hand+\")\");\n\t\tif(hand == null){\n\t\t\tlog.debug(\"Hand was null. Returning null\");\n\t\t\treturn null;\n\t\t}\n\t\tArrayList<Card> cards = hand.getCards();\n\t\tif(cards == null){\n\t\t\tlog.debug(\"The ArrayList<Card> inside the Hand Object was NULL. Returning null\");\n\t\t\treturn null;\n\t\t}\n\t\tlog.trace(\"Number of cards in Hand: \"+cards.size());\n\t\tSet<CardNumber> set = new HashSet<CardNumber>(hand.getNumberValues());\n\t\tif(set.size()<5){\n\t\t\tlog.debug(\"Only \"+set.size()+\" unique numbers\");\n\t\t\treturn null;\n\t\t}\n\t\tList<CardNumber> sorted = CollectionHelper.asSortedList(set);\n\t\tlog.debug(\"Sorted Size = \"+sorted.size());\n\t\tHand numberInSequence = new FiveCardHand();\n\t\tif(sorted.size()>1){\n\t\t\t//Inch worm a long, adding hands as this will handle more than 5 cards\n\t\t\tnumberInSequence.addHand(hand.getSubHandHavingNumber(sorted.get(0)));\n\t\t\tfor(int i=1; i<sorted.size();i++){\n\t\t\t\tif(CardUtil.areCardNumbersSequential(sorted.get(i-1),sorted.get(i))){\n\t\t\t\t\tnumberInSequence.addHand(hand.getSubHandHavingNumber(sorted.get(i)));\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tnumberInSequence = hand.getSubHandHavingNumber(sorted.get(i));\n\t\t\t\t}\n\t\t\t}\n\t\t\t //Check wrap around, (example: Ace)\n\t\t\tCardNumber start = sorted.get(0);\n\t\t\tCardNumber end = sorted.get(sorted.size()-1);\n\t\t\tlog.debug(\"Checking wrap around case, if \"+start+\" and \"\n\t\t\t\t\t+end+\" are sequential\");\n\t\t\tif(CardUtil.areCardNumbersSequential(start,end)){\n\t\t\t\tlog.debug(\"Wrap around Ace in play\");\n\t\t\t\t//Add the Ace\n\t\t\t\tnumberInSequence.addHand(hand.getSubHandHavingNumber(sorted.get(0)));\n\t\t\t}\n\t\t}\n\t\tlog.debug(\"Number of cards in sequence: \"+numberInSequence.getCards().size());\n\t\tif(numberInSequence.getCards().size()>4){\n\t\t\treturn numberInSequence;\n\t\t}\n\t\treturn null;\n\t}",
"public boolean playCard(Cards card, Players player) {\n boolean higher = false;\n int compare = 0;\n if (playedCards.size() == 0 || this.playAgain(player)) { //to check if it is a new game or this is a new round\n if (card instanceof TrumpCards) { //to check if the first played card is a supertrump card\n setCategory(((TrumpCards) card).cardEffect());\n }\n higher = true;\n } else {\n if (card instanceof NormCards) { //to check if the played card is a normal card\n if (getLastCard() instanceof NormCards) { //to check whether the last played card is a normal card or a supertrump card\n if (category.equals(\"H\")) {\n Float now = new Float(((NormCards) card).getHardness());\n Float last = new Float(((NormCards) getLastCard()).getHardness());\n compare = now.compareTo(last);\n } else if (category.equals(\"S\")) {\n Float now = new Float(((NormCards) card).getSpecGravity());\n Float last = new Float(((NormCards) getLastCard()).getSpecGravity());\n compare = now.compareTo(last);\n } else if (category.equals(\"C\")) {\n Float now = new Float(((NormCards) card).getCleavageValue());\n Float last = new Float(((NormCards) getLastCard()).getCleavageValue());\n compare = now.compareTo(last);\n } else if (category.equals(\"CA\")) {\n Float now = new Float(((NormCards) card).getCrustalAbunVal());\n Float last = new Float(((NormCards) getLastCard()).getCrustalAbunVal());\n compare = now.compareTo(last);\n } else if (category.equals(\"EV\")) {\n Float now = new Float(((NormCards) card).getEcoValueValue());\n Float last = new Float(((NormCards) getLastCard()).getEcoValueValue());\n compare = now.compareTo(last);\n\n }\n if (compare > 0) {\n higher = true;\n } else {\n System.out.println(\"The selected card does not has higher value!\");\n }\n } else { //or else, the last played card is a supertrump card\n higher = true;\n }\n } else { //or else, the played is a supertrump card\n setCategory(((TrumpCards) card).cardEffect());\n higher = true;\n }\n }\n return higher;\n }",
"private int highCard() {\n\t\tint highCard = 0;\n\t\tfor (int counter = 0; counter < Constants.HAND_SIZE; counter++) {\n\t\t\tif (hand[counter].getValueIndex() > highCard) {\n\t\t\t\thighCard = hand[counter].getValueIndex();\n\t\t\t}\n\t\t}\n\t\tresult.setPrimaryValuePos(highCard);\n\t\treturn highCard;\n\t}",
"public void sortByValue() {\n\t\tArrayList<Card> newHand = new ArrayList<Card>();\n\t\twhile (this.cardsInhand.size() > 0) {\n\t\t\tint pos = 0; // Position of minimal card.\n\t\t\tCard c = this.cardsInhand.get(0); // Minimal card.\n\t\t\tfor (int i = 1; i < this.cardsInhand.size(); i++) {\n\t\t\t\tCard c1 = this.cardsInhand.get(i);\n\t\t\t\tif (c1.getValue() < c.getValue() || (c1.getValue() == c.getValue() && c1.getSuit() < c.getSuit())) {\n\t\t\t\t\tpos = i;\n\t\t\t\t\tc = c1;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.cardsInhand.remove(pos);\n\t\t\tnewHand.add(c);\n\t\t}\n\t\tthis.cardsInhand = newHand;\n\t}",
"@Test\r\n public void testPlayer_getCautiousStrategyCardCard_numeric_matchNumberNotColor() {\n player2 = new Player(\"Player Two\", true);\r\n player2.setHand(strategyHand.getAllCards());\r\n\r\n // let the cpc be a blue eight\r\n Card blueEight = new Card(Card.BLUE, Card.EIGHT, cvm);\r\n\r\n // get rid of all non-numeric cards and the blue four so the red eight is the most attractive option\r\n player2.getHand().discard(wild);\r\n player2.getHand().discard(wildDrawFour);\r\n player2.getHand().discard(yellowReverse);\r\n player2.getHand().discard(redDrawTwo);\r\n player2.getHand().discard(blueFour);\r\n\r\n Card redEight = new Card(Card.RED, Card.EIGHT, cvm);\r\n\r\n assertTrue(player2.getCautiousStrategyCard(blueEight, yellowThree.getColor()).equals(redEight));\r\n }",
"private void revertMortgage(ArrayList<PropertyCard> cards) {\n\t\tfor(PropertyCard c: cards) {\n\t\t\tc.outOfMortgage();\n\t\t}\n\t}",
"for (Card ca : deck) {\n\t\tif (ca.suit == 'c') {\n\t\t\tdeck.remove(ca);\n\t\t}\n\t}",
"public void removeFromHand(int card) {\n\t\tString [] temp = new String[hand.length];//make new temp array for hand\n\t\tint internalCounter = 0;//keeps track of next available index\n\t\tfor(int i = 0; i < hand.length; ++i){//loop through whole hand\n\t\t if( i != card ){//if the current card is not equal to the desired card\n\t\t temp[internalCounter] = hand[i];//add the current card to the array in the lowest available slot\n\t\t internalCounter++;//increase available index\n\t\t }\n\t\t}\n\t\ttemp[temp.length-1] = null;//make last slot null\n\t\tString [] temp2 = new String[temp.length-1];//new temp array to shorten the hand to exclude null entries\n\t\tfor (int j = 0; j < temp2.length; j++) {//loop through the new temp array\n\t\t\tif (temp[j] != null) {//if the slot in the first temp array isn't null\n\t\t\t\ttemp2[j] = temp[j];//add the card to the shortened temp array\n\t\t\t}\n\t\t}\n\t\thand = temp2;//make the hand equal to the shortened hand\n\t}",
"@Test\n public void testShuffleGood() {\n System.out.println(\"shuffleGood\");\n Deck deck = new Deck();\n boolean shuffled = false;\n deck.shuffle();\n //we take out one card from the deck\n Card lastCard = deck.nextCard();\n //we take out 58 more cards\n for (int i =0 ; i<57;i++)\n {\n deck.nextCard();\n }\n //we take out the last card from the deck\n Card firstCard = deck.nextCard();\n \n //if both cards = the same value they were before being shuffled, then test will fail.\n if (lastCard.getValue() != CardType.WILDCARD )\n shuffled = true;\n else if (firstCard.getValue()!=CardType.ZERO)\n shuffled = true;\n \n //if either of the cards are different, that means the deck was shuffled and the test will pass\n assertEquals(true, shuffled);\n }",
"public void dealerAskCard() {\n int dealerScore = this.getDealerHand().getActualValue();\n while (dealerScore < 17) {\n Card card = this.deck.deal(this.getDealerHand());\n dealerScore = this.getDealerHand().getActualValue();\n }\n }",
"private void badMatch() {\n\t\tArrayList<Integer> faceValues = new ArrayList<Integer>();\n\t\tInteger firstSelectableCardPos = null;\n\t\t\n\t\tfor (int card = 0; card < CARDS_SUM; card++) {\n\t\t\tPlayingCard thisCard = ((PlayingCard) getActivity().findViewById(solo.getImage(card).getId()));\n\t\t\t\n\t\t\t// cheat by finding card face without turning card over\n\t\t\tint face = thisCard.getCard();\n\t\t\tfaceValues.add(face);\n\t\t\t\n\t\t\t// can't select all cards\n\t\t\tif (thisCard.isLocked() || thisCard.getVisible()) {\n\t\t\t\tcontinue;\n\t\t\t} else if (firstSelectableCardPos == null) {\n\t\t\t\tfirstSelectableCardPos = card;\n\t\t\t}\n\t\t\t\n\t\t\t// if this is a different card, select the bad pair\n\t\t\tif (faceValues.get(firstSelectableCardPos) != face) {\n\t\t\t\tsolo.clickOnImage(firstSelectableCardPos);\n\t\t\t\tsolo.clickOnImage(card);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}",
"void dealTheCards();",
"@Test\n\tpublic void testQualityOver50SellInUnder0() {\n\t\tGildedRose inn = new GildedRose();\n\t\tinn.setItem(new Item(\"Aged Brie\", -11, 51));\n\t\tinn.oneDay();\n\t\t\n\t\t//access a list of items, get the quality of the one set\n\t\tList<Item> items = inn.getItems();\n\t\tint quality = items.get(0).getQuality();\n\t\t\n\t\t//assert quality remains the same\n\t\tassertEquals(\"Quality with quality 0 Brie\", 51, quality);\n\t}",
"@Test\n public void discardIfCannot() {\n gm.setPlayerInfo(clientPlayer3);\n gm.setThisPlayerIndex(clientPlayer3.getPlayerIndex());\n dc.increaseAmount(ResourceType.ORE);\n dc.increaseAmount(ResourceType.ORE);\n dc.increaseAmount(ResourceType.WOOD);\n assertEquals(2, getAmounts().getOfType(ResourceType.ORE));\n assertEquals(1, getAmounts().getOfType(ResourceType.WOOD));\n Player p = model.getPlayer(clientPlayer3.getPlayerIndex());\n when(robberFacade.canDiscard(dc.getDiscardAmount(), p)).thenReturn(false);\n dc.discard();\n // This verifies that the robberFacade.discard is only called once instead of twice\n verify(robberFacade, atMost(1)).discard(dc.getDiscardAmount(), p);\n\n }",
"public Card dealCard()\n {\n Card errorReturn = new Card('E', Card.Suit.spades); // in rare cases\n\n if (topCard == 0)\n return errorReturn;\n else\n return cards[--topCard];\n }",
"public void ArrangeSuits() {\n if (mCardCount > 0) {\n \tCard card;\n \tCard orderedCards[];\n \torderedCards = new Card[mCardCount];\n \tint iValue;\n \tint iOrder[];\n \tint iCount = 0;\n \tiOrder = new int [mCardCount];\n \tint iMinValue = Card.HEARTS * 13 + Card.KING;\n \tiOrder[0] = iMinValue;\n \tfor (int i = 0; i < mCardCount; i++){\n \t\tcard = mCard[i];\n \t\tiValue = card.GetSuit()*13 + card.GetValue();\n \t\tiCount = 0;\n \t\t// See where the card value comes in the pecking order\n \t\twhile (iValue > iOrder[iCount]){\n \t\t\tiCount++;\n \t\t}\n \t\t// It goes here, so move everything else along one\n \t\tfor (int j = mCardCount-1; j > iCount; j--)\n \t\t\tiOrder[j] = iOrder[j-1];\n \t\tiOrder[iCount] = iValue;\n \t}\n \t\n \tfor (int i = 0; i < mCardCount; i++){\n \t\tfor (int j = 0; j < mCardCount; j++){\n \t\tcard = mCard[j];\n \t\tiValue = card.GetSuit()*13 + card.GetValue(); \t\t\t\n \t\t\tif (iValue == iOrder[i]){\n \t\t\t\torderedCards[i] = mCard[j];\n \t\t\t\tbreak;\n \t\t\t}\n \t\t}\n \t}\n \tfor (int i = 0; i < mCardCount; i++){\n \t\tmCard[i] = orderedCards[i];\n \t} \t\n }\n }",
"public boolean VerifyHumanChoice(int value){\n String card = handHuman.get(value);\n System.out.print(\"CARD IN VERIFY HUMAN\" + card);\n\n String firstLetter = Character.toString(card.charAt(0));\n String topFirstLetter = Character.toString(topCard.charAt(0));\n\n if(topCard.contains(\"8\")){\n //Can play any card ontop to determine suite\n topCard = card;\n return true;\n }\n\n if(card.contains(\"8\")){\n //valid because 8s are wild cards, human can place it\n topCard = card;\n return true;\n }\n\n //the cards match in suite, doesn't matter what it is\n else if(firstLetter.equals(topFirstLetter)){\n topCard = card;\n return true;\n }\n\n else{\n if(topFirstLetter.equals(\"c\")){\n String temp = topCard.substring(5, topCard.length());\n System.out.println(\"TEMP \" + temp);\n\n if(card.contains(temp)){\n topCard = card;\n return true;\n }\n\n }\n\n else if(topFirstLetter.equals(\"h\")){\n String temp = topCard.substring(6, topCard.length());\n System.out.println(\"TEMP \" + temp);\n\n if(card.contains(temp)){\n topCard = card;\n return true;\n }\n\n }\n\n else if(topFirstLetter.equals(\"d\")){\n String temp = topCard.substring(8, topCard.length());\n System.out.println(\"TEMP \" + temp);\n\n if(card.contains(temp)){\n topCard = card;\n return true;\n }\n\n }\n\n else if(topFirstLetter.equals(\"s\")){\n String temp = topCard.substring(6, topCard.length());\n System.out.println(\"TEMP \" + temp);\n\n if(card.contains(temp)){\n topCard = card;\n return true;\n }\n\n }\n }\n\n //You can't play this card\n return false;\n }",
"public void discardAll()\n\t{\n\t\thand = new Card[12];\n\t\tnumCards = 0;\n\t}",
"public int[] hasNSequentially(int lengthOfHand) {//check for Ace case //need to NOT ALLOW DUPLICATES\n ArrayList<Card> handList = new ArrayList<Card>();\n int solution[] = {0, 0};//number in a row, lowest number of that\n boolean foundSomeNInAFow = false;\n int hasAce = 0;\n\n int usedNumbers[] = new int[13];//2,3,4,5,6,7,8,9,10,j,q,k,a --> THIS HANDLES THE ACE CASE\n for (int i = 0; i < lengthOfHand; i++) {//was\n usedNumbers[allCards[i].value - 2]++;//USED\n if (usedNumbers[allCards[i].value - 2] == 1) {//handles NOT having doubles of numbers like 2 3 4 4 5 \n handList.add(this.allCards[i]);\n if (this.allCards[i].value == 14) {\n Card c = new Card(1, this.allCards[i].suit);\n handList.add(0, c);//add to front..shifts elements to right\n }\n }\n }\n\n for (int i = 0; i < handList.size() - 4; i++) {//check for 5 in a row, //was - 4\n int val = handList.get(i).value;\n int counter = 0;\n for (int j = 0; j < 4; j++) {//was 4\n if (handList.get(j + i + 1).value == val + 1 + j) {\n counter++;\n } else {\n break;\n }\n if (counter == 4) {//was 4\n foundSomeNInAFow = true;\n solution[0] = 5;\n solution[1] = val;\n }\n }\n }\n\n if (foundSomeNInAFow == false) {\n for (int i = 0; i < handList.size() - 3; i++) {//check for 5 in a row, //was - 4\n int val = handList.get(i).value;\n int counter = 0;\n for (int j = 0; j < 3; j++) {\n if (handList.get(j + i + 1).value == val + 1 + j) {\n counter++;\n } else {\n break;\n }\n if (counter == 3) {\n // System.out.println(\"yes 4 sequentially\");\n foundSomeNInAFow = true;\n solution[0] = 4;\n solution[1] = val;\n }\n }\n }\n }\n\n if (foundSomeNInAFow == false) {\n for (int i = 0; i < handList.size() - 2; i++) {//check for 5 in a row, //was - 4\n int val = handList.get(i).value;\n int counter = 0;\n for (int j = 0; j < 2; j++) {\n if (handList.get(j + i + 1).value == val + 1 + j) {\n counter++;\n } else {\n break;\n }\n if (counter == 2) {\n // System.out.println(\"yes 3 sequentially\");\n foundSomeNInAFow = true;\n solution[0] = 3;\n solution[1] = val;\n }\n }\n }\n }\n\n if (foundSomeNInAFow == false) {\n for (int i = 0; i < handList.size() - 1; i++) {//check for 5 in a row, //was - 4\n int val = handList.get(i).value;\n int counter = 0;\n for (int j = 0; j < 1; j++) {\n if (handList.get(j + i + 1).value == val + 1 + j) {\n counter++;\n } else {\n break;\n }\n if (counter == 1) {\n //System.out.println(\"yes 2 sequentially\");\n foundSomeNInAFow = true;\n solution[0] = 2;\n solution[1] = val;\n\n }\n }\n }\n }\n\n return solution;//return at end that way if there is 2,3,5,7,8 it returns 7 8 not 2 3\n\n }",
"public void deal(){\n // deal cards when game is started and game stage is 0\n // need to clear everything\n if(turn == 4){\n turn = 0;\n }\n player1Hand.clear();\n player2Hand.clear();\n player3Hand.clear();\n player4Hand.clear();\n kitty.clear();\n currentMiddle.clear();\n\n /**\n * External Citation\n * Date: 19 September 2019\n * Problem: Did not have a good way to shuffle array\n * Resource: Dr. Tribelhorn, https://www.geeksforgeeks.org/collections-shuffle-java-examples/\n * Solution: Tribelhorn informed us of the shuffle function, and\n * we used the code in this post as a resource\n */\n // shuffle deck\n Collections.shuffle(deck.cardDeck);\n\n // deal cards to each player\n // player 1's hand\n for (int i = 0; i < 5; i++) {\n player1Hand.add(i, deck.cardDeck.get(i));\n player2Hand.add(i, deck.cardDeck.get(5 + i));\n player3Hand.add(i, deck.cardDeck.get(10 + i));\n player4Hand.add(i, deck.cardDeck.get(15 + i));\n }\n\n for (int i = 0; i < 4; i++) {\n kitty.add(i, deck.cardDeck.get(20 + i));\n }\n kittyTop = kitty.get(0);\n middleCard = deck.cardDeck.get(20);\n middleCardSuit = middleCard.getSuit();\n\n // make middle card visible\n middleVisible = true;\n\n // change game state to 1\n gameStage++;\n }",
"private final void flipBonusCard() {\n\t\tstate.setBonusCard(deck.removeTopCard());\n\t}",
"@Test\n void pass3CardsRound99(){\n Dealer testDealer = new Dealer();\n testDealer.initDealer();\n testDealer.setRoundCount(99);\n \n List<Card> heartHand, spadeHand, clubHand, diamondHand,userPassedCards;\n\n heartHand = new ArrayList<Card>();\n spadeHand = new ArrayList<Card>();\n clubHand = new ArrayList<Card>();\n diamondHand = new ArrayList<Card>();\n userPassedCards = new ArrayList<Card>();\n \n userPassedCards.add(new Card(Suit.DIAMONDS, Rank.ACE, true));\n userPassedCards.add(new Card(Suit.DIAMONDS, Rank.KING, true));\n userPassedCards.add(new Card(Suit.DIAMONDS, Rank.QUEEN, true));\n\n \n for(Card c:userPassedCards) {\n c.setOwnerOfCard(\"user\");\n }\n\n for (Rank rank : Rank.values()) {\n heartHand.add(new Card(Suit.HEARTS, rank, true));\n }\n\n for (Rank rank : Rank.values()) {\n spadeHand.add(new Card(Suit.SPADES, rank, true));\n }\n\n for (Rank rank : Rank.values()) {\n clubHand.add(new Card(Suit.CLUBS, rank, true));\n }\n\n for (Rank rank : Rank.values()) {\n diamondHand.add(new Card(Suit.DIAMONDS, rank, true));\n }\n \n testDealer.getBotA().fillHandCards(heartHand);\n testDealer.getBotB().fillHandCards(spadeHand);\n testDealer.getBotC().fillHandCards(clubHand);\n testDealer.getUser().fillHandCards(diamondHand);\n\n testDealer.distributePassedCards(userPassedCards);\n\n assertEquals(13, testDealer.getUserHandCards().size());\n assertEquals(13, testDealer.getBotA().getHandCards().size());\n assertEquals(13, testDealer.getBotB().getHandCards().size());\n assertEquals(13, testDealer.getBotC().getHandCards().size());\n\n assertEquals(\"QUEEN of CLUBS[pickable by botA]\", testDealer.getBotA().getHandCards().get(0).toString());\n assertEquals(\"KING of CLUBS[pickable by botA]\", testDealer.getBotA().getHandCards().get(1).toString());\n assertEquals(\"ACE of CLUBS[pickable by botA]\", testDealer.getBotA().getHandCards().get(2).toString());\n\n assertEquals(\"QUEEN of DIAMONDS[pickable by botB]\", testDealer.getBotB().getHandCards().get(0).toString());\n assertEquals(\"KING of DIAMONDS[pickable by botB]\", testDealer.getBotB().getHandCards().get(1).toString());\n assertEquals(\"ACE of DIAMONDS[pickable by botB]\", testDealer.getBotB().getHandCards().get(2).toString());\n\n assertEquals(\"QUEEN of HEARTS[pickable by botC]\", testDealer.getBotC().getHandCards().get(10).toString());\n assertEquals(\"KING of HEARTS[pickable by botC]\", testDealer.getBotC().getHandCards().get(11).toString());\n assertEquals(\"ACE of HEARTS[pickable by botC]\", testDealer.getBotC().getHandCards().get(12).toString());\n\n assertEquals(\"QUEEN of SPADES[pickable by user]\", testDealer.getUser().getHandCards().get(10).toString());\n assertEquals(\"KING of SPADES[pickable by user]\", testDealer.getUser().getHandCards().get(11).toString());\n assertEquals(\"ACE of SPADES[pickable by user]\", testDealer.getUser().getHandCards().get(12).toString());\n }",
"@Override\n void pickCard() {\n\n boolean suitFound = false; // true if player has the suit\n Card cardToBeat; // strongest card on pile\n Card pickedCard = null; // card to throw\n ArrayList<Card> cardsToChooseFrom = new ArrayList<Card>();\n char trump = pitchTable.getTrump();\n\n // find the strongest card on pile\n cardToBeat = pitchTable.getCardToBeat();\n\n // if pile is empty\n if (cardToBeat == null){\n // pick the strongest non trump card\n for (Card card : hand)\n if (card.suit != trump)\n if ((pickedCard == null) || (pickedCard.rank < card.rank))\n pickedCard = card;\n\n // if non trump card not found (means all cards are trump)\n // then pick the strongest card\n if (pickedCard == null)\n for (Card card : hand)\n if ((pickedCard == null) || (pickedCard.rank < card.rank))\n pickedCard = card;\n }\n else { // means leading suit is set already\n // check if player has suit\n for (Card card : hand) {\n if (card.suit == pitchTable.getLeadingSuit())\n suitFound = true;\n }\n\n // if player does not have suit he can play any card\n if (!suitFound)\n cardsToChooseFrom = hand;\n else // if player has suit then cardsToChooseFrom = allowed cards\n for (Card card : hand)\n if ((card.suit == pitchTable.getLeadingSuit()) ||\n card.suit == pitchTable.getTrump())\n cardsToChooseFrom.add(card);\n }\n\n // try to take the trick with the lowest winning card\n // if no winning card then throw the lowest you have\n\n // (trying to take the trick)\n // if card not picked yet\n // then find the lowest card that has the suit and is higher than cardToBeat\n if (pickedCard == null)\n for (Card card : cardsToChooseFrom)\n if ((cardToBeat.suit == card.suit) && (cardToBeat.rank < card.rank))\n if ((pickedCard == null) || (pickedCard.rank > card.rank))\n pickedCard = card;\n\n // (trying to take the trick)\n // if card not picked yet and cardToBeat is not trump\n // then find the lowest trump\n if ((pickedCard == null) && (cardToBeat.suit != trump))\n for (Card card : cardsToChooseFrom)\n if (card.suit == trump)\n if ((pickedCard == null) || (pickedCard.rank > card.rank))\n pickedCard = card;\n\n // (trying to throw the lowest)\n // if still no card picked (means player cannot take the trick)\n // then throw the lowest non trump\n if (pickedCard == null)\n for (Card card : cardsToChooseFrom)\n if (card.suit != trump)\n if ((pickedCard == null) || (pickedCard.rank > card.rank))\n pickedCard = card;\n\n // (trying to throw the lowest)\n // if still no card picked (means all allowed cards are trump)\n // then throw the lowest trump\n if (pickedCard == null)\n for (Card card : cardsToChooseFrom)\n if ((pickedCard == null) || (pickedCard.rank > card.rank))\n pickedCard = card;\n\n if (pickedCard == null)\n System.out.println(\"Error: picked card still null\");\n\n pitchTable.putOnPile(pickedCard);\n hand.remove(pickedCard);\n\n }",
"void refillCards() {\n if (this.gameDeck.isEmpty() && !this.wonDeck.isEmpty()) {\n this.wonDeck.shufffle();\n Deck temp = this.gameDeck;\n this.gameDeck = this.wonDeck;\n this.wonDeck = temp;\n\n }\n\n }",
"@Test\n \tpublic void testDisprovingSuggestion() {\n \t\t//Set suggestion\n \t\tSolution suggestion = new Solution(\"Colonel Mustard\", \"Knife\", \"Library\");\n \t\tComputerPlayer computer1 = new ComputerPlayer();\n \t\tComputerPlayer computer2 = new ComputerPlayer();\n \t\tComputerPlayer computer3 = new ComputerPlayer();\n \t\tHumanPlayer human = new HumanPlayer();\n \t\tArrayList<Card> hand = new ArrayList<Card>();\n \t\tArrayList<ComputerPlayer> comps = new ArrayList<ComputerPlayer>();\n \t\t\n \t\t\n \t\t//ensure If a player (human or computer) has a card that's suggested, that card is \"shown\"\n \t\tCard mustardCard = new Card(\"Colonel Mustard\", Card.cardType.PERSON);\n \t\thand.add(mustardCard);\n \t\tcomputer1.setCards(hand);\n \t\tAssert.assertEquals(computer1.disproveSuggestion(suggestion), mustardCard);\n \t\t\n \t\t\n \t\t//ensure If the player has multiple cards that match, the card to be returned is selected randomly.\n \t\tCard knifeCard = new Card (\"Knife\", Card.cardType.WEAPON);\n \t\tCard libraryCard = new Card(\"Library\", Card.cardType.ROOM);\n \t\thand.add(knifeCard);\n \t\thand.add(libraryCard);\n \t\thuman.setCards(hand);\n \t\tint mustard = 0, knife = 0, library = 0;\n \t\t//make sure card is valid and counts how many times each card is returned\n \t\tfor(int i = 0; i < 100; i++) {\n \t\t\tCard disproved = human.disproveSuggestion(suggestion);\n \t\t\t\n \t\t\tif(disproved == mustardCard)\n \t\t\t\tmustard++;\n \t\t\telse if(disproved == knifeCard)\n \t\t\t\tknife++;\n \t\t\telse if(disproved == libraryCard)\n \t\t\t\tlibrary++;\n \t\t\telse\n \t\t\t\tfail(\"Invalid card returned\");\n \t\t}\n \t\t//makes sure every card is returned more than once\n \t\tAssert.assertTrue(mustard > 10);\n \t\tAssert.assertTrue(knife > 10);\n \t\tAssert.assertTrue(library > 10);\n \t\t\n \t\thuman.setCards(null);\n \t\tgame.setCurrentPlayer(game.getHuman());\n \t\t\t\n \t\t//ensure In the board game, disproving a suggestion starts with a player to the left of the person making the suggestion\n \t\thand.remove(mustardCard);\n \t\thand.remove(knifeCard);\n \t\tcomputer2.setCards(hand);\n \t\thand.remove(libraryCard);\n \t\thand.add(knifeCard);\n \t\tcomputer3.setCards(hand);\n \t\tcomps.add(computer1);\n \t\tcomps.add(computer2);\n \t\tcomps.add(computer3);\n \t\t\n \t\tint comp1 = 0, comp2 = 0, comp3 = 0;\n \t\tgame.setComputer(comps);\n \t\tfor(int i = 0; i < 100; i++) {\n \t\t\tCard returned = game.handleSuggestion(suggestion);\n \t\t\tif(returned == mustardCard)\n \t\t\t\tcomp1++;\n \t\t\telse if(returned == libraryCard)\n \t\t\t\tcomp2++;\n \t\t\telse if(returned == knifeCard)\n \t\t\t\tcomp3++;\n \t\t\telse\n \t\t\t\tfail(\"Invalid card returned\");\t\n \t\t}\n\t\t//Assert.assertTrue(comp1 > 10);\n\t\t//Assert.assertTrue(comp2 > 10);\n \t\tAssert.assertTrue(comp3 > 10);\n \t\t//ensure The player making the suggestion should not be queried\n \t\tgame.setCurrentPlayer(computer1);\n \t\tfor(int i = 0; i < 100; i++) {\n \t\t\tCard returned = game.handleSuggestion(suggestion);\n \t\t\tif(returned == mustardCard)\n \t\t\t\tfail(\"Suggesting player cannot return a card\");\t\n \t\t}\n \t}",
"public boolean CheckForUnwinnableCondition(){\n int humanSize = GetSizeOfHumanHand();\n int computerSize = GetSizeOfComputerHand();\n\n for(int i = 0; i < humanSize; i++) {\n //Human can play a card\n String card = handHuman.get(i);\n\n String firstLetter = Character.toString(card.charAt(0));\n String topFirstLetter = Character.toString(topCard.charAt(0));\n\n if (topCard.contains(\"8\")) {\n //Can play any card ontop to determine suite\n return true;\n }\n\n if (card.contains(\"8\")) {\n //valid because 8s are wild cards, human can place it\n return true;\n }\n\n //the cards match in suite, doesn't matter what it is\n else if (firstLetter.equals(topFirstLetter)) {\n return true;\n }\n\n else {\n if (topFirstLetter.equals(\"c\")) {\n String temp = topCard.substring(5, topCard.length());\n\n if (card.contains(temp)) {\n return true;\n }\n\n } else if (topFirstLetter.equals(\"h\")) {\n String temp = topCard.substring(6, topCard.length());\n\n if (card.contains(temp)) {\n return true;\n }\n\n } else if (topFirstLetter.equals(\"d\")) {\n String temp = topCard.substring(8, topCard.length());\n\n if (card.contains(temp)) {\n return true;\n }\n\n } else if (topFirstLetter.equals(\"s\")) {\n String temp = topCard.substring(6, topCard.length());\n\n if (card.contains(temp)) {\n return true;\n }\n }\n }\n }\n\n for(int i = 0; i < computerSize; i++){\n //Human can play a card\n String card = handComputer.get(i);\n\n String firstLetter = Character.toString(card.charAt(0));\n String topFirstLetter = Character.toString(topCard.charAt(0));\n\n if (topCard.contains(\"8\")) {\n //Can play any card ontop to determine suite\n return true;\n }\n\n if (card.contains(\"8\")) {\n //valid because 8s are wild cards, human can place it\n return true;\n }\n\n //the cards match in suite, doesn't matter what it is\n else if (firstLetter.equals(topFirstLetter)) {\n return true;\n }\n\n else {\n if (topFirstLetter.equals(\"c\")) {\n String temp = topCard.substring(5, topCard.length());\n\n if (card.contains(temp)) {\n return true;\n }\n\n } else if (topFirstLetter.equals(\"h\")) {\n String temp = topCard.substring(6, topCard.length());\n\n if (card.contains(temp)) {\n return true;\n }\n\n } else if (topFirstLetter.equals(\"d\")) {\n String temp = topCard.substring(8, topCard.length());\n\n if (card.contains(temp)) {\n return true;\n }\n\n } else if (topFirstLetter.equals(\"s\")) {\n String temp = topCard.substring(6, topCard.length());\n\n if (card.contains(temp)) {\n return true;\n }\n }\n }\n }\n\n //Human and computer can't play a card\n return false;\n }",
"public void catchCard(){\r\n changePlace(deck);\r\n changePlace(hand);\r\n }",
"public void clearHand() {\n for (Component c : cardPane.getComponents()) {\n if (c instanceof Card) {\n cardPane.remove(c); //Removes all Cards from card panel\n }\n }\n busted = false; //Hand not busted\n values.clear(); //Removes all Integers from values\n values.add(0); //Sets initial value to 0\n updateValue(); //Updates value\n repaint(); //Redraws hand\n }",
"@Test(expected = TooManyDiscardsException.class)\n public void allow_discard_no_more_than_2_cards(){\n\n Deck deck = new Deck();\n Card card1 = new Card(3,2,5);\n Card card2 = new Card(2,7,1);\n Card card3 = new Card(2,7,1);\n deck.add(card1);\n deck.add(card2);\n deck.add(card3);\n Game game = new Game(deck);\n\n game.join(\"susan\");\n game.join(\"peter\");\n\n Card pickedCard1 = game.pickCard(\"susan\");\n game.discard(\"susan\");\n Card pickedCard2 = game.pickCard(\"susan\");\n game.discard(\"susan\");\n Card pickedCard3 = game.pickCard(\"susan\");\n game.discard(\"susan\");\n\n }",
"private int GetBestCard(Card[] card) {\n\t int iPos = 0;\n\t int iWeightTemp = 0;\n\t int iWeight[] = new int[8];\n\t for (int i = 0; i < 8; i++){\n\t\t iWeight[i] = -1;\n\t }\n\t // For each selectable card, work out a weight, the highest weight is the one selected.\n\t // The weight is worked out by the distance another of the players cards is from playable ones, with no playable cards in between\n\t Card myCard, nextCard;\n\t for (int i = 0; i < 8; i++){\n\t\t if (card[i] != null){\n\t\t\t // if card value > 7\n\t\t\t if (card[i].GetValue() > 7){\n\t\t\t\t // do you have cards that are higher than this card\n\t\t\t\t myCard = card[i];\n\t\t\t\t iWeightTemp = 0;\n\t\t\t \tfor (int j = 0; j < mCardCount; j++){\n\t\t\t \t\tnextCard = mCard[j];\n\t\t\t \t\tif (nextCard != null && nextCard.GetSuit() == myCard.GetSuit() && nextCard.GetValue() > myCard.GetValue()){\n\t\t\t \t\t\tif (nextCard.GetValue() - myCard.GetValue() > iWeightTemp)\n\t\t\t \t\t\t\tiWeightTemp = nextCard.GetValue() - myCard.GetValue();\n\t\t\t \t\t\tmyCard = nextCard;\n\t\t\t \t\t}\n\t\t\t \t}\n\t\t\t \tiWeight[i] = iWeightTemp;\n\t\t\t \t\t\n\t\t\t }\n\t\t\t if (card[i].GetValue() < 7){\n\t\t\t\t // do you have cards that are lower than this card\n\t\t\t\t myCard = card[i];\n\t\t\t\t iWeightTemp = 0;\n\t\t\t \tfor (int j = mCardCount-1; j >=0; j--){\n\t\t\t \t\tnextCard = mCard[j];\n\t\t\t \t\tif (nextCard != null && nextCard.GetSuit() == myCard.GetSuit() && nextCard.GetValue() < myCard.GetValue()){\n\t\t\t \t\t\tif (myCard.GetValue() - nextCard.GetValue() > iWeightTemp)\n\t\t\t \t\t\t\tiWeightTemp = myCard.GetValue() - nextCard.GetValue();\n\t\t\t \t\t\tmyCard = nextCard;\n\t\t\t \t\t}\n\t\t\t \t}\n\t\t\t \tiWeight[i] = iWeightTemp;\n\t\t\t \t\t\n\t\t\t }\t\n\t\t\t if (card[i].GetValue() == 7){\n\t\t\t\t // do you have cards that are in this suit\n\t\t\t\t myCard = card[i];\n\t\t\t\t int iWeightTemp1;\n\t\t\t\t iWeightTemp = 0;\n\t\t\t\t iWeightTemp1 = 0;\n\t\t\t\t // do you have cards that are higher than this card\n\t\t\t \tfor (int j = 0; j < mCardCount; j++){\n\t\t\t \t\tnextCard = mCard[j];\n\t\t\t \t\tif (nextCard != null && nextCard.GetSuit() == myCard.GetSuit() && nextCard.GetValue() > myCard.GetValue()){\n\t\t\t \t\t\tif (nextCard.GetValue() - myCard.GetValue() > iWeightTemp)\n\t\t\t \t\t\t\tiWeightTemp = nextCard.GetValue() - myCard.GetValue();\n\t\t\t \t\t\tmyCard = nextCard;\n\t\t\t \t\t}\n\t\t\t \t}\n\t\t\t \tmyCard = card[i];\n\t\t\t \t// do you have cards that are lower than this card\n\t\t\t \tfor (int j = mCardCount-1; j >=0; j--){\n\t\t\t \t\tnextCard = mCard[j];\n\t\t\t \t\tif (nextCard != null && nextCard.GetSuit() == myCard.GetSuit() && nextCard.GetValue() < myCard.GetValue()){\n\t\t\t \t\t\tif (myCard.GetValue() - nextCard.GetValue() > iWeightTemp1)\n\t\t\t \t\t\t\tiWeightTemp1 = myCard.GetValue() - nextCard.GetValue();\n\t\t\t \t\t\tmyCard = nextCard;\n\t\t\t \t\t}\n\t\t\t \t} \t\n\t\t\t \tiWeight[i] = iWeightTemp + iWeightTemp1;\n\t\t\t \t\t\n\t\t\t }\t\t\t \n\t\t }\n\t\t \t \n\t }\n\t boolean bLoopAceKing = true;\n\t int iMaxTemp = 0;\n\t int iMaxCount = 0;\t\n\t int[] iMaxs;\n\t iMaxs = new int[8];\n\t while (bLoopAceKing){\n\t\t for (int i = 0; i < 8; i++){\n\t\t\t if (iWeight[i] >= iMaxTemp){\n\t\t\t\t if (iWeight[i] == iMaxTemp){\n\t\t\t\t\t iMaxs[iMaxCount] = i;\n\t\t\t\t\t iMaxCount++;\n\t\t\t\t }\n\t\t\t\t else {\n\t\t\t\t\t iMaxTemp = iWeight[i];\n\t\t\t\t\t iMaxs = new int[8];\n\t\t\t\t\t iMaxCount = 0;\n\t\t\t\t\t iMaxs[iMaxCount] = i;\n\t\t\t\t\t iMaxCount++;\n\t\t\t\t }\t\t\t \n\t\t\t }\t \n\t\t }\n\t\t boolean bAceKing = false;\n\t\t // If the top weight is zero, meaning your options don't help you, then play the one that is closest to ace/king\n\t\t if (iMaxTemp == 0 && iMaxCount > 1){\n\t\t\t for (int k = 0; k < iMaxCount; k++){\n\t\t\t\t\t iWeight[iMaxs[k]] = Math.abs(card[iMaxs[k]].GetValue()-7);\n\t\t\t\t\t bAceKing = true;\t\t\t\t \n\t\t\t } \t\t \n\t\t }\n\t\t if (bAceKing){\n\t\t\t bLoopAceKing = true;\n\t\t\t iMaxs = new int[8];\n\t\t\t iMaxTemp = 0;\n\t\t\t iMaxCount = 0;\t\t\t \n\t\t }\n\t\t else \n\t\t\t bLoopAceKing = false;\n\t }\n\t if (iMaxCount == 1)\n\t\t iPos = iMaxs[iMaxCount-1];\n\t else {\n\t\t Random generator = new Random();\n\t\t int randomIndex = generator.nextInt( iMaxCount );\n\t\t iPos = iMaxs[randomIndex];\n\t }\n\t\t \n\t return iPos;\n\t \n }",
"public TrainCard usedCard(){\n TrainCard removedCard = cardDeck.remove(0);\n return removedCard;\n }",
"private void reshuffleDiscardPile() {\n ICard topCard = discardPile.pop();\n\n drawPile.addAll(discardPile);\n Collections.shuffle(drawPile, rng);\n\n discardPile.clear();\n discardPile.add(topCard);\n }",
"private void dealCards(){\n\t\tfor(int k = 0; k <2;k++){\n\t\t\tfor(int i = 0; i < Players.size();i++){\n\t\t\t\tPlayers.get(i).addCardToHand(gameDeck.dealCard());\n\t\t\t}\n\t\t}\n\t\t\n\t setChanged();\n\t notifyObservers(\"CardsDealed\");\n\t}",
"void bust() {\n\t\t_loses++;\n\t\t//_money -= _bet;\n\t\tclearHand();\n\t\t_bet = 0;\n\t}",
"public void ComputerUpdateTopCard(int value){\n topCard = handComputer.get(value);\n }",
"public void findBestTwoCardHandName() {\n if (handContainsTheseTwoCards_With_AtLeastOneFromPlayerOriginalHand(14, 'x', 14) == true) {//aces, any suit\n bestHandFromCardsNickNameString = \"Pocket Rockets\";\n } else if (handContainsTheseTwoCards_With_AtLeastOneFromPlayerOriginalHand(13, 'y', 14) == true) {//king, then ace, same suit\n bestHandFromCardsNickNameString = \"Big Slick in a Suit\";\n } else if (handContainsTheseTwoCards_With_AtLeastOneFromPlayerOriginalHand(13, 'x', 14) == true) {\n bestHandFromCardsNickNameString = \"Full Auto\";\n } else if (handContainsTheseTwoCards_With_AtLeastOneFromPlayerOriginalHand(8, 'x', 14) == true) {\n bestHandFromCardsNickNameString = \"Dead Man's Hand\";\n } else if (handContainsTheseTwoCards_With_AtLeastOneFromPlayerOriginalHand(13, 'x', 13) == true) {\n bestHandFromCardsNickNameString = \"Cowboys King Kong\";\n } else if (handContainsTheseTwoCards_With_AtLeastOneFromPlayerOriginalHand(9, 'x', 14) == true) {\n bestHandFromCardsNickNameString = \"The Dog\";\n } else if (handContainsTheseTwoCards_With_AtLeastOneFromPlayerOriginalHand(12, 'x', 12) == true) {\n bestHandFromCardsNickNameString = \"Ladies\";\n } else if (handContainsTheseTwoCards_With_AtLeastOneFromPlayerOriginalHand(3, 'x', 12) == true) {\n bestHandFromCardsNickNameString = \"The Waiter\";\n } else if (handContainsTheseTwoCards_With_AtLeastOneFromPlayerOriginalHand(9, 'x', 9) == true) {\n bestHandFromCardsNickNameString = \"A German Dime\";\n } else if (allCards[0].value == allCards[1].value) {\n bestHandFromCardsNickNameString = \"Pocket Pair\";\n } else if (allCards[0].suit == allCards[1].suit) {\n bestHandFromCardsNickNameString = \"Flush Rush\";\n } else if (allCards[0].value == allCards[1].value + 1 || allCards[0].value + 1 == allCards[1].value || (allCards[0].value == 14 && allCards[1].value == 2) || (allCards[0].value == 2 && allCards[1].value == 14) ) {\n bestHandFromCardsNickNameString = \"Straight Bait\";\n } else if (allCards[0].value == 14 || allCards[1].value == 14) {\n bestHandFromCardsNickNameString = \"A Spike\";\n } else if (allCards[0].value == 13 || allCards[1].value == 13) {\n bestHandFromCardsNickNameString = \"A Dame\";\n } else if (allCards[0].value == 12 || allCards[1].value == 12) {\n bestHandFromCardsNickNameString = \"A Jackal\";\n } else if (allCards[0].value == 11 || allCards[1].value == 11) {\n bestHandFromCardsNickNameString = \"A Fishhook\";\n } else if (allCards[0].value == 10 || allCards[1].value == 10) {\n bestHandFromCardsNickNameString = \"A Sawbuck\";\n } else if (allCards[0].value == 9 || allCards[1].value == 9) {\n bestHandFromCardsNickNameString = \"Nina Ross\";\n } else {\n bestHandFromCardsNickNameString = \"Down on Your Luck\";\n }\n \n System.out.println(\"findBestTwoCardHandName---->>> \" + bestHandFromCardsNickNameString);\n\n }",
"public static void main(String[] args) {\n Hand hand1 = new Hand();\n\n hand1.add(new Card(2, Card.SPADES));\n hand1.add(new Card(14, Card.CLUBS));\n hand1.add(new Card(12, Card.HEARTS));\n hand1.add(new Card(2, Card.CLUBS));\n\n hand1.sort();\n\n Hand hand2 = new Hand();\n\n hand2.add(new Card(11, Card.DIAMONDS));\n hand2.add(new Card(11, Card.CLUBS));\n hand2.add(new Card(11, Card.HEARTS));\n\n int comparison = hand1.compareTo(hand2);\n\n if (comparison < 0) {\n System.out.println(\"the most valuable hand contains the cards\");\n hand2.print();\n } else if (comparison > 0) {\n System.out.println(\"the most valuable hand contains the cards\");\n hand1.print();\n } else {\n System.out.println(\"the hands are equally valuable\");\n }\n\n System.out.println(\"\");\n System.out.println(\"_________________________\");\n System.out.println(\"\");\n\n Card cardTest1 = new Card(3, Card.SPADES);\n Card cardTest2 = new Card(3, Card.SPADES);\n\n SortAgainstSuitAndValue sorter = new SortAgainstSuitAndValue();\n int sortingVar = sorter.compare(cardTest1, cardTest2);\n\n if (sortingVar < 0) {\n System.out.println(\"The highest card is:\" + cardTest1);\n } else if (sortingVar > 0) {\n System.out.println(\"The highest card is:\" + cardTest2);\n } else if (sortingVar == 0) {\n System.out.println(\"The cards are the same.\");\n }\n\n Hand hand = new Hand();\n\n hand.add(new Card(12, Card.HEARTS));\n hand.add(new Card(4, Card.CLUBS));\n hand.add(new Card(2, Card.DIAMONDS));\n hand.add(new Card(14, Card.CLUBS));\n hand.add(new Card(7, Card.HEARTS));\n hand.add(new Card(2, Card.CLUBS));\n\n hand.sortAgainstSuit();\n\n //hand.print();\n }",
"public void shufflePerfectly() {\n\n ArrayList<Card> topDeck = new ArrayList<Card>(), botDeck = new ArrayList<Card>();\n for (int i = cards.size()-1; i >= 0; i--) {\n Card shuffleCard = null;\n try {\n shuffleCard = cards.get(i);\n }\n catch (Exception e) {\n // If card does not exist\n }\n if (shuffleCard != null) {\n if (i >= cards.size() / 2) {\n topDeck.add(shuffleCard);\n }\n else {\n botDeck.add(shuffleCard);\n }\n }\n }\n int len;\n boolean equalStacks = false;\n Card extraCard = null;\n\n if (topDeck.size() == botDeck.size()) {\n equalStacks = true;\n len = topDeck.size();\n }\n else {\n if (topDeck.size()>botDeck.size()) {\n len = botDeck.size();\n extraCard = topDeck.get(topDeck.size()-1);\n }\n else {\n len = topDeck.size();\n extraCard = botDeck.get(botDeck.size()-1);\n }\n }\n\n ArrayList<Card> shuffledDeck = new ArrayList<Card>();\n\n for (int i = len-1; i >= 0; i--) {\n // Shuffle the cards\n shuffledDeck.add(botDeck.get(i));\n shuffledDeck.add(topDeck.get(i));\n\n }\n if (!equalStacks) {\n shuffledDeck.add(extraCard);\n }\n\n ArrayList<Card> newDeck = new ArrayList<Card>();\n\n for (int i = 0; i < shuffledDeck.size(); i++) {\n newDeck.add(shuffledDeck.get(i));\n }\n cards = newDeck;\n }",
"public int trickWinner(){\n Card.NUMBER one = player1Play.getValue();\n Card.NUMBER two = player2Play.getValue();\n Card.NUMBER three = player3Play.getValue();\n Card.NUMBER four = player4Play.getValue();\n Card.SUIT oneSuit = player1Play.getSuit();\n Card.SUIT twoSuit = player2Play.getSuit();\n Card.SUIT threeSuit = player3Play.getSuit();\n Card.SUIT fourSuit = player4Play.getSuit();\n int[] value = new int[4];\n value[0] = Card.getValsVal(one, oneSuit, currentTrumpSuit);\n value[1] = Card.getValsVal(two, twoSuit, currentTrumpSuit);\n value[2] = Card.getValsVal(three, threeSuit, currentTrumpSuit);\n value[3] = Card.getValsVal(four, fourSuit, currentTrumpSuit);\n if(player1Play.getSuit() == firstPlayedSuit && firstPlayedSuit != currentTrumpSuit && value[0] != 7){\n value[0] += 10;\n }\n if(player2Play.getSuit() == firstPlayedSuit && firstPlayedSuit != currentTrumpSuit && value[0] != 7){\n value[1] += 10;\n }\n if(player3Play.getSuit() == firstPlayedSuit && firstPlayedSuit != currentTrumpSuit && value[0] != 7){\n value[2] += 10;\n }\n if(player4Play.getSuit() == firstPlayedSuit && firstPlayedSuit != currentTrumpSuit && value[0] != 7){\n value[3] += 10;\n }\n if(player1Play.getSuit() == currentTrumpSuit || value[0] == 7){\n value[0] += 20;\n }\n if(player2Play.getSuit() == currentTrumpSuit || value[1] == 7){\n value[1] += 20;\n }\n if(player3Play.getSuit() == currentTrumpSuit || value[2] == 7){\n value[2] += 20;\n }\n if(player4Play.getSuit() == currentTrumpSuit || value[3] == 7){\n value[3] += 20;\n }\n int winner = 0;\n int winVal = 0;\n for(int i = 0; i < 4; i++){\n if(value[i] > winVal){\n winVal = value[i];\n winner = i;\n }\n }\n return winner;\n }",
"public Card dealCard() {\n if (deck.size() == 52) {\n shuffle();\n }\n Card temp;\n temp = deck.get(0);\n remove(0);\n return temp;\n }",
"private static short eval_5cards(int[] hand)\n {\n int q = (hand[0] | hand[1] | hand[2] | hand[3] | hand[4]) >> 16;\n\n // This checks for any kind of Flushes\n if ((hand[0] & hand[1] & hand[2] & hand[3] & hand[4] & 0xf000) != 0)\n return flushes.get(q);\n\n // This checks for Straights and High Card hands\n if ( unique5.get(q) != 0)\n return unique5.get(q);\n\n // This performs a perfect-hash lookup for remaining possible hands\n long q1 = (hand[0] & 0xff) * (hand[1] & 0xff) * (hand[2] & 0xff) * (hand[3] & 0xff) * (hand[4] & 0xff);\n return hash_values.get((int)find_fast(q1));\n }",
"@Test\n\tpublic void testQualityWithSellInUnder0Concert() {\n\t\tGildedRose inn = new GildedRose();\n\t\tinn.setItem(new Item(\"Backstage passes to a TAFKAL80ETC concert\", -1, 100));\n\t\tinn.oneDay();\n\t\t\n\t\t//access a list of items, get the quality of the one set\n\t\tList<Item> items = inn.getItems();\n\t\tint quality = items.get(0).getQuality();\n\t\t\n\t\t//assert quality has decreased to 0\n\t\tassertEquals(\"Quality with sellIn under 0 concert passes\", 0, quality);\n\t}",
"private int demDoiThong(List<Card> bai) {\n List<Card> cards = new ArrayList<>() ;\n int max = 0;\n int count = 0;\n for (int i = 0; i < bai.size() - 1; i++) {\n if (bai.get(i).getId() >= 48) {\n break;\n }\n if (count == 0 && bai.get(i).getCardNumber() == bai.get(i + 1).getCardNumber()) {\n count = 1;\n if (cards.isEmpty()) {\n cards.add(bai.get(i));\n cards.add(bai.get(i + 1));\n }\n } else {\n if (count % 2 != 0) {\n if (bai.get(i).getCardNumber()== bai.get(i + 1).getCardNumber() - 1) {\n count++;\n } else if (bai.get(i).getCardNumber()!= bai.get(i + 1).getCardNumber()) {\n // valid = false;\n if (count > max) {\n max = count;\n }\n if(cards.size()<6){\n cards.clear();\n }\n count = 0;\n }\n } else {\n if (bai.get(i).getCardNumber()== bai.get(i + 1).getCardNumber()) {\n if(!cards.contains(bai.get(i))){\n cards.add(bai.get(i));\n }\n if(!cards.contains(bai.get(i+1))){\n cards.add(bai.get(i+1));\n }\n count++;\n } else {\n // valid = false;\n if (count > max) {\n max = count;\n }\n if(cards.size()<6){\n cards.clear();\n }\n count = 0;\n }\n }\n }\n }\n if (count > max) {\n max = count;\n }\n if (max >= 5) {\n this.specialCards.addAll(cards);\n }\n return (max + 1) / 2;\n }",
"@Test\n public void decreaseWithDiscardLessThan4() {\n gm.setPlayerInfo(clientPlayer4);\n gm.setThisPlayerIndex(clientPlayer4.getPlayerIndex());\n for (ResourceType type : ResourceType.values()) {\n assertEquals(0, getAmounts().getOfType(type));\n }\n assertFalse(dc.getMaxDiscard() >= 4);\n dc.increaseAmount(ResourceType.ORE);\n assertEquals(0, getAmounts().getOfType(ResourceType.ORE));\n dc.decreaseAmount(ResourceType.ORE);\n assertEquals(0, getAmounts().getOfType(ResourceType.ORE));\n }",
"public Card play7(){\n Scanner scanner = new Scanner(System.in);\n Card chosenCard = null;\n int cardIndex;\n do{\n System.out.println(\"which card ? (it should be 7 )\");\n cardIndex = scanner.nextInt();\n// scanner.nextLine();\n if(cardIndex<=0 || cardIndex > hand.size()){\n System.out.println(\"not valid input\");\n System.out.println(\"please try again : \");\n }\n else if((!(hand.get(cardIndex-1).getSign().equals(\"7\")))){\n System.out.println(\"! it is not a seven card !\");\n System.out.println(\"please try again : \");\n }\n else{\n chosenCard = hand.get(cardIndex - 1);\n }\n\n }while(cardIndex <= 0 || cardIndex > hand.size() || chosenCard == null);\n\n\n hand.remove(chosenCard);\n return chosenCard;\n\n\n }",
"public Card chooseFromHand(String sign , String colorName){\n Scanner scanner = new Scanner(System.in);\n Card chosenCard = null;\n int cardIndex;\n do{\n System.out.println(\"which cart ? (-1 to pick up card from cardDeck) ?\");\n cardIndex =scanner.nextInt();\n// scanner.nextLine();\n if(cardIndex == -1){\n ArrayList<Card> playableCards = playableNormalCards(sign , colorName);\n if(playableCards.size() == 0){\n return null;\n }\n else {\n System.out.println(\"you still can play : \");\n for(Card card : playableCards){\n System.out.print(card + \" \");\n }\n System.out.println();\n }\n }\n else if(cardIndex<=0 ||cardIndex > hand.size()){\n System.out.println(\"not valid input\");\n System.out.println(\"please try again : \");\n }\n else if(hand.get(cardIndex-1).getSign().equals(\"B\")){\n chosenCard = hand.get(cardIndex -1);\n }\n else if((!(hand.get(cardIndex-1).getSign().equals(sign))) &&\n (!(hand.get(cardIndex-1).getColorName().equals(colorName)))){\n System.out.println(\"not playable card\");\n System.out.println(\"please try again : \");\n }\n else{\n chosenCard = hand.get(cardIndex - 1);\n }\n\n }while(cardIndex <= 0 || cardIndex > hand.size() || chosenCard == null);\n\n\n hand.remove(chosenCard);\n return chosenCard;\n }",
"@Test\n void pass3CardsRound2(){\n Dealer testDealer = new Dealer();\n testDealer.initDealer();\n testDealer.setRoundCount(2);\n \n List<Card> heartHand, spadeHand, clubHand, diamondHand,userPassedCards;\n\n heartHand = new ArrayList<Card>();\n spadeHand = new ArrayList<Card>();\n clubHand = new ArrayList<Card>();\n diamondHand = new ArrayList<Card>();\n userPassedCards = new ArrayList<Card>();\n \n userPassedCards.add(new Card(Suit.DIAMONDS, Rank.ACE, true));\n userPassedCards.add(new Card(Suit.DIAMONDS, Rank.KING, true));\n userPassedCards.add(new Card(Suit.DIAMONDS, Rank.QUEEN, true));\n\n \n for(Card c:userPassedCards) {\n c.setOwnerOfCard(\"user\");\n }\n\n for (Rank rank : Rank.values()) {\n heartHand.add(new Card(Suit.HEARTS, rank, true));\n }\n\n for (Rank rank : Rank.values()) {\n spadeHand.add(new Card(Suit.SPADES, rank, true));\n }\n\n for (Rank rank : Rank.values()) {\n clubHand.add(new Card(Suit.CLUBS, rank, true));\n }\n\n for (Rank rank : Rank.values()) {\n diamondHand.add(new Card(Suit.DIAMONDS, rank, true));\n }\n \n testDealer.getBotA().fillHandCards(heartHand);\n testDealer.getBotB().fillHandCards(spadeHand);\n testDealer.getBotC().fillHandCards(clubHand);\n testDealer.getUser().fillHandCards(diamondHand);\n\n testDealer.distributePassedCards(userPassedCards);\n\n assertEquals(13, testDealer.getUserHandCards().size());\n assertEquals(13, testDealer.getBotA().getHandCards().size());\n assertEquals(13, testDealer.getBotB().getHandCards().size());\n assertEquals(13, testDealer.getBotC().getHandCards().size());\n\n assertEquals(\"QUEEN of SPADES[pickable by botA]\", testDealer.getBotA().getHandCards().get(0).toString());\n assertEquals(\"KING of SPADES[pickable by botA]\", testDealer.getBotA().getHandCards().get(1).toString());\n assertEquals(\"ACE of SPADES[pickable by botA]\", testDealer.getBotA().getHandCards().get(2).toString());\n\n assertEquals(\"QUEEN of CLUBS[pickable by botB]\", testDealer.getBotB().getHandCards().get(0).toString());\n assertEquals(\"KING of CLUBS[pickable by botB]\", testDealer.getBotB().getHandCards().get(1).toString());\n assertEquals(\"ACE of CLUBS[pickable by botB]\", testDealer.getBotB().getHandCards().get(2).toString());\n System.out.println(testDealer.getBotC().getHandCards());\n assertEquals(\"QUEEN of DIAMONDS[pickable by botC]\", testDealer.getBotC().getHandCards().get(10).toString());\n assertEquals(\"KING of DIAMONDS[pickable by botC]\", testDealer.getBotC().getHandCards().get(11).toString());\n assertEquals(\"ACE of DIAMONDS[pickable by botC]\", testDealer.getBotC().getHandCards().get(12).toString());\n System.out.println(testDealer.getUser().getHandCards());\n assertEquals(\"QUEEN of HEARTS[pickable by user]\", testDealer.getUser().getHandCards().get(10).toString());\n assertEquals(\"KING of HEARTS[pickable by user]\", testDealer.getUser().getHandCards().get(11).toString());\n assertEquals(\"ACE of HEARTS[pickable by user]\", testDealer.getUser().getHandCards().get(12).toString());\n }",
"@Test\n void pass3CardsRound3(){\n Dealer testDealer = new Dealer();\n testDealer.initDealer();\n testDealer.setRoundCount(3);\n \n List<Card> heartHand, spadeHand, clubHand, diamondHand,userPassedCards;\n\n heartHand = new ArrayList<Card>();\n spadeHand = new ArrayList<Card>();\n clubHand = new ArrayList<Card>();\n diamondHand = new ArrayList<Card>();\n userPassedCards = new ArrayList<Card>();\n \n userPassedCards.add(new Card(Suit.DIAMONDS, Rank.ACE, true));\n userPassedCards.add(new Card(Suit.DIAMONDS, Rank.KING, true));\n userPassedCards.add(new Card(Suit.DIAMONDS, Rank.QUEEN, true));\n\n \n for(Card c:userPassedCards) {\n c.setOwnerOfCard(\"user\");\n }\n\n for (Rank rank : Rank.values()) {\n heartHand.add(new Card(Suit.HEARTS, rank, true));\n }\n\n for (Rank rank : Rank.values()) {\n spadeHand.add(new Card(Suit.SPADES, rank, true));\n }\n\n for (Rank rank : Rank.values()) {\n clubHand.add(new Card(Suit.CLUBS, rank, true));\n }\n\n for (Rank rank : Rank.values()) {\n diamondHand.add(new Card(Suit.DIAMONDS, rank, true));\n }\n \n testDealer.getBotA().fillHandCards(heartHand);\n testDealer.getBotB().fillHandCards(spadeHand);\n testDealer.getBotC().fillHandCards(clubHand);\n testDealer.getUser().fillHandCards(diamondHand);\n\n testDealer.distributePassedCards(userPassedCards);\n\n assertEquals(13, testDealer.getUserHandCards().size());\n assertEquals(13, testDealer.getBotA().getHandCards().size());\n assertEquals(13, testDealer.getBotB().getHandCards().size());\n assertEquals(13, testDealer.getBotC().getHandCards().size());\n\n assertEquals(\"QUEEN of CLUBS[pickable by botA]\", testDealer.getBotA().getHandCards().get(0).toString());\n assertEquals(\"KING of CLUBS[pickable by botA]\", testDealer.getBotA().getHandCards().get(1).toString());\n assertEquals(\"ACE of CLUBS[pickable by botA]\", testDealer.getBotA().getHandCards().get(2).toString());\n\n assertEquals(\"QUEEN of DIAMONDS[pickable by botB]\", testDealer.getBotB().getHandCards().get(0).toString());\n assertEquals(\"KING of DIAMONDS[pickable by botB]\", testDealer.getBotB().getHandCards().get(1).toString());\n assertEquals(\"ACE of DIAMONDS[pickable by botB]\", testDealer.getBotB().getHandCards().get(2).toString());\n\n assertEquals(\"QUEEN of HEARTS[pickable by botC]\", testDealer.getBotC().getHandCards().get(10).toString());\n assertEquals(\"KING of HEARTS[pickable by botC]\", testDealer.getBotC().getHandCards().get(11).toString());\n assertEquals(\"ACE of HEARTS[pickable by botC]\", testDealer.getBotC().getHandCards().get(12).toString());\n\n assertEquals(\"QUEEN of SPADES[pickable by user]\", testDealer.getUser().getHandCards().get(10).toString());\n assertEquals(\"KING of SPADES[pickable by user]\", testDealer.getUser().getHandCards().get(11).toString());\n assertEquals(\"ACE of SPADES[pickable by user]\", testDealer.getUser().getHandCards().get(12).toString());\n }",
"private void prepareDeal(){\n\t\tdeck.shuffle();\n\t\tplayers.clear(); //Remove any possible rubbish\n\t\tfor(Player p : seatPlayers){\n\t\t\tif(p != null){\n\t\t\t\tList<BlackjackHand> hands = new ArrayList<>();\n\t\t\t\tBlackjackHand hand = new BlackjackHandPlayer();\n\t\t\t\thands.add(hand);\n\t\t\t\thistoricalActions.put(hand, new ArrayList<>());\n\t\t\t\tplayers.put(p, hands);\n\t\t\t}\n\t\t}\n\t\tdealerHand = new BlackjackHandDealer();\n\t}",
"public void discardToDeck() {\n\t\tfor(int i=discardPile.size(); i>0; i--) {\n\t\t deck.add(discardPile.remove(0));\n\t\t}\n\t\tCollections.shuffle(deck);\n\t}",
"public Card removeCard(){\n Card temp = pile[0]; //removes top card. putting placement card to avoid null pointer\n for(int i = 0; i < pilePlace; i++){ //shifts cards\n pile[i] = pile[i+1];\n }\n pilePlace--;\n return temp;\n\n }",
"public static void main(String[] args) throws StackFullException, StackEmptyException {\n\t try {\n\t DiscardPile<Card> discardPile1 = null; \n\t\tdiscardPile1 = new DiscardPile<Card>(52, 0);// max is 52\n\t\tdiscardPile1.push(new Card(8));\n\t\tdiscardPile1.push(new Card(32));\n\t\tdiscardPile1.push(new Card(48));\t\t\n\t\tdiscardPile1.push(new Card(2));\n\t\tdiscardPile1.push(new Card(17));\n\t\tdiscardPile1.push(new Card(20)); //removeTopCard should remove all that's above\n\t\tdiscardPile1.push(new Card(25));\n\t\tdiscardPile1.push(new Card(50));\n\t\tdiscardPile1.push(new Card(19));\n\t\tdiscardPile1.push(new Card(41)); //10 Cards that must be popped\n\t\tSystem.out.println(\"*********************************************************************************\"); \n\t\tCollections.reverse(discardPile1);\n\t\tfor(Card comi : discardPile1) { //for loop for objects\n\t\t\tSystem.out.println(comi);\n\t\t\t}\t\t\t\n\t }\n\t catch (StackFullException SFE) {\n\t System.out.println(\"StackFullException: \" + SFE.getMessage());\n}\n\t try {\n\t\t\tDiscardPile<Card> discardPile = null; \n\t\t\tdiscardPile = new DiscardPile<Card>(52, 0);\n\t\t\tdiscardPile.push(new Card(8));\n\t\t\tdiscardPile.push(new Card(32));\n\t\t\tdiscardPile.push(new Card(48));\t\t\n\t\t\tdiscardPile.push(new Card(2));\n\t\t\tdiscardPile.push(new Card(17));\n\t\t\tdiscardPile.push(new Card(20)); //removeTopCard should remove all that's above\n\t\t\tdiscardPile.push(new Card(25));\n\t\t\tdiscardPile.push(new Card(50));\n\t\t\tdiscardPile.push(new Card(19));\n\t\t\tdiscardPile.push(new Card(41)); //10 Cards that must be popped\n\t\t\t \n\t\t\tSystem.out.println(\"*********************************************************************************\"); \n\t\t\t\n\t\t\tCard[] cardArr = discardPile.removeTopCard(new Card(20));\n\t\t\tfor(Card co : cardArr) { //for loop for objects\n\t\t\t\tSystem.out.println(co);\n\t\t\t\t}\t\t\n\t\t\tSystem.out.println(\"*********************************************************************************\"); \n\n\t\t }\n\t\t catch (StackFullException SFE) {\n\t\t \tSystem.out.println(\"StackFullException: \" + SFE.getMessage());\n\t\t }\n\t\t catch (StackEmptyException SEE) {\n\t\t \tSystem.out.println(\"StackFullException: \" + SEE.getMessage());\n\t\t }\n\t try {\n\t\t\tDiscardPile<Card> discardPile = null; \n\t\t\tdiscardPile = new DiscardPile<Card>(52, 0);\n\t\t\tdiscardPile.push(new Card(8));\n\t\t\tdiscardPile.push(new Card(32));\n\t\t\tdiscardPile.push(new Card(48));\t\t\n\t\t\tdiscardPile.push(new Card(2));\n\t\t\tdiscardPile.push(new Card(17));\n\t\t\tdiscardPile.push(new Card(20)); //removeTopCard should remove all that's above\n\t\t\tdiscardPile.push(new Card(25));\n\t\t\tdiscardPile.push(new Card(50));\n\t\t\tdiscardPile.push(new Card(19));\n\t\t\tdiscardPile.push(new Card(41)); //10 Cards that must be popped\n\t\t\t \n\t\t\t\n\t\t\tCard[] cardArr = discardPile.removeTopCard(new Card(50));\n\t\t\tfor(Card co : cardArr) { //for loop for objects\n\t\t\t\tSystem.out.println(co);\n\t\t\t\t}\t\t\n\t\t\tSystem.out.println(\"*********************************************************************************\"); \n\n\t\t }\n\t\t catch (StackFullException SFE) {\n\t\t \tSystem.out.println(\"StackFullException: \" + SFE.getMessage());\n\t\t }\n\t\t catch (StackEmptyException SEE) {\n\t\t \tSystem.out.println(\"StackFullException: \" + SEE.getMessage());\n\t\t }\n\n}",
"@Test\n void testWinnerOfTrickNotFollowingSuit() {\n Dealer testDealer = new Dealer();\n testDealer.initDealer();\n\n Bot botA = testDealer.getBotA();\n Bot botB = testDealer.getBotB();\n Bot botC = testDealer.getBotC();\n\n ArrayList<Card> botAHand, botBHand, botCHand = new ArrayList <Card>();\n\n // botAHand = new ArrayList <Card>();\n botAHand = new ArrayList <Card>();\n botBHand = new ArrayList <Card>();\n botCHand = new ArrayList <Card>();\n\n Card thrownCard = new Card(Suit.CLUBS,Rank.FOUR,true);\n \n Card cardA1 = new Card(Suit.CLUBS,Rank.ACE,true);\n\n Card cardB1 = new Card(Suit.DIAMONDS,Rank.ACE,true);\n\n Card cardC1 = new Card(Suit.SPADES,Rank.ACE,true);\n\n botAHand.add(cardA1);\n botBHand.add(cardB1);\n botCHand.add(cardC1);\n \n // botA.fillHandCards(botAHand);\n botA.fillHandCards(botAHand);\n botB.fillHandCards(botBHand);\n botC.fillHandCards(botCHand);\n\n testDealer.addToPlayedCards(thrownCard);\n \n Card cardToPlay = botA.playCard(thrownCard, 1);\n testDealer.addToPlayedCards(cardToPlay);\n Card largestPlayedCard = testDealer.getLargestCardFromTrick();\n\n cardToPlay = botB.playCard(largestPlayedCard, 2);\n testDealer.addToPlayedCards(cardToPlay);\n largestPlayedCard = testDealer.getLargestCardFromTrick();\n\n cardToPlay = botC.playCard(largestPlayedCard, 3);\n testDealer.addToPlayedCards(cardToPlay);\n\n // List<Card> allPlayedCards = testDealer.getPlayedCardsForTrick();\n assertEquals(\"botA\", testDealer.getWinnerOfTrick(testDealer.getPlayedCardsForTrick()));\n }",
"private int highestPossibleValue(List<Card> cards) {\n int value = 0;\n int assCounter = 0;\n\n // Calculate the value without taking * into account\n for (Card card : cards) {\n value += card.getValue();\n if (card.getName().equals(\"*\")) assCounter++;\n }\n\n // Subtracts value of *\n for (int i = 0; i < assCounter; i++) {\n if (value <= 21)\n break;\n value -= 10;\n }\n\n return value;\n }",
"private void InitializeComputerHand(){\n for(int i = 0; i < 7; i++){\n //Add to the computer\n handComputer.add(deck.get(i));\n }\n\n for(int i = 6; i >= 0; i--){\n deck.remove(i);\n }\n }",
"@Test\n void pass3CardsRound1(){\n Dealer testDealer = new Dealer();\n testDealer.initDealer();\n testDealer.setRoundCount(1);\n \n List<Card> heartHand, spadeHand, clubHand, diamondHand,userPassedCards;\n\n heartHand = new ArrayList<Card>();\n spadeHand = new ArrayList<Card>();\n clubHand = new ArrayList<Card>();\n diamondHand = new ArrayList<Card>();\n userPassedCards = new ArrayList<Card>();\n \n userPassedCards.add(new Card(Suit.DIAMONDS, Rank.ACE, true));\n userPassedCards.add(new Card(Suit.DIAMONDS, Rank.KING, true));\n userPassedCards.add(new Card(Suit.DIAMONDS, Rank.QUEEN, true));\n\n for(Card c:userPassedCards) {\n c.setOwnerOfCard(\"user\");\n }\n\n for (Rank rank : Rank.values()) {\n heartHand.add(new Card(Suit.HEARTS, rank, true));\n }\n\n for (Rank rank : Rank.values()) {\n spadeHand.add(new Card(Suit.SPADES, rank, true));\n }\n\n for (Rank rank : Rank.values()) {\n clubHand.add(new Card(Suit.CLUBS, rank, true));\n }\n\n for (Rank rank : Rank.values()) {\n diamondHand.add(new Card(Suit.DIAMONDS, rank, true));\n }\n \n testDealer.getBotA().fillHandCards(heartHand);\n testDealer.getBotB().fillHandCards(spadeHand);\n testDealer.getBotC().fillHandCards(clubHand);\n testDealer.getUser().fillHandCards(diamondHand);\n\n testDealer.distributePassedCards(userPassedCards);\n\n assertEquals(13, testDealer.getUserHandCards().size());\n assertEquals(13, testDealer.getBotA().getHandCards().size());\n assertEquals(13, testDealer.getBotB().getHandCards().size());\n assertEquals(13, testDealer.getBotC().getHandCards().size());\n\n assertEquals(\"QUEEN of DIAMONDS[pickable by botA]\", testDealer.getBotA().getHandCards().get(0).toString());\n assertEquals(\"KING of DIAMONDS[pickable by botA]\", testDealer.getBotA().getHandCards().get(1).toString());\n assertEquals(\"ACE of DIAMONDS[pickable by botA]\", testDealer.getBotA().getHandCards().get(2).toString());\n\n assertEquals(\"QUEEN of HEARTS[pickable by botB]\", testDealer.getBotB().getHandCards().get(10).toString());\n assertEquals(\"KING of HEARTS[pickable by botB]\", testDealer.getBotB().getHandCards().get(11).toString());\n assertEquals(\"ACE of HEARTS[pickable by botB]\", testDealer.getBotB().getHandCards().get(12).toString());\n\n assertEquals(\"QUEEN of SPADES[pickable by botC]\", testDealer.getBotC().getHandCards().get(10).toString());\n assertEquals(\"KING of SPADES[pickable by botC]\", testDealer.getBotC().getHandCards().get(11).toString());\n assertEquals(\"ACE of SPADES[pickable by botC]\", testDealer.getBotC().getHandCards().get(12).toString());\n System.out.println(testDealer.getUser().getHandCards());\n System.out.println();\n assertEquals(\"QUEEN of CLUBS[pickable by user]\", testDealer.getUser().getHandCards().get(0).toString());\n assertEquals(\"KING of CLUBS[pickable by user]\", testDealer.getUser().getHandCards().get(1).toString());\n assertEquals(\"ACE of CLUBS[pickable by user]\", testDealer.getUser().getHandCards().get(2).toString());\n }",
"@Override\n public Card playCard() {\n List<Card> rank1 = new ArrayList<>();\n List<Card> rank2 = new ArrayList<>();\n List<Card> rank3 = new ArrayList<>();\n List<Card> rank4 = new ArrayList<>();\n for (Card card : cardsInHand) {\n if (card.getRank().equals(Card.Rank.EIGHT)) {\n rank1.add(card);\n break;\n } else if (card.getSuit().equals(idealSuit)\n && card.getRank().equals(idealRank)\n && (topCard.getSuit().equals(card.getSuit())\n || topCard.getRank().equals(card.getRank()))) {\n rank2.add(card);\n } else if ((card.getSuit().equals(idealSuit) || card.getRank().equals(idealRank))\n && (topCard.getSuit().equals(card.getSuit())\n || topCard.getRank().equals(card.getRank()))) {\n rank3.add(card);\n } else if (topCard.getSuit().equals(card.getSuit())\n || topCard.getRank().equals(card.getRank())) {\n rank4.add(card);\n }\n }\n List<List<Card>> playPossibilities = new ArrayList<>(Arrays.asList(rank1, rank2, rank3, rank4));\n for (List<Card> list : playPossibilities) {\n if (list.size() > 0) {\n cardsInHand.remove(list.get(0));\n return list.get(0);\n }\n }\n // This method will never return null if shouldDrawCard() is called beforehand.\n return null;\n }",
"@Test\r\n public void testPlayer_getCautiousStrategyCardCard_numeric_matchColorNotNumber() {\n player2 = new Player(\"Player Two\", true);\r\n player2.setHand(strategyHand.getAllCards());\r\n\r\n // let the cpc be a yellow three\r\n // get rid of all non-numeric cards and the green three so the yellow six is the most attractive option\r\n player2.getHand().discard(wild);\r\n player2.getHand().discard(wildDrawFour);\r\n player2.getHand().discard(yellowReverse);\r\n player2.getHand().discard(redDrawTwo);\r\n player2.getHand().discard(greenThree);\r\n\r\n assertTrue(player2.getCautiousStrategyCard(yellowThree, yellowThree.getColor()).equals(yellowSix));\r\n }",
"@Test\n void negativeQuality() {\n Item[] items = new Item[]{new Item(\"noValue\", 2, 0)};\n GildedRose app = new GildedRose(items);\n app.updateQuality();\n\n assertEquals(0, app.items[0].quality, \"Quality shouldn't drop below 0\");\n }",
"public void drawCard(Integer cardLocation){\n Random random = new Random();\n boolean isPlayerHandEmpty = false;\n Integer sizeOfPlayerHand = 4;\n //The reason for this is as follows: we are wanting to keep an array size of 4 consistent for playerHand, however\n //using the .remove() function actually shortens the size. Yet .set(index,null) is still counted as an element, hence\n //isEmpty does not work, and the size() is still 4.\n //Is this the most agile way to do this? I don't know, but this worked.\n\n for (Card s:playerHand){\n if(s == null){\n sizeOfPlayerHand--;\n }\n }\n if (sizeOfPlayerHand == 0){\n isPlayerHandEmpty = true;\n }\n\n\n\n if (playerTempDeck.size() > 0 && (sizeOfPlayerHand < 4 || playerHand.size() < 4)){\n //System.out.println(\"Adding cards from deck.\");\n\n Integer n = random.nextInt(playerTempDeck.size()); //0 to the number in the bracket. Pick a random card from the deck and use it here.\n playerHand.set(cardLocation, playerTempDeck.get(n));\n //System.out.println(\"Now the playerHand is: \" + playerHand.toString());\n //System.out.println(\"Size of deck: \" + playerTempDeck.size());\n //System.out.println(\"Trying to remove: \" + playerTempDeck.get(n).getEffect());\n playerTempDeck.remove(playerTempDeck.get(n));\n }\n\n if (playerTempDeck.size() == 0 && (isPlayerHandEmpty || playerHand.size() == 0)){ //deck is empty and no cards left to play, reshuffle.\n //System.out.println(\"Hand and deck are both empty!\");\n playerTempDeck.addAll(discardedCards);\n discardedCards.clear();\n drawCard(0);\n drawCard(1);\n drawCard(2);\n drawCard(3);\n }\n }",
"private Pair[] bribeCalculateBag(final int maxCards,\n final HashMap<String, Integer> association) {\n final int minMoney = 5;\n final int maxBagSize = 3;\n if (getInventory().getMoney() < minMoney || numberOfIllegals(association) == 0) {\n return calculateBag(maxCards, association);\n }\n Pair[] result;\n if (numberOfIllegals(association) <= 2 || getInventory().getMoney() < minMoney * 2) {\n getInventory().getBagToGive().setBribe(minMoney);\n getInventory().setMoney(getInventory().getMoney() - minMoney);\n int duplicate = findIllegal(association);\n removeOneAsset(findIllegal(association));\n if (duplicate == findIllegal(association)) {\n result = new Pair[1];\n result[0] = new Pair<>(findIllegal(association), 2);\n getInventory().setNumberOfDeclared(2);\n } else {\n if (findIllegal(association) == -1) {\n result = new Pair[1];\n result[0] = new Pair<>(duplicate, 1);\n getInventory().setNumberOfDeclared(1);\n } else {\n result = new Pair[2];\n result[0] = new Pair<>(duplicate, 1);\n result[1] = new Pair<>(findIllegal(association), 1);\n getInventory().setNumberOfDeclared(2);\n }\n }\n removeOneAsset(findIllegal(association));\n getInventory().setDeclaredAssets(0);\n return result;\n } else {\n getInventory().getBagToGive().setBribe(minMoney * 2);\n getInventory().setMoney(getInventory().getMoney() - (minMoney * 2));\n int contor = maxCards - 1;\n final int contorStart = contor;\n int[] resultAux = new int[maxBagSize];\n getInventory().setDeclaredAssets(0);\n while (contor > 0 && findIllegal(association) != -1) {\n resultAux[findIllegal(association) % maxBagSize]++;\n removeOneAsset(findIllegal(association));\n contor--;\n }\n getInventory().setNumberOfDeclared(contorStart - contor);\n getInventory().setDeclaredAssets(0);\n contor = 0;\n for (int it : resultAux) {\n if (it != 0) {\n contor++;\n }\n }\n result = new Pair[contor];\n if (contor == maxBagSize) {\n result = new Pair[maxBagSize];\n result[0] = new Pair<>(association.get(\"Silk\"), resultAux[1]);\n result[1] = new Pair<>(association.get(\"Pepper\"), resultAux[2]);\n result[2] = new Pair<>(association.get(\"Barrel\"), resultAux[0]);\n } else {\n if (contor == 1) {\n result = new Pair[1];\n if (resultAux[0] > 0) {\n result[0] = new Pair<>(association.get(\"Barrel\"), resultAux[0]);\n }\n if (resultAux[1] > 0) {\n result[0] = new Pair<>(association.get(\"Silk\"), resultAux[1]);\n }\n if (resultAux[2] > 0) {\n result[0] = new Pair<>(association.get(\"Pepper\"), resultAux[2]);\n }\n } else {\n result = new Pair[2];\n int i = 0;\n if (resultAux[0] > 0) {\n result[i] = new Pair<>(association.get(\"Barrel\"), resultAux[0]);\n i++;\n }\n if (resultAux[1] > 0) {\n result[i] = new Pair<>(association.get(\"Silk\"), resultAux[1]);\n i++;\n }\n if (resultAux[2] > 0) {\n result[i] = new Pair<>(association.get(\"Pepper\"), resultAux[2]);\n }\n }\n }\n return result;\n }\n\n }",
"public void antiClue(Card c) {\n\t\tnotPossible.add(c);\n\t}",
"@Override\n\tboolean isValid(){\n\t\tif(size()==5) {\n\t\t\tint suite = getCard(0).suit;\n\t\t\tfor(int i = 1 ; i< size(); i++) {\n\t\t\t\tif(getCard(i).suit != suite) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tsort();\n\t\t\tint currRank = (getCard(0).rank +11)%13;\n\t\t\tfor(int i=0; i<size(); i++) {\n\t\t\t\tif((getCard(i).rank+11)%13 != currRank) return false;\n\t\t\t\tcurrRank++;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}",
"private void shuffleOnceRandom(){\n\t\t//You need to have a copy of the deck before you shuffled it so you can reference\n\t\t//It when you are trying to replace the new values\n\t\tList<Card> beforeShuffle = ourDeck.makeCopy().getCurrentDeck();\n\t\t//The topIndex tells us where we are in reference to the top half of the deck\n\t\t//Same with bottom this helps us reference the original deck to get whatever\n\t\t//Card we need and the deckIndex helps us put it in the correct spot\n\t\tint topIndex = 0, bottomIndex = ourDeck.getSize() / 2, deckIndex = 0;\n\t\t//These ints help us keep track of how many cards are left in each half\n\t\tint remainingTop = ourDeck.getSize() / 2, remainingBot = ourDeck.getSize() / 2;\n\t\tboolean shouldLoop = true;\n\t\t//This is the shuffling loop\n\t\twhile(shouldLoop){\n\t\t\t//This means the number coming from the specific deck which in this method is random\n\t\t\tint numTop = generator.nextInt(RAND_BOUND), numBot = generator.nextInt(RAND_BOUND);\n\t\t\t//After we determine the random number of cards we're using we have to do some checks\n\t\t\t//This means we wanted more than there was less therefore the stack is out\n\t\t\t//This is the stopping condition for the loop\n\t\t\tif(numTop >= remainingTop){\n\t\t\t\tnumTop = remainingTop;\n\t\t\t\tnumBot = remainingBot;\n\t\t\t\tshouldLoop = false;\n\t\t\t}\n\t\t\t\t\n\t\t\tif(numBot >= remainingBot){\n\t\t\t\tnumTop = remainingTop;\n\t\t\t\tnumBot = remainingBot;\n\t\t\t\tshouldLoop = false;\n\t\t\t}\n\t\t\t//This is where I replace the newCard into ourDeck\n\t\t\t//I iterate for the number of times we take from the top or bottom\n\t\t\tfor(int i = 1; i <= numTop; i++){\t\n\t\t\t\tCard newCard = beforeShuffle.get(topIndex);\t//I get the card we want to move\n\t\t\t\tourDeck.setCard(newCard, deckIndex);\t\t//Then I move it to the new deckIndex\n\t\t\t\ttopIndex++;\tdeckIndex++;\n\t\t\t}\n\t\t\tfor(int i = 1; i <= numBot; i++){\n\t\t\t\tCard newCard = beforeShuffle.get(bottomIndex);\n\t\t\t\tourDeck.setCard(newCard, deckIndex);\n\t\t\t\tbottomIndex++;\tdeckIndex++;\n\t\t\t}\n\t\t\tremainingTop = remainingTop - numTop;\n\t\t\tremainingBot = remainingBot - numBot;\n\t\t}\n\t}",
"public Deck() {\n cards = new LinkedList<Integer>();\n removedCards = new LinkedList<Integer>();\n \n int i, j;\n for (i = MIN_VALUE; i <= MAX_VALUE; i++) {\n for (j = 0; j <= NUM_SUITS; j++) {\n cards.add(i);\n }\n }\n }",
"public void processStandardECard(ErgebnisLOSCard card) {\n\t\tswitch(card.getId()) {\n\t\tcase 1:\n\t\t\tcurrent.raiseScore(20);\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tcurrent.raiseScore(10);\n\t\t\tgetLeftNeighbor().raiseScore(20);\n\t\t\tbreak;\n\t\tcase 4:\n\t\t\traiseScoreOfEveryPlayer(10);\n\t\t\tbreak;\n\t\tcase 5:\n\t\t\tcurrent.raiseScore(10);\n\t\t\tbreak;\n\t\tcase 6:\n\t\t\tbreak;\n\t\tcase 7:\n\t\t\tcurrent.raiseScore(30);\n\t\t\tbreak;\n\t\tcase 8:\n\t\t\tbreak;\n\t\tcase 9:\n\t\t\tcurrent.raiseScore(20);\n\t\t\tbreak;\n\t\tcase 11:\n\t\t\tgetLeftNeighbor().raiseScore(10);\n\t\t\tgetRightNeigbour().raiseScore(10);\n\t\t\tbreak;\n\t\tcase (12):\n\t\tcase (13):\n\t\tcase (14):\n\t\t\tcurrent.raiseScore(10);\n\t\t\tbreak;\n\t\tcase (15):\n\t\tcase (16):\n\t\tcase (17):\n\t\t\tbreak;\n\t\tcase (18):\n\t\t\tcurrent.raiseScore(30);\n\t\t\tbreak;\n\t\tcase (19):\n\t\t\tcurrent.raiseScore(20);\n\t\t\tbreak;\n\t\tcase (20):\n\t\t\tcurrent.raiseScore(50);\n\t\t\tbreak;\n\t\tcase (21):\n\t\t\tgetRightNeigbour().lowerScore(50);\n\t\t\tcurrent.raiseScore(50);\n\t\t\tbreak;\n\t\tcase (22):\n\t\t\tcurrent.raiseScore(20);\n\t\t\tbreak;\n\t\tcase (23):\n\t\t\tbreak;\n\t\tcase (25):\n\t\t\tcurrent.raiseScore(20);\n\t\t\tbreak;\n\t\tcase (26):\n\t\tcase (27):\n\t\tcase (28):\n\t\tcase (29):\n\t\tcase (30):\n\t\tcase (31):\n\t\t\tcurrent.raiseScore(10);\n\t\tcase (32):\n\t\t\tcurrent.raiseScore(30);\n\t\tcase (33):\n\t\t\tcurrent.raiseScore(20);\n\t\tcase (34):\n\t\t\tcurrent.raiseScore(20);\n\t\t\tgetRightNeigbour().raiseScore(10);\n\t\tcase (35):\n\t\t\tcurrent.raiseScore(20);\n\t\tcase (36):{\n\t\t\tif(!projectsAvailable.isEmpty()) {\n\t\t\t\topenUpProject(drawProject());\t\t\t\t\n\t\t\t}\n\t\t\telse current.raiseScore(30);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase (37):\n\t\t\tcurrent.raiseScore(20);\n\t\t\tbreak;\n\t\tcase (38):\n\t\t\tcurrent.raiseScore(10);\n\t\t\tbreak;\n\t\tcase (39):\n\t\t\tcurrent.raiseScore(10);\n\t\t\traiseScoreSecondRightNeighbor(10);\n\t\t\tbreak;\n\t\tcase (40):\n\t\t\tcurrent.raiseScore(20);\n\t\t\tbreak;\n\t\tcase (41):\n\t\t\tcurrent.raiseScore(10);\n\t\t\tbreak;\n\t\tcase (43):\n\t\t\tcurrent.lowerScore(20);\n\t\t\tgetRightNeigbour().raiseScore(20);\n\t\t\tbreak;\n\t\tcase (44):\n\t\tcase (45):\n\t\t\tcurrent.raiseScore(20);\n\t\t\tbreak;\n\t\tcase (46):\n\t\t\traiseScoreOfEveryPlayer(10);\n\t\t\tbreak;\n\t\tcase (48):\n\t\t\tcurrent.raiseScore(20);\n\t\tcase (50):\n\t\t\tbreak;\n\t\tcase (52):\n\t\t\tcurrent.raiseScore(20);\n\t\t\tbreak;\n\t\tcase (54):\n\t\t\tcurrent.raiseScore(50);\n\t\t\tbreak;\n\t\tcase (55):\n\t\t\tcurrent.raiseScore(10);\n\t\t\tbreak;\n\t\t}\n\t}",
"public void dealCardsToPile()\n {\n // Set the first initial computer card to display\n computerCard = highCardGame.getCardFromDeck();\n\n // Sets the first initial player card\n playerCard = highCardGame.getCardFromDeck();\n }",
"public boolean play(DiscardPile discardPile, \n\t Stack<Card> drawPile, \n\t\t\t\t\t\t\t\t\t\t\tArrayList<Player> players)\n\t{\t\n\t\n\t\n\tSystem.out.println(\"Before playing: \" + this.hand.toString());\n\t\tboolean temp = false;\n\t\tString suitEight = \"xyz\";\n\t\n\t\tif ((discardPile.top()).getRank() == 4 && super.checker_4 == true){\n\t\t\tSystem.out.println();\n\t\t\tSystem.out.println(\"\\t _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \");\n\t\t\tSystem.out.println(\"\\t | skipping the turn.. :( |\");\n\t\t\tSystem.out.println(\"\\t -----------------------------\");\n\t\t\tSystem.out.println();\n\t\t\tSystem.out.println();\n\t\t\tsuper.checker_4 = false;\n\t\t\treturn false;\n\t\t\t\n\t\t\t}\n\t\n\t\n\t\n\t\n\t\n\t\n\t\t/* adding two cards */\n\t\t if ((discardPile.top()).getRank() == 2 && super.checker_2 == true){\n\t\t\t \n\t\t\t System.out.println();\n\t\t\t System.out.println(\"\\t _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \");\n\t\t\t System.out.println(\"\\t | twice the value added! |\");\n\t\t\t System.out.println(\"\\t -----------------------------\");\n\t\t\t System.out.println();\n\t\t\t System.out.println();\n\t\t\t \n\t\t\t \n\t\t\tthis.hand.add(drawPile.pop());\n\t\t\t this.hand.add(drawPile.pop());\n\t\t\ttemp = false;\n\t\t\tsuper.checker_2 = false;\n\t\t }\n\t\t\n\t\t\n\t\t \n\t\t\n\t\telse{\n\t\t\tint i = location_1(discardPile);\n\t\t\t\n\t\t\t\n\t\t\tif(i == -1){\n\t\t\t\tthis.hand.add(drawPile.pop());\n\t\t\t\tif( i == location_2(discardPile)){ \n\t\t\t\t\t//System.out.println(\"value is added!\");\n\t\t\t\t\t//System.out.println();\n\t\t\t\t\t//System.out.println();\n\t\t\t\t\n\t\t\t\t} else{\n\t\t\t\t\ti = location_2(discardPile);\n\t\t\t\t\t//System.out.println(\"HAHA! got it!\");\n\t\t\t\t\tdiscardPile.add(this.hand.remove(i));\n\t\t\t\t\ttemp = false;\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tif ((discardPile.top()).getRank() == 2 && super.checker_2 == false){\n\t\t\t\t\t\tsuper.checker_2 = true;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(discardPile.top().getRank() == 4 && super.checker_4 == false){\n\t\t\t\t\t\tsuper.checker_4 = true;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif ((discardPile.top()).getRank() == 8 && temp == false){\n\t\t\t\t\t\tsuitEight = this.wildEight(discardPile, drawPile, players);\n\t\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t\tSystem.out.println(\"\\t \\t ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\");\n\t\t\t\t\t\tSystem.out.println(\"\\t \\t \\t Changing the suit to: \" + suitEight);\n\t\t\t\t\t\tSystem.out.print(\"\\t \\t \\t Processing....\");\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\tSystem.out.println();\n\t\t\t\t\t\t(discardPile.top()).setSuit(suitEight);\n\t\t\t\t\t\tSystem.out.println(\"\\t \\t \\t draw pile : \" + drawPile.peek() );\n\t\t\t\t\t\tSystem.out.println(\"\\t \\t \\t discard pile : \" + discardPile.top() );\n\t\t\t\t\t\tSystem.out.println(\"\\t \\t ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\");\n\t\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tif( this.hand.size() == 0 ){\n\t\t\t\t\ttemp = true;\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\t\n\t\t\t} else{\n\t\t\t\tdiscardPile.add(this.hand.remove(i));\n\t\t\t\ttemp = false;\n\t\t\t\t\n\t\t\t\tif ((discardPile.top()).getRank() == 2 && super.checker_2 == false){\n\t\t\t\t\t\tsuper.checker_2 = true;\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(discardPile.top().getRank() == 4 && super.checker_4 == false){\n\t\t\t\t\tsuper.checker_4 = true;\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ((discardPile.top()).getRank() == 8 && temp == false){\n\t\t\t\t\t\tsuitEight = this.wildEight(discardPile, drawPile, players);\n\t\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t\tSystem.out.println(\"\\t \\t ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\");\n\t\t\t\t\t\tSystem.out.println(\"\\t \\t \\t Changing the suit to: \" + suitEight);\n\t\t\t\t\t\tSystem.out.print(\"\\t \\t \\t Processing....\");\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\tSystem.out.println();\n\t\t\t\t\t\t(discardPile.top()).setSuit(suitEight);\n\t\t\t\t\t\tSystem.out.println(\"\\t \\t \\t draw pile : \" + drawPile.peek() );\n\t\t\t\t\t\tSystem.out.println(\"\\t \\t \\t discard pile : \" + discardPile.top() );\n\t\t\t\t\t\tSystem.out.println(\"\\t \\t ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\");\n\t\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t\tSystem.out.println();\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\tif( this.hand.size() == 0 ){\n\t\t\t\t\ttemp = true;\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\n\n\t\t\n\t\t\n\t\n\t\tSystem.out.println(\"After Playing: \" + this.hand.toString());\n\t\tSystem.out.println();\n\t\treturn temp;\n\t\t\n\t\n\t}",
"@Test\n\tpublic void testQuality0SellInUnder0() {\n\t\tGildedRose inn = new GildedRose();\n\t\tinn.setItem(new Item(\"Sulfuras, Hand of Ragnaros\", -11, 0));\n\t\tinn.oneDay();\n\t\t\n\t\t//access a list of items, get the quality of the one set\n\t\tList<Item> items = inn.getItems();\n\t\tint quality = items.get(0).getQuality();\n\t\t\n\t\t//assert quality remains the same\n\t\tassertEquals(\"Quality with quality 0 Sulfuras\", 0, quality);\n\t}",
"public void dealCards() {\n for(int i=0; i < 5; i++) { \n for(PokerPlayer player : players) {\n player.takeCard(deck.draw());\n }\n }\n }",
"public boolean hasBlackjack() {\n\t\treturn this.hand.countValue().lower(22) == 21;\n\t}",
"@Test\r\n public void testHasAtLeastTwoPlayableCards() {\n Player player2 = new Player(\"Three Playable Cards Test\", true);\r\n Hand threePlayableCardsHand = strategyHand;\r\n player2.setHand(threePlayableCardsHand.getAllCards());\r\n\r\n // Make it harder to find playable cards:\r\n player2.getHand().discard(new Card(Card.COLORLESS, Card.WILD, cvm));\r\n player2.getHand().discard(new Card(Card.COLORLESS, Card.WILD_DRAW_FOUR, cvm));\r\n\r\n Card currentPlayedCard_1 = new Card(Card.YELLOW, Card.ONE, cvm);\r\n assertTrue(player2.hasAtLeastTwoPlayableCards(currentPlayedCard_1, Card.BLUE));\r\n\r\n Card currentPlayedCard_2 = new Card(Card.BLUE, Card.SEVEN, cvm);\r\n assertFalse(player2.hasAtLeastTwoPlayableCards(currentPlayedCard_2, Card.BLUE));\r\n }",
"public boolean isFlush(){\n \r\n if(haveSameSuit(cards)){\r\n handValue = cards.get(cards.size()-1).getValue();\r\n return true;\r\n }\r\n \r\n return false;\r\n }",
"@Test\n void pass3CardsRound4(){\n Dealer testDealer = new Dealer();\n testDealer.initDealer();\n testDealer.setRoundCount(4);\n \n List<Card> heartHand, spadeHand, clubHand, diamondHand,userPassedCards;\n\n heartHand = new ArrayList<Card>();\n spadeHand = new ArrayList<Card>();\n clubHand = new ArrayList<Card>();\n diamondHand = new ArrayList<Card>();\n userPassedCards = new ArrayList<Card>();\n \n userPassedCards.add(new Card(Suit.DIAMONDS, Rank.ACE, true));\n userPassedCards.add(new Card(Suit.DIAMONDS, Rank.KING, true));\n userPassedCards.add(new Card(Suit.DIAMONDS, Rank.QUEEN, true));\n\n \n for(Card c:userPassedCards) {\n c.setOwnerOfCard(\"user\");\n }\n\n for (Rank rank : Rank.values()) {\n heartHand.add(new Card(Suit.HEARTS, rank, true));\n }\n\n for (Rank rank : Rank.values()) {\n spadeHand.add(new Card(Suit.SPADES, rank, true));\n }\n\n for (Rank rank : Rank.values()) {\n clubHand.add(new Card(Suit.CLUBS, rank, true));\n }\n\n for (Rank rank : Rank.values()) {\n diamondHand.add(new Card(Suit.DIAMONDS, rank, true));\n }\n \n testDealer.getBotA().fillHandCards(heartHand);\n testDealer.getBotB().fillHandCards(spadeHand);\n testDealer.getBotC().fillHandCards(clubHand);\n testDealer.getUser().fillHandCards(diamondHand);\n\n testDealer.distributePassedCards(userPassedCards);\n\n assertEquals(13, testDealer.getUserHandCards().size());\n assertEquals(13, testDealer.getBotA().getHandCards().size());\n assertEquals(13, testDealer.getBotB().getHandCards().size());\n assertEquals(13, testDealer.getBotC().getHandCards().size());\n\n assertEquals(\"TWO of HEARTS[pickable by botA]\", testDealer.getBotA().getHandCards().get(0).toString());\n assertEquals(\"THREE of HEARTS[pickable by botA]\", testDealer.getBotA().getHandCards().get(1).toString());\n assertEquals(\"FOUR of HEARTS[pickable by botA]\", testDealer.getBotA().getHandCards().get(2).toString());\n\n assertEquals(\"TWO of SPADES[pickable by botB]\", testDealer.getBotB().getHandCards().get(0).toString());\n assertEquals(\"THREE of SPADES[pickable by botB]\", testDealer.getBotB().getHandCards().get(1).toString());\n assertEquals(\"FOUR of SPADES[pickable by botB]\", testDealer.getBotB().getHandCards().get(2).toString());\n\n assertEquals(\"QUEEN of CLUBS[pickable by botC]\", testDealer.getBotC().getHandCards().get(10).toString());\n assertEquals(\"KING of CLUBS[pickable by botC]\", testDealer.getBotC().getHandCards().get(11).toString());\n assertEquals(\"ACE of CLUBS[pickable by botC]\", testDealer.getBotC().getHandCards().get(12).toString());\n\n assertEquals(\"QUEEN of DIAMONDS[pickable by user]\", testDealer.getUser().getHandCards().get(10).toString());\n assertEquals(\"KING of DIAMONDS[pickable by user]\", testDealer.getUser().getHandCards().get(11).toString());\n assertEquals(\"ACE of DIAMONDS[pickable by user]\", testDealer.getUser().getHandCards().get(12).toString());\n }",
"private int flushValue() {\n int flushValue = 0;\n if (inSameSuit()) {\n flushValue += 4;\n \n char firstCardSuit = cards[0].charAt(1);\n char StartCardSuit = cards[cards.length-1].charAt(1);\n \n if(firstCardSuit==StartCardSuit){\n flushValue +=1;\n }\n } \n return flushValue;\n }",
"public void sortHand(){\n\t\thand.sort(PlayingCard.PlayingCardComparator_ACEHIGH);\n\t}",
"public Bag getGreedyBag() {\r\n bag = super.getBag();\r\n List<Integer> auxiliarHand = new LinkedList<Integer>(hand);\r\n\r\n for (int i = 0; i < bag.getCardsIds().size(); i++) {\r\n if (auxiliarHand.contains(bag.getCardsIds().get(i))) {\r\n auxiliarHand.remove(bag.getCardsIds().get(i));\r\n }\r\n }\r\n\r\n if (this.roundNumber % 2 == 0) {\r\n highestProfitIllegalCard = 0;\r\n if (bag.getCards().size() < MAX_CARDS_IN_BAG) {\r\n for (Integer cardId : auxiliarHand) {\r\n if (cardId > MAX_LEGAL_INDEX\r\n && goodsFactory.getGoodsById(cardId).getProfit()\r\n > goodsFactory.getGoodsById(highestProfitIllegalCard).getProfit()) {\r\n highestProfitIllegalCard = cardId;\r\n }\r\n }\r\n if (highestProfitIllegalCard != 0\r\n && (coins - goodsFactory\r\n .getGoodsById(highestProfitIllegalCard)\r\n .getPenalty()) > 0) {\r\n bag.addCard(goodsFactory.getGoodsById(highestProfitIllegalCard));\r\n }\r\n }\r\n }\r\n return bag;\r\n }"
] | [
"0.69811",
"0.66877985",
"0.6444614",
"0.64220464",
"0.6380917",
"0.62755746",
"0.6200595",
"0.6163179",
"0.61618143",
"0.61522377",
"0.6096841",
"0.6085034",
"0.6071958",
"0.60304946",
"0.60273415",
"0.6003574",
"0.59849685",
"0.59827185",
"0.5982406",
"0.597542",
"0.5952737",
"0.59514594",
"0.59452194",
"0.59436154",
"0.59363705",
"0.5925734",
"0.59171426",
"0.5915247",
"0.59148026",
"0.58950585",
"0.5886751",
"0.586134",
"0.58600926",
"0.5847565",
"0.5838982",
"0.58304656",
"0.5822416",
"0.582142",
"0.5819582",
"0.58174706",
"0.5812019",
"0.581061",
"0.5809425",
"0.58093184",
"0.5798741",
"0.5797879",
"0.5788371",
"0.57587713",
"0.57582474",
"0.5758118",
"0.5754232",
"0.575248",
"0.5747975",
"0.5734902",
"0.5731492",
"0.57305163",
"0.5722162",
"0.5710676",
"0.57017523",
"0.56874233",
"0.56805587",
"0.5676727",
"0.5674809",
"0.5667354",
"0.5654901",
"0.56522757",
"0.5649795",
"0.5642512",
"0.56422186",
"0.5629481",
"0.56177723",
"0.5608765",
"0.5599978",
"0.5598282",
"0.5597856",
"0.55957925",
"0.55949056",
"0.5590245",
"0.55874544",
"0.55766946",
"0.55714947",
"0.5567607",
"0.55672956",
"0.55657154",
"0.5558812",
"0.5551286",
"0.55302525",
"0.55283314",
"0.5526721",
"0.55201834",
"0.55095875",
"0.5508622",
"0.55045253",
"0.5502632",
"0.5498562",
"0.54947704",
"0.54939294",
"0.54888105",
"0.5484",
"0.54829913"
] | 0.63324803 | 5 |
assert that, given no nonnumeric cards, a color match is possible without a numeric match | @Test
public void testPlayer_getCautiousStrategyCardCard_numeric_matchColorNotNumber() {
player2 = new Player("Player Two", true);
player2.setHand(strategyHand.getAllCards());
// let the cpc be a yellow three
// get rid of all non-numeric cards and the green three so the yellow six is the most attractive option
player2.getHand().discard(wild);
player2.getHand().discard(wildDrawFour);
player2.getHand().discard(yellowReverse);
player2.getHand().discard(redDrawTwo);
player2.getHand().discard(greenThree);
assertTrue(player2.getCautiousStrategyCard(yellowThree, yellowThree.getColor()).equals(yellowSix));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\r\n public void testPlayer_getCautiousStrategyCardCard_numeric_matchNumberNotColor() {\n player2 = new Player(\"Player Two\", true);\r\n player2.setHand(strategyHand.getAllCards());\r\n\r\n // let the cpc be a blue eight\r\n Card blueEight = new Card(Card.BLUE, Card.EIGHT, cvm);\r\n\r\n // get rid of all non-numeric cards and the blue four so the red eight is the most attractive option\r\n player2.getHand().discard(wild);\r\n player2.getHand().discard(wildDrawFour);\r\n player2.getHand().discard(yellowReverse);\r\n player2.getHand().discard(redDrawTwo);\r\n player2.getHand().discard(blueFour);\r\n\r\n Card redEight = new Card(Card.RED, Card.EIGHT, cvm);\r\n\r\n assertTrue(player2.getCautiousStrategyCard(blueEight, yellowThree.getColor()).equals(redEight));\r\n }",
"@Test\r\n public void testPlayer_getBoldStrategyCard_numeric_matchColorNotNumber() {\n player2 = new Player(\"Player Two\", true);\r\n player2.setHand(strategyHand.getAllCards());\r\n player2.getHand().discard(greenThree);\r\n player2.getHand().discard(yellowZero);\r\n assertTrue(player2.getBoldStrategyCard(yellowThree, yellowThree.getColor()).equals(yellowSix));\r\n }",
"@Test\r\n public void testPlayer_getBoldStrategyCard_numeric_matchNumberNotColor() {\n player2 = new Player(\"Player Two\", true);\r\n player2.setHand(strategyHand.getAllCards());\r\n Card blueEight = new Card(Card.BLUE, Card.EIGHT, cvm);\r\n player2.getHand().discard(blueFour);\r\n player2.getHand().discard(yellowZero);\r\n Card redEight = new Card(Card.RED, Card.EIGHT, cvm);\r\n assertTrue(player2.getBoldStrategyCard(blueEight, yellowThree.getColor()).equals(redEight));\r\n }",
"boolean similarColorTo(Card c);",
"@Test\r\n public void testPlayer_getBoldStrategyCard_numeric_colorBeatsNumber() {\n\r\n player2 = new Player(\"Player Two\", true);\r\n player2.setHand(strategyHand.getAllCards());\r\n\r\n // pick a cpc that could return two possible options\r\n // and assert that the higher value card comes back\r\n\r\n // make a cpc that might return a yellow six or a red eight\r\n // assert the yellow comes back, even though the red eight has a higher value\r\n Card redSix = new Card(Card.RED, Card.SIX, cvm);\r\n assertTrue(player2.getBoldStrategyCard(redSix, redSix.getColor()).equals(yellowSix));\r\n }",
"@Test\n\t\tpublic void testGetColour() {\n\t\t\tgreenSix = new Card (Card.Colour.Green, 6);\n\t\t\tblueSix = new Card (Card.Colour.Blue, 6);\n\t\t\twild = new Card (Card.Wild.Wild);\n\t\t\twild_Draw4 = new Card (Card.Wild.WildDraw4);\n\t\t\tblueSkip = new Card(Card.Colour.Blue, Card.Action.Skip);\n\t\t\tredDraw2 = new Card(Card.Colour.Red, Card.Action.Draw2);\n\t\t\tgreenReverse = new Card (Card.Colour.Green, Card.Action.Reverse);\n\t\t\tassertEquals(\"black\", wild.getColour());\n\t\t\tassertEquals(\"black\", wild_Draw4.getColour());\n\t\t\tassertEquals(\"Blue\", blueSkip.getColour());\n\t\t\tassertEquals(\"Red\", redDraw2.getColour());\n\t\t\tassertEquals(\"Green\", greenReverse.getColour());\n\t\t}",
"@Override\n public boolean match(Card card) {\n if (card.getColor().equals(\"BLACK\"))\n return true;\n\n return (card.getColor().equals(this.getColor())\n || card.getValue().equals(this.getValue()));\n }",
"@Test\r\n public void testPlayer_selectNewColor_dumb() {\r\n player2 = new Player(\"\", true);\r\n player2.setStrategy(Player.STRATEGY_DUMB);\r\n player2.setHand(strategyHand.getAllCards());\r\n player2.setLastPlayedCard(wild);\r\n String firstRandomColor = player2.selectNewColor();\r\n boolean differentColorFound = false;\r\n for(int i = 0; i < 25; i++) {\r\n String nextRandomColor = player2.selectNewColor();\r\n if(!nextRandomColor.equalsIgnoreCase(firstRandomColor)) {\r\n differentColorFound = true;\r\n }\r\n }\r\n assertTrue(differentColorFound);\r\n }",
"@Test\n public void testCardSelectionIsValid_TRUE() throws Exception {\n System.out.println(\"cardSelectionIsValid not valid\");\n UnoCard cardSelection = new UnoCard(UnoCardColour.BLUE, UnoCardValue.TWO);\n UnoCard drawCard = new UnoCard(UnoCardColour.BLUE, UnoCardValue.ONE);\n UnoCardColour wildColour = UnoCardColour.BLUE;\n utils.cardSelectionIsValid(cardSelection, drawCard, wildColour);\n }",
"private static void checkForMatches() {\n int matchesThisTurn = 0;\n switch (pattern) {\n case RED:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardColor(playerDeck.get(i)).equals(\"Red\")) {\n //system.out.println(\"Matched Card Color:\" + GameDeck.getCardColor(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case BLACK:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardColor(playerDeck.get(i)).equals(\"Black\")) {\n //system.out.println(\"Matched Card Color:\" + GameDeck.getCardColor(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n matchesThisTurn++;\n playerDeck.get(i).setCardPurchased(true);\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case HEART:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardSuit(playerDeck.get(i)).equals(\"Heart\")) {\n //system.out.println(\"Matched Card Suit:\" + GameDeck.getCardSuit(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case DIAMOND:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardSuit(playerDeck.get(i)).equals(\"Diamond\")) {\n //system.out.println(\"Matched Card Suit:\" + GameDeck.getCardSuit(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case CLUB:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardSuit(playerDeck.get(i)).equals(\"Club\")) {\n //system.out.println(\"Matched Card Suit:\" + GameDeck.getCardSuit(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case SPADE:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardSuit(playerDeck.get(i)).equals(\"Spade\")) {\n //system.out.println(\"Matched Card Suit:\" + GameDeck.getCardSuit(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case TWO:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"2\")) {\n //system.out.println(\"Matched Card Name:\" + GameDeck.getCardName(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case THREE:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"3\")) {\n //system.out.println(\"Matched Card Name:\" + GameDeck.getCardName(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case FOUR:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"4\")) {\n //system.out.println(\"Matched Card Name:\" + GameDeck.getCardName(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case FIVE:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"5\")) {\n //system.out.println(\"Matched Card Name:\" + GameDeck.getCardName(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case SIX:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"6\")) {\n //system.out.println(\"Matched Card Name:\" + GameDeck.getCardName(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case SEVEN:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"7\")) {\n //system.out.println(\"Matched Card Name:\" + GameDeck.getCardName(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case EIGHT:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"8\")) {\n //system.out.println(\"Matched Card Name:\" + GameDeck.getCardName(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case NINE:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"9\")) {\n //system.out.println(\"Matched Card Name:\" + GameDeck.getCardName(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case TEN:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"10\")) {\n //system.out.println(\"Matched Card Name:\" + GameDeck.getCardName(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case JACK:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"J\")) {\n //system.out.println(\"Matched Card Name:\" + GameDeck.getCardName(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case QUEEN:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"Q\")) {\n //system.out.println(\"Matched Card Name:\" + GameDeck.getCardName(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case KING:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"K\")) {\n //system.out.println(\"Matched Card Name:\" + GameDeck.getCardName(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case ACE:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"A\")) {\n //system.out.println(\"Matched Card Name:\" + GameDeck.getCardName(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case SINGLEDIGITPRIMES:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"2\") ||\n GameDeck.getCardName(playerDeck.get(i)).equals(\"3\") ||\n GameDeck.getCardName(playerDeck.get(i)).equals(\"5\") ||\n GameDeck.getCardName(playerDeck.get(i)).equals(\"7\")) {\n //system.out.println(\"Matched Card Name:\" + GameDeck.getCardName(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case PAIRS:\n int[] isAPair = new int[]{0,0,0,0};\n if(GameDeck.getCardName(playerDeck.get(0)).equals(GameDeck.getCardName(playerDeck.get(1)))) {\n //system.out.println(\"Matched Pair Name:\" + GameDeck.getCardName(playerDeck.get(0)));\n matchedDeck.add(playerDeck.get(0));\n playerDeck.get(0).setCardPurchased(true);\n matchedDeck.add(playerDeck.get(1));\n playerDeck.get(1).setCardPurchased(true);\n isAPair[1] = 1;\n matchesThisTurn += 2;\n } else if(GameDeck.getCardName(playerDeck.get(0)).equals(GameDeck.getCardName(playerDeck.get(2)))) {\n //system.out.println(\"Matched Pair Name:\" + GameDeck.getCardName(playerDeck.get(0)));\n matchedDeck.add(playerDeck.get(0));\n playerDeck.get(0).setCardPurchased(true);\n matchedDeck.add(playerDeck.get(2));\n playerDeck.get(2).setCardPurchased(true);\n isAPair[2] = 1;\n matchesThisTurn += 2;\n } else if(GameDeck.getCardName(playerDeck.get(0)).equals(GameDeck.getCardName(playerDeck.get(3)))) {\n //system.out.println(\"Matched Pair Name:\" + GameDeck.getCardName(playerDeck.get(0)));\n matchedDeck.add(playerDeck.get(0));\n playerDeck.get(0).setCardPurchased(true);\n matchedDeck.add(playerDeck.get(3));\n playerDeck.get(3).setCardPurchased(true);\n isAPair[3] = 1;\n matchesThisTurn += 2;\n }\n else\n {\n \tplayerDeck.get(0).setCardPurchased(false);\n \tplayerDeck.get(1).setCardPurchased(false);\n \tplayerDeck.get(2).setCardPurchased(false);\n \tplayerDeck.get(3).setCardPurchased(false);\n }\n \n if(isAPair[1] != 1) {\n if(isAPair[2] != 1 && GameDeck.getCardName(playerDeck.get(1)).equals(GameDeck.getCardName(playerDeck.get(2)))) {\n //system.out.println(\"Matched Pair Name:\" + GameDeck.getCardName(playerDeck.get(1)));\n matchedDeck.add(playerDeck.get(1));\n playerDeck.get(1).setCardPurchased(true);\n matchedDeck.add(playerDeck.get(2));\n playerDeck.get(2).setCardPurchased(true);\n isAPair[2] = 1;\n matchesThisTurn += 2;\n } else if(isAPair[3] != 1 && GameDeck.getCardName(playerDeck.get(1)).equals(GameDeck.getCardName(playerDeck.get(3)))) {\n //system.out.println(\"Matched Pair Name:\" + GameDeck.getCardName(playerDeck.get(1)));\n matchedDeck.add(playerDeck.get(1));\n playerDeck.get(1).setCardPurchased(true);\n matchedDeck.add(playerDeck.get(3));\n playerDeck.get(3).setCardPurchased(true);\n isAPair[3] = 1;\n matchesThisTurn += 2;\n }\n else\n {\n \tplayerDeck.get(1).setCardPurchased(false);\n \tplayerDeck.get(2).setCardPurchased(false);\n \tplayerDeck.get(3).setCardPurchased(false);\n }\n \n }\n \n if(isAPair[2] != 1) {\n if(isAPair[3] != 1 && GameDeck.getCardName(playerDeck.get(2)).equals(GameDeck.getCardName(playerDeck.get(3)))) {\n //system.out.println(\"Matched Pair Name:\" + GameDeck.getCardName(playerDeck.get(2)));\n matchedDeck.add(playerDeck.get(2));\n playerDeck.get(2).setCardPurchased(true);\n matchedDeck.add(playerDeck.get(3));\n playerDeck.get(3).setCardPurchased(true);\n matchesThisTurn += 2;\n }\n else\n {\n \tplayerDeck.get(2).setCardPurchased(false);\n \tplayerDeck.get(3).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n guessPattern();\n }\n break;\n case SUMOFPAIRS: //Ace is high for this sum calculation(Ace=14)\n int tempSum;\n int sumPairCount = 0;\n for(int i=0;i<playerDeck.size();i+=2) {\n tempSum = 0;\n tempSum += GameDeck.getCardValue(playerDeck.get(i));\n tempSum += GameDeck.getCardValue(playerDeck.get(i+1));\n if(tempSum == sumValue) {\n //system.out.println(\"Sum Value:\" + tempSum);\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchedDeck.add(playerDeck.get(i+1));\n playerDeck.get(i+1).setCardPurchased(true);\n sumPairCount++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n \tplayerDeck.get(i+1).setCardPurchased(false);\n }\n }\n if(sumPairCount == 2)\n {\n// guessPattern();\n }\n break;\n case INCREMENTING:\n int[] isIncrementing = new int[]{0,0,0,0};\n int[] isConsecutive = new int[]{0,0,0};\n int consecutiveCount = 0;\n for(int i = 0; i< playerDeck.size()-1; i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"A\")) {\n if(1 == GameDeck.getCardValue(playerDeck.get(i+1))-1) {\n //system.out.println(\"Matched incrementing:\" + GameDeck.getCardName(playerDeck.get(i)) +\n // \" & \" + GameDeck.getCardName(playerDeck.get(i+1)));\n isIncrementing[i] = 1;\n isIncrementing[i+1] = 1;\n isConsecutive[i] = 1;\n }\n } else {\n if(GameDeck.getCardValue(playerDeck.get(i)) == GameDeck.getCardValue(playerDeck.get(i+1))-1) {\n //system.out.println(\"Matched incrementing:\" + GameDeck.getCardName(playerDeck.get(i)) +\n // \" & \" + GameDeck.getCardName(playerDeck.get(i+1)));\n isIncrementing[i] = 1;\n isIncrementing[i+1] = 1;\n isConsecutive[i] = 1;\n }\n }\n }\n for(int i=0;i<playerDeck.size();i++) {\n if(isIncrementing[i] == 1) {\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn ++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n for(int i=0;i<3;i++) {\n if(isConsecutive[i] == 1) {\n consecutiveCount++;\n }\n }\n if(consecutiveCount == 3)\n {\n// guessPattern();\n }\n break;\n case DECREMENTING:\n int[] isDecrementing = new int[]{0,0,0,0};\n int[] isConsecutive2 = new int[]{0,0,0};\n int consecutiveCount2 = 0;\n for(int i = 0; i< playerDeck.size()-1; i++) {\n if(GameDeck.getCardValue(playerDeck.get(i)) == 2) {\n if(GameDeck.getCardName(playerDeck.get(i+1)).equals(\"A\")) {\n //system.out.println(\"Matched decrementing:\" + GameDeck.getCardName(playerDeck.get(i)) +\n // \" & \" + GameDeck.getCardName(playerDeck.get(i+1)));\n isDecrementing[i] = 1;\n isDecrementing[i+1] = 1;\n isConsecutive2[i] = 1;\n }\n } else {\n if(GameDeck.getCardValue(playerDeck.get(i)) == GameDeck.getCardValue(playerDeck.get(i+1))+1) {\n //system.out.println(\"Matched decrementing:\" + GameDeck.getCardName(playerDeck.get(i)) +\n // \" & \" + GameDeck.getCardName(playerDeck.get(i+1)));\n isDecrementing[i] = 1;\n isDecrementing[i+1] = 1;\n isConsecutive2[i] = 1;\n }\n }\n }\n for(int i=0;i<playerDeck.size();i++) {\n if(isDecrementing[i] == 1) {\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn ++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n for(int i=0;i<3;i++) {\n if(isConsecutive2[i] == 1) {\n consecutiveCount2++;\n }\n }\n if(consecutiveCount2 == 3)\n {\n// guessPattern();\n }\n break;\n default:\n //system.out.println(\"\");\n break;\n }\n }",
"@Test\r\n public void testPlayer_getBoldStrategyCard_zeroColor() {\n player2 = new Player(\"Player Two\", true);\r\n player2.setHand(strategyHand.getAllCards());\r\n assertTrue(player2.getBoldStrategyCard(yellowSix, yellowSix.getColor()).equals(yellowZero));\r\n\r\n // try again, but reduce the yellow color group to <= 2\r\n player2.getHand().discard(yellowSix);\r\n player2.getHand().discard(yellowReverse);\r\n\r\n assertTrue(player2.getBoldStrategyCard(yellowOne, yellowSix.getColor()).equals(yellowOne));\r\n }",
"@Test\r\n public void testPlayer_getDumbStrategyCard_oneWinner_color() {\n player2 = new Player(\"\", true);\r\n player2.setHand(strategyHand.getAllCards());\r\n player2.getHand().discard(wild);\r\n player2.getHand().discard(wildDrawFour);\r\n assertTrue(player2.getDumbStrategyCard(blueNine, blueNine.getColor()).equals(blueFour));\r\n }",
"@Test\n public void testCardCanPlay_FALSE() {\n System.out.println(\"cardCanPlay FALSE COLOUR\");\n UnoCard cardSelection = new UnoCard(UnoCardColour.RED, UnoCardValue.TWO);\n UnoCard drawCard = new UnoCard(UnoCardColour.BLUE, UnoCardValue.ONE);\n UnoCardColour wildColour = UnoCardColour.BLUE;\n boolean result = utils.cardCanPlay(cardSelection, drawCard, wildColour);\n assertEquals(false, result);\n }",
"@Test\n public void testCardCanPlay_TRUE() {\n System.out.println(\"cardCanPlay TRUE COLOUR\");\n UnoCard cardSelection = new UnoCard(UnoCardColour.BLUE, UnoCardValue.TWO);\n UnoCard drawCard = new UnoCard(UnoCardColour.BLUE, UnoCardValue.ONE);\n UnoCardColour wildColour = UnoCardColour.BLUE;\n boolean result = utils.cardCanPlay(cardSelection, drawCard, wildColour);\n assertEquals(true, result);\n }",
"@Override\n\tpublic String checkPlay(String cardNameRequest, String colorRequest) {\n\n\t\tfor (String color : AVAILABLE_COLORS) {\n\t\t\tif (color.equals(colorRequest)) // Checking if color is valid\n\t\t\t{\n\t\t\t\tif (\"Joker\".equals(cardNameRequest))\n\t\t\t\t\treturn \"Normal-Play\";\n\t\t\t\telse if (\"+4\".equals(cardNameRequest))\n\t\t\t\t\treturn \"+4\";\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn \"Invalid-Play\";\n\t}",
"@Test(expected = Exception.class)\n public void testCardSelectionIsValid_FALSE() throws Exception {\n System.out.println(\"cardSelectionIsValid not valid\");\n UnoCard cardSelection = new UnoCard(UnoCardColour.RED, UnoCardValue.TWO);\n UnoCard drawCard = new UnoCard(UnoCardColour.BLUE, UnoCardValue.ONE);\n UnoCardColour wildColour = UnoCardColour.BLUE;\n utils.cardSelectionIsValid(cardSelection, drawCard, wildColour);\n \n }",
"private void badMatch() {\n\t\tArrayList<Integer> faceValues = new ArrayList<Integer>();\n\t\tInteger firstSelectableCardPos = null;\n\t\t\n\t\tfor (int card = 0; card < CARDS_SUM; card++) {\n\t\t\tPlayingCard thisCard = ((PlayingCard) getActivity().findViewById(solo.getImage(card).getId()));\n\t\t\t\n\t\t\t// cheat by finding card face without turning card over\n\t\t\tint face = thisCard.getCard();\n\t\t\tfaceValues.add(face);\n\t\t\t\n\t\t\t// can't select all cards\n\t\t\tif (thisCard.isLocked() || thisCard.getVisible()) {\n\t\t\t\tcontinue;\n\t\t\t} else if (firstSelectableCardPos == null) {\n\t\t\t\tfirstSelectableCardPos = card;\n\t\t\t}\n\t\t\t\n\t\t\t// if this is a different card, select the bad pair\n\t\t\tif (faceValues.get(firstSelectableCardPos) != face) {\n\t\t\t\tsolo.clickOnImage(firstSelectableCardPos);\n\t\t\t\tsolo.clickOnImage(card);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}",
"private boolean isTheColorInputCorrect(int red, int green, int blue, int alpha){\n if(red > 255 || green > 255 || blue > 255 || alpha > 255){\n System.out.println(\"Values should be equal or smaller then 255.\");\n return false;\n }else if(red < 0 || green < 0 || blue < 0 || alpha < 0){\n System.out.println(\"Values should be equal or bigger then 0.\");\n return false;\n }else{\n return true;\n }\n }",
"public void testCheckForTripleSingleColor()\n {\n // Note that fromString calls the reset method internally.\n\n // An empty board\n assertEquals(b1.checkForTriple(), Cell.EMPTY);\n\n // A single filled cell\n b1.reset();\n b1.fromString(\"REEEEEEEE\");\n assertEquals(b1.checkForTriple(), Cell.EMPTY);\n\n // Some partially filled rows\n b1.fromString(\"RREEEEEEE\");\n assertEquals(b1.checkForTriple(), Cell.EMPTY);\n b1.fromString(\"EEEEEERER\");\n assertEquals(b1.checkForTriple(), Cell.EMPTY);\n b1.fromString(\"RRE\"+\"EEE\"+\"RER\");\n assertEquals(b1.checkForTriple(), Cell.EMPTY);\n\n // Some partially filled columns;\n b1.fromString(\"REEREEEEE\");\n assertEquals(b1.checkForTriple(), Cell.EMPTY);\n b1.fromString(\"EEREEEEER\");\n assertEquals(b1.checkForTriple(), Cell.EMPTY);\n b1.fromString(\"RER\"+\"REE\"+\"EER\");\n assertEquals(b1.checkForTriple(), Cell.EMPTY);\n\n // Partial Diagonals\n b1.fromString(\"REE\"+\"ERE\"+\"EEE\");\n assertEquals(b1.checkForTriple(), Cell.EMPTY);\n b1.fromString(\"REE\"+\"EEE\"+\"EER\");\n assertEquals(b1.checkForTriple(), Cell.EMPTY);\n b1.fromString(\"RER\"+\"ERE\"+\"EEE\");\n assertEquals(b1.checkForTriple(), Cell.EMPTY);\n\n // Filled columns\n b1.fromString(\"REEREEREE\");\n assertEquals(b1.checkForTriple(), Cell.RED1);\n b1.fromString(\"EEREEREER\");\n assertEquals(b1.checkForTriple(), Cell.RED1);\n b1.fromString(\"RERRERRER\");\n assertEquals(b1.checkForTriple(), Cell.RED1);\n\n // Filled Rows\n b1.fromString(\"RRREEEEEE\");\n assertEquals(b1.checkForTriple(), Cell.RED1);\n b1.fromString(\"EEEEEERRR\");\n assertEquals(b1.checkForTriple(), Cell.RED1);\n b1.fromString(\"RRREEERRR\");\n assertEquals(b1.checkForTriple(), Cell.RED1);\n\n // Filled Diagonals\n b1.fromString(\"REE\"+\"ERE\"+\"EER\");\n assertEquals(b1.checkForTriple(), Cell.RED1);\n b1.fromString(\"EER\"+\"ERE\"+\"REE\");\n assertEquals(b1.checkForTriple(), Cell.RED1);\n b1.fromString(\"RER\"+\"ERE\"+\"RER\");\n assertEquals(b1.checkForTriple(), Cell.RED1);\n\n }",
"protected final boolean isDifferentColor(Card cardOne, Card cardTwo)\n {\n return cardOne.getColor() != cardTwo.getColor();\n }",
"public void testCheckForTripleMultiColor()\n {\n // Note that fromString calls the reset method internally.\n\n // An empty board\n assertEquals(b1.checkForTriple(), Cell.EMPTY);\n\n // A single filled cell\n b1.reset();\n b1.fromString(\"REEEEBEEE\");\n assertEquals(b1.checkForTriple(), Cell.EMPTY);\n\n // Some partially filled rows\n b1.fromString(\"RREEBBEEE\");\n assertEquals(b1.checkForTriple(), Cell.EMPTY);\n b1.fromString(\"BEBEEERER\");\n assertEquals(b1.checkForTriple(), Cell.EMPTY);\n b1.fromString(\"RRB\"+\"BEB\"+\"RER\");\n assertEquals(b1.checkForTriple(), Cell.EMPTY);\n\n // Some partially filled columns;\n b1.fromString(\"RBERBEEEE\");\n assertEquals(b1.checkForTriple(), Cell.EMPTY);\n b1.fromString(\"EBREEEEBR\");\n assertEquals(b1.checkForTriple(), Cell.EMPTY);\n b1.fromString(\"RBR\"+\"REB\"+\"EBR\");\n assertEquals(b1.checkForTriple(), Cell.EMPTY);\n\n // Partial Diagonals\n b1.fromString(\"REE\"+\"ERE\"+\"EEB\");\n assertEquals(b1.checkForTriple(), Cell.EMPTY);\n b1.fromString(\"REB\"+\"EEE\"+\"BER\");\n assertEquals(b1.checkForTriple(), Cell.EMPTY);\n b1.fromString(\"RER\"+\"ERE\"+\"EEE\");\n assertEquals(b1.checkForTriple(), Cell.EMPTY);\n\n // Filled columns\n b1.fromString(\"RBBREERBB\");\n assertEquals(b1.checkForTriple(), Cell.RED1);\n b1.fromString(\"BBRBBREER\");\n assertEquals(b1.checkForTriple(), Cell.RED1);\n b1.fromString(\"RBRRBRRER\");\n assertEquals(b1.checkForTriple(), Cell.RED1);\n\n // Filled Rows\n b1.fromString(\"RRREEBBBE\");\n assertEquals(b1.checkForTriple(), Cell.RED1);\n b1.fromString(\"EEBBBERRR\");\n assertEquals(b1.checkForTriple(), Cell.RED1);\n b1.fromString(\"RRRBBERRR\");\n assertEquals(b1.checkForTriple(), Cell.RED1);\n\n // Filled Diagonals\n b1.fromString(\"REB\"+\"ERE\"+\"BER\");\n assertEquals(b1.checkForTriple(), Cell.RED1);\n b1.fromString(\"BBR\"+\"ERE\"+\"RBB\");\n assertEquals(b1.checkForTriple(), Cell.RED1);\n b1.fromString(\"RBR\"+\"BRB\"+\"RBR\");\n assertEquals(b1.checkForTriple(), Cell.RED1);\n\n }",
"boolean similarCard(Card c);",
"@Test\n public void isRedTest() {\n assertTrue(red_piece.isRed());\n assertTrue(!white_piece.isRed());\n }",
"@Test\n public void testCardCanPlay_WILD() {\n System.out.println(\"cardCanPlay WILD\");\n UnoCard cardSelection = new UnoCard(UnoCardColour.WILD, UnoCardValue.ONE);\n UnoCard drawCard = new UnoCard(UnoCardColour.BLUE, UnoCardValue.THREE);\n UnoCardColour wildColour = UnoCardColour.BLUE;\n boolean result = utils.cardCanPlay(cardSelection, drawCard, wildColour);\n assertEquals(true, result);\n }",
"private boolean isValidCard(int index)\n {\n if (index >= cards.size() || index < 0)\n return false;\n \n for (int i = index; i < cards.size() - 1; i++)\n if (!isDifferentColor(cards.get(i), cards.get(i + 1)) ||\n !isOneLess(cards.get(i + 1), cards.get(i)))\n return false;\n\n return true;\n }",
"public static void main(String[] args) {\r\n\t\tCard aceHearts = new Card(\"Ace\", \"Hearts\", 14);\r\n\t\tSystem.out.println(aceHearts.rank());\r\n\t\tSystem.out.println(aceHearts.suit());\r\n\t\tSystem.out.println(aceHearts.pointValue());\r\n\t\tSystem.out.println(aceHearts.toString());\r\n\t\tCard tenDiamonds = new Card(\"Ten\", \"Diamonds\", 10);\r\n\t\tSystem.out.println(tenDiamonds.rank());\r\n\t\tSystem.out.println(tenDiamonds.suit());\r\n\t\tSystem.out.println(tenDiamonds.pointValue());\r\n\t\tSystem.out.println(tenDiamonds.toString());\r\n\t\tCard fiveSpades = new Card(\"Five\", \"Spades\", 5);\r\n\t\tSystem.out.println(fiveSpades.rank());\r\n\t\tSystem.out.println(fiveSpades.suit());\r\n\t\tSystem.out.println(fiveSpades.pointValue());\r\n\t\tSystem.out.println(fiveSpades.toString());\r\n\t\tSystem.out.println(aceHearts.matches(tenDiamonds));\r\n\t\tSystem.out.println(aceHearts.matches(fiveSpades));\r\n\t\tSystem.out.println(aceHearts.matches(aceHearts));\r\n\t\tSystem.out.println(tenDiamonds.matches(fiveSpades));\r\n\t\tSystem.out.println(tenDiamonds.matches(aceHearts));\r\n\t\tSystem.out.println(tenDiamonds.matches(tenDiamonds));\r\n\t\tSystem.out.println(fiveSpades.matches(aceHearts));\r\n\t\tSystem.out.println(fiveSpades.matches(tenDiamonds));\r\n\t\tSystem.out.println(fiveSpades.matches(fiveSpades));\r\n\t}",
"@Test\n\t\t public void InitializeTest1() {\n\t\t\tCard colourNum = new Card(Card.Colour.Blue, 0);\n\t\t\tString expected = \"Blue\";\n\t\t\tString actual = colourNum.getColour();\n\t\t assertEquals(expected, actual);\n\t\t int expectedN = 0;\n\t\t int actualN = colourNum.getNumber();\n\t\t assertEquals(expectedN, actualN);\n\t\t expected = \"none\";\n\t\t actual = colourNum.getAction();\n\t\t assertEquals(expected, actual);\n\t\t expected = null;\n\t\t actual = colourNum.getWild();\n\t\t assertEquals(expected, actual);\n\t\t actualN = colourNum.getValue();\n\t\t assertEquals(expected, actual);\n\t\t }",
"@Test\r\n public void testPlayer_getDumbStrategyCard_differentWinners() {\r\n player2 = new Player(\"\", true);\r\n player2.setHand(strategyHand.getAllCards());\r\n boolean differentLegalCardFound = false;\r\n Card firstDiscard = player2.getDumbStrategyCard(yellowSix, yellowSix.getColor());\r\n for(int i = 0; i < 25; i++) {\r\n Card loopCard = player2.getDumbStrategyCard(yellowSix, yellowSix.getColor());\r\n if(!loopCard.equals(firstDiscard)) {\r\n differentLegalCardFound = true;\r\n }\r\n }\r\n assertTrue(differentLegalCardFound);\r\n }",
"private boolean canPlay(UnoCard topCard, UnoCard newCard) {\n\n\t\t// Color or value matches\n\t\tif (topCard.getColor().equals(newCard.getColor())\n\t\t\t\t|| topCard.getValue().equals(newCard.getValue()))\n\t\t\treturn true;\n\t\t// if chosen wild card color matches\n\t\telse if (topCard instanceof WildCard)\n\t\t\treturn ((WildCard) topCard).getWildColor().equals(newCard.getColor());\n\n\t\t// suppose the new card is a wild card\n\t\telse if (newCard instanceof WildCard)\n\t\t\treturn true;\n\n\t\t// else\n\t\treturn false;\n\t}",
"public boolean canPlace(Card o, String c)\r\n {\r\n if (this.color == c)\r\n return true;\r\n else if (this.value == o.value)\r\n return true;\r\n else if (this.color == \"none\") // Wild cards\r\n return true;\r\n return false;\r\n }",
"public boolean MatchColor(){\n boolean result = false;\n String gameData;\n gameData = DriverStation.getInstance().getGameSpecificMessage();\n if(gameData.length() > 0)\n {\n switch (gameData.charAt(0))\n {\n case 'B' :\n //Blue case code\n result = StopPanelWithColor(kRedTarget);\n break;\n case 'G' :\n //Green case code\n result = StopPanelWithColor(kYellowTarget);\n break; \n case 'R' :\n //Red case code\n result = StopPanelWithColor(kBlueTarget);\n break;\n case 'Y' :\n //Yellow case code\n result = StopPanelWithColor(kGreenTarget);\n break;\n default :\n //This is corrupt data\n break;\n }\n } else {\n //Code for no data received yet\n }\n return result;\n }",
"@Test\n public void getColorTest() {\n assertTrue(red_piece.getColor() == Piece.Color.RED);\n assertTrue(white_piece.getColor() == Piece.Color.WHITE);\n }",
"@Test\n void findDevCard() {\n ArrayList<DevelopmentCardExt> developmentCards= Starter.DevCardParser();\n DashboardExt dashboard= new DashboardExt(developmentCards);\n Random rand= new Random();\n\n for (int i=0; i<48; i++){\n assertNotNull(dashboard.findDevCard(i));\n }\n\n for (int i=48; i<100; i++){\n assertNull(dashboard.findDevCard(i));\n }\n\n\n assertEquals(dashboard.findDevCard(5).getLevel(), Level.ONE);\n assertEquals(dashboard.findDevCard(16).getColor(), ColorDevCard.GREEN);\n\n }",
"public boolean validCardPlay(UnoCard card) {\r\n return card.getColor() == validColor || card.getValue() == validValue;\r\n }",
"@Test\n public void testCardCanPlay_FALSE_VALUE() {\n System.out.println(\"cardCanPlay FALSE VALUE\");\n UnoCard cardSelection = new UnoCard(UnoCardColour.RED, UnoCardValue.TWO);\n UnoCard drawCard = new UnoCard(UnoCardColour.BLUE, UnoCardValue.THREE);\n UnoCardColour wildColour = UnoCardColour.BLUE;\n boolean result = utils.cardCanPlay(cardSelection, drawCard, wildColour);\n assertEquals(false, result);\n }",
"public boolean VerifyHumanChoice(int value){\n String card = handHuman.get(value);\n System.out.print(\"CARD IN VERIFY HUMAN\" + card);\n\n String firstLetter = Character.toString(card.charAt(0));\n String topFirstLetter = Character.toString(topCard.charAt(0));\n\n if(topCard.contains(\"8\")){\n //Can play any card ontop to determine suite\n topCard = card;\n return true;\n }\n\n if(card.contains(\"8\")){\n //valid because 8s are wild cards, human can place it\n topCard = card;\n return true;\n }\n\n //the cards match in suite, doesn't matter what it is\n else if(firstLetter.equals(topFirstLetter)){\n topCard = card;\n return true;\n }\n\n else{\n if(topFirstLetter.equals(\"c\")){\n String temp = topCard.substring(5, topCard.length());\n System.out.println(\"TEMP \" + temp);\n\n if(card.contains(temp)){\n topCard = card;\n return true;\n }\n\n }\n\n else if(topFirstLetter.equals(\"h\")){\n String temp = topCard.substring(6, topCard.length());\n System.out.println(\"TEMP \" + temp);\n\n if(card.contains(temp)){\n topCard = card;\n return true;\n }\n\n }\n\n else if(topFirstLetter.equals(\"d\")){\n String temp = topCard.substring(8, topCard.length());\n System.out.println(\"TEMP \" + temp);\n\n if(card.contains(temp)){\n topCard = card;\n return true;\n }\n\n }\n\n else if(topFirstLetter.equals(\"s\")){\n String temp = topCard.substring(6, topCard.length());\n System.out.println(\"TEMP \" + temp);\n\n if(card.contains(temp)){\n topCard = card;\n return true;\n }\n\n }\n }\n\n //You can't play this card\n return false;\n }",
"public Card()\r\n {\r\n rand = new Random();\r\n value = rand.nextInt(28); \r\n // Assigning value\r\n if (value >= 14) // Check if value is greater than 14 then value = value - 14;\r\n value -= 14;\r\n // Assigning color\r\n rand = new Random();\r\n // Switch statement for assigning different colors\r\n switch(rand.nextInt(4) )\r\n {\r\n case 0: color = \"Red\"; \r\n break;\r\n case 1: color = \"Green\"; \r\n break;\r\n case 2: color = \"Blue\"; \r\n break;\r\n case 3: color = \"Yellow\"; \r\n break;\r\n }\r\n // If the card is a wild card and value is greater than or equal to 13 then none value is assigned to color variable\r\n if (value >= 13)\r\n color = \"none\";\r\n }",
"public abstract void colorChecker(Color c);",
"public UnoCard searchForMatch(UnoCard prev) {\r\n \r\n //case where previous card was a \r\n // special card(wild, or WD4)\r\n if(UnoSpecialCardsV2.unoSpecialCard(prev)) {\r\n //Tests to determine 1) which special card previous was; and\r\n if(UnoSpecialCardsV2.unoCardWild(prev)) {\r\n int unoCardTgtColor = UnoV2.getWildColor();\r\n // 2) does player have a card to match it. \r\n for (int i = hand.handSize()-1; i >=0; i--) {\r\n UnoCard unocard = hand.getCard(i);\r\n if (unocard.getColor() == unoCardTgtColor \r\n || (unocard.getRank() > 24)) { \r\n return hand.popCard(i);\r\n }\r\n }\r\n return null;\r\n \r\n }\r\n // Same comments as above\r\n if(UnoSpecialCardsV2.unoCardWildDrawFour(prev)) {\r\n int unoCardTgtColor = UnoV2.getWildColor();\r\n System.out.println(\"unoCardTgtColor into WD4 SearchForMatch \" \r\n + UnoCard.getColors()[unoCardTgtColor]);\r\n \r\n for (int i = hand.handSize()-1; i >=0;i--) {\r\n UnoCard unocard = hand.getCard(i);\r\n if ((unocard.getColor() == unoCardTgtColor) \r\n || unocard.getRank() > 24) {\r\n return hand.popCard(i); //had problem bug just because I forgot the 'i' in popCard...\r\n }\r\n }\r\n return null;\r\n } \r\n } //end special card prev, search for match\r\n \r\n for (int i = 0; i < hand.handSize(); i++) {\r\n UnoCard unocard = hand.getCard(i);\r\n \r\n/** Runs thru hand looks for regular wild cards, plays \r\n * them first*/\r\n if (unocard.getRank() > 24 && unocard.getRank() < 29) { \r\n return hand.popCard(i); \r\n/** Look for skip,reverse, D2, plays them next */\r\n } else if((unocard.getRank() > 18 && unocard.getRank() < 25) \r\n && UnoCard.unoCardsMatch(unocard, prev)) {\r\n return hand.popCard(i);\r\n }\r\n }\r\n/** After 'filters'\r\n * above, only cases are unocard < 19(normal cards 0 \r\n * to 9} or unocard wild Draw4. \r\n * Sort cards that are not special cards \r\n * or regular wild cards to play highest first \r\n */ \r\n UnoHand.insertionSortUnoHand(hand); \r\n \r\n // search from end of hand as hand sorted ascending\r\n for (int i = hand.handSize() - 1; i >= 0; i--) { \r\n UnoCard unocard = hand.getCard(i);\r\n if (unocard.getRank() <= 19 \r\n && UnoCard.unoCardsMatch(unocard, prev)) {\r\n return hand.popCard(i);\r\n // all else fails, play DrawFour\r\n }else if (unocard.getColor() > 3) { \r\n return hand.popCard(i);\r\n } \r\n }\r\n return null;\r\n }",
"@Test\n public void testMatch() {\n assertMetrics(\"match:1\", \"a\",\"a\");\n assertMetrics(\"match:0.9339\",\"a\",\"a x\");\n assertMetrics(\"match:0\", \"a\",\"x\");\n assertMetrics(\"match:0.9243\",\"a\",\"x a\");\n assertMetrics(\"match:0.9025\",\"a\",\"x a x\");\n\n assertMetrics(\"match:1\", \"a b\",\"a b\");\n assertMetrics(\"match:0.9558\",\"a b\",\"a b x\");\n assertMetrics(\"match:0.9463\",\"a b\",\"x a b\");\n assertMetrics(\"match:0.1296\",\"a b\",\"a x x x x x x x x x x x x x x x x x x x x x x b\");\n assertMetrics(\"match:0.1288\",\"a b\",\"a x x x x x x x x x x x x x x x x x x x x x x x x x x x b\");\n\n assertMetrics(\"match:0.8647\",\"a b c\",\"x x a x b x x x x x x x x a b c x x x x x x x x c x x\");\n assertMetrics(\"match:0.861\", \"a b c\",\"x x a x b x x x x x x x x x x a b c x x x x x x c x x\");\n assertMetrics(\"match:0.4869\",\"a b c\",\"a b x x x x x x x x x x x x x x x x x x x x x x c x x\");\n assertMetrics(\"match:0.4853\",\"a b c\",\"x x a x b x x x x x x x x x x b a c x x x x x x c x x\");\n assertMetrics(\"match:0.3621\",\"a b c\",\"a x b x x x x x x x x x x x x x x x x x x x x x c x x\");\n assertMetrics(\"match:0.3619\",\"a b c\",\"x x a x b x x x x x x x x x x x x x x x x x x x c x x\");\n assertMetrics(\"match:0.3584\",\"a b c\",\"x x a x b x x x x x x x x x x x x x x x x x x x x x c\");\n assertMetrics(\"match:0.3474\",\"a b c\",\"x x a x b x x x x x x x x x x x x x x b x x x b x b x\");\n assertMetrics(\"match:0.3421\",\"a b c\",\"x x a x b x x x x x x x x x x x x x x x x x x x x x x\");\n assertMetrics(\"match:0.305\" ,\"a b c\",\"x x a x b:0.7 x x x x x x x x x x x x x x x x x x x x x x\");\n assertMetrics(\"match:0.2927\",\"a b!200 c\",\"x x a x b:0.7 x x x x x x x x x x x x x x x x x x x x x x\");\n }",
"private boolean is_valid(int x, int y, int proposed_color) {\n\t\tfor (int x1 = 1; x1 <= x; x1++) {\n\t\t\tif (color[x1 - 1][y - 1] == proposed_color)\n\t\t\t\treturn false;\n\t\t}\n\t\tfor (int y1 = 1; y1 <= y; y1++) {\n\t\t\tif (color[x - 1][y1 - 1] == proposed_color)\n\t\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}",
"public void testCOLOUR6() throws Exception {\n\t\tObject retval = execLexer(\"COLOUR\", 125, \"or\", false);\n\t\tObject actual = examineExecResult(org.antlr.gunit.gUnitParser.FAIL, retval);\n\t\tObject expecting = \"FAIL\";\n\n\t\tassertEquals(\"testing rule \"+\"COLOUR\", expecting, actual);\n\t}",
"@Test \n\tpublic void testIfValueisBlackPiece()\n\t{\n \tData d = new Data();\n\t\tassertFalse(d.isWhite(4)); // 4 is the value of one of the black pieces. \n\t}",
"private void checkCorrectColor(String color) {\n List<String> colors = Arrays.asList(COLORS);\n if (!colors.contains(color)) {\n throw new IllegalArgumentException(\"Google Calendar Event color must be one of the specified\");\n }\n }",
"@Test\n public void testNextCardGood() {\n System.out.println(\"nextCardGood\");\n Deck deck = new Deck();\n Card card = deck.nextCard();\n ////since the deck is unshuffled, that last card should be WILDCARD\n assertEquals(CardType.WILDCARD, card.getValue());\n }",
"@Test\n public void testCardCanPlay_TRUE_VALUE() {\n System.out.println(\"cardCanPlay TRUE VALUE\");\n UnoCard cardSelection = new UnoCard(UnoCardColour.RED, UnoCardValue.TWO);\n UnoCard drawCard = new UnoCard(UnoCardColour.BLUE, UnoCardValue.TWO);\n UnoCardColour wildColour = UnoCardColour.BLUE;\n boolean result = utils.cardCanPlay(cardSelection, drawCard, wildColour);\n assertEquals(true, result);\n }",
"protected int verify(Node<T> u) {\n\t\tif (u == nil)\n\t\t\treturn u.colour;\n\t\tif (u.colour < red || u.colour > black)\n\t\t\tthrow new AssertionError(\"Invalid color: \" + u.colour);\n\t\tif (u.colour == red)\n\t\t\tif (u.left.colour == red || u.right.colour == red)\n\t\t\t\tthrow new AssertionError(\"red-red edge found\");\n\t\tif (u.right.colour == red && u.left.colour != red)\n\t\t\tthrow new AssertionError(\"non-left-leaning node found\");\n\t\tint dl = verify(u.left);\n\t\tint dr = verify(u.right);\n\t\tif (dl != dr)\n\t\t\tthrow new AssertionError(\"black-height property violated\");\n\t\treturn dl + u.colour;\n\t}",
"public boolean canUseCard(Card card) {\r\n\t\tif (card.cardColor.contains(CardColor.GREEN)\r\n\t\t\t\t|| card.cardColor.contains(CardColor.GREY)) {\r\n\t\t\treturn false;\r\n\t\t} else if (this.blackTurns > 0) {\r\n\t\t\treturn true;\r\n\t\t} else if (card.cardColor.contains(CardColor.PURPLE)\r\n\t\t\t\t&& this.purpleTurns > 0) {\r\n\t\t\treturn true;\r\n\t\t} else if (card.cardColor.contains(CardColor.RED) && this.redTurns > 0) {\r\n\t\t\treturn true;\r\n\t\t} else if (card.cardColor.contains(CardColor.BLUE)\r\n\t\t\t\t&& this.blueTurns > 0) {\r\n\t\t\treturn true;\r\n\t\t} else if (card.cardColor.contains(CardColor.BROWN)\r\n\t\t\t\t&& this.brownTurns > 0) {\r\n\t\t\treturn true;\r\n\t\t} else\r\n\t\t\treturn false;\r\n\t}",
"void testColorChecker(Tester t) {\r\n initData();\r\n Cell topLeft = (Cell) this.game7.indexHelp(0, 0);\r\n Cell topRight = (Cell) this.game7.indexHelp(1, 0);\r\n Cell botLeft = (Cell) this.game7.indexHelp(0, 1);\r\n Cell botRight = (Cell) this.game7.indexHelp(1, 1);\r\n t.checkExpect(topLeft.flooded, true);\r\n t.checkExpect(topRight.flooded, false);\r\n t.checkExpect(botLeft.flooded, false);\r\n t.checkExpect(botRight.flooded, false);\r\n\r\n topRight.colorChecker(topLeft.color);\r\n t.checkExpect(topRight.flooded, true);\r\n t.checkExpect(botRight.flooded, true);\r\n t.checkExpect(botLeft.flooded, false);\r\n t.checkExpect(topLeft.flooded, true);\r\n }",
"private String printColorError(List<Card> hand, Card upCard,\n UnoPlayer.Color calledColor, ArrayList<Integer> validPlays,\n UnoPlayer.Color newColor)\n {\n String s = \"\";\n s += \"Whoops -- your callColor() method has an error!\\n\";\n s += \"You were given this hand:\\n\";\n for (int i = 0; i < hand.size(); i++)\n {\n s += \" \" + i + \". \" + hand.get(i) + \"\\n\";\n }\n\n s += \"and the up card was: \" + upCard + \"\\n\";\n if (upCard.getRank() == UnoPlayer.Rank.WILD\n || upCard.getRank() == UnoPlayer.Rank.WILD_D4)\n {\n s += \"and the called color was: \" + calledColor + \"\\n\";\n }\n s += \"and you (wrongly) returned \" + newColor + \".\\n\";\n return s;\n }",
"private void checkCardMatch(Card card1, Card card2) {\n if(card1.getColor().getColor() == card2.getColor().getColor()){\n card1.setCardState(CardState.MATCHED);\n card2.setCardState(CardState.MATCHED);\n\n playerManager.incrementScore();\n } else{\n card1.flipCard();\n card2.flipCard();\n }\n cardsClicked = new Card[2];\n switchPlayer();\n setRandomColors();\n checkGameOver();\n }",
"public void testCOLOUR4() throws Exception {\n\t\tObject retval = execLexer(\"COLOUR\", 123, \"azure\", false);\n\t\tObject actual = examineExecResult(org.antlr.gunit.gUnitParser.OK, retval);\n\t\tObject expecting = \"OK\";\n\n\t\tassertEquals(\"testing rule \"+\"COLOUR\", expecting, actual);\n\t}",
"public void testCanPlayOn() {\n \n DrawCard redDraw2 = new DrawCard(Card.COLOUR_RED, 2);\n \n // create another 4 normal cards\n \n Card card1 = new Card(Card.COLOUR_BLUE, 5);\n Card card2 = new Card(Card.COLOUR_BLUE,2);\n \n //card 1 and card 2 should yield false on the method\n assertFalse(redDraw2.canPlayOn(card1));\n assertFalse(redDraw2.canPlayOn(card2));\n \n Card card3 = new Card(Card.COLOUR_RED, 5);\n Card card4 = new Card(Card.COLOUR_RED,2);\n \n // card 3 and card 4 should gives true\n \n assertTrue(redDraw2.canPlayOn(card3));\n assertTrue(redDraw2.canPlayOn(card4));\n \n }",
"@Test\n public void getDeckTest3() {\n GenericStandardDeckGame g = new GenericStandardDeckGame();\n List<Card> deck = g.getDeck();\n String s = \"♣♦♥♠\";\n for (char ch : s.toCharArray()) {\n int counter = 0;\n for (Card c : deck) {\n if (c.getSuit().getValue() == ch) {\n counter++;\n }\n }\n assertEquals(counter, 13);\n }\n }",
"@Test\n public void testIsValidTap() {\n setUpCorrect();\n assertTrue(boardManager.isValidTap(11));\n assertTrue(boardManager.isValidTap(14));\n assertFalse(boardManager.isValidTap(10));\n }",
"@Test //TEST FOUR\n void testLowercaseBlackColor()\n {\n Rabbit_RegEx rabbit_color = new Rabbit_RegEx();\n rabbit_color.setIsBaby(true);\n rabbit_color.setWeight(2);\n rabbit_color.setAge(4);\n rabbit_color.setColor(\"black\");\n String expected = \"Is the rabbit a baby?: true\\n\" +\n \"How old is the rabbit?: 4 weeks\\n\" +\n \"Weight: 2.0 in ounces\\n\" +\n \"Color: black\";\n assertEquals(expected, rabbit_color.toString());\n }",
"@Test\n public void testShuffleGood() {\n System.out.println(\"shuffleGood\");\n Deck deck = new Deck();\n boolean shuffled = false;\n deck.shuffle();\n //we take out one card from the deck\n Card lastCard = deck.nextCard();\n //we take out 58 more cards\n for (int i =0 ; i<57;i++)\n {\n deck.nextCard();\n }\n //we take out the last card from the deck\n Card firstCard = deck.nextCard();\n \n //if both cards = the same value they were before being shuffled, then test will fail.\n if (lastCard.getValue() != CardType.WILDCARD )\n shuffled = true;\n else if (firstCard.getValue()!=CardType.ZERO)\n shuffled = true;\n \n //if either of the cards are different, that means the deck was shuffled and the test will pass\n assertEquals(true, shuffled);\n }",
"public boolean isValid() {\n //valid melds must have 3+ tile\n if (tiles.size() < 3) {\n //System.out.println(\"fail 1\");\n return false;\n }\n if (tiles.get(0).getColour() == tiles.get(1).getColour() &&\n\t\t\ttiles.get(0).getValue() != tiles.get(1).getValue()) { //test a run\n\t\t\tif (this.size() > 13) {\n //System.out.println(\"fail 2\");\n return false;\n }\n for (int i=1; i<tiles.size(); i++) {\n if (tiles.get(i).getColour() != tiles.get(0).getColour()) { //make sure all are same colour\n //System.out.println(\"fail 3\");\n return false;\n }\n if (tiles.get(i).getValue() != (tiles.get(0).getValue() + i)) { //make sure all values make a run\n //System.out.println(\"fail 4\");\n return false;\n }\n }\n } else { //test a set\n Set<Character> colours = new HashSet<>();\n for (int i=0; i<tiles.size(); i++) {\n if (tiles.get(i).getValue() != tiles.get(0).getValue()) { //all are same value\n //System.out.println(\"fail 5\");\n\t\t\t\t\treturn false;\n }\n\n if (colours.contains(tiles.get(i).getColour()) && tiles.get(i).getColour() != 'J') { //check for duplicate colours\n //System.out.println(\"fail 6\");\n\t\t\t\t\treturn false;\n } else {\n\t\t\t\t\tcolours.add(tiles.get(i).getColour()); //keep track of all the colours this set has\n }\n }\n if (this.size() > 4) { //only possible if there are 5 cards, including a joker\n //System.out.println(\"fail 7\");\n\t\t\t\treturn false;\n }\n }\n\n return true; \n }",
"public void testCOLOUR2() throws Exception {\n\t\tObject retval = execLexer(\"COLOUR\", 121, \"sable\", false);\n\t\tObject actual = examineExecResult(org.antlr.gunit.gUnitParser.OK, retval);\n\t\tObject expecting = \"OK\";\n\n\t\tassertEquals(\"testing rule \"+\"COLOUR\", expecting, actual);\n\t}",
"public void testCOLOUR5() throws Exception {\n\t\tObject retval = execLexer(\"COLOUR\", 124, \"purpure\", false);\n\t\tObject actual = examineExecResult(org.antlr.gunit.gUnitParser.OK, retval);\n\t\tObject expecting = \"OK\";\n\n\t\tassertEquals(\"testing rule \"+\"COLOUR\", expecting, actual);\n\t}",
"public boolean sameColor(Card card) {\r\n boolean isSameColor = false;\r\n if (card.getColor().equals(color)) {\r\n isSameColor = true;\r\n }\r\n return isSameColor;\r\n }",
"@Test\n @Disabled\n public void testValidateMatriculaCoche() {\n assertFalse(RegExprMain.validateMatriculaCoche(\"543 JTD\"));\n assertTrue(RegExprMain.validateMatriculaCoche(\"5432 JTD\"));\n assertFalse(RegExprMain.validateMatriculaCoche(\"5433 JAD\"));\n assertFalse(RegExprMain.validateMatriculaCoche(\"54333 JTD\"));\n assertTrue(RegExprMain.validateMatriculaCoche(\"5432 JTD\"));\n assertTrue(RegExprMain.validateMatriculaCoche(\"6784 CLD\"));\n assertTrue(RegExprMain.validateMatriculaCoche(\"4563 BVB\"));\n assertTrue(RegExprMain.validateMatriculaCoche(\"6789 LMN\"));\n assertTrue(RegExprMain.validateMatriculaCoche(\"2435 JKD\"));\n assertTrue(RegExprMain.validateMatriculaCoche(\"4567 GJD\"));\n \n\n }",
"@Test\n public void isGameOverNoRed()\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 = 8 - 3; y < 8; 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(0));\n assertThat(environment.getTokenCountFor(CheckersTeam.WHITE), is(12));\n\n final CheckersAdjudicator adjudicator = injector.injectAdjudicator();\n\n // Run / Verify.\n assertTrue(adjudicator.isGameOver(environment));\n }",
"boolean isAllowed(int rgb, float[] hsl);",
"@Test\n\tpublic void verifyCombosOnBoard() {\n\t\tBoard board = boardFactory.fromTextGenerateBoard(\"/boards/1LineOf3.txt\", mockGroup);\n\t\tassertFalse(board.outOfMoves());\n\n\t}",
"boolean isMismatch(double score);",
"void testRandColor(Tester t) {\r\n initData();\r\n t.checkExpect(this.game2.randColor(), Color.ORANGE);\r\n t.checkExpect(this.game3.randColor(), Color.RED);\r\n t.checkExpect(this.game5.randColor(), Color.PINK);\r\n }",
"@Test\n public void testGetColor() {\n assertEquals(r1.getColor(), new Color(255, 0, 0));\n assertEquals(r2.getColor(), new Color(255, 255, 255));\n assertEquals(r3.getColor(), new Color(255, 255, 0));\n assertEquals(r4.getColor(), new Color(200, 150, 133));\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 }",
"private void testHand(List<Card> hand, Card upCard,\n UnoPlayer.Color calledColor, ArrayList<Integer> validPlays, int n)\n {\n int cardPlayed = thePlayer.play(hand, upCard, calledColor,\n new GameState(upCard));\n\n if (!validPlays.contains(new Integer(cardPlayed)))\n {\n String error = printCardError(hand, upCard, calledColor,\n validPlays, cardPlayed);\n fail(\"Failed test \" + n + \".\\n\" + error);\n }\n\n UnoPlayer.Color color = thePlayer.callColor(hand);\n\n if (color != UnoPlayer.Color.RED && color != UnoPlayer.Color.BLUE\n && color != UnoPlayer.Color.GREEN\n && color != UnoPlayer.Color.YELLOW)\n {\n String error = printColorError(hand, upCard, calledColor,\n validPlays, color);\n fail(\"Failed test \" + n + \".\\n\" + error);\n }\n\n }",
"@Test\n\t\t public void InitializeTest2() {\n\t\t\tCard colourAction = new Card(Card.Colour.Red, Card.Action.Draw2);\n\t\t\tString expected = \"Red\";\n\t\t\tString actual = colourAction.getColour();\n\t\t assertEquals(expected, actual);\n\t\t int expectedN = -10;\n\t\t int actualN = colourAction.getNumber();\n\t\t assertEquals(expectedN, actualN);\n\t\t expected = \"Draw2\";\n\t\t actual = colourAction.getAction();\n\t\t assertEquals(expected, actual);\n\t\t expected = null;\n\t\t actual = colourAction.getWild();\n\t\t assertEquals(expected, actual);\n\t\t expectedN = 20;\n\t\t actualN = colourAction.getValue();\n\t\t assertEquals(expected, actual);\n\t\t }",
"boolean matches(String medium, CSSCanvas canvas);",
"public static Card of(Color color) {\n if (color == null){\n return LOCOMOTIVE;\n } else{\n switch (color) {\n case BLACK: return BLACK;\n case VIOLET: return VIOLET;\n case BLUE: return BLUE;\n case GREEN: return GREEN;\n case YELLOW: return YELLOW;\n case ORANGE: return ORANGE;\n case RED: return RED;\n case WHITE: return WHITE;\n default: throw new Error();\n }\n }\n }",
"public void testCOLOUR7() throws Exception {\n\t\tObject retval = execLexer(\"COLOUR\", 126, \"blue\", false);\n\t\tObject actual = examineExecResult(org.antlr.gunit.gUnitParser.FAIL, retval);\n\t\tObject expecting = \"FAIL\";\n\n\t\tassertEquals(\"testing rule \"+\"COLOUR\", expecting, actual);\n\t}",
"public boolean checkColorValue(String valueCombo) {\r\n\t\tString Storedvalue = valueCombo.substring(0,1);\r\n\t\tint storeValueInt = Integer.parseInt(Storedvalue);\r\n\t\tint[] colorValues = getScreenColor(lifeGlobe.getPosition().get(9 - storeValueInt).get(1), \r\n\t\t\t\tlifeGlobe.getPosition().get(9 - storeValueInt).get(0));\r\n\t\tdouble dist = calcDist(colorValues);\r\n\r\n\t\t\r\n\t\t// I might wanna rework this because it dont work 100% of the times\r\n\t\tif(dist < 40){\r\n\t\t\tfc.playSound();\r\n\t\t}\r\n\t\t\r\n\t\r\n\t\treturn false;\r\n\t\r\n\t\t/*\r\n\t\tif(colorValues[0] != 186.0 && colorValues[0] != 91.0){\r\n\t\t\tif(colorValues[1] != 149.0 && colorValues[1] != 70.0){\r\n\t\t\t\tif(colorValues[1] != 107.0 && colorValues[1] != 45.0){\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\r\n\t\t\r\n\t\t}\r\n\t\t*/\r\n\t}",
"public boolean CheckForUnwinnableCondition(){\n int humanSize = GetSizeOfHumanHand();\n int computerSize = GetSizeOfComputerHand();\n\n for(int i = 0; i < humanSize; i++) {\n //Human can play a card\n String card = handHuman.get(i);\n\n String firstLetter = Character.toString(card.charAt(0));\n String topFirstLetter = Character.toString(topCard.charAt(0));\n\n if (topCard.contains(\"8\")) {\n //Can play any card ontop to determine suite\n return true;\n }\n\n if (card.contains(\"8\")) {\n //valid because 8s are wild cards, human can place it\n return true;\n }\n\n //the cards match in suite, doesn't matter what it is\n else if (firstLetter.equals(topFirstLetter)) {\n return true;\n }\n\n else {\n if (topFirstLetter.equals(\"c\")) {\n String temp = topCard.substring(5, topCard.length());\n\n if (card.contains(temp)) {\n return true;\n }\n\n } else if (topFirstLetter.equals(\"h\")) {\n String temp = topCard.substring(6, topCard.length());\n\n if (card.contains(temp)) {\n return true;\n }\n\n } else if (topFirstLetter.equals(\"d\")) {\n String temp = topCard.substring(8, topCard.length());\n\n if (card.contains(temp)) {\n return true;\n }\n\n } else if (topFirstLetter.equals(\"s\")) {\n String temp = topCard.substring(6, topCard.length());\n\n if (card.contains(temp)) {\n return true;\n }\n }\n }\n }\n\n for(int i = 0; i < computerSize; i++){\n //Human can play a card\n String card = handComputer.get(i);\n\n String firstLetter = Character.toString(card.charAt(0));\n String topFirstLetter = Character.toString(topCard.charAt(0));\n\n if (topCard.contains(\"8\")) {\n //Can play any card ontop to determine suite\n return true;\n }\n\n if (card.contains(\"8\")) {\n //valid because 8s are wild cards, human can place it\n return true;\n }\n\n //the cards match in suite, doesn't matter what it is\n else if (firstLetter.equals(topFirstLetter)) {\n return true;\n }\n\n else {\n if (topFirstLetter.equals(\"c\")) {\n String temp = topCard.substring(5, topCard.length());\n\n if (card.contains(temp)) {\n return true;\n }\n\n } else if (topFirstLetter.equals(\"h\")) {\n String temp = topCard.substring(6, topCard.length());\n\n if (card.contains(temp)) {\n return true;\n }\n\n } else if (topFirstLetter.equals(\"d\")) {\n String temp = topCard.substring(8, topCard.length());\n\n if (card.contains(temp)) {\n return true;\n }\n\n } else if (topFirstLetter.equals(\"s\")) {\n String temp = topCard.substring(6, topCard.length());\n\n if (card.contains(temp)) {\n return true;\n }\n }\n }\n }\n\n //Human and computer can't play a card\n return false;\n }",
"public boolean testColourcomponents(EIfcpixeltexture type) throws SdaiException;",
"@Test\n\tpublic void testCreateEmptyCarColor() {\n\t\tCarFactory _carFactory = new CarFactory();\n\n\t\tCarType _carType = CarType.valueOf((\"coupe\".toUpperCase()));\n\t\tString _make = \"BMW\";\n\t\tString _model = \"Z4\";\n\t\tString _color = \"\";\n\t\tint _year = 1990;\n\n\t\t// ---------------------------------------------\n\t\t// Creating an empty color car.\n\t\ttry {\n\t\t\t@SuppressWarnings(\"unused\")\n\t\t\tAbstractCar _unknown = _carFactory.buildCar(_carType, _make, _model, _color, _year);\n\n\t\t\tfail(\"Successfully created an invalid car (should not work).\");\n\t\t} catch (Exception expected_) {\n\n\t\t}\n\t}",
"@Test\r\n public void testIsValidTap() {\r\n assertTrue(boardManager3.isValidTap(7));\r\n assertTrue(boardManager3.isValidTap(5));\r\n assertFalse(boardManager3.isValidTap(0));\r\n }",
"private boolean isBlack(Color color){\r\n return color == Color.black;\r\n }",
"@Test\r\n public void testPlayer_getCautiousStrategyCardCard_higherFirst_drawTwo() {\n player2 = new Player(\"Player Two\", true);\r\n player2.setHand(strategyHand.getAllCards());\r\n\r\n // let the cpc be a red nine\r\n // get rid of the wild and wd4 cards so the red draw two is the most attractive option\r\n player2.getHand().discard(wild);\r\n player2.getHand().discard(wildDrawFour);\r\n Card redNine = new Card(Card.RED, Card.NINE, cvm);\r\n assertTrue(player2.getCautiousStrategyCard(redNine, redNine.getColor()).equals(redDrawTwo));\r\n }",
"@Test\r\n public void testPlayer_getCautiousStrategyCardCard_higherFirst_wd4() {\n player2 = new Player(\"Player Two\", true);\r\n player2.setHand(strategyHand.getAllCards());\r\n\r\n // get rid of the wild so the wd4 is the most attractive option\r\n player2.getHand().discard(wild);\r\n assertTrue(player2.getCautiousStrategyCard(yellowThree, yellowThree.getColor()).equals(wildDrawFour));\r\n }",
"public static boolean validateCard(String[] args) {\n return true;\n }",
"int canon_600_color (int ratio[], int mar)\n{\n int clipped=0, target, miss;\n\n if (flash_used != 0.0) {\n if (ratio[1] < -104)\n { ratio[1] = -104; clipped = 1; }\n if (ratio[1] > 12)\n { ratio[1] = 12; clipped = 1; }\n } else {\n if (ratio[1] < -264 || ratio[1] > 461) return 2;\n if (ratio[1] < -50)\n { ratio[1] = -50; clipped = 1; }\n if (ratio[1] > 307)\n { ratio[1] = 307; clipped = 1; }\n }\n target = flash_used != 0.0 || ratio[1] < 197\n\t? -38 - (398 * ratio[1] >> 10)\n\t: -123 + (48 * ratio[1] >> 10);\n if (target - mar <= ratio[0] &&\n target + 20 >= ratio[0] && clipped == 0) return 0;\n miss = target - ratio[0];\n if ( Math.abs(miss) >= mar*4) return 2;\n if (miss < -20) miss = -20;\n if (miss > mar) miss = mar;\n ratio[0] = target - miss;\n return 1;\n}",
"public static boolean validColor(String code) {\n\n String colorCode = \"(1?\\\\d{1,2}|2[0-4]\\\\d|25[0-5])\";\n String transparency = \"([0-1]|(\\\\.\\\\d*)|[0-1](\\\\.\\\\d*))\";\n Matcher rgb = Pattern.compile(\"rgb\\\\(\" +\n \"(\" + colorCode + \",){2}\" + colorCode +\n \"\\\\)\").matcher(code);\n Matcher rgba = Pattern.compile(\"rgba\\\\(\" +\n \"(\" + colorCode + \",){3}\" + transparency +\n \"\\\\)\").matcher(code);\n return rgb.matches() || rgba.matches();\n }",
"@SmallTest\n\tpublic void testBadMatchPenalty() {\n\t\tbadMatch();\n\t\tassertEquals((Integer) (START_SCORE - BAD_MATCH_PENALTY), Integer.valueOf(solo.getText(1).getText().toString()));\n\t}",
"public static interface CardColors{\n public static final Color RGBA_0 = new Color(0xCCC0B3FF);\n public static final Color RGBA_2 = new Color(0xEEE4DAFF);\n public static final Color RGBA_4 = new Color(0xEDE0C8FF);\n public static final Color RGBA_8 = new Color(0xF2B179FF);\n public static final Color RGBA_16 = new Color(0xF49563FF);\n public static final Color RGBA_32 = new Color(0xF5794DFF);\n public static final Color RGBA_64 = new Color(0xF55D37FF);\n public static final Color RGBA_128 = new Color(0xEEE863FF);\n public static final Color RGBA_256 = new Color(0xEDB04DFF);\n public static final Color RGBA_512 = new Color(0xECB04DFF);\n public static final Color RGBA_1024 = new Color(0xEB9437FF);\n public static final Color RGBA_2048 = new Color(0xEA7821FF);\n }",
"@Test\n public void checkValidityTest2() {\n GenericStandardDeckGame g = new GenericStandardDeckGame();\n List<Card> deck = g.getDeck();\n deck.set(32, new Card(Card.number.four, Card.suit.club));\n assert (!g.checkValidity(deck));\n }",
"protected boolean canChoose(int n, Board gameBoard) {\n Card chosenCard = myCards.get(n);// get the chosenCard\n Card groundCard = gameBoard.getGroundCard();\n if (chosenCard.getColor() == groundCard.getColor()) { // if they had same color\n return true;\n }\n if (chosenCard instanceof NumericCard && groundCard instanceof NumericCard) {// if they had same number\n NumericCard tempChosen = (NumericCard) chosenCard; // change the static type\n NumericCard tempground = (NumericCard) groundCard; // change the static type\n if (tempChosen.getNumber() == tempground.getNumber()) {\n return true;\n }\n }\n\n if (groundCard.getClass().equals(chosenCard.getClass()) && !(groundCard instanceof NumericCard)\n && !(chosenCard instanceof NumericCard)) {// if they were sameInstance\n return true;\n }\n return false;\n }",
"public boolean CheckIfCardPlayedIsValid(UNOCard aCard) {\n\t\t\n\t\tif (discardPile.size() == 0) {\n\t\t\tdiscardPile.add(aCard);\n\t\t\treturn true;\n\t\t}\n\t\telse if (discardPile.get(discardPile.size() - 1).getName() == aCard.getName()) { // If card has the same value as last card played it is valid\n\t\t\tdiscardPile.add(aCard);\n\t\t\tcurrentTurnColor = aCard.getColor();\n\t\t\tif (aCard.getName() == \"Skip\" || aCard.getName() == \"Reverse\" || aCard.getName() == \"Draw Two\") { //if it is a special card it needs to have the action performed\n\t\t\t\tSpecialCardAction(aCard);\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\telse if (currentTurnColor == aCard.getColor()) { // if card is the same color as last card played's color it is valid\n\t\t\tdiscardPile.add(aCard);\n\t\t\tif (aCard.getName() == \"Skip\" || aCard.getName() == \"Reverse\" || aCard.getName() == \"Draw Two\") { //if it is a special card it needs to have the action performed\n\t\t\t\tSpecialCardAction(aCard);\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\telse if (aCard.getName() == \"Wild\" || aCard.getName() == \"Wild Draw Four\") { // if it is a wild or wild draw four card it is valid and performs its special action\n\t\t\tSpecialCardAction(aCard);\n\t\t\tdiscardPile.add(aCard);\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}",
"public static boolean checkSequence(String cards){\r\n //split all the cards and store in card array\r\n String[] cardArray = cards.split(\",\");\r\n //convert card array into card object arrayList\r\n ArrayList<Card> cardList = new ArrayList<Card>();\r\n int numCards = cardArray.length;\r\n //if there is less than 3 cards eliminate deck\r\n if(numCards < 3) return false;\r\n //store suit and face value in card object\r\n for(int i=0;i<numCards;i++){\r\n Card c = new Card(cardArray[i].split(\"#\")[0].trim(),cardArray[i].split(\"#\")[1].trim());\r\n cardList.add(c);\r\n }\r\n int i=0;\r\n String cardSuit=\"\",nextCardSuit=\"\";\r\n int cardValue=-1,nextCardValue=-1,prevCardValue = -1;\r\n \r\n //loop till penultimate card\r\n for(i=0; i<numCards-1 ;i++){ \r\n \r\n cardValue = cardList.get(i).value;\r\n nextCardValue = cardList.get(i+1).value;\r\n cardSuit = cardList.get(i).suit;\r\n nextCardSuit = cardList.get(i+1).suit;\r\n \r\n //suit check\r\n if(!cardSuit.equals(nextCardSuit)) return false;\r\n \r\n //card check\r\n if(cardValue != nextCardValue-1){\r\n \r\n //exception only for queen followed by king followed by ace\r\n if(!(prevCardValue==11 && cardValue == 12 && nextCardValue ==0)){\r\n return false;\r\n }\r\n }\r\n //execption for king followed by ace followed by 2\r\n if(prevCardValue == 12 && cardValue == 0 && nextCardValue==1) return false;\r\n prevCardValue = cardValue;\r\n }\r\n \r\n return true;\r\n }",
"@Test\n public void NineAndMissExpected_90(){\n String input = \"9-9-9-9-9-9-9-9-9-9-\";\n assertEquals(game.scoreOfGame(input),90);\n }",
"@Test\n public void shouldReturnValidBoardLayouts()\n {\n String[] layout = DatabaseHelper.getBoardLayout();\n int expectedRs = (layout[0].equals(\"R\")) ? 9 : 8;\n int expectedBs = (layout[0].equals(\"B\")) ? 9 : 8;\n int expectedCs = 7;\n int expectedA = 1;\n boolean validLayout = true;\n\n // Functional method to count instances of char in string take from: https://stackoverflow.com/a/23906674/1585599\n\n if(layout[1].chars().filter(num -> num == 'R').count() != expectedRs)\n {\n validLayout = false;\n System.out.println(\"Wrong number of Rs.\");\n }\n\n if(layout[1].chars().filter(num -> num == 'B').count() != expectedBs)\n {\n validLayout = false;\n System.out.println(\"Wrong number of Bs.\");\n }\n\n if(layout[1].chars().filter(num -> num == 'C').count() != expectedCs)\n {\n validLayout = false;\n System.out.println(\"Wrong number of Cs.\");\n }\n\n if(layout[1].chars().filter(num -> num == 'A').count() != expectedA)\n {\n validLayout = false;\n System.out.println(\"Wrong number of A.\");\n }\n\n assertTrue(validLayout);\n }",
"public boolean anyValid(OthelloPiece colour){\n boolean valid = false;\n for(int i=0; i<WIDTH;i++){\n for(int j=0;j<HEIGHT;j++){\n if(anyMove(i,j,colour)){\n valid = true;\n }\n } \n }\n clearPieces();\n return valid;\n }",
"public void addCard() {\n for (int i = 0; i < 4; i++) {\n cards.add(new Wild());\n cards.add(new WildDrawFour());\n }\n for (Color color : Color.values())\n cards.add(new NumberCard(color.name(),0));\n for (Color color : Color.values()) {\n for (int i = 0; i < 2; i++) {\n for (int j = 1; j < 10; j++)\n cards.add(new NumberCard(color.name(),j));\n cards.add(new DrawTwo(color.name()));\n cards.add(new Reverse(color.name()));\n cards.add(new Skip(color.name()));\n }\n }\n }",
"public void testCOLOUR3() throws Exception {\n\t\tObject retval = execLexer(\"COLOUR\", 122, \"vert\", false);\n\t\tObject actual = examineExecResult(org.antlr.gunit.gUnitParser.OK, retval);\n\t\tObject expecting = \"OK\";\n\n\t\tassertEquals(\"testing rule \"+\"COLOUR\", expecting, actual);\n\t}",
"private boolean checkMatch(InventoryCrafting inventoryCrafting,IInventory schematic, int par2, int par3, boolean par4) {\r\n\t\tfor (int k = 0; k < 5; ++k) {\r\n\t\t\tfor (int l = 0; l < 5; ++l) {\r\n\t\t\t\tint i1 = k - par2;\r\n\t\t\t\tint j1 = l - par3;\r\n\t\t\t\tItemStack itemstack = null;\r\n\r\n\t\t\t\tif (i1 >= 0 && j1 >= 0 && i1 < this.recipeWidth && j1 < this.recipeHeight) {\r\n\t\t\t\t\tif (par4) {\r\n\t\t\t\t\t\titemstack = this.recipeItems[this.recipeWidth - i1 - 1 + j1 * this.recipeWidth];\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\titemstack = this.recipeItems[i1 + j1 * this.recipeWidth];\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tItemStack itemstack1 = inventoryCrafting.getStackInRowAndColumn(k, l);\r\n\r\n\t\t\t\tif (itemstack1 != null || itemstack != null) {\r\n\t\t\t\t\tif (itemstack1 == null && itemstack != null || itemstack1 != null && itemstack == null) {\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (itemstack.getItem() != itemstack1.getItem()) {\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (itemstack.getItemDamage() != 32767 && itemstack.getItemDamage() != itemstack1.getItemDamage()) {\r\n\t\t\t\t\t\treturn 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\t// for debugging\r\n\t\t/* if(schematicTypeNeeded != null)\r\n\t\t * System.out.println(schematicTypeNeeded.getUnlocalizedName());\r\n\t\t * else System.out.println(\"null type needed\"); */\r\n\r\n\t\t// if there is no specilness needed, just return true\r\n\t\tif (schematicTypeNeeded == null) return true;\r\n\r\n\t\tItemStack schematicStack = schematic.getStackInSlot(0);\r\n\t\t\r\n\t\tif (schematicStack == null) return false;\r\n\r\n\t\tSystem.out.println(schematicStack.getUnlocalizedName());\r\n\r\n\t\tSystem.out.println(\"[NausicaaMod] block that needs schematic\");\r\n\r\n\t\tif (!schematicStack.hasTagCompound()) {\r\n\t\t\tSystem.out.println(\"[NausicaaMod] crafting canceled: no tags\");\r\n\t\t\treturn false;\r\n\r\n\t\t} else if (!SchematicHolder.getCanCraft(schematicStack, schematicTypeNeeded)) {\r\n\t\t\tSystem.out.println(\"[NausicaaMod] crafting canceled\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\r\n\t}",
"@Test\n public void testVictoryRed(){\n for (Cell c: modelTest.grid) {\n if (c.getX() == 6)\n c.setColor(Color.RED);\n }\n\n modelTest.researchVictory(1,0);\n Color winnerTest = modelTest.getWinner();\n\n Assert.assertEquals(winnerTest,Color.RED);\n }",
"@Test\n public void test000_collision_scheme() {\n HashTableADT htIntegerKey = new HashTable<Integer, String>();\n int scheme = htIntegerKey.getCollisionResolution();\n if (scheme < 1 || scheme > 9)\n fail(\"collision resolution must be indicated with 1-9\");\n }",
"private boolean isSquareQuantityValid() {\n int blueSquares = 0;\n int yellowSquares = 0;\n int greenSquares = 0;\n int whiteSquares = 0;\n int orangeSquares = 0;\n int redSquares = 0;\n\n for (RubiksFace face : rubiksFaceList) {\n for (RubiksColor color : face.getRubiksColors()) {\n switch(color) {\n case RED:\n redSquares++;\n break;\n case GREEN:\n greenSquares++;\n break;\n case BLUE:\n blueSquares++;\n break;\n case YELLOW:\n yellowSquares++;\n break;\n case ORANGE:\n orangeSquares++;\n break;\n case WHITE:\n whiteSquares++;\n break;\n }\n }\n }\n\n System.out.println(\"BLUE: \" + blueSquares);\n System.out.println(\"YELLOW: \" + yellowSquares);\n System.out.println(\"GREEN: \" + greenSquares);\n System.out.println(\"WHITE: \" + whiteSquares);\n System.out.println(\"ORANGE: \" + orangeSquares);\n System.out.println(\"RED: \" + redSquares);\n\n return (blueSquares == 9 && yellowSquares == 9 && greenSquares == 9 && whiteSquares == 9 && orangeSquares == 9 && redSquares == 9);\n }"
] | [
"0.7586943",
"0.7304255",
"0.7197761",
"0.6856518",
"0.68447196",
"0.641441",
"0.63702893",
"0.635899",
"0.62785953",
"0.620228",
"0.61442393",
"0.6120811",
"0.60796154",
"0.6073282",
"0.60570556",
"0.60495806",
"0.598328",
"0.5948798",
"0.5928809",
"0.58349645",
"0.581146",
"0.57993054",
"0.57556224",
"0.57439524",
"0.5742469",
"0.57095134",
"0.5699321",
"0.56981003",
"0.5697217",
"0.56867665",
"0.55876553",
"0.5577436",
"0.55157804",
"0.5472462",
"0.5472339",
"0.5460631",
"0.5455472",
"0.54465437",
"0.5444057",
"0.5433463",
"0.5422843",
"0.54224455",
"0.541657",
"0.54135674",
"0.5391506",
"0.5381872",
"0.5375684",
"0.5368445",
"0.5361737",
"0.53505385",
"0.53492194",
"0.534776",
"0.5341934",
"0.5338081",
"0.5337113",
"0.5333767",
"0.5317244",
"0.5316291",
"0.5316289",
"0.53112364",
"0.53012943",
"0.52977884",
"0.5290036",
"0.5283628",
"0.52774477",
"0.5271891",
"0.52648693",
"0.5261066",
"0.5258244",
"0.5252944",
"0.52481395",
"0.5238066",
"0.5237898",
"0.5237786",
"0.52369595",
"0.5232406",
"0.52233434",
"0.5211242",
"0.5211013",
"0.5207063",
"0.52063286",
"0.5205824",
"0.51939124",
"0.5186884",
"0.5185716",
"0.5184572",
"0.51794946",
"0.5173218",
"0.51729476",
"0.51722205",
"0.5165574",
"0.51642835",
"0.51625204",
"0.515818",
"0.51581055",
"0.51531863",
"0.5149721",
"0.51477295",
"0.51449674",
"0.51436794"
] | 0.7841206 | 0 |
assert that, given no nonnumeric cards, a numeric match is possible without a color match | @Test
public void testPlayer_getCautiousStrategyCardCard_numeric_matchNumberNotColor() {
player2 = new Player("Player Two", true);
player2.setHand(strategyHand.getAllCards());
// let the cpc be a blue eight
Card blueEight = new Card(Card.BLUE, Card.EIGHT, cvm);
// get rid of all non-numeric cards and the blue four so the red eight is the most attractive option
player2.getHand().discard(wild);
player2.getHand().discard(wildDrawFour);
player2.getHand().discard(yellowReverse);
player2.getHand().discard(redDrawTwo);
player2.getHand().discard(blueFour);
Card redEight = new Card(Card.RED, Card.EIGHT, cvm);
assertTrue(player2.getCautiousStrategyCard(blueEight, yellowThree.getColor()).equals(redEight));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\r\n public void testPlayer_getCautiousStrategyCardCard_numeric_matchColorNotNumber() {\n player2 = new Player(\"Player Two\", true);\r\n player2.setHand(strategyHand.getAllCards());\r\n\r\n // let the cpc be a yellow three\r\n // get rid of all non-numeric cards and the green three so the yellow six is the most attractive option\r\n player2.getHand().discard(wild);\r\n player2.getHand().discard(wildDrawFour);\r\n player2.getHand().discard(yellowReverse);\r\n player2.getHand().discard(redDrawTwo);\r\n player2.getHand().discard(greenThree);\r\n\r\n assertTrue(player2.getCautiousStrategyCard(yellowThree, yellowThree.getColor()).equals(yellowSix));\r\n }",
"@Test\r\n public void testPlayer_getBoldStrategyCard_numeric_matchNumberNotColor() {\n player2 = new Player(\"Player Two\", true);\r\n player2.setHand(strategyHand.getAllCards());\r\n Card blueEight = new Card(Card.BLUE, Card.EIGHT, cvm);\r\n player2.getHand().discard(blueFour);\r\n player2.getHand().discard(yellowZero);\r\n Card redEight = new Card(Card.RED, Card.EIGHT, cvm);\r\n assertTrue(player2.getBoldStrategyCard(blueEight, yellowThree.getColor()).equals(redEight));\r\n }",
"@Test\r\n public void testPlayer_getBoldStrategyCard_numeric_matchColorNotNumber() {\n player2 = new Player(\"Player Two\", true);\r\n player2.setHand(strategyHand.getAllCards());\r\n player2.getHand().discard(greenThree);\r\n player2.getHand().discard(yellowZero);\r\n assertTrue(player2.getBoldStrategyCard(yellowThree, yellowThree.getColor()).equals(yellowSix));\r\n }",
"@Test\r\n public void testPlayer_getBoldStrategyCard_numeric_colorBeatsNumber() {\n\r\n player2 = new Player(\"Player Two\", true);\r\n player2.setHand(strategyHand.getAllCards());\r\n\r\n // pick a cpc that could return two possible options\r\n // and assert that the higher value card comes back\r\n\r\n // make a cpc that might return a yellow six or a red eight\r\n // assert the yellow comes back, even though the red eight has a higher value\r\n Card redSix = new Card(Card.RED, Card.SIX, cvm);\r\n assertTrue(player2.getBoldStrategyCard(redSix, redSix.getColor()).equals(yellowSix));\r\n }",
"@Test\n public void testCardSelectionIsValid_TRUE() throws Exception {\n System.out.println(\"cardSelectionIsValid not valid\");\n UnoCard cardSelection = new UnoCard(UnoCardColour.BLUE, UnoCardValue.TWO);\n UnoCard drawCard = new UnoCard(UnoCardColour.BLUE, UnoCardValue.ONE);\n UnoCardColour wildColour = UnoCardColour.BLUE;\n utils.cardSelectionIsValid(cardSelection, drawCard, wildColour);\n }",
"boolean similarColorTo(Card c);",
"private static void checkForMatches() {\n int matchesThisTurn = 0;\n switch (pattern) {\n case RED:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardColor(playerDeck.get(i)).equals(\"Red\")) {\n //system.out.println(\"Matched Card Color:\" + GameDeck.getCardColor(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case BLACK:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardColor(playerDeck.get(i)).equals(\"Black\")) {\n //system.out.println(\"Matched Card Color:\" + GameDeck.getCardColor(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n matchesThisTurn++;\n playerDeck.get(i).setCardPurchased(true);\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case HEART:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardSuit(playerDeck.get(i)).equals(\"Heart\")) {\n //system.out.println(\"Matched Card Suit:\" + GameDeck.getCardSuit(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case DIAMOND:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardSuit(playerDeck.get(i)).equals(\"Diamond\")) {\n //system.out.println(\"Matched Card Suit:\" + GameDeck.getCardSuit(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case CLUB:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardSuit(playerDeck.get(i)).equals(\"Club\")) {\n //system.out.println(\"Matched Card Suit:\" + GameDeck.getCardSuit(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case SPADE:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardSuit(playerDeck.get(i)).equals(\"Spade\")) {\n //system.out.println(\"Matched Card Suit:\" + GameDeck.getCardSuit(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case TWO:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"2\")) {\n //system.out.println(\"Matched Card Name:\" + GameDeck.getCardName(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case THREE:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"3\")) {\n //system.out.println(\"Matched Card Name:\" + GameDeck.getCardName(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case FOUR:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"4\")) {\n //system.out.println(\"Matched Card Name:\" + GameDeck.getCardName(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case FIVE:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"5\")) {\n //system.out.println(\"Matched Card Name:\" + GameDeck.getCardName(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case SIX:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"6\")) {\n //system.out.println(\"Matched Card Name:\" + GameDeck.getCardName(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case SEVEN:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"7\")) {\n //system.out.println(\"Matched Card Name:\" + GameDeck.getCardName(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case EIGHT:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"8\")) {\n //system.out.println(\"Matched Card Name:\" + GameDeck.getCardName(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case NINE:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"9\")) {\n //system.out.println(\"Matched Card Name:\" + GameDeck.getCardName(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case TEN:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"10\")) {\n //system.out.println(\"Matched Card Name:\" + GameDeck.getCardName(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case JACK:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"J\")) {\n //system.out.println(\"Matched Card Name:\" + GameDeck.getCardName(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case QUEEN:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"Q\")) {\n //system.out.println(\"Matched Card Name:\" + GameDeck.getCardName(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case KING:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"K\")) {\n //system.out.println(\"Matched Card Name:\" + GameDeck.getCardName(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case ACE:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"A\")) {\n //system.out.println(\"Matched Card Name:\" + GameDeck.getCardName(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case SINGLEDIGITPRIMES:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"2\") ||\n GameDeck.getCardName(playerDeck.get(i)).equals(\"3\") ||\n GameDeck.getCardName(playerDeck.get(i)).equals(\"5\") ||\n GameDeck.getCardName(playerDeck.get(i)).equals(\"7\")) {\n //system.out.println(\"Matched Card Name:\" + GameDeck.getCardName(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case PAIRS:\n int[] isAPair = new int[]{0,0,0,0};\n if(GameDeck.getCardName(playerDeck.get(0)).equals(GameDeck.getCardName(playerDeck.get(1)))) {\n //system.out.println(\"Matched Pair Name:\" + GameDeck.getCardName(playerDeck.get(0)));\n matchedDeck.add(playerDeck.get(0));\n playerDeck.get(0).setCardPurchased(true);\n matchedDeck.add(playerDeck.get(1));\n playerDeck.get(1).setCardPurchased(true);\n isAPair[1] = 1;\n matchesThisTurn += 2;\n } else if(GameDeck.getCardName(playerDeck.get(0)).equals(GameDeck.getCardName(playerDeck.get(2)))) {\n //system.out.println(\"Matched Pair Name:\" + GameDeck.getCardName(playerDeck.get(0)));\n matchedDeck.add(playerDeck.get(0));\n playerDeck.get(0).setCardPurchased(true);\n matchedDeck.add(playerDeck.get(2));\n playerDeck.get(2).setCardPurchased(true);\n isAPair[2] = 1;\n matchesThisTurn += 2;\n } else if(GameDeck.getCardName(playerDeck.get(0)).equals(GameDeck.getCardName(playerDeck.get(3)))) {\n //system.out.println(\"Matched Pair Name:\" + GameDeck.getCardName(playerDeck.get(0)));\n matchedDeck.add(playerDeck.get(0));\n playerDeck.get(0).setCardPurchased(true);\n matchedDeck.add(playerDeck.get(3));\n playerDeck.get(3).setCardPurchased(true);\n isAPair[3] = 1;\n matchesThisTurn += 2;\n }\n else\n {\n \tplayerDeck.get(0).setCardPurchased(false);\n \tplayerDeck.get(1).setCardPurchased(false);\n \tplayerDeck.get(2).setCardPurchased(false);\n \tplayerDeck.get(3).setCardPurchased(false);\n }\n \n if(isAPair[1] != 1) {\n if(isAPair[2] != 1 && GameDeck.getCardName(playerDeck.get(1)).equals(GameDeck.getCardName(playerDeck.get(2)))) {\n //system.out.println(\"Matched Pair Name:\" + GameDeck.getCardName(playerDeck.get(1)));\n matchedDeck.add(playerDeck.get(1));\n playerDeck.get(1).setCardPurchased(true);\n matchedDeck.add(playerDeck.get(2));\n playerDeck.get(2).setCardPurchased(true);\n isAPair[2] = 1;\n matchesThisTurn += 2;\n } else if(isAPair[3] != 1 && GameDeck.getCardName(playerDeck.get(1)).equals(GameDeck.getCardName(playerDeck.get(3)))) {\n //system.out.println(\"Matched Pair Name:\" + GameDeck.getCardName(playerDeck.get(1)));\n matchedDeck.add(playerDeck.get(1));\n playerDeck.get(1).setCardPurchased(true);\n matchedDeck.add(playerDeck.get(3));\n playerDeck.get(3).setCardPurchased(true);\n isAPair[3] = 1;\n matchesThisTurn += 2;\n }\n else\n {\n \tplayerDeck.get(1).setCardPurchased(false);\n \tplayerDeck.get(2).setCardPurchased(false);\n \tplayerDeck.get(3).setCardPurchased(false);\n }\n \n }\n \n if(isAPair[2] != 1) {\n if(isAPair[3] != 1 && GameDeck.getCardName(playerDeck.get(2)).equals(GameDeck.getCardName(playerDeck.get(3)))) {\n //system.out.println(\"Matched Pair Name:\" + GameDeck.getCardName(playerDeck.get(2)));\n matchedDeck.add(playerDeck.get(2));\n playerDeck.get(2).setCardPurchased(true);\n matchedDeck.add(playerDeck.get(3));\n playerDeck.get(3).setCardPurchased(true);\n matchesThisTurn += 2;\n }\n else\n {\n \tplayerDeck.get(2).setCardPurchased(false);\n \tplayerDeck.get(3).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n guessPattern();\n }\n break;\n case SUMOFPAIRS: //Ace is high for this sum calculation(Ace=14)\n int tempSum;\n int sumPairCount = 0;\n for(int i=0;i<playerDeck.size();i+=2) {\n tempSum = 0;\n tempSum += GameDeck.getCardValue(playerDeck.get(i));\n tempSum += GameDeck.getCardValue(playerDeck.get(i+1));\n if(tempSum == sumValue) {\n //system.out.println(\"Sum Value:\" + tempSum);\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchedDeck.add(playerDeck.get(i+1));\n playerDeck.get(i+1).setCardPurchased(true);\n sumPairCount++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n \tplayerDeck.get(i+1).setCardPurchased(false);\n }\n }\n if(sumPairCount == 2)\n {\n// guessPattern();\n }\n break;\n case INCREMENTING:\n int[] isIncrementing = new int[]{0,0,0,0};\n int[] isConsecutive = new int[]{0,0,0};\n int consecutiveCount = 0;\n for(int i = 0; i< playerDeck.size()-1; i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"A\")) {\n if(1 == GameDeck.getCardValue(playerDeck.get(i+1))-1) {\n //system.out.println(\"Matched incrementing:\" + GameDeck.getCardName(playerDeck.get(i)) +\n // \" & \" + GameDeck.getCardName(playerDeck.get(i+1)));\n isIncrementing[i] = 1;\n isIncrementing[i+1] = 1;\n isConsecutive[i] = 1;\n }\n } else {\n if(GameDeck.getCardValue(playerDeck.get(i)) == GameDeck.getCardValue(playerDeck.get(i+1))-1) {\n //system.out.println(\"Matched incrementing:\" + GameDeck.getCardName(playerDeck.get(i)) +\n // \" & \" + GameDeck.getCardName(playerDeck.get(i+1)));\n isIncrementing[i] = 1;\n isIncrementing[i+1] = 1;\n isConsecutive[i] = 1;\n }\n }\n }\n for(int i=0;i<playerDeck.size();i++) {\n if(isIncrementing[i] == 1) {\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn ++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n for(int i=0;i<3;i++) {\n if(isConsecutive[i] == 1) {\n consecutiveCount++;\n }\n }\n if(consecutiveCount == 3)\n {\n// guessPattern();\n }\n break;\n case DECREMENTING:\n int[] isDecrementing = new int[]{0,0,0,0};\n int[] isConsecutive2 = new int[]{0,0,0};\n int consecutiveCount2 = 0;\n for(int i = 0; i< playerDeck.size()-1; i++) {\n if(GameDeck.getCardValue(playerDeck.get(i)) == 2) {\n if(GameDeck.getCardName(playerDeck.get(i+1)).equals(\"A\")) {\n //system.out.println(\"Matched decrementing:\" + GameDeck.getCardName(playerDeck.get(i)) +\n // \" & \" + GameDeck.getCardName(playerDeck.get(i+1)));\n isDecrementing[i] = 1;\n isDecrementing[i+1] = 1;\n isConsecutive2[i] = 1;\n }\n } else {\n if(GameDeck.getCardValue(playerDeck.get(i)) == GameDeck.getCardValue(playerDeck.get(i+1))+1) {\n //system.out.println(\"Matched decrementing:\" + GameDeck.getCardName(playerDeck.get(i)) +\n // \" & \" + GameDeck.getCardName(playerDeck.get(i+1)));\n isDecrementing[i] = 1;\n isDecrementing[i+1] = 1;\n isConsecutive2[i] = 1;\n }\n }\n }\n for(int i=0;i<playerDeck.size();i++) {\n if(isDecrementing[i] == 1) {\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn ++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n for(int i=0;i<3;i++) {\n if(isConsecutive2[i] == 1) {\n consecutiveCount2++;\n }\n }\n if(consecutiveCount2 == 3)\n {\n// guessPattern();\n }\n break;\n default:\n //system.out.println(\"\");\n break;\n }\n }",
"@Override\n public boolean match(Card card) {\n if (card.getColor().equals(\"BLACK\"))\n return true;\n\n return (card.getColor().equals(this.getColor())\n || card.getValue().equals(this.getValue()));\n }",
"@Test(expected = Exception.class)\n public void testCardSelectionIsValid_FALSE() throws Exception {\n System.out.println(\"cardSelectionIsValid not valid\");\n UnoCard cardSelection = new UnoCard(UnoCardColour.RED, UnoCardValue.TWO);\n UnoCard drawCard = new UnoCard(UnoCardColour.BLUE, UnoCardValue.ONE);\n UnoCardColour wildColour = UnoCardColour.BLUE;\n utils.cardSelectionIsValid(cardSelection, drawCard, wildColour);\n \n }",
"public static void main(String[] args) {\r\n\t\tCard aceHearts = new Card(\"Ace\", \"Hearts\", 14);\r\n\t\tSystem.out.println(aceHearts.rank());\r\n\t\tSystem.out.println(aceHearts.suit());\r\n\t\tSystem.out.println(aceHearts.pointValue());\r\n\t\tSystem.out.println(aceHearts.toString());\r\n\t\tCard tenDiamonds = new Card(\"Ten\", \"Diamonds\", 10);\r\n\t\tSystem.out.println(tenDiamonds.rank());\r\n\t\tSystem.out.println(tenDiamonds.suit());\r\n\t\tSystem.out.println(tenDiamonds.pointValue());\r\n\t\tSystem.out.println(tenDiamonds.toString());\r\n\t\tCard fiveSpades = new Card(\"Five\", \"Spades\", 5);\r\n\t\tSystem.out.println(fiveSpades.rank());\r\n\t\tSystem.out.println(fiveSpades.suit());\r\n\t\tSystem.out.println(fiveSpades.pointValue());\r\n\t\tSystem.out.println(fiveSpades.toString());\r\n\t\tSystem.out.println(aceHearts.matches(tenDiamonds));\r\n\t\tSystem.out.println(aceHearts.matches(fiveSpades));\r\n\t\tSystem.out.println(aceHearts.matches(aceHearts));\r\n\t\tSystem.out.println(tenDiamonds.matches(fiveSpades));\r\n\t\tSystem.out.println(tenDiamonds.matches(aceHearts));\r\n\t\tSystem.out.println(tenDiamonds.matches(tenDiamonds));\r\n\t\tSystem.out.println(fiveSpades.matches(aceHearts));\r\n\t\tSystem.out.println(fiveSpades.matches(tenDiamonds));\r\n\t\tSystem.out.println(fiveSpades.matches(fiveSpades));\r\n\t}",
"private void badMatch() {\n\t\tArrayList<Integer> faceValues = new ArrayList<Integer>();\n\t\tInteger firstSelectableCardPos = null;\n\t\t\n\t\tfor (int card = 0; card < CARDS_SUM; card++) {\n\t\t\tPlayingCard thisCard = ((PlayingCard) getActivity().findViewById(solo.getImage(card).getId()));\n\t\t\t\n\t\t\t// cheat by finding card face without turning card over\n\t\t\tint face = thisCard.getCard();\n\t\t\tfaceValues.add(face);\n\t\t\t\n\t\t\t// can't select all cards\n\t\t\tif (thisCard.isLocked() || thisCard.getVisible()) {\n\t\t\t\tcontinue;\n\t\t\t} else if (firstSelectableCardPos == null) {\n\t\t\t\tfirstSelectableCardPos = card;\n\t\t\t}\n\t\t\t\n\t\t\t// if this is a different card, select the bad pair\n\t\t\tif (faceValues.get(firstSelectableCardPos) != face) {\n\t\t\t\tsolo.clickOnImage(firstSelectableCardPos);\n\t\t\t\tsolo.clickOnImage(card);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}",
"boolean similarCard(Card c);",
"@Test\n public void testCardCanPlay_FALSE() {\n System.out.println(\"cardCanPlay FALSE COLOUR\");\n UnoCard cardSelection = new UnoCard(UnoCardColour.RED, UnoCardValue.TWO);\n UnoCard drawCard = new UnoCard(UnoCardColour.BLUE, UnoCardValue.ONE);\n UnoCardColour wildColour = UnoCardColour.BLUE;\n boolean result = utils.cardCanPlay(cardSelection, drawCard, wildColour);\n assertEquals(false, result);\n }",
"@Test\n public void testCardCanPlay_TRUE() {\n System.out.println(\"cardCanPlay TRUE COLOUR\");\n UnoCard cardSelection = new UnoCard(UnoCardColour.BLUE, UnoCardValue.TWO);\n UnoCard drawCard = new UnoCard(UnoCardColour.BLUE, UnoCardValue.ONE);\n UnoCardColour wildColour = UnoCardColour.BLUE;\n boolean result = utils.cardCanPlay(cardSelection, drawCard, wildColour);\n assertEquals(true, result);\n }",
"@Test\n\t\tpublic void testGetColour() {\n\t\t\tgreenSix = new Card (Card.Colour.Green, 6);\n\t\t\tblueSix = new Card (Card.Colour.Blue, 6);\n\t\t\twild = new Card (Card.Wild.Wild);\n\t\t\twild_Draw4 = new Card (Card.Wild.WildDraw4);\n\t\t\tblueSkip = new Card(Card.Colour.Blue, Card.Action.Skip);\n\t\t\tredDraw2 = new Card(Card.Colour.Red, Card.Action.Draw2);\n\t\t\tgreenReverse = new Card (Card.Colour.Green, Card.Action.Reverse);\n\t\t\tassertEquals(\"black\", wild.getColour());\n\t\t\tassertEquals(\"black\", wild_Draw4.getColour());\n\t\t\tassertEquals(\"Blue\", blueSkip.getColour());\n\t\t\tassertEquals(\"Red\", redDraw2.getColour());\n\t\t\tassertEquals(\"Green\", greenReverse.getColour());\n\t\t}",
"@Test\r\n public void testPlayer_selectNewColor_dumb() {\r\n player2 = new Player(\"\", true);\r\n player2.setStrategy(Player.STRATEGY_DUMB);\r\n player2.setHand(strategyHand.getAllCards());\r\n player2.setLastPlayedCard(wild);\r\n String firstRandomColor = player2.selectNewColor();\r\n boolean differentColorFound = false;\r\n for(int i = 0; i < 25; i++) {\r\n String nextRandomColor = player2.selectNewColor();\r\n if(!nextRandomColor.equalsIgnoreCase(firstRandomColor)) {\r\n differentColorFound = true;\r\n }\r\n }\r\n assertTrue(differentColorFound);\r\n }",
"public boolean VerifyHumanChoice(int value){\n String card = handHuman.get(value);\n System.out.print(\"CARD IN VERIFY HUMAN\" + card);\n\n String firstLetter = Character.toString(card.charAt(0));\n String topFirstLetter = Character.toString(topCard.charAt(0));\n\n if(topCard.contains(\"8\")){\n //Can play any card ontop to determine suite\n topCard = card;\n return true;\n }\n\n if(card.contains(\"8\")){\n //valid because 8s are wild cards, human can place it\n topCard = card;\n return true;\n }\n\n //the cards match in suite, doesn't matter what it is\n else if(firstLetter.equals(topFirstLetter)){\n topCard = card;\n return true;\n }\n\n else{\n if(topFirstLetter.equals(\"c\")){\n String temp = topCard.substring(5, topCard.length());\n System.out.println(\"TEMP \" + temp);\n\n if(card.contains(temp)){\n topCard = card;\n return true;\n }\n\n }\n\n else if(topFirstLetter.equals(\"h\")){\n String temp = topCard.substring(6, topCard.length());\n System.out.println(\"TEMP \" + temp);\n\n if(card.contains(temp)){\n topCard = card;\n return true;\n }\n\n }\n\n else if(topFirstLetter.equals(\"d\")){\n String temp = topCard.substring(8, topCard.length());\n System.out.println(\"TEMP \" + temp);\n\n if(card.contains(temp)){\n topCard = card;\n return true;\n }\n\n }\n\n else if(topFirstLetter.equals(\"s\")){\n String temp = topCard.substring(6, topCard.length());\n System.out.println(\"TEMP \" + temp);\n\n if(card.contains(temp)){\n topCard = card;\n return true;\n }\n\n }\n }\n\n //You can't play this card\n return false;\n }",
"@Test\r\n public void testPlayer_getDumbStrategyCard_differentWinners() {\r\n player2 = new Player(\"\", true);\r\n player2.setHand(strategyHand.getAllCards());\r\n boolean differentLegalCardFound = false;\r\n Card firstDiscard = player2.getDumbStrategyCard(yellowSix, yellowSix.getColor());\r\n for(int i = 0; i < 25; i++) {\r\n Card loopCard = player2.getDumbStrategyCard(yellowSix, yellowSix.getColor());\r\n if(!loopCard.equals(firstDiscard)) {\r\n differentLegalCardFound = true;\r\n }\r\n }\r\n assertTrue(differentLegalCardFound);\r\n }",
"@Test\r\n public void testPlayer_getDumbStrategyCard_oneWinner_color() {\n player2 = new Player(\"\", true);\r\n player2.setHand(strategyHand.getAllCards());\r\n player2.getHand().discard(wild);\r\n player2.getHand().discard(wildDrawFour);\r\n assertTrue(player2.getDumbStrategyCard(blueNine, blueNine.getColor()).equals(blueFour));\r\n }",
"@Test\r\n public void testPlayer_getBoldStrategyCard_zeroColor() {\n player2 = new Player(\"Player Two\", true);\r\n player2.setHand(strategyHand.getAllCards());\r\n assertTrue(player2.getBoldStrategyCard(yellowSix, yellowSix.getColor()).equals(yellowZero));\r\n\r\n // try again, but reduce the yellow color group to <= 2\r\n player2.getHand().discard(yellowSix);\r\n player2.getHand().discard(yellowReverse);\r\n\r\n assertTrue(player2.getBoldStrategyCard(yellowOne, yellowSix.getColor()).equals(yellowOne));\r\n }",
"@Test\n public void testMatch() {\n assertMetrics(\"match:1\", \"a\",\"a\");\n assertMetrics(\"match:0.9339\",\"a\",\"a x\");\n assertMetrics(\"match:0\", \"a\",\"x\");\n assertMetrics(\"match:0.9243\",\"a\",\"x a\");\n assertMetrics(\"match:0.9025\",\"a\",\"x a x\");\n\n assertMetrics(\"match:1\", \"a b\",\"a b\");\n assertMetrics(\"match:0.9558\",\"a b\",\"a b x\");\n assertMetrics(\"match:0.9463\",\"a b\",\"x a b\");\n assertMetrics(\"match:0.1296\",\"a b\",\"a x x x x x x x x x x x x x x x x x x x x x x b\");\n assertMetrics(\"match:0.1288\",\"a b\",\"a x x x x x x x x x x x x x x x x x x x x x x x x x x x b\");\n\n assertMetrics(\"match:0.8647\",\"a b c\",\"x x a x b x x x x x x x x a b c x x x x x x x x c x x\");\n assertMetrics(\"match:0.861\", \"a b c\",\"x x a x b x x x x x x x x x x a b c x x x x x x c x x\");\n assertMetrics(\"match:0.4869\",\"a b c\",\"a b x x x x x x x x x x x x x x x x x x x x x x c x x\");\n assertMetrics(\"match:0.4853\",\"a b c\",\"x x a x b x x x x x x x x x x b a c x x x x x x c x x\");\n assertMetrics(\"match:0.3621\",\"a b c\",\"a x b x x x x x x x x x x x x x x x x x x x x x c x x\");\n assertMetrics(\"match:0.3619\",\"a b c\",\"x x a x b x x x x x x x x x x x x x x x x x x x c x x\");\n assertMetrics(\"match:0.3584\",\"a b c\",\"x x a x b x x x x x x x x x x x x x x x x x x x x x c\");\n assertMetrics(\"match:0.3474\",\"a b c\",\"x x a x b x x x x x x x x x x x x x x b x x x b x b x\");\n assertMetrics(\"match:0.3421\",\"a b c\",\"x x a x b x x x x x x x x x x x x x x x x x x x x x x\");\n assertMetrics(\"match:0.305\" ,\"a b c\",\"x x a x b:0.7 x x x x x x x x x x x x x x x x x x x x x x\");\n assertMetrics(\"match:0.2927\",\"a b!200 c\",\"x x a x b:0.7 x x x x x x x x x x x x x x x x x x x x x x\");\n }",
"@Override\n\tpublic String checkPlay(String cardNameRequest, String colorRequest) {\n\n\t\tfor (String color : AVAILABLE_COLORS) {\n\t\t\tif (color.equals(colorRequest)) // Checking if color is valid\n\t\t\t{\n\t\t\t\tif (\"Joker\".equals(cardNameRequest))\n\t\t\t\t\treturn \"Normal-Play\";\n\t\t\t\telse if (\"+4\".equals(cardNameRequest))\n\t\t\t\t\treturn \"+4\";\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn \"Invalid-Play\";\n\t}",
"boolean isMismatch(double score);",
"@Test\n public void NineAndMissExpected_90(){\n String input = \"9-9-9-9-9-9-9-9-9-9-\";\n assertEquals(game.scoreOfGame(input),90);\n }",
"@Test\n public void testCardCanPlay_WILD() {\n System.out.println(\"cardCanPlay WILD\");\n UnoCard cardSelection = new UnoCard(UnoCardColour.WILD, UnoCardValue.ONE);\n UnoCard drawCard = new UnoCard(UnoCardColour.BLUE, UnoCardValue.THREE);\n UnoCardColour wildColour = UnoCardColour.BLUE;\n boolean result = utils.cardCanPlay(cardSelection, drawCard, wildColour);\n assertEquals(true, result);\n }",
"@Test\n public void testNextCardGood() {\n System.out.println(\"nextCardGood\");\n Deck deck = new Deck();\n Card card = deck.nextCard();\n ////since the deck is unshuffled, that last card should be WILDCARD\n assertEquals(CardType.WILDCARD, card.getValue());\n }",
"@Test\n public void shouldMatchDigits(){\n Assert.assertThat(\"match all digits\",CharMatcher.DIGIT.matchesAllOf(\"1234434\"),is(true));\n Assert.assertThat(\"match any digits \",CharMatcher.DIGIT.matchesAnyOf(\"123TTT4\"),is(true));\n }",
"private boolean isValidCard(int index)\n {\n if (index >= cards.size() || index < 0)\n return false;\n \n for (int i = index; i < cards.size() - 1; i++)\n if (!isDifferentColor(cards.get(i), cards.get(i + 1)) ||\n !isOneLess(cards.get(i + 1), cards.get(i)))\n return false;\n\n return true;\n }",
"@Test\n @Disabled\n public void testValidateMatriculaCoche() {\n assertFalse(RegExprMain.validateMatriculaCoche(\"543 JTD\"));\n assertTrue(RegExprMain.validateMatriculaCoche(\"5432 JTD\"));\n assertFalse(RegExprMain.validateMatriculaCoche(\"5433 JAD\"));\n assertFalse(RegExprMain.validateMatriculaCoche(\"54333 JTD\"));\n assertTrue(RegExprMain.validateMatriculaCoche(\"5432 JTD\"));\n assertTrue(RegExprMain.validateMatriculaCoche(\"6784 CLD\"));\n assertTrue(RegExprMain.validateMatriculaCoche(\"4563 BVB\"));\n assertTrue(RegExprMain.validateMatriculaCoche(\"6789 LMN\"));\n assertTrue(RegExprMain.validateMatriculaCoche(\"2435 JKD\"));\n assertTrue(RegExprMain.validateMatriculaCoche(\"4567 GJD\"));\n \n\n }",
"@Test\n public void getDeckTest3() {\n GenericStandardDeckGame g = new GenericStandardDeckGame();\n List<Card> deck = g.getDeck();\n String s = \"♣♦♥♠\";\n for (char ch : s.toCharArray()) {\n int counter = 0;\n for (Card c : deck) {\n if (c.getSuit().getValue() == ch) {\n counter++;\n }\n }\n assertEquals(counter, 13);\n }\n }",
"@SmallTest\n\tpublic void testBadMatchPenalty() {\n\t\tbadMatch();\n\t\tassertEquals((Integer) (START_SCORE - BAD_MATCH_PENALTY), Integer.valueOf(solo.getText(1).getText().toString()));\n\t}",
"@Test\n public void testIsValidTap() {\n setUpCorrect();\n assertTrue(boardManager.isValidTap(11));\n assertTrue(boardManager.isValidTap(14));\n assertFalse(boardManager.isValidTap(10));\n }",
"public void testCheckForTripleSingleColor()\n {\n // Note that fromString calls the reset method internally.\n\n // An empty board\n assertEquals(b1.checkForTriple(), Cell.EMPTY);\n\n // A single filled cell\n b1.reset();\n b1.fromString(\"REEEEEEEE\");\n assertEquals(b1.checkForTriple(), Cell.EMPTY);\n\n // Some partially filled rows\n b1.fromString(\"RREEEEEEE\");\n assertEquals(b1.checkForTriple(), Cell.EMPTY);\n b1.fromString(\"EEEEEERER\");\n assertEquals(b1.checkForTriple(), Cell.EMPTY);\n b1.fromString(\"RRE\"+\"EEE\"+\"RER\");\n assertEquals(b1.checkForTriple(), Cell.EMPTY);\n\n // Some partially filled columns;\n b1.fromString(\"REEREEEEE\");\n assertEquals(b1.checkForTriple(), Cell.EMPTY);\n b1.fromString(\"EEREEEEER\");\n assertEquals(b1.checkForTriple(), Cell.EMPTY);\n b1.fromString(\"RER\"+\"REE\"+\"EER\");\n assertEquals(b1.checkForTriple(), Cell.EMPTY);\n\n // Partial Diagonals\n b1.fromString(\"REE\"+\"ERE\"+\"EEE\");\n assertEquals(b1.checkForTriple(), Cell.EMPTY);\n b1.fromString(\"REE\"+\"EEE\"+\"EER\");\n assertEquals(b1.checkForTriple(), Cell.EMPTY);\n b1.fromString(\"RER\"+\"ERE\"+\"EEE\");\n assertEquals(b1.checkForTriple(), Cell.EMPTY);\n\n // Filled columns\n b1.fromString(\"REEREEREE\");\n assertEquals(b1.checkForTriple(), Cell.RED1);\n b1.fromString(\"EEREEREER\");\n assertEquals(b1.checkForTriple(), Cell.RED1);\n b1.fromString(\"RERRERRER\");\n assertEquals(b1.checkForTriple(), Cell.RED1);\n\n // Filled Rows\n b1.fromString(\"RRREEEEEE\");\n assertEquals(b1.checkForTriple(), Cell.RED1);\n b1.fromString(\"EEEEEERRR\");\n assertEquals(b1.checkForTriple(), Cell.RED1);\n b1.fromString(\"RRREEERRR\");\n assertEquals(b1.checkForTriple(), Cell.RED1);\n\n // Filled Diagonals\n b1.fromString(\"REE\"+\"ERE\"+\"EER\");\n assertEquals(b1.checkForTriple(), Cell.RED1);\n b1.fromString(\"EER\"+\"ERE\"+\"REE\");\n assertEquals(b1.checkForTriple(), Cell.RED1);\n b1.fromString(\"RER\"+\"ERE\"+\"RER\");\n assertEquals(b1.checkForTriple(), Cell.RED1);\n\n }",
"@Override\n public boolean isLegal(List<Integer> selectedCards)\n {\n //checks if the two cards selected added together equal 13\n if(selectedCards.size() == 2)\n {\n if(containsSum13(selectedCards))\n {\n \treturn true;\n }\n }\n \n //checks if the selected card is a K\n if(selectedCards.size() == 1)\n {\n \treturn containsK(selectedCards);\n }\n return false;\n \n }",
"@Test\n void findDevCard() {\n ArrayList<DevelopmentCardExt> developmentCards= Starter.DevCardParser();\n DashboardExt dashboard= new DashboardExt(developmentCards);\n Random rand= new Random();\n\n for (int i=0; i<48; i++){\n assertNotNull(dashboard.findDevCard(i));\n }\n\n for (int i=48; i<100; i++){\n assertNull(dashboard.findDevCard(i));\n }\n\n\n assertEquals(dashboard.findDevCard(5).getLevel(), Level.ONE);\n assertEquals(dashboard.findDevCard(16).getColor(), ColorDevCard.GREEN);\n\n }",
"private boolean canPlay(UnoCard topCard, UnoCard newCard) {\n\n\t\t// Color or value matches\n\t\tif (topCard.getColor().equals(newCard.getColor())\n\t\t\t\t|| topCard.getValue().equals(newCard.getValue()))\n\t\t\treturn true;\n\t\t// if chosen wild card color matches\n\t\telse if (topCard instanceof WildCard)\n\t\t\treturn ((WildCard) topCard).getWildColor().equals(newCard.getColor());\n\n\t\t// suppose the new card is a wild card\n\t\telse if (newCard instanceof WildCard)\n\t\t\treturn true;\n\n\t\t// else\n\t\treturn false;\n\t}",
"private boolean isWrong() {\n\t\treturn wrongMatches >= 5;\n\t}",
"public boolean canPlace(Card o, String c)\r\n {\r\n if (this.color == c)\r\n return true;\r\n else if (this.value == o.value)\r\n return true;\r\n else if (this.color == \"none\") // Wild cards\r\n return true;\r\n return false;\r\n }",
"public boolean CheckForUnwinnableCondition(){\n int humanSize = GetSizeOfHumanHand();\n int computerSize = GetSizeOfComputerHand();\n\n for(int i = 0; i < humanSize; i++) {\n //Human can play a card\n String card = handHuman.get(i);\n\n String firstLetter = Character.toString(card.charAt(0));\n String topFirstLetter = Character.toString(topCard.charAt(0));\n\n if (topCard.contains(\"8\")) {\n //Can play any card ontop to determine suite\n return true;\n }\n\n if (card.contains(\"8\")) {\n //valid because 8s are wild cards, human can place it\n return true;\n }\n\n //the cards match in suite, doesn't matter what it is\n else if (firstLetter.equals(topFirstLetter)) {\n return true;\n }\n\n else {\n if (topFirstLetter.equals(\"c\")) {\n String temp = topCard.substring(5, topCard.length());\n\n if (card.contains(temp)) {\n return true;\n }\n\n } else if (topFirstLetter.equals(\"h\")) {\n String temp = topCard.substring(6, topCard.length());\n\n if (card.contains(temp)) {\n return true;\n }\n\n } else if (topFirstLetter.equals(\"d\")) {\n String temp = topCard.substring(8, topCard.length());\n\n if (card.contains(temp)) {\n return true;\n }\n\n } else if (topFirstLetter.equals(\"s\")) {\n String temp = topCard.substring(6, topCard.length());\n\n if (card.contains(temp)) {\n return true;\n }\n }\n }\n }\n\n for(int i = 0; i < computerSize; i++){\n //Human can play a card\n String card = handComputer.get(i);\n\n String firstLetter = Character.toString(card.charAt(0));\n String topFirstLetter = Character.toString(topCard.charAt(0));\n\n if (topCard.contains(\"8\")) {\n //Can play any card ontop to determine suite\n return true;\n }\n\n if (card.contains(\"8\")) {\n //valid because 8s are wild cards, human can place it\n return true;\n }\n\n //the cards match in suite, doesn't matter what it is\n else if (firstLetter.equals(topFirstLetter)) {\n return true;\n }\n\n else {\n if (topFirstLetter.equals(\"c\")) {\n String temp = topCard.substring(5, topCard.length());\n\n if (card.contains(temp)) {\n return true;\n }\n\n } else if (topFirstLetter.equals(\"h\")) {\n String temp = topCard.substring(6, topCard.length());\n\n if (card.contains(temp)) {\n return true;\n }\n\n } else if (topFirstLetter.equals(\"d\")) {\n String temp = topCard.substring(8, topCard.length());\n\n if (card.contains(temp)) {\n return true;\n }\n\n } else if (topFirstLetter.equals(\"s\")) {\n String temp = topCard.substring(6, topCard.length());\n\n if (card.contains(temp)) {\n return true;\n }\n }\n }\n }\n\n //Human and computer can't play a card\n return false;\n }",
"@Test\n void checkIsTrueForStringWithNumbers() {\n // Act, Assert\n assertTrue(IsNumeric.check(\"3\"));\n assertTrue(IsNumeric.check(\"0\"));\n assertTrue(IsNumeric.check(\"-0f\"));\n assertTrue(IsNumeric.check(\"3.8f\"));\n assertTrue(IsNumeric.check(\"-3.87F\"));\n assertTrue(IsNumeric.check(\"-3\"));\n assertTrue(IsNumeric.check(\"32f\"));\n assertTrue(IsNumeric.check(\"15D\"));\n assertTrue(IsNumeric.check(\"3.2\"));\n assertTrue(IsNumeric.check(\"0.2\"));\n assertTrue(IsNumeric.check(\"-0.28\"));\n assertTrue(IsNumeric.check(\"0.24D\"));\n assertTrue(IsNumeric.check(\"0.379d\"));\n }",
"public void verifyCards() {\n\t\t\n\t\tString text = myTextField.getText();\n\t\tString settext = setText.getText();\n\t\t\n\t\t// Stack for cards\n\t\tStack<Integer> cardNums = new Stack<Integer>();\n\t\tStack<Integer>tmpCard = new Stack<Integer>(); \n\t\t// Set up Stack for numbers\n\t\tStack<Integer> nums = new Stack<Integer>();\n\t\tStack<Integer>tmpNums = new Stack<Integer>(); \n\n\t\t// Set up Stack for Operators\n\t\tStack<Character> ops = new Stack<Character>();\n\n\t\t\n\t\tchar[] cardChars = settext.toCharArray();\n\t\t\n\t\t\n\t\tfor (int i = 0; i < cardChars.length; i++) {\n\t\t\tif (cardChars[i] >= '1' && cardChars[i] <= '9') {\n\t\t\t\tStringBuffer sbuf = new StringBuffer();\n\t\t\t\t\n\t\t\t\t// If there is more than one digit in a number, check, then push if so\n\t\t\t\twhile (i < cardChars.length && cardChars[i] >= '0' && cardChars[i] <= '9') {\n\t\t\t\t\tsbuf.append(cardChars[i++]);\n\t\t\t\t\tcardNums.push(Integer.parseInt(sbuf.toString()));\n\t\t\t\t\ttmpCard.push(Integer.parseInt(sbuf.toString()));\n\t\t\t\t}\n\t\t\t\tSystem.out.println(cardNums.peek()); \n\t\t\t\tSystem.out.println(tmpCard.peek()); \n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\tchar[] chars = text.toCharArray();\n\t\t\n\t\t\n\t\tmyTextField.textProperty().addListener(new ChangeListener<String>() {\n @Override\n public void changed(ObservableValue<? extends String> observable, String oldValue, \n String newValue) {\n if (!newValue.matches(\"\\\\d*\")) {\n \tmyTextField.setText(newValue.replaceAll(\"[^\\\\d\\\\h+-/*]\", \"\"));\n }\n }\n });\n \n\n\t\tfor (int i = 0; i < chars.length; i++) {\n\n\t\t\t// Do the stack for numbers, if its 0 - 9, means its a number\n\t\t\tif (chars[i] >= '1' && chars[i] <= '9') {\n\t\t\t\tStringBuffer sbuf = new StringBuffer();\n\t\t\t\t\n\t\t\t\t// If there is more than one digit in a number, check, then push if so\n\t\t\t\twhile (i < chars.length && chars[i] >= '0' && chars[i] <= '9') {\n\t\t\t\t\tsbuf.append(chars[i++]);\n\t\t\t\t\tnums.push(Integer.parseInt(sbuf.toString()));\n\t\t\t\t\ttmpNums.push(Integer.parseInt(sbuf.toString()));\n\n\t\t\t\t}\n\t\t\t\tSystem.out.println(nums.peek());\n\t\t\t}\n\t\t\t\n\t\t\t// open brace, pushed to operator stack\n\t\t\telse if (chars[i] == '(')\n\t\t\t\tops.push(chars[i]);\n\n\t\t\t// Closing brace, now solve\n\t\t\telse if (chars[i] == ')') {\n\t\t\t\t// look at the top of the stack, see if there was a ( brace before the ) brace\n\t\t\t\twhile (ops.peek() != '(')\n\t\t\t\t\tnums.push(operatorCases(ops.pop(), nums.pop(), nums.pop()));\n\t\t\t\tops.pop();\n\t\t\t}\n\n\t\t\n\t\t\telse if (chars[i] == '+' || chars[i] == '-' || chars[i] == '*' || chars[i] == '/') {\n\n\t\t\t\twhile (!ops.empty() && precedenceOrder(chars[i], ops.peek()))\n\t\t\t\t\tnums.push(operatorCases(ops.pop(), nums.pop(), nums.pop()));\n\t\t\t\tops.push(chars[i]);\n\t\t\t}\n\t\t\t\n\t\t}\n\t \n\t\t// pop out the tmp values, then check to see if they equal eachother for validation.\n\n\t\t\nint cardP1 = tmpCard.pop(); \nint cardP2 = tmpCard.pop(); \nint cardP3 = tmpCard.pop(); \nint cardP4 = tmpCard.pop(); \n\n\nint numP1 = tmpNums.pop(); \nint numP2 = tmpNums.pop(); \nint numP3 = tmpNums.pop(); \nint numP4 = tmpNums.pop(); \nint whileLoopGood = 0; \nboolean resultWhile;\nresultWhile = false;\nwhile(!resultWhile) { \n\twhile(numP1 == cardP1 || numP1 == cardP2 || numP1 == cardP3 || numP1 == cardP4) {\n\t\twhile(numP2 == cardP1 || numP2 == cardP2 || numP2 == cardP3 || numP2 == cardP4) {\n\t\t\twhile(numP3 == cardP1 || numP3 == cardP2 || numP3 == cardP3 || numP3 == cardP4) {\n\t\t\t\twhile(numP4 == cardP1 || numP4 == cardP2 || numP4 == cardP3 || numP4 == cardP4) {\n\t\t\t\t\twhileLoopGood = 1;\n\t\t\t\t\tresultWhile = true; \n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tbreak; \n\t\t}\n\t\tbreak;\n\t}\n\tbreak;\n}\n\n//if the while loop does reach the final desitintion then user did not type in correctly. \n\n\n\n\t\t// Entire expression has been parsed at this point, apply remaining\n\t\t// ops to remaining nums\n\t\twhile (!ops.empty())\n\t\t\tnums.push(operatorCases(ops.pop(), nums.pop(), nums.pop()));\n\n\t\t// Result is on the top of the numbs Stack so Return the Top of number stack\n\t\t// Check to see if the number is equal to 24\n\t\tint result = nums.pop();\n\t\tif (result != 24) {\n\t\t\ttxtFldAns.setText(\"Wrong : \" + result + \" is NOT equal to 24\");\n\t\t\tif(whileLoopGood == 0) {\n\t\t\t\ttxtFldAns.setText(\"You must use all 4 cards Once and only once\");\n\t\t\t\t}\n\t\t} else\n\t\t\ttxtFldAns.setText(\"Correct : \" + result + \" is equal to 24\");\n\t\tif(whileLoopGood == 0) {\n\t\t\ttxtFldAns.setText(\"You must use all 4 cards Once and only once\");\n\t\t\t}\n\t}",
"@Test\n\t\t public void InitializeTest1() {\n\t\t\tCard colourNum = new Card(Card.Colour.Blue, 0);\n\t\t\tString expected = \"Blue\";\n\t\t\tString actual = colourNum.getColour();\n\t\t assertEquals(expected, actual);\n\t\t int expectedN = 0;\n\t\t int actualN = colourNum.getNumber();\n\t\t assertEquals(expectedN, actualN);\n\t\t expected = \"none\";\n\t\t actual = colourNum.getAction();\n\t\t assertEquals(expected, actual);\n\t\t expected = null;\n\t\t actual = colourNum.getWild();\n\t\t assertEquals(expected, actual);\n\t\t actualN = colourNum.getValue();\n\t\t assertEquals(expected, actual);\n\t\t }",
"@Test\n public void shouldMatchDigitsWithSpace() {\n Assert.assertThat(\"match any digits with space\",CharMatcher.DIGIT.matchesAllOf(\"123T TT4\"),is(false));\n Assert.assertThat(\"match any digits with space\",CharMatcher.DIGIT.matchesAnyOf(\"123 TTT4\"),is(true));\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 }",
"@Test\n public void testCardCanPlay_FALSE_VALUE() {\n System.out.println(\"cardCanPlay FALSE VALUE\");\n UnoCard cardSelection = new UnoCard(UnoCardColour.RED, UnoCardValue.TWO);\n UnoCard drawCard = new UnoCard(UnoCardColour.BLUE, UnoCardValue.THREE);\n UnoCardColour wildColour = UnoCardColour.BLUE;\n boolean result = utils.cardCanPlay(cardSelection, drawCard, wildColour);\n assertEquals(false, result);\n }",
"public void testCheckForTripleMultiColor()\n {\n // Note that fromString calls the reset method internally.\n\n // An empty board\n assertEquals(b1.checkForTriple(), Cell.EMPTY);\n\n // A single filled cell\n b1.reset();\n b1.fromString(\"REEEEBEEE\");\n assertEquals(b1.checkForTriple(), Cell.EMPTY);\n\n // Some partially filled rows\n b1.fromString(\"RREEBBEEE\");\n assertEquals(b1.checkForTriple(), Cell.EMPTY);\n b1.fromString(\"BEBEEERER\");\n assertEquals(b1.checkForTriple(), Cell.EMPTY);\n b1.fromString(\"RRB\"+\"BEB\"+\"RER\");\n assertEquals(b1.checkForTriple(), Cell.EMPTY);\n\n // Some partially filled columns;\n b1.fromString(\"RBERBEEEE\");\n assertEquals(b1.checkForTriple(), Cell.EMPTY);\n b1.fromString(\"EBREEEEBR\");\n assertEquals(b1.checkForTriple(), Cell.EMPTY);\n b1.fromString(\"RBR\"+\"REB\"+\"EBR\");\n assertEquals(b1.checkForTriple(), Cell.EMPTY);\n\n // Partial Diagonals\n b1.fromString(\"REE\"+\"ERE\"+\"EEB\");\n assertEquals(b1.checkForTriple(), Cell.EMPTY);\n b1.fromString(\"REB\"+\"EEE\"+\"BER\");\n assertEquals(b1.checkForTriple(), Cell.EMPTY);\n b1.fromString(\"RER\"+\"ERE\"+\"EEE\");\n assertEquals(b1.checkForTriple(), Cell.EMPTY);\n\n // Filled columns\n b1.fromString(\"RBBREERBB\");\n assertEquals(b1.checkForTriple(), Cell.RED1);\n b1.fromString(\"BBRBBREER\");\n assertEquals(b1.checkForTriple(), Cell.RED1);\n b1.fromString(\"RBRRBRRER\");\n assertEquals(b1.checkForTriple(), Cell.RED1);\n\n // Filled Rows\n b1.fromString(\"RRREEBBBE\");\n assertEquals(b1.checkForTriple(), Cell.RED1);\n b1.fromString(\"EEBBBERRR\");\n assertEquals(b1.checkForTriple(), Cell.RED1);\n b1.fromString(\"RRRBBERRR\");\n assertEquals(b1.checkForTriple(), Cell.RED1);\n\n // Filled Diagonals\n b1.fromString(\"REB\"+\"ERE\"+\"BER\");\n assertEquals(b1.checkForTriple(), Cell.RED1);\n b1.fromString(\"BBR\"+\"ERE\"+\"RBB\");\n assertEquals(b1.checkForTriple(), Cell.RED1);\n b1.fromString(\"RBR\"+\"BRB\"+\"RBR\");\n assertEquals(b1.checkForTriple(), Cell.RED1);\n\n }",
"public static boolean checkSequence(String cards){\r\n //split all the cards and store in card array\r\n String[] cardArray = cards.split(\",\");\r\n //convert card array into card object arrayList\r\n ArrayList<Card> cardList = new ArrayList<Card>();\r\n int numCards = cardArray.length;\r\n //if there is less than 3 cards eliminate deck\r\n if(numCards < 3) return false;\r\n //store suit and face value in card object\r\n for(int i=0;i<numCards;i++){\r\n Card c = new Card(cardArray[i].split(\"#\")[0].trim(),cardArray[i].split(\"#\")[1].trim());\r\n cardList.add(c);\r\n }\r\n int i=0;\r\n String cardSuit=\"\",nextCardSuit=\"\";\r\n int cardValue=-1,nextCardValue=-1,prevCardValue = -1;\r\n \r\n //loop till penultimate card\r\n for(i=0; i<numCards-1 ;i++){ \r\n \r\n cardValue = cardList.get(i).value;\r\n nextCardValue = cardList.get(i+1).value;\r\n cardSuit = cardList.get(i).suit;\r\n nextCardSuit = cardList.get(i+1).suit;\r\n \r\n //suit check\r\n if(!cardSuit.equals(nextCardSuit)) return false;\r\n \r\n //card check\r\n if(cardValue != nextCardValue-1){\r\n \r\n //exception only for queen followed by king followed by ace\r\n if(!(prevCardValue==11 && cardValue == 12 && nextCardValue ==0)){\r\n return false;\r\n }\r\n }\r\n //execption for king followed by ace followed by 2\r\n if(prevCardValue == 12 && cardValue == 0 && nextCardValue==1) return false;\r\n prevCardValue = cardValue;\r\n }\r\n \r\n return true;\r\n }",
"private boolean isTheColorInputCorrect(int red, int green, int blue, int alpha){\n if(red > 255 || green > 255 || blue > 255 || alpha > 255){\n System.out.println(\"Values should be equal or smaller then 255.\");\n return false;\n }else if(red < 0 || green < 0 || blue < 0 || alpha < 0){\n System.out.println(\"Values should be equal or bigger then 0.\");\n return false;\n }else{\n return true;\n }\n }",
"@Test\n public void allOnesExpected_20(){\n String input = \"11111111111111111111\";\n assertEquals(game.scoreOfGame(input),20);\n }",
"@Test\r\n public void testIsValidTap() {\r\n assertTrue(boardManager3.isValidTap(7));\r\n assertTrue(boardManager3.isValidTap(5));\r\n assertFalse(boardManager3.isValidTap(0));\r\n }",
"public boolean validCardPlay(UnoCard card) {\r\n return card.getColor() == validColor || card.getValue() == validValue;\r\n }",
"@Test\n public void testShuffleGood() {\n System.out.println(\"shuffleGood\");\n Deck deck = new Deck();\n boolean shuffled = false;\n deck.shuffle();\n //we take out one card from the deck\n Card lastCard = deck.nextCard();\n //we take out 58 more cards\n for (int i =0 ; i<57;i++)\n {\n deck.nextCard();\n }\n //we take out the last card from the deck\n Card firstCard = deck.nextCard();\n \n //if both cards = the same value they were before being shuffled, then test will fail.\n if (lastCard.getValue() != CardType.WILDCARD )\n shuffled = true;\n else if (firstCard.getValue()!=CardType.ZERO)\n shuffled = true;\n \n //if either of the cards are different, that means the deck was shuffled and the test will pass\n assertEquals(true, shuffled);\n }",
"private static void validate(Card card) throws CardNumberException {\n card.validateNumber();\n }",
"@Test\n void checkIsFalseForStringWithNumbersAndOtherChars() {\n // Act, Assert\n assertFalse(IsNumeric.check(\"a3\"));\n assertFalse(IsNumeric.check(\"3l\"));\n assertFalse(IsNumeric.check(\"345L\"));\n assertFalse(IsNumeric.check(\"32b\"));\n assertFalse(IsNumeric.check(\"*3.2 \"));\n assertFalse(IsNumeric.check(\"/0.2\"));\n assertFalse(IsNumeric.check(\"0.28L\"));\n assertFalse(IsNumeric.check(\"0.28.\"));\n assertFalse(IsNumeric.check(\"3.2.4\"));\n assertFalse(IsNumeric.check(\"0x400\"));\n assertFalse(IsNumeric.check(\"0.24Dd\"));\n }",
"@Test\n public void testCardCanPlay_TRUE_VALUE() {\n System.out.println(\"cardCanPlay TRUE VALUE\");\n UnoCard cardSelection = new UnoCard(UnoCardColour.RED, UnoCardValue.TWO);\n UnoCard drawCard = new UnoCard(UnoCardColour.BLUE, UnoCardValue.TWO);\n UnoCardColour wildColour = UnoCardColour.BLUE;\n boolean result = utils.cardCanPlay(cardSelection, drawCard, wildColour);\n assertEquals(true, result);\n }",
"public UnoCard searchForMatch(UnoCard prev) {\r\n \r\n //case where previous card was a \r\n // special card(wild, or WD4)\r\n if(UnoSpecialCardsV2.unoSpecialCard(prev)) {\r\n //Tests to determine 1) which special card previous was; and\r\n if(UnoSpecialCardsV2.unoCardWild(prev)) {\r\n int unoCardTgtColor = UnoV2.getWildColor();\r\n // 2) does player have a card to match it. \r\n for (int i = hand.handSize()-1; i >=0; i--) {\r\n UnoCard unocard = hand.getCard(i);\r\n if (unocard.getColor() == unoCardTgtColor \r\n || (unocard.getRank() > 24)) { \r\n return hand.popCard(i);\r\n }\r\n }\r\n return null;\r\n \r\n }\r\n // Same comments as above\r\n if(UnoSpecialCardsV2.unoCardWildDrawFour(prev)) {\r\n int unoCardTgtColor = UnoV2.getWildColor();\r\n System.out.println(\"unoCardTgtColor into WD4 SearchForMatch \" \r\n + UnoCard.getColors()[unoCardTgtColor]);\r\n \r\n for (int i = hand.handSize()-1; i >=0;i--) {\r\n UnoCard unocard = hand.getCard(i);\r\n if ((unocard.getColor() == unoCardTgtColor) \r\n || unocard.getRank() > 24) {\r\n return hand.popCard(i); //had problem bug just because I forgot the 'i' in popCard...\r\n }\r\n }\r\n return null;\r\n } \r\n } //end special card prev, search for match\r\n \r\n for (int i = 0; i < hand.handSize(); i++) {\r\n UnoCard unocard = hand.getCard(i);\r\n \r\n/** Runs thru hand looks for regular wild cards, plays \r\n * them first*/\r\n if (unocard.getRank() > 24 && unocard.getRank() < 29) { \r\n return hand.popCard(i); \r\n/** Look for skip,reverse, D2, plays them next */\r\n } else if((unocard.getRank() > 18 && unocard.getRank() < 25) \r\n && UnoCard.unoCardsMatch(unocard, prev)) {\r\n return hand.popCard(i);\r\n }\r\n }\r\n/** After 'filters'\r\n * above, only cases are unocard < 19(normal cards 0 \r\n * to 9} or unocard wild Draw4. \r\n * Sort cards that are not special cards \r\n * or regular wild cards to play highest first \r\n */ \r\n UnoHand.insertionSortUnoHand(hand); \r\n \r\n // search from end of hand as hand sorted ascending\r\n for (int i = hand.handSize() - 1; i >= 0; i--) { \r\n UnoCard unocard = hand.getCard(i);\r\n if (unocard.getRank() <= 19 \r\n && UnoCard.unoCardsMatch(unocard, prev)) {\r\n return hand.popCard(i);\r\n // all else fails, play DrawFour\r\n }else if (unocard.getColor() > 3) { \r\n return hand.popCard(i);\r\n } \r\n }\r\n return null;\r\n }",
"@Override\n\tboolean isValid(){\n\t\tif(size()==5) {\n\t\t\tint suite = getCard(0).suit;\n\t\t\tfor(int i = 1 ; i< size(); i++) {\n\t\t\t\tif(getCard(i).suit != suite) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tsort();\n\t\t\tint currRank = (getCard(0).rank +11)%13;\n\t\t\tfor(int i=0; i<size(); i++) {\n\t\t\t\tif((getCard(i).rank+11)%13 != currRank) return false;\n\t\t\t\tcurrRank++;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}",
"@Test\n public void checkValidityTest2() {\n GenericStandardDeckGame g = new GenericStandardDeckGame();\n List<Card> deck = g.getDeck();\n deck.set(32, new Card(Card.number.four, Card.suit.club));\n assert (!g.checkValidity(deck));\n }",
"@Test\n public void isRedTest() {\n assertTrue(red_piece.isRed());\n assertTrue(!white_piece.isRed());\n }",
"@Test \n\tpublic void testIfValueisBlackPiece()\n\t{\n \tData d = new Data();\n\t\tassertFalse(d.isWhite(4)); // 4 is the value of one of the black pieces. \n\t}",
"int compareValue(Card c);",
"@Test\n\tpublic void test() {\n\t\tString r1 = CGroup.createRandomId();\n\t\tassertTrue(r1.matches(\"[0-9]+\"));\n\t\t\n\t\tString r2 = CGroup.createRandomId();\n\t\tassertFalse(r1.equals(r2));\n\t}",
"@Test\r\n public void testPlayer_getCautiousStrategyCardCard_higherFirst_wd4() {\n player2 = new Player(\"Player Two\", true);\r\n player2.setHand(strategyHand.getAllCards());\r\n\r\n // get rid of the wild so the wd4 is the most attractive option\r\n player2.getHand().discard(wild);\r\n assertTrue(player2.getCautiousStrategyCard(yellowThree, yellowThree.getColor()).equals(wildDrawFour));\r\n }",
"@Ignore\n @Test\n public void kingSecurity() {\n board = new Board(\"rnbqkbnr/ppp2ppp/8/8/8/8/3PPPPP/RNBQKBNR w qkQK -\");\n board.printBoard();\n\n int value = StaticEvaluator.getValue(board.getSquares());\n\n assertTrue(value > 0);\n\n }",
"private boolean faceCard(ArrayList<Card> cards) {\r\n\t\tfor (Card card: cards) {\r\n\t\t\tif (card.getValue() >= 11 && card.getValue() <= 13) \r\n\t\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"public static boolean validateCard(String[] args) {\n return true;\n }",
"@Test\n public void isCorrectTest(){\n BuyCard cardErr = new BuyCard(12,0);\n\n thrown.expect(IllegalArgumentException.class);\n thrown.expectMessage(\"Row index out of bounds.\");\n cardErr.isCorrect();\n }",
"private boolean checkMatch(InventoryCrafting inventoryCrafting,IInventory schematic, int par2, int par3, boolean par4) {\r\n\t\tfor (int k = 0; k < 5; ++k) {\r\n\t\t\tfor (int l = 0; l < 5; ++l) {\r\n\t\t\t\tint i1 = k - par2;\r\n\t\t\t\tint j1 = l - par3;\r\n\t\t\t\tItemStack itemstack = null;\r\n\r\n\t\t\t\tif (i1 >= 0 && j1 >= 0 && i1 < this.recipeWidth && j1 < this.recipeHeight) {\r\n\t\t\t\t\tif (par4) {\r\n\t\t\t\t\t\titemstack = this.recipeItems[this.recipeWidth - i1 - 1 + j1 * this.recipeWidth];\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\titemstack = this.recipeItems[i1 + j1 * this.recipeWidth];\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tItemStack itemstack1 = inventoryCrafting.getStackInRowAndColumn(k, l);\r\n\r\n\t\t\t\tif (itemstack1 != null || itemstack != null) {\r\n\t\t\t\t\tif (itemstack1 == null && itemstack != null || itemstack1 != null && itemstack == null) {\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (itemstack.getItem() != itemstack1.getItem()) {\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (itemstack.getItemDamage() != 32767 && itemstack.getItemDamage() != itemstack1.getItemDamage()) {\r\n\t\t\t\t\t\treturn 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\t// for debugging\r\n\t\t/* if(schematicTypeNeeded != null)\r\n\t\t * System.out.println(schematicTypeNeeded.getUnlocalizedName());\r\n\t\t * else System.out.println(\"null type needed\"); */\r\n\r\n\t\t// if there is no specilness needed, just return true\r\n\t\tif (schematicTypeNeeded == null) return true;\r\n\r\n\t\tItemStack schematicStack = schematic.getStackInSlot(0);\r\n\t\t\r\n\t\tif (schematicStack == null) return false;\r\n\r\n\t\tSystem.out.println(schematicStack.getUnlocalizedName());\r\n\r\n\t\tSystem.out.println(\"[NausicaaMod] block that needs schematic\");\r\n\r\n\t\tif (!schematicStack.hasTagCompound()) {\r\n\t\t\tSystem.out.println(\"[NausicaaMod] crafting canceled: no tags\");\r\n\t\t\treturn false;\r\n\r\n\t\t} else if (!SchematicHolder.getCanCraft(schematicStack, schematicTypeNeeded)) {\r\n\t\t\tSystem.out.println(\"[NausicaaMod] crafting canceled\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\r\n\t}",
"@Test //TEST THREE\n void testallNumbersRabbitName()\n {\n Rabbit_RegEx rabbit_Name = new Rabbit_RegEx();\n rabbit_Name.setRabbitName(\"12345\");\n assertFalse(rabbit_Name.getRabbitName().matches(\"[A-Za-z-]*\"));\n }",
"@Test\n void compareTo_NoMatch_AllParts() {\n runIsMatchTest(AnswerType.no, AnswerType.no, AnswerType.no, AnswerType.no, ContactMatchType.NoMatch);\n }",
"@Test\n void checkIsFalseForStringWithoutNumbers() {\n // Act, Assert\n assertFalse(IsNumeric.check(\"a\"));\n assertFalse(IsNumeric.check(\"ö\"));\n assertFalse(IsNumeric.check(\"\"));\n assertFalse(IsNumeric.check(\"´´´\"));\n assertFalse(IsNumeric.check(\"lgk\"));\n assertFalse(IsNumeric.check(\"lL y\"));\n assertFalse(IsNumeric.check(\" \"));\n assertFalse(IsNumeric.check(\"h* \"));\n assertFalse(IsNumeric.check(\"/+\"));\n assertFalse(IsNumeric.check(\"-\"));\n assertFalse(IsNumeric.check(\"+\"));\n assertFalse(IsNumeric.check(\"d\"));\n assertFalse(IsNumeric.check(\"ariel\"));\n assertFalse(IsNumeric.check(\"#€%/!\"));\n }",
"public void testCanPlayOn() {\n \n DrawCard redDraw2 = new DrawCard(Card.COLOUR_RED, 2);\n \n // create another 4 normal cards\n \n Card card1 = new Card(Card.COLOUR_BLUE, 5);\n Card card2 = new Card(Card.COLOUR_BLUE,2);\n \n //card 1 and card 2 should yield false on the method\n assertFalse(redDraw2.canPlayOn(card1));\n assertFalse(redDraw2.canPlayOn(card2));\n \n Card card3 = new Card(Card.COLOUR_RED, 5);\n Card card4 = new Card(Card.COLOUR_RED,2);\n \n // card 3 and card 4 should gives true\n \n assertTrue(redDraw2.canPlayOn(card3));\n assertTrue(redDraw2.canPlayOn(card4));\n \n }",
"@Test\n public void isNumericNegetive() {\n Boolean bool = Utils.isNumeric(\"123a\");\n Assert.assertEquals(false, bool);\n }",
"@Test\n public void shouldRetainDigitsAndWhiteSpace() {\n Assert.assertThat(\"match any digits\",CharMatcher.DIGIT.or(CharMatcher.WHITESPACE)\n .retainFrom(\"123TT T4\"),is(\"123 4\"));\n }",
"@Test\n @Disabled\n public void testValidateFormat() {\n assertTrue(RegExprMain.validateFormat(\"CC222CC\"));\n assertTrue(RegExprMain.validateFormat(\"DD333DD\"));\n assertTrue(RegExprMain.validateFormat(\"AA999AA\"));\n assertTrue(RegExprMain.validateFormat(\"VV555VV\"));\n assertTrue(RegExprMain.validateFormat(\"JJ777JJ\"));\n assertFalse(RegExprMain.validateFormat(\"J777JJ\"));\n assertFalse(RegExprMain.validateFormat(\"JJ777J\"));\n assertFalse(RegExprMain.validateFormat(\"JJ77JJ\"));\n assertFalse(RegExprMain.validateFormat(\"JJ777AA\"));\n assertFalse(RegExprMain.validateFormat(\"AA777JJ\"));\n \n\n }",
"@Test\n void checkIsTrueForStringWithNumbersWithSpacesAtTheBeginningAndEnd() {\n // Act, Assert\n assertTrue(IsNumeric.check(\" 3\"));\n assertTrue(IsNumeric.check(\"32 \"));\n assertTrue(IsNumeric.check(\" 3.2 \"));\n assertTrue(IsNumeric.check(\" -0.2\"));\n assertTrue(IsNumeric.check(\" -0.2d\"));\n assertTrue(IsNumeric.check(\"0.24D \"));\n assertTrue(IsNumeric.check(\"0.28 \"));\n assertTrue(IsNumeric.check(\" 3.8f\"));\n assertTrue(IsNumeric.check(\"-3.87F \"));\n }",
"@Test\n public void testStringCom11CaracteresIguaisIsNotCPF() {\n ArrayList<String> stringsCom11CaracteresIguais = new ArrayList<>();\n stringsCom11CaracteresIguais.add(\"00000000000\");\n stringsCom11CaracteresIguais.add(\"11111111111\");\n stringsCom11CaracteresIguais.add(\"22222222222\");\n stringsCom11CaracteresIguais.add(\"33333333333\");\n stringsCom11CaracteresIguais.add(\"44444444444\");\n stringsCom11CaracteresIguais.add(\"55555555555\");\n stringsCom11CaracteresIguais.add(\"66666666666\");\n stringsCom11CaracteresIguais.add(\"77777777777\");\n stringsCom11CaracteresIguais.add(\"88888888888\");\n stringsCom11CaracteresIguais.add(\"99999999999\");\n\n boolean todosInvalidos = true;\n for (String stringCom11CaracteresIguais : stringsCom11CaracteresIguais) {\n //Se algum for validado, o teste falha:\n if (ValidadorCPF.isCPF(stringCom11CaracteresIguais)) {\n todosInvalidos = false;\n }\n }\n assertTrue(todosInvalidos);\n }",
"@Test\n public void TestIlegalCorrectInputCheck(){\n Assert.assertEquals(player.CorrectInputCheck(\"horisonaz\",5,1,1)\n ,false , \" check horisontal spelling\"\n );\n\n //illegal : check vertical\n Assert.assertEquals(player.CorrectInputCheck(\"verticles\",5,1,1)\n ,false , \" check vertical spelling\"\n );\n\n //illegal : place a 5 ship horisontal at 0,1 outside of the grid\n Assert.assertEquals(player.CorrectInputCheck(\"horisontal\",5,0,1)\n ,false,\" illegal : place a 5 ship horisontal at 0,1 outside of the grid \"\n );\n\n // illegal : place a 5 ship horisontal at 1,0 outside of the grid\n Assert.assertEquals(player.CorrectInputCheck(\"horisontal\",5,1,0)\n ,false, \" illegal : place a 5 ship horisontal at 1,0 outside of the grid \"\n );\n\n // illegal : place a 5 ship horisontal at 7,1 ship is to big it goes outside the grid\n Assert.assertEquals(player.CorrectInputCheck(\"horisontal\",5,7,1)\n ,false , \" illegal : place a 5 ship horisontal at 7,1 outside of the grid \"\n );\n\n // illegal : place a 5 ship horisontal at 1,10\n Assert.assertEquals(player.CorrectInputCheck(\"vertical\",5,1,7)\n ,false , \" illegal : place a 5 ship horisontal at 1,7 outside of the grid \"\n );\n\n\n }",
"@Test\r\n public void testHasAtLeastTwoPlayableCards() {\n Player player2 = new Player(\"Three Playable Cards Test\", true);\r\n Hand threePlayableCardsHand = strategyHand;\r\n player2.setHand(threePlayableCardsHand.getAllCards());\r\n\r\n // Make it harder to find playable cards:\r\n player2.getHand().discard(new Card(Card.COLORLESS, Card.WILD, cvm));\r\n player2.getHand().discard(new Card(Card.COLORLESS, Card.WILD_DRAW_FOUR, cvm));\r\n\r\n Card currentPlayedCard_1 = new Card(Card.YELLOW, Card.ONE, cvm);\r\n assertTrue(player2.hasAtLeastTwoPlayableCards(currentPlayedCard_1, Card.BLUE));\r\n\r\n Card currentPlayedCard_2 = new Card(Card.BLUE, Card.SEVEN, cvm);\r\n assertFalse(player2.hasAtLeastTwoPlayableCards(currentPlayedCard_2, Card.BLUE));\r\n }",
"@Override\n public boolean anotherPlayIsPossible()\n {\n \t\n List<Integer> test = cardIndexes();\n return containsSum13(test) || containsK(test);\n \n }",
"@Test //TEST FOUR\n void testOneNumberinRabbitName()\n {\n Rabbit_RegEx rabbit_Name = new Rabbit_RegEx();\n rabbit_Name.setRabbitName(\"MO0N\");\n assertFalse(rabbit_Name.getRabbitName().matches(\"[A-Za-z-]*\"));\n }",
"@Test(priority = 7, description=\"Check for remaining cards field, with bad value to Draw\", dependsOnGroups = \"StatusCheck\")\n public void drawUsingBadCountValue() throws IOException, URISyntaxException {\n response = DeckOfCardsApi.drawCardsFromDeckUsingGet(\"https://deckofcardsapi.com/api/deck/\", deckID, \"-1\");\n jsonObject = DeckOfCardsApi.getJsonData(response);\n\n Assert.assertEquals(DeckOfCardsApi.getJsonValue(jsonObject, jkey_remaining), \"50\", \"Expected to Fail, Seems like an error in the API; When given -n, n is a number, All Cards are deleted but only n card remains.\");\n }",
"@Test\n \tpublic void testDisprovingSuggestion() {\n \t\t//Set suggestion\n \t\tSolution suggestion = new Solution(\"Colonel Mustard\", \"Knife\", \"Library\");\n \t\tComputerPlayer computer1 = new ComputerPlayer();\n \t\tComputerPlayer computer2 = new ComputerPlayer();\n \t\tComputerPlayer computer3 = new ComputerPlayer();\n \t\tHumanPlayer human = new HumanPlayer();\n \t\tArrayList<Card> hand = new ArrayList<Card>();\n \t\tArrayList<ComputerPlayer> comps = new ArrayList<ComputerPlayer>();\n \t\t\n \t\t\n \t\t//ensure If a player (human or computer) has a card that's suggested, that card is \"shown\"\n \t\tCard mustardCard = new Card(\"Colonel Mustard\", Card.cardType.PERSON);\n \t\thand.add(mustardCard);\n \t\tcomputer1.setCards(hand);\n \t\tAssert.assertEquals(computer1.disproveSuggestion(suggestion), mustardCard);\n \t\t\n \t\t\n \t\t//ensure If the player has multiple cards that match, the card to be returned is selected randomly.\n \t\tCard knifeCard = new Card (\"Knife\", Card.cardType.WEAPON);\n \t\tCard libraryCard = new Card(\"Library\", Card.cardType.ROOM);\n \t\thand.add(knifeCard);\n \t\thand.add(libraryCard);\n \t\thuman.setCards(hand);\n \t\tint mustard = 0, knife = 0, library = 0;\n \t\t//make sure card is valid and counts how many times each card is returned\n \t\tfor(int i = 0; i < 100; i++) {\n \t\t\tCard disproved = human.disproveSuggestion(suggestion);\n \t\t\t\n \t\t\tif(disproved == mustardCard)\n \t\t\t\tmustard++;\n \t\t\telse if(disproved == knifeCard)\n \t\t\t\tknife++;\n \t\t\telse if(disproved == libraryCard)\n \t\t\t\tlibrary++;\n \t\t\telse\n \t\t\t\tfail(\"Invalid card returned\");\n \t\t}\n \t\t//makes sure every card is returned more than once\n \t\tAssert.assertTrue(mustard > 10);\n \t\tAssert.assertTrue(knife > 10);\n \t\tAssert.assertTrue(library > 10);\n \t\t\n \t\thuman.setCards(null);\n \t\tgame.setCurrentPlayer(game.getHuman());\n \t\t\t\n \t\t//ensure In the board game, disproving a suggestion starts with a player to the left of the person making the suggestion\n \t\thand.remove(mustardCard);\n \t\thand.remove(knifeCard);\n \t\tcomputer2.setCards(hand);\n \t\thand.remove(libraryCard);\n \t\thand.add(knifeCard);\n \t\tcomputer3.setCards(hand);\n \t\tcomps.add(computer1);\n \t\tcomps.add(computer2);\n \t\tcomps.add(computer3);\n \t\t\n \t\tint comp1 = 0, comp2 = 0, comp3 = 0;\n \t\tgame.setComputer(comps);\n \t\tfor(int i = 0; i < 100; i++) {\n \t\t\tCard returned = game.handleSuggestion(suggestion);\n \t\t\tif(returned == mustardCard)\n \t\t\t\tcomp1++;\n \t\t\telse if(returned == libraryCard)\n \t\t\t\tcomp2++;\n \t\t\telse if(returned == knifeCard)\n \t\t\t\tcomp3++;\n \t\t\telse\n \t\t\t\tfail(\"Invalid card returned\");\t\n \t\t}\n\t\t//Assert.assertTrue(comp1 > 10);\n\t\t//Assert.assertTrue(comp2 > 10);\n \t\tAssert.assertTrue(comp3 > 10);\n \t\t//ensure The player making the suggestion should not be queried\n \t\tgame.setCurrentPlayer(computer1);\n \t\tfor(int i = 0; i < 100; i++) {\n \t\t\tCard returned = game.handleSuggestion(suggestion);\n \t\t\tif(returned == mustardCard)\n \t\t\t\tfail(\"Suggesting player cannot return a card\");\t\n \t\t}\n \t}",
"public Card()\r\n {\r\n rand = new Random();\r\n value = rand.nextInt(28); \r\n // Assigning value\r\n if (value >= 14) // Check if value is greater than 14 then value = value - 14;\r\n value -= 14;\r\n // Assigning color\r\n rand = new Random();\r\n // Switch statement for assigning different colors\r\n switch(rand.nextInt(4) )\r\n {\r\n case 0: color = \"Red\"; \r\n break;\r\n case 1: color = \"Green\"; \r\n break;\r\n case 2: color = \"Blue\"; \r\n break;\r\n case 3: color = \"Yellow\"; \r\n break;\r\n }\r\n // If the card is a wild card and value is greater than or equal to 13 then none value is assigned to color variable\r\n if (value >= 13)\r\n color = \"none\";\r\n }",
"@Test\n public void TestLegalCorrectInputCheck(){\n Assert.assertEquals(player.CorrectInputCheck(\"horisontal\",5,1,1)\n ,true , \" check horisontal \"\n );\n\n //legal : check vertical spelling\n Assert.assertEquals(player.CorrectInputCheck(\"vertical\",5,1,1)\n ,true , \" check vertical \"\n );\n\n //legal : place a 5 ship horisontal at 1,1\n Assert.assertEquals(player.CorrectInputCheck(\"horisontal\",5,1,1)\n ,true , \" legal : place a 5 ship horisontal at 1,1 \"\n );\n\n // legal : place a 5 ship horisontal at 1,10\n Assert.assertEquals(player.CorrectInputCheck(\"horisontal\",5,1,10)\n ,true ,\" legal : place a 5 ship horisontal at 1,10 \"\n );\n\n // legal : place a 5 ship vertical at 1,10\n Assert.assertEquals(player.CorrectInputCheck(\"vertical\",5,1,1)\n ,true , \" legal : place a 5 ship vertical at 1,10 \"\n );\n\n // legal : place a 5 ship vertical at 1,10\n Assert.assertEquals(player.CorrectInputCheck(\"vertical\",5,10,1)\n ,true ,\"000 legal : place a 5 ship vertical at 1,10 \"\n );\n\n // legal : place a 5 ship horisontal at 6,1\n Assert.assertEquals(player.CorrectInputCheck(\"horisontal\",5,6,1)\n ,true , \" legal : place a 5 ship horisontal at 6,1 \"\n );\n\n // legal : place a 5 ship vertical at 1,6\n Assert.assertEquals(player.CorrectInputCheck(\"vertical\",5,1,6)\n ,true ,\"000 legal : place a 5 ship vertical at 10,6 \"\n );\n\n }",
"public boolean match( DataExp p ) { return false; }",
"@Test\n\tpublic void testIfKingIsNotOnSpecialSquare()\n\t{\n\t\tData d = new Data();\n\t\tassertFalse(d.isKingOnSpecialSquare(61));\n\t\tassertFalse(d.isKingOnSpecialSquare(2));\n\t}",
"@Test\n public void testNumbersInvalid() throws Exception {\n testLexerSource(\"6x foo\", true, INVALID, WHITESPACE, IDENTIFIER);\n testLexerSource(\"6g foo\", true, INVALID, WHITESPACE, IDENTIFIER);\n testLexerSource(\"6xsd foo\", true, INVALID, WHITESPACE, IDENTIFIER);\n testLexerSource(\"6gsd foo\", true, INVALID, WHITESPACE, IDENTIFIER);\n }",
"void showFaithCards(int first, int second, int third);",
"protected final boolean isDifferentColor(Card cardOne, Card cardTwo)\n {\n return cardOne.getColor() != cardTwo.getColor();\n }",
"@Test\n\tpublic void testDigitTestReplacementInValid() {\n\t\tString input = \"0\";\n\t\tString actualOutput = GeneralUtility.digitHasReplacement(input);\n\t\tAssert.assertEquals(null, actualOutput);\n\t}",
"@Test\r\n public void testPlayer_getCautiousStrategyCardCard_higherFirst_drawTwo() {\n player2 = new Player(\"Player Two\", true);\r\n player2.setHand(strategyHand.getAllCards());\r\n\r\n // let the cpc be a red nine\r\n // get rid of the wild and wd4 cards so the red draw two is the most attractive option\r\n player2.getHand().discard(wild);\r\n player2.getHand().discard(wildDrawFour);\r\n Card redNine = new Card(Card.RED, Card.NINE, cvm);\r\n assertTrue(player2.getCautiousStrategyCard(redNine, redNine.getColor()).equals(redDrawTwo));\r\n }",
"private boolean determineValid(){\n for(Integer val : group){\n if(!racers.containsKey(val)){\n WrongNumber = val;\n return false;\n }\n }\n return true;\n }",
"public static boolean isValid(String _card){\r\n\t\t//communication with sumOfDoubleEvenPlace() and sumOfOddPlace()\r\n\t\tsumOfDoubleEvenPlace(_card);\r\n\t\tsumOfOddPlace(_card);\r\n\t\tgetCompany(_card);\r\n\t\tString _errorLength = \"Invalid number of digits.\";\r\n\t\tString _errorInvalid = \"Invalid credit card number.\";\r\n\t\t\r\n\t\t//condition for valid credit card.\r\n\t\tif((getCompany(_card) != _errorInvalid) && (getCompany(_card) != _errorLength)){\r\n\t\t\tif((sumOfDoubleEvenPlace(_card) + sumOfOddPlace(_card) != 0)){\t//if user enters all zeroes\r\n\t\t\t\tif ((sumOfDoubleEvenPlace(_card) + sumOfOddPlace(_card)) % 10 == 0 ){\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\treturn false;\r\n\t\t\t\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\treturn false;\r\n\t\t}\t\r\n\t}",
"@Test\n\tpublic void verifyCombosOnBoard() {\n\t\tBoard board = boardFactory.fromTextGenerateBoard(\"/boards/1LineOf3.txt\", mockGroup);\n\t\tassertFalse(board.outOfMoves());\n\n\t}",
"@Test(expected = TooManyDiscardsException.class)\n public void allow_discard_no_more_than_2_cards(){\n\n Deck deck = new Deck();\n Card card1 = new Card(3,2,5);\n Card card2 = new Card(2,7,1);\n Card card3 = new Card(2,7,1);\n deck.add(card1);\n deck.add(card2);\n deck.add(card3);\n Game game = new Game(deck);\n\n game.join(\"susan\");\n game.join(\"peter\");\n\n Card pickedCard1 = game.pickCard(\"susan\");\n game.discard(\"susan\");\n Card pickedCard2 = game.pickCard(\"susan\");\n game.discard(\"susan\");\n Card pickedCard3 = game.pickCard(\"susan\");\n game.discard(\"susan\");\n\n }",
"@Test\n public void testTakeNumberFromString224() { // FlairImage: 224\n assertEquals(\"From: FlairImage line: 225\", 123, takeNumberFromString(\"123\")); \n assertEquals(\"From: FlairImage line: 226\", 0, takeNumberFromString(\"123a\")); \n assertEquals(\"From: FlairImage line: 227\", -123, takeNumberFromString(\"-123\")); \n assertEquals(\"From: FlairImage line: 228\", 0, takeNumberFromString(\"--123\")); \n assertEquals(\"From: FlairImage line: 229\", 0, takeNumberFromString(\"pz4\")); \n }",
"@Test\n public void test000_collision_scheme() {\n HashTableADT htIntegerKey = new HashTable<Integer, String>();\n int scheme = htIntegerKey.getCollisionResolution();\n if (scheme < 1 || scheme > 9)\n fail(\"collision resolution must be indicated with 1-9\");\n }",
"protected boolean canChoose(int n, Board gameBoard) {\n Card chosenCard = myCards.get(n);// get the chosenCard\n Card groundCard = gameBoard.getGroundCard();\n if (chosenCard.getColor() == groundCard.getColor()) { // if they had same color\n return true;\n }\n if (chosenCard instanceof NumericCard && groundCard instanceof NumericCard) {// if they had same number\n NumericCard tempChosen = (NumericCard) chosenCard; // change the static type\n NumericCard tempground = (NumericCard) groundCard; // change the static type\n if (tempChosen.getNumber() == tempground.getNumber()) {\n return true;\n }\n }\n\n if (groundCard.getClass().equals(chosenCard.getClass()) && !(groundCard instanceof NumericCard)\n && !(chosenCard instanceof NumericCard)) {// if they were sameInstance\n return true;\n }\n return false;\n }",
"@Test\n\tpublic void TestR1NonIntegerParseableChars() {\n\t\tString invalid_solution = \"a74132865635897241812645793126489357598713624743526189259378416467251938381964572\";\n\t\tassertEquals(-1, sv.verify(invalid_solution));\n\t}"
] | [
"0.7716127",
"0.726576",
"0.71657795",
"0.6784718",
"0.6116214",
"0.60920346",
"0.6069052",
"0.59803843",
"0.59409875",
"0.58873224",
"0.58651394",
"0.5849499",
"0.58392483",
"0.58081114",
"0.5796819",
"0.57575345",
"0.57564896",
"0.5713951",
"0.5704936",
"0.5664257",
"0.5637904",
"0.5630886",
"0.5627698",
"0.5626189",
"0.56212664",
"0.55966055",
"0.55934733",
"0.5590011",
"0.5552665",
"0.5537475",
"0.5534602",
"0.5534153",
"0.5511223",
"0.5510925",
"0.54794455",
"0.5477812",
"0.5467278",
"0.54654914",
"0.54608494",
"0.54573846",
"0.5445445",
"0.5441369",
"0.5440427",
"0.5431573",
"0.5428425",
"0.5425599",
"0.5411187",
"0.53955346",
"0.5395484",
"0.53883237",
"0.53701174",
"0.53620017",
"0.53592885",
"0.53458863",
"0.5337801",
"0.53367996",
"0.53187233",
"0.5314569",
"0.53123724",
"0.53095055",
"0.5286934",
"0.52864593",
"0.5267898",
"0.5266711",
"0.52599055",
"0.5259507",
"0.5255059",
"0.52415085",
"0.5241506",
"0.52364564",
"0.52283883",
"0.52208245",
"0.5212893",
"0.521282",
"0.5209016",
"0.5208737",
"0.5203223",
"0.51921093",
"0.51775956",
"0.5177584",
"0.51756036",
"0.51728487",
"0.5167655",
"0.5164283",
"0.5160499",
"0.5159277",
"0.51556396",
"0.5150881",
"0.51426375",
"0.5136788",
"0.51354194",
"0.5135278",
"0.5133637",
"0.5133124",
"0.51272905",
"0.51272136",
"0.51057434",
"0.51050687",
"0.5104969",
"0.5099344"
] | 0.77016693 | 1 |
make sure getDumbStrategyCard returns null if no legal card found | @Test
public void testPlayer_getDumbStrategyCard_null() {
player2 = new Player("", true);
Hand hand = new Hand();
player2.setHand(hand.getAllCards());
assertEquals(player2.getDumbStrategyCard(yellowOne, yellowOne.getColor()), null);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public DevCard giveDevCard(){\n \n return null;\n }",
"@Override\n public boolean canUseCard(){\n return false;\n }",
"public Card enemyPlayCard(){ //Is it really worth the effort to give the enemy a full deck/temp hand? Having 2-4 basic abilities that vary should be enough.\n if(!(enemyHand.isEmpty())){\n return enemyHand.get(0);\n } else {\n return null;\n }\n }",
"public CardStack getAvailableCards()\n {\n return null;\n }",
"@Test\r\n public void testGetSpecificCard() {\r\n Deck instance = new Deck();\r\n System.out.println(\"Testing getSpecificCard\");\r\n Card result = instance.getSpecificCard(51);\r\n System.out.println('\\t' + \"Card toString: \" + result.toString());\r\n assertNotNull(result);\r\n }",
"ICard getTopCard() throws IllegalArgumentException;",
"Card getCard(UUID cardId);",
"Symbol getActiveCard();",
"@Test\r\n public void testPlayer_getDumbStrategyCard_differentWinners() {\r\n player2 = new Player(\"\", true);\r\n player2.setHand(strategyHand.getAllCards());\r\n boolean differentLegalCardFound = false;\r\n Card firstDiscard = player2.getDumbStrategyCard(yellowSix, yellowSix.getColor());\r\n for(int i = 0; i < 25; i++) {\r\n Card loopCard = player2.getDumbStrategyCard(yellowSix, yellowSix.getColor());\r\n if(!loopCard.equals(firstDiscard)) {\r\n differentLegalCardFound = true;\r\n }\r\n }\r\n assertTrue(differentLegalCardFound);\r\n }",
"public de.uni_koblenz.jgralabtest.schemas.gretl.pddsl.Card createCard();",
"@Test\n public void buyCardWithNoResources() throws Exception {\n when(devCardFacade.canBuyDevCard(noDevCardsPlayer)).thenReturn(false);\n dcc.buyCard();\n verify(devCardFacade, never()).buyDevCard(noDevCardsPlayer);\n }",
"@Test\r\n public void testPlayer_getCautiousStrategyCardCard_higherFirst_wd4() {\n player2 = new Player(\"Player Two\", true);\r\n player2.setHand(strategyHand.getAllCards());\r\n\r\n // get rid of the wild so the wd4 is the most attractive option\r\n player2.getHand().discard(wild);\r\n assertTrue(player2.getCautiousStrategyCard(yellowThree, yellowThree.getColor()).equals(wildDrawFour));\r\n }",
"@Override\n\tpublic MedicalCard issueCard(Patient patient) {\n\t\treturn null;\n\t}",
"public Card dealCard()\n {\n Card errorReturn = new Card('E', Card.Suit.spades); // in rare cases\n\n if (topCard == 0)\n return errorReturn;\n else\n return cards[--topCard];\n }",
"public static Bitmap GetCardSoruceBitmap()\r\n\t{\r\n\t\tBitmap image = null;\r\n\t\tif(CGameHelper.m_GameContext != null)\r\n\t\t{\r\n\t\t\tResources res = CGameHelper.m_GameContext.getResources();\r\n\t\t\tif(res == null)\r\n\t\t\t\treturn image; \r\n\r\n\t\t\tif(IsPortraitMode())\r\n\t\t\t{\r\n\t\t\t\tif(m_CardBitmapProtrait == null)\r\n\t\t\t\t{\r\n\t\t\t\t\tm_CardBitmapProtrait = BitmapFactory.decodeResource(res, R.drawable.card);\r\n\t\t\t\t}\r\n\t\t\t\timage = m_CardBitmapProtrait;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tif(m_CardBitmapLandscape == null)\r\n\t\t\t\t{\r\n\t\t\t\t\tm_CardBitmapLandscape = BitmapFactory.decodeResource(res, R.drawable.card2);\r\n\t\t\t\t}\r\n\t\t\t\timage = m_CardBitmapLandscape;\r\n\t\t\t}\r\n\t\t} \r\n\t\treturn image;\r\n\t}",
"public Card[] GetCardStack() { return null; }",
"@Test\r\n public void testPlayer_getCautiousStrategyCardCard_higherFirst_drawTwo() {\n player2 = new Player(\"Player Two\", true);\r\n player2.setHand(strategyHand.getAllCards());\r\n\r\n // let the cpc be a red nine\r\n // get rid of the wild and wd4 cards so the red draw two is the most attractive option\r\n player2.getHand().discard(wild);\r\n player2.getHand().discard(wildDrawFour);\r\n Card redNine = new Card(Card.RED, Card.NINE, cvm);\r\n assertTrue(player2.getCautiousStrategyCard(redNine, redNine.getColor()).equals(redDrawTwo));\r\n }",
"public Card pullCard(){\n if(this.deckOfCards.isEmpty()){\n return null;\n }\n Card cardPulled = this.deckOfCards.get(0);\n this.deckOfCards.remove(0);\n return cardPulled;\n }",
"public Card getCard() {\n return this.card;\n }",
"ICard getCard(int cardIndex) throws IllegalArgumentException;",
"public Card drawCard() {\n Card c = cards.get(0);//get a card\n cards.remove(0);//remove the card form the deck that's given out\n discard.add(c);//so the card given out is added to the discard list\n return c;//return a card object\n\n }",
"public Pricing checkoutVehicle(Card card) {\n return null;\n }",
"Card dealOneCard();",
"public Card inspectCard(int k)\r\n {\r\n if (0 <= k && k < numCards && myCards[k] != null && \r\n myCards[k].getErrorFlag() == true)\r\n {\r\n return myCards[k];\r\n }\r\n return new Card('E', Card.Suit.valueOf(\"SPADES\"));\r\n }",
"public Card getCard() {\n return this.card;\n }",
"public Optional<Card> dealOneCard() {\n if (cards.size() > 0) {\n return Optional.of(cards.remove(0));\n } else {\n return Optional.empty();\n }\n }",
"public Card dealCard() {\n //Return an invalid card if there are no cards in the deck.\n if (this.topCard < 0)\n return new Card('0', Card.Suit.spades);\n else {\n //Create a copy of the card on the top of the deck.\n Card card = new Card(this.cards[this.topCard - 1]);\n //Set the actual card on the top of the deck to null, to destroy it.\n this.cards[this.topCard - 1] = null;\n //The topCard is now one less than it was.\n this.topCard--;\n //return the copy.\n return card;\n }\n }",
"@Test\r\n public void testPlayer_getDumbStrategyCard_oneWinner_color() {\n player2 = new Player(\"\", true);\r\n player2.setHand(strategyHand.getAllCards());\r\n player2.getHand().discard(wild);\r\n player2.getHand().discard(wildDrawFour);\r\n assertTrue(player2.getDumbStrategyCard(blueNine, blueNine.getColor()).equals(blueFour));\r\n }",
"public Map<String,Card> getCard(){\n return null;\n }",
"Card inspectCard(int k)\n {\n\n Card errorReturn = new Card('E', Card.Suit.spades); // in rare cases\n\n if (k < 0 || k >= numCards)\n return errorReturn;\n else\n return myCards[k];\n }",
"public CardDeck getDeck(String name)\n {\n if(deckStore.isValidName(name) == false)\n {\n return null;\n }\n \n return deckStore.get(name);\n }",
"@Override\r\n\tpublic void buyCard() {\n\t\t\r\n\t}",
"public CardDeck getCardDeck() {\n return cardDeck;\n }",
"public Card chooseFromHand(String sign , String colorName){\n Scanner scanner = new Scanner(System.in);\n Card chosenCard = null;\n int cardIndex;\n do{\n System.out.println(\"which cart ? (-1 to pick up card from cardDeck) ?\");\n cardIndex =scanner.nextInt();\n// scanner.nextLine();\n if(cardIndex == -1){\n ArrayList<Card> playableCards = playableNormalCards(sign , colorName);\n if(playableCards.size() == 0){\n return null;\n }\n else {\n System.out.println(\"you still can play : \");\n for(Card card : playableCards){\n System.out.print(card + \" \");\n }\n System.out.println();\n }\n }\n else if(cardIndex<=0 ||cardIndex > hand.size()){\n System.out.println(\"not valid input\");\n System.out.println(\"please try again : \");\n }\n else if(hand.get(cardIndex-1).getSign().equals(\"B\")){\n chosenCard = hand.get(cardIndex -1);\n }\n else if((!(hand.get(cardIndex-1).getSign().equals(sign))) &&\n (!(hand.get(cardIndex-1).getColorName().equals(colorName)))){\n System.out.println(\"not playable card\");\n System.out.println(\"please try again : \");\n }\n else{\n chosenCard = hand.get(cardIndex - 1);\n }\n\n }while(cardIndex <= 0 || cardIndex > hand.size() || chosenCard == null);\n\n\n hand.remove(chosenCard);\n return chosenCard;\n }",
"@Override\r\n public Card getSecondCard() {\r\n return this.secondCard.equals(null) ? Card.NONE : this.secondCard;\r\n }",
"public Card dealCard() {\n if (deck.size() == 52) {\n shuffle();\n }\n Card temp;\n temp = deck.get(0);\n remove(0);\n return temp;\n }",
"@Test\n public void buyCard() throws Exception {\n model.getTurnTracker().setCurrentTurn(PlayerIndex.FIRST);\n when(devCardFacade.canBuyDevCard(currentPlayer)).thenReturn(true);\n dcc.buyCard();\n verify(devCardFacade, atMost(1)).buyDevCard(currentPlayer);\n }",
"private static Card getCard(String bank, String number, Date date) throws InvalidBankException {\n \n Card card = new Card(bank, number, date);\n \n if (HSBCCA.equalsName(bank)) {\n card.setComponents(new SixteenDigitsWithDashes(),\n new ShowFirstTwoMasker());\n } else if (RBC.equalsName(bank)) {\n card.setComponents(new SixteenDigitsWithDashes(),\n new ShowFirstFourMasker());\n } else if (AMEX.equalsName(bank)) {\n card.setComponents(new FifteenDigitsWithDashesValidator(),\n new ShowLastThreeMasker());\n } else {\n throw new InvalidBankException(\"Bank \" + bank + \" is not a valid bank name\");\n }\n \n return card;\n }",
"public Card inspectCard(int k) {\n if (k >= this.numCards || k < 0)\n return new Card('0', Card.Suit.spades);\n else\n return new Card(this.myCards[k]);\n }",
"@Override\n public Card playCard() {\n List<Card> rank1 = new ArrayList<>();\n List<Card> rank2 = new ArrayList<>();\n List<Card> rank3 = new ArrayList<>();\n List<Card> rank4 = new ArrayList<>();\n for (Card card : cardsInHand) {\n if (card.getRank().equals(Card.Rank.EIGHT)) {\n rank1.add(card);\n break;\n } else if (card.getSuit().equals(idealSuit)\n && card.getRank().equals(idealRank)\n && (topCard.getSuit().equals(card.getSuit())\n || topCard.getRank().equals(card.getRank()))) {\n rank2.add(card);\n } else if ((card.getSuit().equals(idealSuit) || card.getRank().equals(idealRank))\n && (topCard.getSuit().equals(card.getSuit())\n || topCard.getRank().equals(card.getRank()))) {\n rank3.add(card);\n } else if (topCard.getSuit().equals(card.getSuit())\n || topCard.getRank().equals(card.getRank())) {\n rank4.add(card);\n }\n }\n List<List<Card>> playPossibilities = new ArrayList<>(Arrays.asList(rank1, rank2, rank3, rank4));\n for (List<Card> list : playPossibilities) {\n if (list.size() > 0) {\n cardsInHand.remove(list.get(0));\n return list.get(0);\n }\n }\n // This method will never return null if shouldDrawCard() is called beforehand.\n return null;\n }",
"public void catchCard(){\r\n changePlace(deck);\r\n changePlace(hand);\r\n }",
"public TrainCard usedCard(){\n TrainCard removedCard = cardDeck.remove(0);\n return removedCard;\n }",
"public Card inspectCard(int k) {\n //If k is invalid, return an invalid card.\n if (k >= this.topCard || k < 0)\n return new Card('0', Card.Suit.spades);\n else\n //Otherwise, return a copy of the card in position k.\n return new Card(this.cards[k]);\n }",
"@Test(expected = IllegalStateException.class)\n public void getDrawCardsOne() {\n this.reset();\n this.bps.getDrawCards();\n }",
"public boolean isCard() {\n\t\treturn id > 0 && id < 53;\n\t}",
"public Card getPresentCard() {\n return storageCards.peek();\n }",
"public Card chooseCard(Hand h, Trick t);",
"public CardGao dealCard()\r\n {\r\n return cards.get(top--);\r\n\r\n }",
"public UnoCard getCardByName(String cardName){\n Drawable color_change_plus4 = this.appContext.getResources().getDrawable(R.drawable.color_change_plus4);\n Drawable card_back = this.appContext.getResources().getDrawable(R.drawable.card_back);\n UnoCard card = new UnoCard(this.appContext, deckPos, new Point(20, 20), color_change_plus4, card_back, \"Color Change Plus 4\", \"\", \"COLOR CHANGE PLUS 4\", \"COLOR CHANGE PLUS 4\");\n for (UnoCard c : this.cards){\n if (c.getName().equals(cardName)){\n card = c;\n break;\n }\n }\n return card;\n }",
"public Card getWinningCard() {\n return winningCard;\n }",
"@Test\r\n public void testDrawCard() {\r\n Deck instance = new Deck();\r\n System.out.println(\"Testing drawCard\");\r\n Card result = instance.drawCard();\r\n System.out.println('\\t' + \"Card toString: \" + result.toString());\r\n assertNotNull(result); \r\n }",
"private Image getCardImage(Card card) {\n return getImage(\"playing-cards/\" + card + \".png\");\n }",
"public Card inspectCard(int k)\n {\n\n Card errorReturn = new Card('E', Card.Suit.spades); // in rare cases\n\n if (k < 0 || k >= topCard)\n return errorReturn;\n else\n return cards[k];\n }",
"public Card PlayCard() {\n\t Card ret = null;\n\t Card card;\n\t if (mCardCount > 0) {\n\t\t // To work out what card to play, see what cards can be played\n\t\t \tCard[] playableCards;\n\t\t \tplayableCards = mRules.GetPlayableCards();\n\t\t \tCard[] selectedCards;\n\t\t \tselectedCards = new Card[8];\n\t\t \tint iNumSelectableCards = 0;\n\t\t \tfor (int i = 0; i < 8; i++)\n\t\t \t\tselectedCards[i] = null;\n\t \tfor (int i = 0; i < mCardCount; i++){\n\t \t\tcard = mCard[i];\n\t \t\tswitch (card.GetSuit()){\n\t \t\tcase Card.HEARTS:\n\t \t\t\t\n\t \t\t\t// Card is a heart, can it be played?\n\t \t\t\t// Is it a seven, it can be played...\n\t \t\t\tif (card.GetValue() == 7){\n\t \t\t\t\tselectedCards[Rules.HEARTS8] = card;\n\t \t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t// and must be played first\n\t \t\t\t\tplayableCards[Rules.HEARTS8] = new Card(8,Card.HEARTS);\n\t \t\t\t\tplayableCards[Rules.HEARTS6] = new Card(6,Card.HEARTS);\n\t \t\t\t\tplayableCards[Rules.CLUBS8] = new Card(7,Card.CLUBS);\n\t \t\t\t\tplayableCards[Rules.DIAMONDS8] = new Card(7,Card.DIAMONDS);\n\t \t\t\t\tplayableCards[Rules.SPADES8] = new Card(7,Card.SPADES);\n\t \n\t \t\t\t\treturn card;\n\t \t\t\t}\n\t \t\t\tif (card.GetValue() < 7){\n\t \t\t\t\tif (card.Equals(playableCards[Rules.HEARTS6])){\n\t \t\t\t\t\tselectedCards[Rules.HEARTS6] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t\t//Log.i(\"\",\" Playing card \" + (card.GetValue()) + \" , \" +card.GetSuit());\n\t \t\t\t\t\t//Log.i(\"\",\" Updating playable card \" + (card.GetValue()-1) + \" , \" +Card.HEARTS);\t \t\t\t\t\t\n\t \t\t\t\t\t//playableCards[Rules.HEARTS6] = new Card(card.GetValue()-1,Card.HEARTS);\n\t \t\t\t\t\t//return card;\n\t \t\t\t\t}\n\t \t\t\t}\n\t \t\t\tif (card.GetValue() > 7){\n\t \t\t\t\tif (card.Equals( playableCards[Rules.HEARTS8])){\n\t \t\t\t\t\tselectedCards[Rules.HEARTS8] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t\t//Log.i(\"\",\" Playing card \" + (card.GetValue()) + \" , \" +card.GetSuit());\n\t \t\t\t\t\t//Log.i(\"\",\" Updating playable card \" + (card.GetValue()+1) + \" , \" +Card.HEARTS);\t \t\t\t\t\t\n\t \t\t\t\t\t//playableCards[Rules.HEARTS8] = new Card(card.GetValue()+1,Card.HEARTS);\n\t \t\t\t\t\t//return card;\n\t \t\t\t\t}\n\t \t\t\t}\t \t\t\t\n\t \t\t\t\n\t \t\t\tbreak;\n\t \t\tcase Card.DIAMONDS:\n\t \t\t\t// Is it a seven, it can be played...\n\t \t\t\tif (card.GetValue() == 7){\n\t \t\t\t\tif (card.Equals(playableCards[Rules.DIAMONDS8])){\n\t \t\t\t\t\tselectedCards[Rules.DIAMONDS8] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t}\n\t \t\t\t}\n\t \t\t\t\n\t \t\t\tif (card.GetValue() < 7){\n\t \t\t\t\tif (card.Equals( playableCards[Rules.DIAMONDS6])){\n\t \t\t\t\t\tselectedCards[Rules.DIAMONDS6] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t}\n\t \t\t\t}\n\t \t\t\tif (card.GetValue() > 7){\n\t \t\t\t\tif (card.Equals( playableCards[Rules.DIAMONDS8])){\n\t \t\t\t\t\tselectedCards[Rules.DIAMONDS8] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t}\n\t \t\t\t}\t\t \t\t\t\n\t \t\t\t\n\t \t\t\tbreak;\n\t \t\t\t\n\t \t\tcase Card.CLUBS:\n\t \t\t\t// Is it a seven, it can be played...\n\t \t\t\tif (card.GetValue() == 7){\n\t \t\t\t\tif (card.Equals(playableCards[Rules.CLUBS8])){\n\t \t\t\t\t\tselectedCards[Rules.CLUBS8] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t}\t \t\t\t\t\n\t \t\t\t}\n\t \t\t\t\n\t \t\t\tif (card.GetValue() < 7){\n\t \t\t\t\tif (card.Equals(playableCards[Rules.CLUBS6])){\n\t \t\t\t\t\tselectedCards[Rules.CLUBS6] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t}\n\t \t\t\t}\n\t \t\t\tif (card.GetValue() > 7){\n\t \t\t\t\tif (card.Equals(playableCards[Rules.CLUBS8])){\n\t \t\t\t\t\tselectedCards[Rules.CLUBS8] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t}\n\t \t\t\t}\t\t \t\t\t\n\t \t\t\tbreak;\n\t \t\t\t\n\t \t\tcase Card.SPADES:\n\t \t\t\t// Is it a seven, it can be played...\n\t \t\t\tif (card.GetValue() == 7){\n\t \t\t\t\tif (card.Equals(playableCards[Rules.SPADES8])){\n\t \t\t\t\t\tselectedCards[Rules.SPADES8] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t}\t \t\t\t\t\n\t \t\t\t}\n\t \t\t\t\n\t \t\t\tif (card.GetValue() < 7){\n\t \t\t\t\tif (card.Equals( playableCards[Rules.SPADES6])){\n\t \t\t\t\t\tselectedCards[Rules.SPADES6] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t}\n\t \t\t\t}\n\t \t\t\tif (card.GetValue() > 7){\n\t \t\t\t\tif (card.Equals( playableCards[Rules.SPADES8])){\n\t \t\t\t\t\tselectedCards[Rules.SPADES8] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t}\n\t \t\t\t}\t \t\t\t\n\t \t\t\tbreak;\n\n\t \t\t\t\t \t\t\t\n\t \t\t}\n\t\n\t \t}\t\n\t \t\n\t \t// Now go through the selectable cards and see which is best to be played\n\t \tif (iNumSelectableCards == 0)\n\t \t\treturn ret;\n\t \t\n\t \tint iPos;\n\t \tcard = null;\n\t \tif (iNumSelectableCards == 1){\n\t\t\t \tfor (int i = 0; i < 8; i++)\n\t\t\t \t\tif (selectedCards[i] != null){\n\t\t\t \t\t\tcard = selectedCards[i];\n\t\t\t \t\t\tbreak;\n\t\t\t \t\t}\n\t\t\t \t\t\t \t\n\t \t}\n\t \telse {\n\t\t\t String sDifficulty = mRules.mView.GetSettings().getString(\"Difficulty\", \"0\");// 0 = hard, 1 = easy\n\t\t\t int iDifficulty = Integer.parseInt(sDifficulty);\n\t\t\t if (iDifficulty == EASY){\n\t\t\t \t// Get a random card from the playable ones\n\t\t\t\t\t Random generator = new Random();\n\t\t\t\t\t int randomIndex = generator.nextInt( iNumSelectableCards );\n\t\t\t\t\t int iCount = 0;\n\t\t\t\t\t \tfor (int i = 0; i < 8; i++){\n\t\t\t\t\t \t\tif (selectedCards[i] != null){\n\t\t\t\t\t \t\t\tif (iCount == randomIndex){\n\t\t\t\t\t \t\t\t\tcard = selectedCards[i];\n\t\t\t\t\t \t\t\t\tbreak;\n\t\t\t\t\t \t\t\t}\n\t\t\t\t\t \t\t\telse iCount++;\n\t\t\t\t\t \t\t}\t\n\t\t\t\t\t \t}\n\t\t\t }\n\t\t\t else {\n\t\t\t \tiPos = GetBestCard(selectedCards);\n\t\t\t \tcard = selectedCards[iPos];\n\t\t\t }\n\t \t}\n\t \t\n\t \tswitch (card.GetSuit()){\n \t\tcase Card.HEARTS:\t \t\n \t\t\tif (card.GetValue() == 7){\n \t\t\t\t// and must be played first\n \t\t\t\tplayableCards[Rules.HEARTS8] = new Card(8,Card.HEARTS);\n \t\t\t\tplayableCards[Rules.HEARTS6] = new Card(6,Card.HEARTS);\n \t\t\t\tplayableCards[Rules.CLUBS8] = new Card(7,Card.CLUBS);\n \t\t\t\tplayableCards[Rules.DIAMONDS8] = new Card(7,Card.DIAMONDS);\n \t\t\t\tplayableCards[Rules.SPADES8] = new Card(7,Card.SPADES);\n \n \t\t\t\treturn card;\n \t\t\t}\n \t\t\tif (card.GetValue() < 7){\n \t\t\t\tif (card.Equals(playableCards[Rules.HEARTS6])){\n \t\t\t\t\tplayableCards[Rules.HEARTS6] = new Card(card.GetValue()-1,Card.HEARTS);\n \t\t\t\t\treturn card;\n \t\t\t\t}\n \t\t\t}\n \t\t\tif (card.GetValue() > 7){\n \t\t\t\tif (card.Equals( playableCards[Rules.HEARTS8])){ \t\t\t\t\t\n \t\t\t\t\tplayableCards[Rules.HEARTS8] = new Card(card.GetValue()+1,Card.HEARTS);\n \t\t\t\t\treturn card;\n \t\t\t\t}\n \t\t\t}\t \t\t\t\n \t\t\t\n \t\t\tbreak; \n \t\tcase Card.DIAMONDS:\n \t\t\t// Is it a seven, it can be played...\n \t\t\tif (card.GetValue() == 7){\n \t\t\t\tif (playableCards[Rules.HEARTS8] != null && playableCards[Rules.HEARTS8].GetValue() > 7){\n\t \t\t\t\tplayableCards[Rules.DIAMONDS8] = new Card(8,Card.DIAMONDS);\n\t \t\t\t\tplayableCards[Rules.DIAMONDS6] = new Card(6,Card.DIAMONDS);\t \t\t\t\t\t\n \t\t\t\t\treturn card;\n \t\t\t\t}\n \t\t\t}\n \t\t\t\n \t\t\tif (card.GetValue() < 7){\n \t\t\t\tif (card.Equals( playableCards[Rules.DIAMONDS6])){\t \t\t\t\t\t\n \t\t\t\t\tplayableCards[Rules.DIAMONDS6] = new Card(card.GetValue()-1,Card.DIAMONDS);\n \t\t\t\t\treturn card;\n \t\t\t\t}\n \t\t\t}\n \t\t\tif (card.GetValue() > 7){\n \t\t\t\tif (card.Equals( playableCards[Rules.DIAMONDS8])){\t \t\t\t\t\t\n \t\t\t\t\tplayableCards[Rules.DIAMONDS8] = new Card(card.GetValue()+1,Card.DIAMONDS);\n \t\t\t\t\treturn card;\n \t\t\t\t}\n \t\t\t}\t\t \t\t\t\n \t\t\t\n \t\t\tbreak; \n \t\t\t\n \t\tcase Card.CLUBS:\n \t\t\t// Is it a seven, it can be played...\n \t\t\tif (card.GetValue() == 7){\n\n \t\t\t\tif (playableCards[Rules.HEARTS8] != null && playableCards[Rules.HEARTS8].GetValue() > 7){\n\t \t\t\t\tplayableCards[Rules.CLUBS8] = new Card(8,Card.CLUBS);\n\t \t\t\t\tplayableCards[Rules.CLUBS6] = new Card(6,Card.CLUBS);\t \t\t\t\t\t\n \t\t\t\t\treturn card;\n \t\t\t\t}\t \t\t\t\t\n \t\t\t}\n \t\t\t\n \t\t\tif (card.GetValue() < 7){\n \t\t\t\tif (card.Equals(playableCards[Rules.CLUBS6])){\n \t\t\t\t\tplayableCards[Rules.CLUBS6] = new Card(card.GetValue()-1,Card.CLUBS);\n \t\t\t\t\treturn card;\n \t\t\t\t}\n \t\t\t}\n \t\t\tif (card.GetValue() > 7){\n \t\t\t\tif (card.Equals(playableCards[Rules.CLUBS8])){\n \t\t\t\t\tLog.i(\"\",\" Updating playable card \" + (card.GetValue()+1) + \" , \" +Card.CLUBS);\n \t\t\t\t\tplayableCards[Rules.CLUBS8] = new Card(card.GetValue()+1,Card.CLUBS);\n \t\t\t\t\treturn card;\n \t\t\t\t}\n \t\t\t}\t\t \t\t\t\n \t\t\tbreak; \n \t\tcase Card.SPADES:\n \t\t\t// Is it a seven, it can be played...\n \t\t\tif (card.GetValue() == 7){\n \t\t\t\tif (playableCards[Rules.HEARTS8] != null && playableCards[Rules.HEARTS8].GetValue() > 7){\n\t \t\t\t\tplayableCards[Rules.SPADES8] = new Card(8,Card.SPADES);\n\t \t\t\t\tplayableCards[Rules.SPADES6] = new Card(6,Card.SPADES);\t \t\t\t\t\t\n \t\t\t\t\treturn card;\n \t\t\t\t}\t \t\t\t\t\n \t\t\t}\n \t\t\t\n \t\t\tif (card.GetValue() < 7){\n \t\t\t\tif (card.Equals( playableCards[Rules.SPADES6])){ \t\t\t\t\t\n \t\t\t\t\tplayableCards[Rules.SPADES6] = new Card(card.GetValue()-1,Card.SPADES);\n \t\t\t\t\treturn card;\n \t\t\t\t}\n \t\t\t}\n \t\t\tif (card.GetValue() > 7){\n \t\t\t\tif (card.Equals( playableCards[Rules.SPADES8])){\t \t\t\t\t\t\n \t\t\t\t\tplayableCards[Rules.SPADES8] = new Card(card.GetValue()+1,Card.SPADES);\n \t\t\t\t\treturn card;\n \t\t\t\t}\n \t\t\t}\t \t\t\t\n \t\t\tbreak;\n \t\t\t\n\t \t}\n\t \n\t }\n\t return ret;\n }",
"private PlayingCard chooseCard(HeartsGraphics g){\t\t\n\t\tHearts.setCurrentPlayer(this);\n\t\t\n\t\tif(number != PLAYER_ONE){\n\t\t\t// A.I. code\n\t\t\tint index;\n\t\t\t\n\t\t\tRandom r = new Random();\n\t\t\tindex = r.nextInt(hand.size());\t\t\t\n\t\t\t\n\t\t\treturn hand.get(index);\t\t\t\n\t\t} else {\n\t\t\treturn getCard(g);\n\t\t}\t\t\n\t}",
"@Override\r\n public Card getCardFromDealer(int deckPosition) {\r\n return this.dealer.getCard(deckPosition);\r\n }",
"static int getComputerCard(Card playerCard) {\n //The computer will iterate through different possible cards it might choose to play.\n //This represents a chosen card at any given time.\n Card possibleCard = null;\n //The position in the computer's hand where the possibleCard is stored.\n int cardPosition = 0;\n //True if the computer has a card of higher value than the player's.\n boolean hasHigherCard = false;\n //Iterate through the computer's hand, trying to find a card higher than the player's\n for (int i = 0; i < highCardGame.getHand(0).getNumCards(); i++) {\n if (playerCard.compareTo(highCardGame.getHand(0).inspectCard(i)) < 0) {\n //The computer has a higher card.\n if (possibleCard != null) {\n //If this card is lower than the possible card, but can still beat the player, then replace possible card.\n if (possibleCard.compareTo(highCardGame.getHand(0).inspectCard(i)) > 0) {\n possibleCard = new Card(highCardGame.getHand(0).inspectCard(i));\n cardPosition = i;\n }\n } else {\n //If the computer has not yet chosen a possible card, choose this one.\n possibleCard = new Card(highCardGame.getHand(0).inspectCard(i));\n hasHigherCard = true;\n cardPosition = i;\n }\n }\n }\n if (!hasHigherCard) {\n //If the computer does not have a card that can beat the player, then feed the lowest card\n //that the computer has to the player.\n for (int i = 0; i < highCardGame.getHand(0).getNumCards(); i++)\n if (playerCard.compareTo(highCardGame.getHand(0).inspectCard(i)) >= 0) {\n if (possibleCard != null) {\n if (possibleCard.compareTo(highCardGame.getHand(0).inspectCard(i)) > 0) {\n possibleCard = new Card(highCardGame.getHand(0).inspectCard(i));\n cardPosition = i;\n }\n } else {\n possibleCard = highCardGame.getHand(0).inspectCard(i);\n cardPosition = i;\n }\n }\n }\n return cardPosition;\n }",
"Card(){\t \n}",
"private Card init_proof_card() {\n\t\t\n\t\tProofCard card = new ProofCard(getActivity());\n\t\t\n\t\tCardExpand expand = new CardExpand(getActivity());\n\t\tcard.addCardExpand(expand);\n\t\tcard.setBackgroundResource(getResources().getDrawable(R.drawable.card_back));\n\t\treturn card;\n\t}",
"public Board.Cards buyCard(Board.Cards card) {\n \t\tif (!affordCard())\n \t\t\treturn null;\n \n \t\t// out of cards\n \t\tif (card == null)\n \t\t\treturn null;\n \n \t\t// deduct resources\n \t\tuseResources(Type.WOOL, 1);\n \t\tuseResources(Type.GRAIN, 1);\n \t\tuseResources(Type.ORE, 1);\n \n \t\tif (card == Cards.VICTORY)\n \t\t\tvictory += 1;\n \t\telse\n \t\t\tnewCards.add(card);\n \n \t\tappendAction(R.string.player_bought_card);\n \n \t\treturn card;\n \t}",
"public Card dealCard(Player player) {\n\t\tCard card = null;\n\t\tif (dealtCards.get() < DECK_SIZE) { // Check if deck still has cards available. \n\t\t\tcard = cards.get(dealtCards.getAndIncrement());\n\t\t\tif (card != null) { // If card has been found.\n\t\t\t\tplayer.addCard(card);\n\t\t\t\tAtomicInteger cardsBySuit = dealtCardsBySuit.get(card.getSuit());\n\t\t\t\tcardsBySuit.getAndIncrement(); // Update cards by suit counters.\n\t\t\t}\n\t\t}\n\t\treturn card;\n\t}",
"@Test\n public void testGetCardID() {\n DevCard devCard = new DevCard(cost, level, color, victoryPoints, productionPower);\n String s = devCard.getCardID();\n }",
"public boolean canUseCard() {\n \t\tif (usedCard)\n \t\t\treturn false;\n \n \t\tfor (int i = 0; i < cards.length; i++) {\n \t\t\tif (cards[i] > 0)\n \t\t\t\treturn true;\n \t\t}\n \n \t\treturn false;\n \t}",
"public Card deal()\n\t{\n\t\tif (cards.isEmpty())\n\t\t\treturn null;\n\t\t\n\t\t//Generate a random index to pull a random card from the ordered deck\n\t\tint rand = (int) (Math.random() * cards.size());\n\t\tCard dealt = cards.get(rand);\n\t\t//Remove the pulled card from the deck\n\t\tcards.remove(rand);\n\t\t\n\t\treturn dealt;\n\t}",
"private Card drawCard() {\n return cardStack.pop();\n }",
"Card drawCard() {\n if (this.pointer >= this.cards.size()) {\n throw new NoMoreCardsAvailableException();\n }\n return cards.get(pointer++);\n }",
"public abstract void selfCardDrawn(Card card);",
"public Card drawCard() {\n return gameDeck.removeTopCard();\n }",
"@Test\n public void playMonopolyCard() throws Exception {\n ResourceType type = ResourceType.ORE;\n when(devCardFacade.canUseMonopolyCard(noDevCardsPlayer, type)).thenReturn(false);\n dcc.playMonopolyCard(type);\n verify(devCardFacade, never()).useMonopolyCard(noDevCardsPlayer, type);\n //Player 1; has devCards\n when(devCardFacade.canUseMonopolyCard(currentPlayer, type)).thenReturn(true);\n dcc.playMonopolyCard(type);\n }",
"public void createDeck(){\n //Does nothing because it will be overridden in the child classes.\n }",
"public Deck getDeck(String token) throws RemoteException {\n return mainScreenProvider.getDeck(token);\n }",
"public static Bitmap GetBasicCardNumberBitmap()\r\n\t{\r\n\t\tBitmap image = null;\r\n\t\tif(CGameHelper.m_GameContext != null)\r\n\t\t{\r\n\t\t\tResources res = CGameHelper.m_GameContext.getResources();\r\n\t\t\tif(res == null)\r\n\t\t\t\treturn image; \r\n\r\n\t\t\tif(m_BasicCardNumberBitmap == null)\r\n\t\t\t{\r\n\t\t\t\tm_BasicCardNumberBitmap = BitmapFactory.decodeResource(res, R.drawable.number);\r\n\t\t\t}\r\n\t image = m_BasicCardNumberBitmap;\r\n\t\t} \r\n\t\treturn image;\r\n\t}",
"public CardDeck cardDeck(){\r\n\t\treturn deck;\r\n\t}",
"@Override\r\n public ICard dealCard() {\r\n //get the first card from top of the deck \r\n ICard top = this.deck[ZERO];\r\n //shift cards to the left, because we get the first one \r\n for (int i = ONE; i < this.numOfCards; i++) {\r\n this.deck[i - ONE] = this.deck[i];\r\n }\r\n this.deck[this.numOfCards - ONE] = null;\r\n //decrement the number of cards currently in the deck \r\n this.numOfCards--;\r\n\r\n return top;\r\n }",
"@Override\n\t\n\tpublic PlayingCard drawCard() {\n\t\tif(getCount() > 0) {\n\t\t\tPlayingCard obersteKarte = aktuellesDeck[getCount() - 1];\n\t\t\taktuellesDeck[getCount() - 1] = null;\n\t\t\tcount--;\n\t\t\treturn obersteKarte;\n\t\t}else {\n\t\t\tSystem.out.println(\"Stapel leer! Karte ziehen nicht mehr möglich.\");\n\t\t\treturn null;\n\t\t}\n\t}",
"public Card getCard(int index)\n {\n if( index <0 || index >=52)\n return null;\n\n return cardAry[index];\n }",
"@Override\r\n public Card getFirstCard() {\r\n return this.firstCard.equals(null) ? Card.NONE : this.firstCard;\r\n }",
"public Card takeTurn() {\n //display current hand and prompt the user to input a card to play\n Scanner scanner = new Scanner(System.in);\n while(true) {\n System.out.println(name+\"'s turn\");\n System.out.println(\"Your current hand is:\");\n System.out.print(\"[\"+hand.getCards().get(0));\n for(int i=1; i<hand.getCards().size(); i++) {\n System.out.print(\", \"+hand.getCards().get(i));\n }\n System.out.println(\"]\");\n System.out.println(\"Which card do you want to play?\");\n //read the user's input and make sure it's a valid card\n String input = scanner.next();\n //if the user entered nothing, they draw by default\n if(input.equals(\"none\")) {\n return null;\n }\n Suit inputSuit = null;\n switch(input.substring(input.length()-1).toLowerCase()) {\n case \"c\":\n inputSuit = Suit.CLUBS;\n break;\n case \"s\":\n inputSuit = Suit.SPADES;\n break;\n case \"h\":\n inputSuit = Suit.HEARTS;\n break;\n case \"d\":\n inputSuit = Suit.DIAMONDS;\n break;\n default:\n throw new InvalidCardException(\"Invalid suit\");\n }\n int inputRank = Integer.parseInt(input.substring(0,input.length()-1));\n if(inputRank < 1 || inputRank > 13) {\n throw new InvalidCardException(\"Invalid rank\");\n }\n //if the player has it in their hand, then play it\n ArrayList<Card> cards = hand.getCards();\n for(int i=0; i<cards.size(); i++) {\n if(cards.get(i).equals(new Card(inputSuit, inputRank))) {\n return hand.draw(input);\n }\n }\n System.out.println(\"Invalid card. Try again\");\n }\n }",
"@Test\n public void receiveCard() throws Exception {\n SmartPlayer x = new SmartPlayer(0, 0);\n x.receiveCard(4, 4);\n assertTrue(x.getCards().get(4) == 4);\n }",
"public Card getCard(int idx) {\r\n\t\tif (idx < 0 || idx >= cards.size()) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\treturn cards.get(idx);\r\n\t}",
"public void testGetCard() {\n System.out.println(\"getCard\");\n Card expResult = new Card(Rank.QUEEN, Suit.SPADES);\n Play instance = new Play(\"Player1\", expResult);\n Card result = instance.getCard();\n assertEquals(expResult, result);\n }",
"@Override\n\tpublic void onCardFail() {\n\t\tLoggerUtils.d(\"onCardFail Start!!!\");\n\t\tonFail();\n\t}",
"public Card getCard(){\n return cards.get(0);\n }",
"@Test\n public void testDeck() {\n System.out.println(\"getCards\");\n assertTrue(instance.getSize() == deckSize);\n\n System.out.println(\"getUsedCards\");\n assertTrue(instance.getUsedPileSize() == ditchCount);\n\n System.out.println(\"ditch\");\n Class<? extends ICardType> type = DefaultType2.class;\n IMarauroaCard ditchedCard = (IMarauroaCard) instance.ditch(RPDeck.PAGES, type);\n assertTrue(ditchedCard == null || ditchedCard instanceof DefaultType2);\n cardDitched();\n assertTrue(instance.getUsedPileSize() == ditchCount);\n assertTrue(instance.getSize() == deckSize);\n updateInterfaceIndex();\n\n System.out.println(\"ditchBottom\");\n IMarauroaCard toDitch = (IMarauroaCard) instance.getCards().get(instance.getCards().size() - 1);\n assertEquals(toDitch, instance.ditchBottom());\n cardDitched();\n assertEquals(ditchCount, instance.getUsedPileSize());\n\n System.out.println(\"ditch\");\n int ditch = 2;\n List<ICard> ditched = instance.ditch(RPDeck.PAGES, ditch, false);\n cardDitched(ditch);\n assertTrue(ditched.size() == ditch);\n\n System.out.println(\"ditch\");\n ditch = 5;\n List result = instance.ditch(RPDeck.PAGES, ditch);\n cardDitched(ditch);\n assertTrue(result.size() == ditch);\n\n System.out.println(\"ditch\");\n toDitch = (IMarauroaCard) instance.getCards().get(0);\n card = (IMarauroaCard) instance.ditch(RPDeck.PAGES, false);\n cardDitched();\n assertEquals(ditchCount, instance.getUsedPileSize());\n assertEquals(toDitch, card);\n\n System.out.println(\"ditch\");\n toDitch = (IMarauroaCard) instance.getCards().get(0);\n card = (IMarauroaCard) instance.ditch(RPDeck.PAGES);\n cardDitched();\n assertEquals(ditchCount, instance.getUsedPileSize());\n assertEquals(toDitch, card);\n\n System.out.println(\"draw\");\n updateInterfaceIndex();\n toDitch = (IMarauroaCard) instance.getCards().get(interfaceIndex);\n card = (IMarauroaCard) instance.draw(DefaultType2.class);\n assertEquals(toDitch, card);\n updateInterfaceIndex();\n interfaceCounter--;\n cardDrawn();\n assertEquals(ditchCount, instance.getUsedPileSize());\n\n System.out.println(\"draw\");\n IMarauroaCard toDraw = (IMarauroaCard) instance.getCards().get(0);\n card = (IMarauroaCard) instance.draw();\n assertEquals(toDraw, card);\n cardDrawn();\n assertEquals(ditchCount, instance.getUsedPileSize());\n\n System.out.println(\"draw\");\n toDraw = (IMarauroaCard) instance.getCards().get(0);\n card = (IMarauroaCard) instance.draw(false);\n assertEquals(toDraw, card);\n cardDrawn();\n assertEquals(ditchCount, instance.getUsedPileSize());\n\n System.out.println(\"drawBottom\");\n toDraw = (IMarauroaCard) instance.getCards().get(instance.getSize() - 1);\n card = (IMarauroaCard) instance.drawBottom();\n assertEquals(toDraw, card);\n cardDrawn();\n assertEquals(ditchCount, instance.getUsedPileSize());\n\n System.out.println(\"draw\");\n int draw = 5;\n list = instance.draw(draw, false);\n assertTrue(result.size() == draw);\n cardDrawn(draw);\n\n System.out.println(\"draw\");\n draw = 5;\n list = instance.draw(draw);\n cardDrawn(draw);\n assertTrue(result.size() == draw);\n\n System.out.println(\"getSize\");\n assertEquals(deckSize, instance.getSize());\n\n System.out.println(\"getUsedPileSize\");\n assertEquals(ditchCount, instance.getUsedPileSize());\n\n System.out.println(\"shuffle\");\n ArrayList<ICard> current = (ArrayList<ICard>) instance.getCards();\n instance.shuffle();\n assertTrue(current.size() == instance.getCards().size());\n updateInterfaceIndex();\n }",
"public void drawCard();",
"public card(){\n\t\tname = \"blank\";\n\t\ttype = \"blank\";\n\t\tcost = 0;\n\t\tgold = 0;\n\t\tvictory_points = 0;\n\t\taction = 0;\n\t\tbuy = 0;\n\t\tcard= 0;\n\t\tattack = false;\n\t}",
"protected abstract boolean isCardActivatable(Card card);",
"public Card playCard()\n {\n\n Card errorReturn = new Card('E', Card.Suit.spades); // in rare cases\n\n if (numCards == 0)\n return errorReturn;\n else\n return myCards[--numCards];\n }",
"private static void showMatchedDeckInfo() {\n }",
"public Deck() {\n generateDeckOfCards();\n }",
"com.google.protobuf.ByteString getCards();",
"public Patron issueCard(String nameOfPatron){\n //Check whether the patron has already had a card!\n if (!this.patron.containsKey(nameOfPatron)){\n Patron newPatron = new Patron(nameOfPatron,this);\n this.patron.put(nameOfPatron, newPatron);\n this.println(\"OK! A card has beed issued to \"+ nameOfPatron);\n return newPatron;\n }\n else{\n this.println(\"No two cards! This Patron has already had a Library Card!!!\");\n return null;\n }\n\n }",
"private void badMatch() {\n\t\tArrayList<Integer> faceValues = new ArrayList<Integer>();\n\t\tInteger firstSelectableCardPos = null;\n\t\t\n\t\tfor (int card = 0; card < CARDS_SUM; card++) {\n\t\t\tPlayingCard thisCard = ((PlayingCard) getActivity().findViewById(solo.getImage(card).getId()));\n\t\t\t\n\t\t\t// cheat by finding card face without turning card over\n\t\t\tint face = thisCard.getCard();\n\t\t\tfaceValues.add(face);\n\t\t\t\n\t\t\t// can't select all cards\n\t\t\tif (thisCard.isLocked() || thisCard.getVisible()) {\n\t\t\t\tcontinue;\n\t\t\t} else if (firstSelectableCardPos == null) {\n\t\t\t\tfirstSelectableCardPos = card;\n\t\t\t}\n\t\t\t\n\t\t\t// if this is a different card, select the bad pair\n\t\t\tif (faceValues.get(firstSelectableCardPos) != face) {\n\t\t\t\tsolo.clickOnImage(firstSelectableCardPos);\n\t\t\t\tsolo.clickOnImage(card);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}",
"@SuppressWarnings(\"unchecked\")\n\t@Test\n\tpublic void testChargePinDebitCardWithoutTrack2() throws Exception {\t\n\t\tHashMap<String, Object> mapBody = new HashMap<String, Object>();\n\t\tmapBody.put(\"amount\", 1.00);mapBody.put(\"currency\", \"USD\");\n\t\tHashMap<String, Object> card = returnMapCardWithCardPresent();\n\t\tHashMap<String, Object> cardPresent = (HashMap<String, Object>) card.get(\"cardPresent\");\n\t\tcardPresent.put(\"track2\", \"\");\n\t\tcard.put(\"cardPresent\", cardPresent);\n\t\tmapBody.put(\"card\", card);\n\t\t\n\t\tHttpResponse response = TestUtil.post(CCChargeUrl,\n\t\t\t\tCCChargeHeaderParams, mapBody);\n\t\tvalidateErrorRes(response, 400, \"invalid_request\", \"PMT-4002\", \"number is required.\", \"number\", \"https://developer.intuit.com/v2/docs?redirectID=PayErrors\");\n\t}",
"public CreditCard getDefaultPaymentInfo();",
"boolean CanBuyDevCard();",
"CardController getCardController() { return cardController; }",
"@JsonIgnore\n\tpublic List<Card> getAvailableCards() {\n\t\tList<Card> availableCards = new ArrayList<>();\n\t\tfor (int i = dealtCards.get(); i < Deck.DECK_SIZE; i++) {\n\t\t\tCard card = cards.get(i);\n\t\t\tavailableCards.add(card);\n\t\t}\n\t\treturn availableCards;\n\t}",
"public ResourceCard giveUpResourceCard() throws Exception {\n\t\t return resourceCardHand.getRandomResourceCard();\n\t }",
"public Cards deal() {\n if (!hasMoreCards()) {\n return null;\n } else {\n Cards temp = null;\n temp = deck[cardHold];\n cardHold = cardHold + 1;\n return temp;\n }\n }"
] | [
"0.6784903",
"0.6620885",
"0.6470615",
"0.64520025",
"0.64515245",
"0.6257009",
"0.6235854",
"0.62256294",
"0.61977386",
"0.61267275",
"0.60983455",
"0.6065121",
"0.60526204",
"0.60487556",
"0.60245997",
"0.60179156",
"0.6015426",
"0.60129297",
"0.60106087",
"0.60097396",
"0.6004763",
"0.5997483",
"0.59936076",
"0.59624684",
"0.59358317",
"0.5926384",
"0.59204847",
"0.58638936",
"0.5862423",
"0.58560866",
"0.58517843",
"0.5832459",
"0.58202225",
"0.5758723",
"0.5757441",
"0.57482654",
"0.5747521",
"0.5746913",
"0.5738216",
"0.57157475",
"0.5710112",
"0.56995195",
"0.5698263",
"0.5694182",
"0.5689181",
"0.5674661",
"0.56596667",
"0.5655481",
"0.56528676",
"0.5638189",
"0.5635026",
"0.56241804",
"0.5622591",
"0.5620877",
"0.560952",
"0.56065494",
"0.55881083",
"0.55795336",
"0.55780643",
"0.55775434",
"0.5576492",
"0.5573174",
"0.5572686",
"0.55675",
"0.55643225",
"0.556324",
"0.55594784",
"0.5558695",
"0.5556934",
"0.5552508",
"0.5550172",
"0.5545525",
"0.554458",
"0.55430084",
"0.554151",
"0.5520738",
"0.5510856",
"0.5506247",
"0.5500654",
"0.5498328",
"0.5493424",
"0.54904103",
"0.54827803",
"0.54804677",
"0.54787135",
"0.5477402",
"0.5476614",
"0.5475717",
"0.5474098",
"0.54727316",
"0.5471772",
"0.546898",
"0.5468252",
"0.54680866",
"0.5467258",
"0.54664344",
"0.5462471",
"0.5455857",
"0.54491234",
"0.54451764"
] | 0.7169054 | 0 |
verify that the dumb strategy returns the one winning card in its hand. | @Test
public void testPlayer_getDumbStrategyCard_oneWinner_color() {
player2 = new Player("", true);
player2.setHand(strategyHand.getAllCards());
player2.getHand().discard(wild);
player2.getHand().discard(wildDrawFour);
assertTrue(player2.getDumbStrategyCard(blueNine, blueNine.getColor()).equals(blueFour));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\r\n public void testPlayer_getDumbStrategyCard_differentWinners() {\r\n player2 = new Player(\"\", true);\r\n player2.setHand(strategyHand.getAllCards());\r\n boolean differentLegalCardFound = false;\r\n Card firstDiscard = player2.getDumbStrategyCard(yellowSix, yellowSix.getColor());\r\n for(int i = 0; i < 25; i++) {\r\n Card loopCard = player2.getDumbStrategyCard(yellowSix, yellowSix.getColor());\r\n if(!loopCard.equals(firstDiscard)) {\r\n differentLegalCardFound = true;\r\n }\r\n }\r\n assertTrue(differentLegalCardFound);\r\n }",
"public boolean CheckForUnwinnableCondition(){\n int humanSize = GetSizeOfHumanHand();\n int computerSize = GetSizeOfComputerHand();\n\n for(int i = 0; i < humanSize; i++) {\n //Human can play a card\n String card = handHuman.get(i);\n\n String firstLetter = Character.toString(card.charAt(0));\n String topFirstLetter = Character.toString(topCard.charAt(0));\n\n if (topCard.contains(\"8\")) {\n //Can play any card ontop to determine suite\n return true;\n }\n\n if (card.contains(\"8\")) {\n //valid because 8s are wild cards, human can place it\n return true;\n }\n\n //the cards match in suite, doesn't matter what it is\n else if (firstLetter.equals(topFirstLetter)) {\n return true;\n }\n\n else {\n if (topFirstLetter.equals(\"c\")) {\n String temp = topCard.substring(5, topCard.length());\n\n if (card.contains(temp)) {\n return true;\n }\n\n } else if (topFirstLetter.equals(\"h\")) {\n String temp = topCard.substring(6, topCard.length());\n\n if (card.contains(temp)) {\n return true;\n }\n\n } else if (topFirstLetter.equals(\"d\")) {\n String temp = topCard.substring(8, topCard.length());\n\n if (card.contains(temp)) {\n return true;\n }\n\n } else if (topFirstLetter.equals(\"s\")) {\n String temp = topCard.substring(6, topCard.length());\n\n if (card.contains(temp)) {\n return true;\n }\n }\n }\n }\n\n for(int i = 0; i < computerSize; i++){\n //Human can play a card\n String card = handComputer.get(i);\n\n String firstLetter = Character.toString(card.charAt(0));\n String topFirstLetter = Character.toString(topCard.charAt(0));\n\n if (topCard.contains(\"8\")) {\n //Can play any card ontop to determine suite\n return true;\n }\n\n if (card.contains(\"8\")) {\n //valid because 8s are wild cards, human can place it\n return true;\n }\n\n //the cards match in suite, doesn't matter what it is\n else if (firstLetter.equals(topFirstLetter)) {\n return true;\n }\n\n else {\n if (topFirstLetter.equals(\"c\")) {\n String temp = topCard.substring(5, topCard.length());\n\n if (card.contains(temp)) {\n return true;\n }\n\n } else if (topFirstLetter.equals(\"h\")) {\n String temp = topCard.substring(6, topCard.length());\n\n if (card.contains(temp)) {\n return true;\n }\n\n } else if (topFirstLetter.equals(\"d\")) {\n String temp = topCard.substring(8, topCard.length());\n\n if (card.contains(temp)) {\n return true;\n }\n\n } else if (topFirstLetter.equals(\"s\")) {\n String temp = topCard.substring(6, topCard.length());\n\n if (card.contains(temp)) {\n return true;\n }\n }\n }\n }\n\n //Human and computer can't play a card\n return false;\n }",
"public boolean isWin_CommanderVimes(){\r\n // player got LordSelachii card\r\n Player playerHoldCard = null;\r\n for (Player player : discWorld.getPlayer_HASH().values()) {\r\n if (player.getPersonalityCardID() == 7) {\r\n playerHoldCard = player;\r\n break;\r\n }\r\n }\r\n \r\n if(playerHoldCard != null){\r\n if(discWorld.getShuffled_PlayerCard().size() == 0){\r\n return true;\r\n }\r\n } \r\n \r\n return false;\r\n }",
"@Test\r\n public void testPlayer_getCautiousStrategyCardCard_higherFirst_wd4() {\n player2 = new Player(\"Player Two\", true);\r\n player2.setHand(strategyHand.getAllCards());\r\n\r\n // get rid of the wild so the wd4 is the most attractive option\r\n player2.getHand().discard(wild);\r\n assertTrue(player2.getCautiousStrategyCard(yellowThree, yellowThree.getColor()).equals(wildDrawFour));\r\n }",
"@Test\r\n public void testPlayer_getCautiousStrategyCardCard_higherFirst_drawTwo() {\n player2 = new Player(\"Player Two\", true);\r\n player2.setHand(strategyHand.getAllCards());\r\n\r\n // let the cpc be a red nine\r\n // get rid of the wild and wd4 cards so the red draw two is the most attractive option\r\n player2.getHand().discard(wild);\r\n player2.getHand().discard(wildDrawFour);\r\n Card redNine = new Card(Card.RED, Card.NINE, cvm);\r\n assertTrue(player2.getCautiousStrategyCard(redNine, redNine.getColor()).equals(redDrawTwo));\r\n }",
"public boolean VerifyHumanChoice(int value){\n String card = handHuman.get(value);\n System.out.print(\"CARD IN VERIFY HUMAN\" + card);\n\n String firstLetter = Character.toString(card.charAt(0));\n String topFirstLetter = Character.toString(topCard.charAt(0));\n\n if(topCard.contains(\"8\")){\n //Can play any card ontop to determine suite\n topCard = card;\n return true;\n }\n\n if(card.contains(\"8\")){\n //valid because 8s are wild cards, human can place it\n topCard = card;\n return true;\n }\n\n //the cards match in suite, doesn't matter what it is\n else if(firstLetter.equals(topFirstLetter)){\n topCard = card;\n return true;\n }\n\n else{\n if(topFirstLetter.equals(\"c\")){\n String temp = topCard.substring(5, topCard.length());\n System.out.println(\"TEMP \" + temp);\n\n if(card.contains(temp)){\n topCard = card;\n return true;\n }\n\n }\n\n else if(topFirstLetter.equals(\"h\")){\n String temp = topCard.substring(6, topCard.length());\n System.out.println(\"TEMP \" + temp);\n\n if(card.contains(temp)){\n topCard = card;\n return true;\n }\n\n }\n\n else if(topFirstLetter.equals(\"d\")){\n String temp = topCard.substring(8, topCard.length());\n System.out.println(\"TEMP \" + temp);\n\n if(card.contains(temp)){\n topCard = card;\n return true;\n }\n\n }\n\n else if(topFirstLetter.equals(\"s\")){\n String temp = topCard.substring(6, topCard.length());\n System.out.println(\"TEMP \" + temp);\n\n if(card.contains(temp)){\n topCard = card;\n return true;\n }\n\n }\n }\n\n //You can't play this card\n return false;\n }",
"public static int hitOrStand(Player human, Player computer, Deck myDeck) {\n System.out.println(\"The dealer is showing: \" + computer.hand[0].name + \" of \" + computer.hand[0].suit);\n int choice = 0;\n int playerHandSize = 2;\n int computerHandSize = 2;\n boolean fail = false;\n Scanner input = new Scanner(System.in);\n\n while (choice != 2 && !fail) {\n System.out.println(\"You have been dealt: \");\n int i = 0;\n while (human.hand[i] != null) {\n if (i > 0) {\n System.out.print(\", \");\n }\n System.out.print(human.hand[i].name + \" of \" + human.hand[i].suit);\n i++;\n }\n System.out.print(\" Total: \" + human.printTotalValue());\n System.out.println();\n System.out.println(\"Would you like to hit or stand? Press 1 to hit, press 2 to stand: \");\n choice = input.nextInt();\n\n while (choice != 1 && choice != 2) {\n System.out.println(\"Invalid choice, please try again\");\n System.out.println(\"1. Hit\");\n System.out.println(\"2. Stand\");\n choice = input.nextInt();\n }\n\n if (choice == 1) {\n myDeck.hit(human, playerHandSize);\n playerHandSize++;\n fail = LoseConditions.doILose(human, myDeck);\n if (fail) {\n System.out.println(\"Sorry, you went over 21, you lose.\");\n }\n choice = 0;\n }\n }\n\n while (computer.getTotalValue(myDeck) < 17 || computerHandSize < 4) {\n myDeck.hit(computer, computerHandSize);\n computerHandSize++;\n fail = LoseConditions.doILose(computer, myDeck);\n if (fail) {\n System.out.println(\"You win!!\");\n }\n }\n boolean automaticWinHuman = false;\n boolean automaticWinComputer = false;\n automaticWinHuman = WinConditions.automaticWin(human, myDeck);\n automaticWinComputer = WinConditions.automaticWin(human, myDeck);\n\n if(automaticWinHuman && !automaticWinComputer){\n return 1;\n }\n if(automaticWinComputer && !automaticWinHuman){\n return -1;\n }\n\n boolean playerWin = WinConditions.whoWins(human, computer, myDeck);\n if(playerWin) return 1;\n else return -1;\n }",
"public boolean isFlush(){\n \r\n if(haveSameSuit(cards)){\r\n handValue = cards.get(cards.size()-1).getValue();\r\n return true;\r\n }\r\n \r\n return false;\r\n }",
"@Test\n void testWinnerOfTrickNotFollowingSuit() {\n Dealer testDealer = new Dealer();\n testDealer.initDealer();\n\n Bot botA = testDealer.getBotA();\n Bot botB = testDealer.getBotB();\n Bot botC = testDealer.getBotC();\n\n ArrayList<Card> botAHand, botBHand, botCHand = new ArrayList <Card>();\n\n // botAHand = new ArrayList <Card>();\n botAHand = new ArrayList <Card>();\n botBHand = new ArrayList <Card>();\n botCHand = new ArrayList <Card>();\n\n Card thrownCard = new Card(Suit.CLUBS,Rank.FOUR,true);\n \n Card cardA1 = new Card(Suit.CLUBS,Rank.ACE,true);\n\n Card cardB1 = new Card(Suit.DIAMONDS,Rank.ACE,true);\n\n Card cardC1 = new Card(Suit.SPADES,Rank.ACE,true);\n\n botAHand.add(cardA1);\n botBHand.add(cardB1);\n botCHand.add(cardC1);\n \n // botA.fillHandCards(botAHand);\n botA.fillHandCards(botAHand);\n botB.fillHandCards(botBHand);\n botC.fillHandCards(botCHand);\n\n testDealer.addToPlayedCards(thrownCard);\n \n Card cardToPlay = botA.playCard(thrownCard, 1);\n testDealer.addToPlayedCards(cardToPlay);\n Card largestPlayedCard = testDealer.getLargestCardFromTrick();\n\n cardToPlay = botB.playCard(largestPlayedCard, 2);\n testDealer.addToPlayedCards(cardToPlay);\n largestPlayedCard = testDealer.getLargestCardFromTrick();\n\n cardToPlay = botC.playCard(largestPlayedCard, 3);\n testDealer.addToPlayedCards(cardToPlay);\n\n // List<Card> allPlayedCards = testDealer.getPlayedCardsForTrick();\n assertEquals(\"botA\", testDealer.getWinnerOfTrick(testDealer.getPlayedCardsForTrick()));\n }",
"@Test\r\n public void testPlayer_getDumbStrategyCard_null() {\n player2 = new Player(\"\", true);\r\n Hand hand = new Hand();\r\n player2.setHand(hand.getAllCards());\r\n assertEquals(player2.getDumbStrategyCard(yellowOne, yellowOne.getColor()), null);\r\n }",
"@Test\n \tpublic void testDisprovingSuggestion() {\n \t\t//Set suggestion\n \t\tSolution suggestion = new Solution(\"Colonel Mustard\", \"Knife\", \"Library\");\n \t\tComputerPlayer computer1 = new ComputerPlayer();\n \t\tComputerPlayer computer2 = new ComputerPlayer();\n \t\tComputerPlayer computer3 = new ComputerPlayer();\n \t\tHumanPlayer human = new HumanPlayer();\n \t\tArrayList<Card> hand = new ArrayList<Card>();\n \t\tArrayList<ComputerPlayer> comps = new ArrayList<ComputerPlayer>();\n \t\t\n \t\t\n \t\t//ensure If a player (human or computer) has a card that's suggested, that card is \"shown\"\n \t\tCard mustardCard = new Card(\"Colonel Mustard\", Card.cardType.PERSON);\n \t\thand.add(mustardCard);\n \t\tcomputer1.setCards(hand);\n \t\tAssert.assertEquals(computer1.disproveSuggestion(suggestion), mustardCard);\n \t\t\n \t\t\n \t\t//ensure If the player has multiple cards that match, the card to be returned is selected randomly.\n \t\tCard knifeCard = new Card (\"Knife\", Card.cardType.WEAPON);\n \t\tCard libraryCard = new Card(\"Library\", Card.cardType.ROOM);\n \t\thand.add(knifeCard);\n \t\thand.add(libraryCard);\n \t\thuman.setCards(hand);\n \t\tint mustard = 0, knife = 0, library = 0;\n \t\t//make sure card is valid and counts how many times each card is returned\n \t\tfor(int i = 0; i < 100; i++) {\n \t\t\tCard disproved = human.disproveSuggestion(suggestion);\n \t\t\t\n \t\t\tif(disproved == mustardCard)\n \t\t\t\tmustard++;\n \t\t\telse if(disproved == knifeCard)\n \t\t\t\tknife++;\n \t\t\telse if(disproved == libraryCard)\n \t\t\t\tlibrary++;\n \t\t\telse\n \t\t\t\tfail(\"Invalid card returned\");\n \t\t}\n \t\t//makes sure every card is returned more than once\n \t\tAssert.assertTrue(mustard > 10);\n \t\tAssert.assertTrue(knife > 10);\n \t\tAssert.assertTrue(library > 10);\n \t\t\n \t\thuman.setCards(null);\n \t\tgame.setCurrentPlayer(game.getHuman());\n \t\t\t\n \t\t//ensure In the board game, disproving a suggestion starts with a player to the left of the person making the suggestion\n \t\thand.remove(mustardCard);\n \t\thand.remove(knifeCard);\n \t\tcomputer2.setCards(hand);\n \t\thand.remove(libraryCard);\n \t\thand.add(knifeCard);\n \t\tcomputer3.setCards(hand);\n \t\tcomps.add(computer1);\n \t\tcomps.add(computer2);\n \t\tcomps.add(computer3);\n \t\t\n \t\tint comp1 = 0, comp2 = 0, comp3 = 0;\n \t\tgame.setComputer(comps);\n \t\tfor(int i = 0; i < 100; i++) {\n \t\t\tCard returned = game.handleSuggestion(suggestion);\n \t\t\tif(returned == mustardCard)\n \t\t\t\tcomp1++;\n \t\t\telse if(returned == libraryCard)\n \t\t\t\tcomp2++;\n \t\t\telse if(returned == knifeCard)\n \t\t\t\tcomp3++;\n \t\t\telse\n \t\t\t\tfail(\"Invalid card returned\");\t\n \t\t}\n\t\t//Assert.assertTrue(comp1 > 10);\n\t\t//Assert.assertTrue(comp2 > 10);\n \t\tAssert.assertTrue(comp3 > 10);\n \t\t//ensure The player making the suggestion should not be queried\n \t\tgame.setCurrentPlayer(computer1);\n \t\tfor(int i = 0; i < 100; i++) {\n \t\t\tCard returned = game.handleSuggestion(suggestion);\n \t\t\tif(returned == mustardCard)\n \t\t\t\tfail(\"Suggesting player cannot return a card\");\t\n \t\t}\n \t}",
"public static boolean dcheck() {\n if ((card[0][0] == 0 && card[1][1] == 0 && card[2][2] == 0 && card[3][3] == 0 && card[4][4] == 0) || (card[0][4] == 0 && card[1][3] == 0 && card[2][2] == 0 && card[3][1] == 0 && card[4][0] == 0)) {\n System.out.println(\"BINGO\");\n System.out.println(\"The numbers called is \" + called);\n return true;\n } else {\n return false;\n }\n }",
"public Card takeTurn() {\n //display current hand and prompt the user to input a card to play\n Scanner scanner = new Scanner(System.in);\n while(true) {\n System.out.println(name+\"'s turn\");\n System.out.println(\"Your current hand is:\");\n System.out.print(\"[\"+hand.getCards().get(0));\n for(int i=1; i<hand.getCards().size(); i++) {\n System.out.print(\", \"+hand.getCards().get(i));\n }\n System.out.println(\"]\");\n System.out.println(\"Which card do you want to play?\");\n //read the user's input and make sure it's a valid card\n String input = scanner.next();\n //if the user entered nothing, they draw by default\n if(input.equals(\"none\")) {\n return null;\n }\n Suit inputSuit = null;\n switch(input.substring(input.length()-1).toLowerCase()) {\n case \"c\":\n inputSuit = Suit.CLUBS;\n break;\n case \"s\":\n inputSuit = Suit.SPADES;\n break;\n case \"h\":\n inputSuit = Suit.HEARTS;\n break;\n case \"d\":\n inputSuit = Suit.DIAMONDS;\n break;\n default:\n throw new InvalidCardException(\"Invalid suit\");\n }\n int inputRank = Integer.parseInt(input.substring(0,input.length()-1));\n if(inputRank < 1 || inputRank > 13) {\n throw new InvalidCardException(\"Invalid rank\");\n }\n //if the player has it in their hand, then play it\n ArrayList<Card> cards = hand.getCards();\n for(int i=0; i<cards.size(); i++) {\n if(cards.get(i).equals(new Card(inputSuit, inputRank))) {\n return hand.draw(input);\n }\n }\n System.out.println(\"Invalid card. Try again\");\n }\n }",
"public void tryDeal() {\n if(previousTie){\n previousTie = false;\n emptyHands();\n shuffle();\n }\n if (player.getBet() < 2) {\n errorFlag = true;\n userMessage = \"You must bet a minimum of $2\";\n return;\n } else if (player.getHand().size() > 0) {\n errorFlag = true;\n userMessage = \"You have already been dealt your initial hand\";\n return;\n } else {\n player.setHand(deal(player.getHand(), 2));\n if (player.getHand().get(0).getValue() == player.getHand().get(1).getValue()) {\n //User can split if they want to\n userMessage = \"Hit, Stand or Split\";\n splitDisabled = false;\n }else{\n userMessage = \"Hit or Stand\";\n }\n dealDisabled = true;\n againDisabled = true;\n doubleDisabled = false;\n standDisabled = false;\n hitDisabled = false;\n bettingDisabled = true;\n }\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}",
"@Test\n void play_BranchOne()\n {\n dealer = 22;\n player = 22;\n result = BlackjackSimple.play(dealer, player);\n\n assertEquals(0, result);\n }",
"@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}",
"public boolean hasBlackjack()\n {\n return getSumOfCards(false) == 21;\n }",
"@Test\r\n public void testPlayer_getCautiousStrategyCardCard_numeric_matchNumberNotColor() {\n player2 = new Player(\"Player Two\", true);\r\n player2.setHand(strategyHand.getAllCards());\r\n\r\n // let the cpc be a blue eight\r\n Card blueEight = new Card(Card.BLUE, Card.EIGHT, cvm);\r\n\r\n // get rid of all non-numeric cards and the blue four so the red eight is the most attractive option\r\n player2.getHand().discard(wild);\r\n player2.getHand().discard(wildDrawFour);\r\n player2.getHand().discard(yellowReverse);\r\n player2.getHand().discard(redDrawTwo);\r\n player2.getHand().discard(blueFour);\r\n\r\n Card redEight = new Card(Card.RED, Card.EIGHT, cvm);\r\n\r\n assertTrue(player2.getCautiousStrategyCard(blueEight, yellowThree.getColor()).equals(redEight));\r\n }",
"@Test\n public void testCardCanPlay_WILD() {\n System.out.println(\"cardCanPlay WILD\");\n UnoCard cardSelection = new UnoCard(UnoCardColour.WILD, UnoCardValue.ONE);\n UnoCard drawCard = new UnoCard(UnoCardColour.BLUE, UnoCardValue.THREE);\n UnoCardColour wildColour = UnoCardColour.BLUE;\n boolean result = utils.cardCanPlay(cardSelection, drawCard, wildColour);\n assertEquals(true, result);\n }",
"public void playBlackjack() {\n\t\tString choice;\n\t\t\n\t\tSystem.out.println(\"Welcome to Blackjack! \\n\");\n\t\tSystem.out.println(\"Dealing hands \\n\");\n\t\tdeck.shuffle();\n\t\tplayer.setHand(deck.drawHand());\n\t\tdealer.setHand(deck.drawHand());\n\t\t\n\t\t\n\t\tif(checkForBlackjack(player) && checkForBlackjack(dealer)) {\n\t\t\tSystem.out.println(showHands());\n\t\t\tSystem.out.println(\"Both player's have blackjack! \\n\");\n\t\t}\n\t\telse if(checkForBlackjack(player)) {\n\t\t\tSystem.out.println(showHands());\n\t\t\tSystem.out.println(\"Player has blackjack! You win! \\n\");\n\t\t}\n\t\telse if(checkForBlackjack(dealer)) {\n\t\t\tSystem.out.println(showHands());\n\t\t\tSystem.out.println(\"Dealer has blackjack! Dealer wins! \\n\");\n\t\t}\n\t\telse{\n\t\t\tSystem.out.println(showInitinalHand());\n\t\t\twhile(player.getHandVal() < 21) {\n\t\t\t\tSystem.out.println(\"Player's turn. Pick to hit or stand \\n\");\n\t\t\t\tchoice = scanner.nextLine().toUpperCase();\n\t\t\t\tif(choice.equals(\"STAND\") || choice.equals(\"S\")) {\n\t\t\t\t\tSystem.out.println(\"Player stands \\n\");\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\telse if(choice.equals(\"HIT\")|| choice.equals(\"H\")) {\n\t\t\t\t\tSystem.out.println(\"Player hits \\n\");\n\t\t\t\t\tplayer.addCard(deck.drawCard());\n\t\t\t\t\tSystem.out.println(showInitinalHand());\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tSystem.out.println(\"Invalid input \\n\");\n\t\t\t\t}\n\t\t\t}\n\t\t\twhile(dealer.getHandVal() < 17) {\n\t\t\t\tSystem.out.println(\"Dealer hits \\n\");\n\t\t\t\tdealer.addCard(deck.drawCard());\n\t\t\t\tSystem.out.println(showHands());\n\t\t\t}\n\t\t\tSystem.out.println(showHands());\n\t\t}\n\t\tcheckWinner();\n\t\tif(result.equals(\"TIE\")) {\n\t\t\tSystem.out.println(\"The result is a tie! \\n\");\n\t\t}\n\t\telse {\n\t\t\tSystem.out.println(\"The winner is the \" + result + \"!\\n\");\n\t\t}\n\t}",
"@Test\r\n public void testHasAtLeastTwoPlayableCards() {\n Player player2 = new Player(\"Three Playable Cards Test\", true);\r\n Hand threePlayableCardsHand = strategyHand;\r\n player2.setHand(threePlayableCardsHand.getAllCards());\r\n\r\n // Make it harder to find playable cards:\r\n player2.getHand().discard(new Card(Card.COLORLESS, Card.WILD, cvm));\r\n player2.getHand().discard(new Card(Card.COLORLESS, Card.WILD_DRAW_FOUR, cvm));\r\n\r\n Card currentPlayedCard_1 = new Card(Card.YELLOW, Card.ONE, cvm);\r\n assertTrue(player2.hasAtLeastTwoPlayableCards(currentPlayedCard_1, Card.BLUE));\r\n\r\n Card currentPlayedCard_2 = new Card(Card.BLUE, Card.SEVEN, cvm);\r\n assertFalse(player2.hasAtLeastTwoPlayableCards(currentPlayedCard_2, Card.BLUE));\r\n }",
"@Test\n public void play_FullHouseVsFullHouse() throws Exception {\n Hand hand1 = new Hand();\n hand1.addCard(new Card(Card.SUIT_HEARTS, Card.CARD_5));\n hand1.addCard(new Card(Card.SUIT_SPADES, Card.CARD_5));\n hand1.addCard(new Card(Card.SUIT_CLUBS, Card.CARD_7));\n hand1.addCard(new Card(Card.SUIT_DIAMONDS, Card.CARD_7));\n hand1.addCard(new Card(Card.SUIT_HEARTS, Card.CARD_7));\n Hand hand2 = new Hand();\n hand2.addCard(new Card(Card.SUIT_CLUBS, Card.CARD_10));\n hand2.addCard(new Card(Card.SUIT_DIAMONDS, Card.CARD_10));\n hand2.addCard(new Card(Card.SUIT_HEARTS, Card.CARD_ACE));\n hand2.addCard(new Card(Card.SUIT_SPADES, Card.CARD_ACE));\n hand2.addCard(new Card(Card.SUIT_CLUBS, Card.CARD_ACE));\n assertEquals(hand2, FiveCardDraw.play(hand1, hand2));\n }",
"@Override\n\t\tboolean hasMatch(ArrayList<Card> hand) {\n\t\t\tint suitValue = hand.get(0).getSuit().getValue();\n\n\t\t\t// check all of the same suit\n\t\t\tfor (int i = 1; i < hand.size(); i++) {\n\t\t\t\tif (hand.get(i).getSuit().getValue() != suitValue)\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}",
"@Test\n public void testPlay1()\n {\n List<Card> hand = new ArrayList<Card>();\n hand.add(new Card(UnoPlayer.Color.RED, UnoPlayer.Rank.NUMBER, 4));\n hand.add(new Card(UnoPlayer.Color.GREEN, UnoPlayer.Rank.NUMBER, 7));\n hand.add(new Card(UnoPlayer.Color.GREEN, UnoPlayer.Rank.REVERSE, -1));\n hand.add(new Card(UnoPlayer.Color.BLUE, UnoPlayer.Rank.NUMBER, 2));\n hand.add(new Card(UnoPlayer.Color.BLUE, UnoPlayer.Rank.SKIP, -1));\n hand.add(new Card(UnoPlayer.Color.NONE, UnoPlayer.Rank.WILD, -1));\n\n Card upCard = new Card(UnoPlayer.Color.RED, UnoPlayer.Rank.NUMBER, 7);\n int cardPlayed = thePlayer.play(hand, upCard, UnoPlayer.Color.RED, new\n GameState(upCard));\n\n // Let's see whether the card played was legit.\n assertTrue(\"Player didn't think a card could be played.\\nThis is an \"\n + \"error, since cards 0, 1, and 5 are legal plays.\",\n cardPlayed >= 0);\n assertTrue(\"Player tried to play \" + hand.get(cardPlayed)\n + \", which is an error.\", cardPlayed == 0 || cardPlayed == 1\n || cardPlayed == 5);\n System.out.println(\"Player played \" + hand.get(cardPlayed));\n }",
"@Test\n public void playMonopolyCard() throws Exception {\n ResourceType type = ResourceType.ORE;\n when(devCardFacade.canUseMonopolyCard(noDevCardsPlayer, type)).thenReturn(false);\n dcc.playMonopolyCard(type);\n verify(devCardFacade, never()).useMonopolyCard(noDevCardsPlayer, type);\n //Player 1; has devCards\n when(devCardFacade.canUseMonopolyCard(currentPlayer, type)).thenReturn(true);\n dcc.playMonopolyCard(type);\n }",
"public boolean hasBlackjack() {\n\t\treturn this.hand.countValue().lower(22) == 21;\n\t}",
"public abstract Chip checkWinner();",
"public void isTrickComplete() {\n if(numPlays!=4){return;}\n if(player1Play == null | player2Play == null | player3Play == null | player4Play == null){return;}//should only call when all have played\n // reset numPlayed\n numPlays = 0;\n // find if the round is over\n currentMiddle.clear();\n trickNum++;\n try {\n sleep(200);//display all four cards before determining winner\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n int trickWinner;\n trickWinner = trickWinner();\n turn = trickWinner;\n if(trickWinner == 0 | trickWinner == 2){\n redTrickScore++;\n }\n else if(trickWinner == 1 | trickWinner == 3){\n blueTrickScore++;\n }\n player1Hand.remove(player1Play);//clear middle\n player2Hand.remove(player2Play);\n player3Hand.remove(player3Play);\n player4Hand.remove(player4Play);\n\n player1Play = null;\n player2Play = null;\n player3Play = null;\n player4Play = null;\n\n if(trickNum == 5){\n // reset everything for new round\n currentTrumpSuit = null;\n numPass = 0;\n isRoundOver();\n if(dealer == 3){\n dealer = 0;\n turn = 1;\n }\n else{\n dealer++;\n turn = dealer + 1;\n }\n gameStage = 0;\n deal();\n trickNum = 0;\n }\n\n\n\n }",
"@Test\r\n\tpublic void TestFullDeck() {\n\t\t\r\n\t\tassertTrue(deck.getTotalCards() == 52); \r\n\t\tint diamonds = 0; \r\n\t\tint hearts = 0; \r\n\t\tint spades = 0; \r\n\t\tint clubs = 0; \r\n\t\tint rank = 0; \r\n\t\tfor (Card c : deck.getCards()) { \r\n\t\t\tswitch (c.getSuit()) { \r\n\t\t\t\tcase DIAMONDS:\r\n\t\t\t\t\tdiamonds++; \r\n\t\t\t\t\tbreak; \r\n\t\t\t\tcase HEARTS: \r\n\t\t\t\t\thearts++; \r\n\t\t\t\t\tbreak; \r\n\t\t\t\tcase SPADES: \r\n\t\t\t\t\tspades++; \r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase CLUBS: \r\n\t\t\t\t\tclubs++; \r\n\t\t\t\t\tbreak; \r\n\t\t\t}\r\n\t\t\trank += c.getRank().getRank();\r\n\t\t}\r\n\t\tassertTrue(diamonds == hearts && hearts == spades && spades == clubs); \r\n\t\tassertTrue(diamonds == 13); \r\n\t\tassertTrue(rank == 416); // A sum of all the card ranks. \r\n\r\n\t}",
"public boolean lookAtWinCard(){\n boolean winCard = false;\n for(Card cards: playerHand){\n if(cards.getCardName().equals(\"Magnetite\")){\n winCard = true;\n }\n }\n return winCard;\n }",
"private void drawCard1(){\n Shoe s = new Shoe(1);\n\n boolean[][] gotPicked=new boolean[4][13];\n\n for(int i=0; i<Deck.getNumCardsInDeck(); i++){\n Card c=s.drawCard();\n int st=c.getSuit();\n int rnk=c.getRank();\n gotPicked[st][rnk]=true;\n }\n\n for(int i=0; i<gotPicked.length;i++){\n for(int j=0;j<gotPicked[0].length;j++){\n Assert.assertTrue(gotPicked[i][j]);\n }\n }\n }",
"@Test\n public void askForCardSmart() throws Exception {\n Map<Integer,Integer> allMovesMade = new HashMap<Integer,Integer>();\n allMovesMade.put(1, 2);\n SmartPlayer x = new SmartPlayer(0,1);\n x.setCards(2,2);\n x.setMovesMadeByOtherPlayers(allMovesMade);\n SmartPlayer y = new SmartPlayer(1,2);\n y.setCards(2,2);\n int rankToAsk = x.askForCard(2);\n assertTrue(rankToAsk == 2);\n //assertTrue(rankToAsk<=13 && rankToAsk> 0);\n }",
"public boolean deal() {\n int k, j;\n boolean enoughCards;\n\n // clear all hands\n for (j = 0; j < numPlayers; j++)\n hand[j].resetHand();\n\n enoughCards = true;\n for (k = 0; k < numCardsPerHand && enoughCards; k++) {\n for (j = 0; j < numPlayers; j++)\n if (deck.getNumCards() > 0)\n hand[j].takeCard(deck.dealCard());\n else {\n enoughCards = false;\n break;\n }\n }\n\n return enoughCards;\n }",
"public boolean isWin_DragonKingOfArms(){\r\n // player got LordSelachii card\r\n /*Player playerHoldCard = null;\r\n for (Player player : discWorld.getPlayer_HASH().values()) {\r\n if (player.getPersonalityCardID() == 5) {\r\n playerHoldCard = player;\r\n break;\r\n }\r\n }*/\r\n int count = 0;\r\n for(TroubleMarker troubleMarker : discWorld.getTroubleMarker_HASH().values()){\r\n if(troubleMarker.getAreaNumber() != ConstantField.DEFAULT_PIECE_AREA_NUMBER){\r\n count++;\r\n }\r\n }\r\n \r\n if(count >= 8){\r\n return true;\r\n }else{\r\n return false;\r\n }\r\n \r\n }",
"@Test\n public void testNextCardGood() {\n System.out.println(\"nextCardGood\");\n Deck deck = new Deck();\n Card card = deck.nextCard();\n ////since the deck is unshuffled, that last card should be WILDCARD\n assertEquals(CardType.WILDCARD, card.getValue());\n }",
"public boolean isFullHouse(){\n List<PokerCard> firstList;\r\n List<PokerCard> secondList;\r\n \r\n //First possibility: first two cards are a pair\r\n firstList = cards.subList(0, 2);\r\n secondList = cards.subList(2, cards.size());\r\n if(haveSameValue(firstList) && haveSameValue(secondList)){\r\n handValue = secondList.get(0).getValue();\r\n return true;\r\n }\r\n \r\n //Second possibility: last two cards are a pair\r\n firstList = cards.subList(0, 3);\r\n secondList = cards.subList(3, cards.size());\r\n if(haveSameValue(firstList) && haveSameValue(secondList)){\r\n handValue = firstList.get(0).getValue();\r\n return true;\r\n }\r\n \r\n return false;\r\n }",
"@Test\n public void testCardCanPlay_FALSE() {\n System.out.println(\"cardCanPlay FALSE COLOUR\");\n UnoCard cardSelection = new UnoCard(UnoCardColour.RED, UnoCardValue.TWO);\n UnoCard drawCard = new UnoCard(UnoCardColour.BLUE, UnoCardValue.ONE);\n UnoCardColour wildColour = UnoCardColour.BLUE;\n boolean result = utils.cardCanPlay(cardSelection, drawCard, wildColour);\n assertEquals(false, result);\n }",
"void checkWinner() {\n\t}",
"public boolean deal()\n {\n int k, j;\n boolean enoughCards;\n\n // clear all hands\n for (j = 0; j < numPlayers; j++)\n hand[j].resetHand();\n\n enoughCards = true;\n for (k = 0; k < numCardsPerHand && enoughCards ; k++)\n {\n for (j = 0; j < numPlayers; j++)\n if (deck.getNumCards() > 0)\n hand[j].takeCard( deck.dealCard() );\n else\n {\n enoughCards = false;\n break;\n }\n }\n\n return enoughCards;\n }",
"public Card getWinningCard() {\n return winningCard;\n }",
"public boolean validMove(int playerID, Card selectedCard){\n // turn == playerID\n if(gameStage == 3){\n if(numPlays == 0){\n if(playerID == 0){\n player1Play = selectedCard;\n // card goes to middle\n //checks suit of the jack if played first and sets first played suit to the correct suit\n //according to which suit is trump\n if(selectedCard.getValue() == Card.NUMBER.JACK){\n if(currentTrumpSuit == Card.SUIT.DIAMONDS && selectedCard.getSuit() == Card.SUIT.HEARTS){\n firstPlayedSuit = Card.SUIT.DIAMONDS;\n }\n if(currentTrumpSuit == Card.SUIT.HEARTS && selectedCard.getSuit() == Card.SUIT.DIAMONDS){\n firstPlayedSuit = Card.SUIT.HEARTS;\n }\n if(currentTrumpSuit == Card.SUIT.CLUBS && selectedCard.getSuit() == Card.SUIT.SPADES){\n firstPlayedSuit = Card.SUIT.CLUBS;\n }\n if(currentTrumpSuit == Card.SUIT.SPADES && selectedCard.getSuit() == Card.SUIT.CLUBS){\n firstPlayedSuit = Card.SUIT.SPADES;\n }\n }\n else{\n firstPlayedSuit = player1Play.getSuit();\n }\n numPlays++;\n turn++;\n return true;\n }\n else if(playerID == 1){\n player2Play = selectedCard;\n // card goes to middle\n //checks suit of the jack if played first and sets first played suit to the correct suit\n //according to which suit is trump\n if(selectedCard.getValue() == Card.NUMBER.JACK){\n if(currentTrumpSuit == Card.SUIT.DIAMONDS && selectedCard.getSuit() == Card.SUIT.HEARTS){\n firstPlayedSuit = Card.SUIT.DIAMONDS;\n }\n if(currentTrumpSuit == Card.SUIT.HEARTS && selectedCard.getSuit() == Card.SUIT.DIAMONDS){\n firstPlayedSuit = Card.SUIT.HEARTS;\n }\n if(currentTrumpSuit == Card.SUIT.CLUBS && selectedCard.getSuit() == Card.SUIT.SPADES){\n firstPlayedSuit = Card.SUIT.CLUBS;\n }\n if(currentTrumpSuit == Card.SUIT.SPADES && selectedCard.getSuit() == Card.SUIT.CLUBS){\n firstPlayedSuit = Card.SUIT.SPADES;\n }\n }\n else{\n firstPlayedSuit = player2Play.getSuit();\n }\n numPlays++;\n turn++;\n return true;\n }\n else if(playerID == 2){\n player3Play = selectedCard;\n // card goes to middle\n //checks suit of the jack if played first and sets first played suit to the correct suit\n //according to which suit is trump\n if(selectedCard.getValue() == Card.NUMBER.JACK){\n if(currentTrumpSuit == Card.SUIT.DIAMONDS && selectedCard.getSuit() == Card.SUIT.HEARTS){\n firstPlayedSuit = Card.SUIT.DIAMONDS;\n }\n if(currentTrumpSuit == Card.SUIT.HEARTS && selectedCard.getSuit() == Card.SUIT.DIAMONDS){\n firstPlayedSuit = Card.SUIT.HEARTS;\n }\n if(currentTrumpSuit == Card.SUIT.CLUBS && selectedCard.getSuit() == Card.SUIT.SPADES){\n firstPlayedSuit = Card.SUIT.CLUBS;\n }\n if(currentTrumpSuit == Card.SUIT.SPADES && selectedCard.getSuit() == Card.SUIT.CLUBS){\n firstPlayedSuit = Card.SUIT.SPADES;\n }\n }\n else{\n firstPlayedSuit = player3Play.getSuit();\n }\n numPlays++;\n turn++;\n return true;\n }\n else if(playerID == 3){\n player4Play = selectedCard;\n // card goes to middle\n //checks suit of the jack if played first and sets first played suit to the correct suit\n //according to which suit is trump\n if(selectedCard.getValue() == Card.NUMBER.JACK){\n if(currentTrumpSuit == Card.SUIT.DIAMONDS && selectedCard.getSuit() == Card.SUIT.HEARTS){\n firstPlayedSuit = Card.SUIT.DIAMONDS;\n }\n if(currentTrumpSuit == Card.SUIT.HEARTS && selectedCard.getSuit() == Card.SUIT.DIAMONDS){\n firstPlayedSuit = Card.SUIT.HEARTS;\n }\n if(currentTrumpSuit == Card.SUIT.CLUBS && selectedCard.getSuit() == Card.SUIT.SPADES){\n firstPlayedSuit = Card.SUIT.CLUBS;\n }\n if(currentTrumpSuit == Card.SUIT.SPADES && selectedCard.getSuit() == Card.SUIT.CLUBS){\n firstPlayedSuit = Card.SUIT.SPADES;\n }\n }\n else{\n firstPlayedSuit = player4Play.getSuit();\n }\n numPlays++;\n turn = 0;\n return true;\n }\n }\n else if(numPlays < 3){\n if(playerID == 0){\n player1Play = selectedCard;\n numPlays++;\n turn++;\n return true;\n }\n else if(playerID == 1){\n player2Play = selectedCard;\n numPlays++;\n turn++;\n return true;\n }\n else if(playerID == 2){\n player3Play = selectedCard;\n numPlays++;\n turn++;\n return true;\n }\n else if(playerID == 3){\n player4Play = selectedCard;\n numPlays++;\n turn = 0;\n return true;\n }\n }\n // if three cards have been played this is the last card\n else if(numPlays == 3){\n if(playerID == 0){\n player1Play = selectedCard;\n numPlays++;\n firstPlayedSuit = null;\n return true;\n }\n else if(playerID == 1){\n player2Play = selectedCard;\n numPlays++;\n firstPlayedSuit = null;\n return true;\n }\n else if(playerID == 2){\n player3Play = selectedCard;\n numPlays++;\n firstPlayedSuit = null;\n return true;\n }\n else if(playerID == 3){\n player4Play = selectedCard;\n numPlays++;\n firstPlayedSuit = null;\n return true;\n }\n }\n }\n return false;\n }",
"@Test\n public void testCardCanPlay_TRUE() {\n System.out.println(\"cardCanPlay TRUE COLOUR\");\n UnoCard cardSelection = new UnoCard(UnoCardColour.BLUE, UnoCardValue.TWO);\n UnoCard drawCard = new UnoCard(UnoCardColour.BLUE, UnoCardValue.ONE);\n UnoCardColour wildColour = UnoCardColour.BLUE;\n boolean result = utils.cardCanPlay(cardSelection, drawCard, wildColour);\n assertEquals(true, result);\n }",
"@Test\n public void testGiveHand() throws Exception {\n\n Deck giveHand = new Deck();\n giveHand.add(cardB);\n giveHand.add(cardB);\n giveHand.add(cardP);\n playerHuman.addCardToDeck(cardB);\n playerHuman.addCardToDeck(cardB);\n playerHuman.addCardToDeck(cardP);\n playerHuman.giveHand();\n org.junit.Assert.assertEquals(giveHand, playerHuman.getPlayHand());\n }",
"public boolean hasFlush(Hand handToCheck){\n\t\tHand hand = new FiveCardHand(handToCheck); //Make copy of the object so original doesn't get modified\n\t\tlog.debug(\"hasFlush(hand = \"+hand+\")\");\n\t\tif(hand == null){\n\t\t\tlog.debug(\"Hand was null. Returning false\");\n\t\t\treturn false;\n\t\t}\n\t\tArrayList<Card> cards = hand.getCards();\n\t\tif(cards == null){\n\t\t\tlog.debug(\"The ArrayList<Card> inside the Hand Object was NULL. Returning false\");\n\t\t\treturn false;\n\t\t}\n\t\tlog.trace(\"Number of cards in Hand: \"+cards.size());\n\t\t\n\t\tList<CardSuit> sorted = CollectionHelper.asSortedList(hand.getSuitValues());\n\t\t\n\t\tint highestNumberInARowThusFar=0;\n\t\tint suitsInARow=0;\n\t\tif(sorted.size()>1){\n\t\t\tsuitsInARow=1;\n\t\t\tfor(int i=1; i<sorted.size();i++){\n\t\t\t\tif(sorted.get(i-1).equals(sorted.get(i))){\n\t\t\t\t\tsuitsInARow++;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tif(suitsInARow > highestNumberInARowThusFar){\n\t\t\t\t\t\thighestNumberInARowThusFar = suitsInARow;\n\t\t\t\t\t}\n\t\t\t\t\tsuitsInARow = 1;\n\t\t\t\t}\t\n\t\t\t}\n\t\t\tif(suitsInARow > highestNumberInARowThusFar){\n\t\t\t\thighestNumberInARowThusFar = suitsInARow;\n\t\t\t}\n\t\t}\n\t\tlog.debug(\"Max number of suits found in a row = \"+highestNumberInARowThusFar);\n\t\tif(highestNumberInARowThusFar>4){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"public boolean isPickItUp(int playerID, Card discard){\n if(turn == playerID && gameStage == 1 && dealer == playerID){\n currentTrumpSuit = middleCardSuit;\n // make dealer discard a card and give them the middle card\n if(dealer == 0){\n //discard card that player taps\n if(player1Hand.get(0) == discard){\n player1Hand.remove(0);\n player1Hand.add(middleCard);\n turn++;\n gameStage = 3;\n }\n else if(player1Hand.get(1) == discard){\n player1Hand.remove(1);\n player1Hand.add(middleCard);\n turn++;\n gameStage = 3;\n }\n else if(player1Hand.get(2) == discard){\n player1Hand.remove(2);\n player1Hand.add(middleCard);\n turn++;\n gameStage = 3;\n }\n else if(player1Hand.get(3) == discard){\n player1Hand.remove(3);\n player1Hand.add(middleCard);\n turn++;\n gameStage = 3;\n }\n else if(player1Hand.get(4) == discard){\n player1Hand.remove(4);\n player1Hand.add(middleCard);\n turn++;\n gameStage = 3;\n }\n }\n }\n return false;\n }",
"@Test\n void testWinnerOfTrickFollowingClubSuit() {\n Dealer testDealer = new Dealer();\n testDealer.initDealer();\n\n Bot botA = testDealer.getBotA();\n Bot botB = testDealer.getBotB();\n Bot botC = testDealer.getBotC();\n\n ArrayList<Card> botAHand, botBHand, botCHand = new ArrayList <Card>();\n\n // botAHand = new ArrayList <Card>();\n botAHand = new ArrayList <Card>();\n botBHand = new ArrayList <Card>();\n botCHand = new ArrayList <Card>();\n\n Card thrownCard = new Card(Suit.CLUBS,Rank.FOUR,true);\n \n Card cardA1 = new Card(Suit.CLUBS,Rank.KING,true);\n\n Card cardB1 = new Card(Suit.CLUBS,Rank.FIVE,true);\n\n Card cardC1 = new Card(Suit.CLUBS,Rank.QUEEN,true);\n\n botAHand.add(cardA1);\n botBHand.add(cardB1);\n botCHand.add(cardC1);\n \n // botA.fillHandCards(botAHand);\n botA.fillHandCards(botAHand);\n botB.fillHandCards(botBHand);\n botC.fillHandCards(botCHand);\n\n testDealer.addToPlayedCards(thrownCard);\n \n Card cardToPlay = botA.playCard(thrownCard, 1);\n testDealer.addToPlayedCards(cardToPlay);\n Card largestPlayedCard = testDealer.getLargestCardFromTrick();\n\n cardToPlay = botB.playCard(largestPlayedCard, 2);\n testDealer.addToPlayedCards(cardToPlay);\n largestPlayedCard = testDealer.getLargestCardFromTrick();\n\n cardToPlay = botC.playCard(largestPlayedCard, 3);\n testDealer.addToPlayedCards(cardToPlay);\n\n // List<Card> allPlayedCards = testDealer.getPlayedCardsForTrick();\n assertEquals(\"botA\", testDealer.getWinnerOfTrick(testDealer.getPlayedCardsForTrick()));\n }",
"@Test\n public void buyCard() throws Exception {\n model.getTurnTracker().setCurrentTurn(PlayerIndex.FIRST);\n when(devCardFacade.canBuyDevCard(currentPlayer)).thenReturn(true);\n dcc.buyCard();\n verify(devCardFacade, atMost(1)).buyDevCard(currentPlayer);\n }",
"public boolean checkBlackJack() {\r\n if(cards.size() == 2 && score() == 21){\r\n blackJack = true;\r\n over = true;\r\n return true;\r\n }else{\r\n return false;\r\n }\r\n }",
"public boolean isInHand( int x)\n\t{\n\t\tfor(int i=0; i<5;i++)\n\t\t{\n\t\t\tif(x == cardNumbers[i]) // verify that you are not adding the same replacement card twice\n\t\t\t\treturn true;\n\t\t}\n\t\treturn false;\t\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 boolean pairTest()\n\t{\n\t\tboolean pair = false;\n\t\tint index = 0;\n\t\t\n\t\twhile (index<(hand.length-1) && (!pair))\n\t\t{\n\t\t\tif (intRep[index] == intRep[index+1])\n\t\t\t{\n\t\t\t\tpair = true;\n\t\t\t\thandScore = 10000;\n\t\t\t\thandScore += 2 * (100 * intRep[index]);\n\t\t\t}\n\t\t\telse index++;\n\t\t}\n\t\t\n\t\t// If there's a pair, resolve kickers\n\t\tif (pair)\n\t\t{\n\t\t\tswitch (index)\n\t\t\t{\n\t\t\t\tcase 0:\t\t// Pair includes first two cards\n\t\t\t\t\tif (!twoPairTest(index)) {\n\t\t\t\t\t\tfor (int i=2; i<MAX_CARDS; i++)\n\t\t\t\t\t\t\thandScore += intRep[i]; }\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase 1:\t\t// Pair excludes first card, includes 2nd-3rd\n\t\t\t\t\tif (!twoPairTest(index)) {\n\t\t\t\t\t\thandScore += intRep[0];\n\t\t\t\t\t\thandScore += (intRep[3] + intRep[4]); }\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase 2:\t\t// Pair excludes first two, includes 3-4\n\t\t\t\t\tif (!twoPairTest(index)) {\n\t\t\t\t\t\thandScore += (intRep[0] + intRep[1]);\n\t\t\t\t\t\thandScore += intRep[4]; }\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tdefault:\t// Anything else where the kickers are higher than pair\n\t\t\t\t\tif (!twoPairTest(index))\n\t\t\t\t\t\thandScore += (intRep[0] + intRep[1] + intRep[2]);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn pair;\n\t}",
"void askLeaderCardThrowing();",
"@Test\n void pass3CardsRound1(){\n Dealer testDealer = new Dealer();\n testDealer.initDealer();\n testDealer.setRoundCount(1);\n \n List<Card> heartHand, spadeHand, clubHand, diamondHand,userPassedCards;\n\n heartHand = new ArrayList<Card>();\n spadeHand = new ArrayList<Card>();\n clubHand = new ArrayList<Card>();\n diamondHand = new ArrayList<Card>();\n userPassedCards = new ArrayList<Card>();\n \n userPassedCards.add(new Card(Suit.DIAMONDS, Rank.ACE, true));\n userPassedCards.add(new Card(Suit.DIAMONDS, Rank.KING, true));\n userPassedCards.add(new Card(Suit.DIAMONDS, Rank.QUEEN, true));\n\n for(Card c:userPassedCards) {\n c.setOwnerOfCard(\"user\");\n }\n\n for (Rank rank : Rank.values()) {\n heartHand.add(new Card(Suit.HEARTS, rank, true));\n }\n\n for (Rank rank : Rank.values()) {\n spadeHand.add(new Card(Suit.SPADES, rank, true));\n }\n\n for (Rank rank : Rank.values()) {\n clubHand.add(new Card(Suit.CLUBS, rank, true));\n }\n\n for (Rank rank : Rank.values()) {\n diamondHand.add(new Card(Suit.DIAMONDS, rank, true));\n }\n \n testDealer.getBotA().fillHandCards(heartHand);\n testDealer.getBotB().fillHandCards(spadeHand);\n testDealer.getBotC().fillHandCards(clubHand);\n testDealer.getUser().fillHandCards(diamondHand);\n\n testDealer.distributePassedCards(userPassedCards);\n\n assertEquals(13, testDealer.getUserHandCards().size());\n assertEquals(13, testDealer.getBotA().getHandCards().size());\n assertEquals(13, testDealer.getBotB().getHandCards().size());\n assertEquals(13, testDealer.getBotC().getHandCards().size());\n\n assertEquals(\"QUEEN of DIAMONDS[pickable by botA]\", testDealer.getBotA().getHandCards().get(0).toString());\n assertEquals(\"KING of DIAMONDS[pickable by botA]\", testDealer.getBotA().getHandCards().get(1).toString());\n assertEquals(\"ACE of DIAMONDS[pickable by botA]\", testDealer.getBotA().getHandCards().get(2).toString());\n\n assertEquals(\"QUEEN of HEARTS[pickable by botB]\", testDealer.getBotB().getHandCards().get(10).toString());\n assertEquals(\"KING of HEARTS[pickable by botB]\", testDealer.getBotB().getHandCards().get(11).toString());\n assertEquals(\"ACE of HEARTS[pickable by botB]\", testDealer.getBotB().getHandCards().get(12).toString());\n\n assertEquals(\"QUEEN of SPADES[pickable by botC]\", testDealer.getBotC().getHandCards().get(10).toString());\n assertEquals(\"KING of SPADES[pickable by botC]\", testDealer.getBotC().getHandCards().get(11).toString());\n assertEquals(\"ACE of SPADES[pickable by botC]\", testDealer.getBotC().getHandCards().get(12).toString());\n System.out.println(testDealer.getUser().getHandCards());\n System.out.println();\n assertEquals(\"QUEEN of CLUBS[pickable by user]\", testDealer.getUser().getHandCards().get(0).toString());\n assertEquals(\"KING of CLUBS[pickable by user]\", testDealer.getUser().getHandCards().get(1).toString());\n assertEquals(\"ACE of CLUBS[pickable by user]\", testDealer.getUser().getHandCards().get(2).toString());\n }",
"public void dealerAskCard() {\n int dealerScore = this.getDealerHand().getActualValue();\n while (dealerScore < 17) {\n Card card = this.deck.deal(this.getDealerHand());\n dealerScore = this.getDealerHand().getActualValue();\n }\n }",
"@Override\n\t\tboolean hasMatch(ArrayList<Card> hand) {\n\n\t\t\tint counter = 0;\n\t\t\tfor (int i = 0; i < hand.size(); i++) {\n\t\t\t\tif (i + 1 < hand.size()) {\n\t\t\t\t\tif (hand.get(i + 1).getCardValue().getValue()\n\t\t\t\t\t\t\t- hand.get(i).getCardValue().getValue() == 1)\n\t\t\t\t\t\tcounter++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//if not straight, then do a final check of 5 unique cards\n\t\t\tHashMap<Integer, Integer> map = new HashMap<Integer, Integer>();\n\t\t\tif (counter != 4) {\n\t\t\t\tfor (int i = 0; i < hand.size(); i++) {\n\t\t\t\t\tif (!map.containsKey(hand.get(i).getCardValue().getValue())) {\n\t\t\t\t\t\tmap.put(hand.get(i).getCardValue().getValue(), 1);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmap.put(hand.get(i).getCardValue().getValue(),\n\t\t\t\t\t\t\t\tmap.get(hand.get(i).getCardValue().getValue()) + 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t\treturn map.size() == 5;\n\t\t}",
"public boolean hit()\n\t{\n\t\taddCardToHand(new BlackJackCard());\n\t\treturn getHandValue() <= 21;\n\t}",
"@Test\n void pass3CardsRound99(){\n Dealer testDealer = new Dealer();\n testDealer.initDealer();\n testDealer.setRoundCount(99);\n \n List<Card> heartHand, spadeHand, clubHand, diamondHand,userPassedCards;\n\n heartHand = new ArrayList<Card>();\n spadeHand = new ArrayList<Card>();\n clubHand = new ArrayList<Card>();\n diamondHand = new ArrayList<Card>();\n userPassedCards = new ArrayList<Card>();\n \n userPassedCards.add(new Card(Suit.DIAMONDS, Rank.ACE, true));\n userPassedCards.add(new Card(Suit.DIAMONDS, Rank.KING, true));\n userPassedCards.add(new Card(Suit.DIAMONDS, Rank.QUEEN, true));\n\n \n for(Card c:userPassedCards) {\n c.setOwnerOfCard(\"user\");\n }\n\n for (Rank rank : Rank.values()) {\n heartHand.add(new Card(Suit.HEARTS, rank, true));\n }\n\n for (Rank rank : Rank.values()) {\n spadeHand.add(new Card(Suit.SPADES, rank, true));\n }\n\n for (Rank rank : Rank.values()) {\n clubHand.add(new Card(Suit.CLUBS, rank, true));\n }\n\n for (Rank rank : Rank.values()) {\n diamondHand.add(new Card(Suit.DIAMONDS, rank, true));\n }\n \n testDealer.getBotA().fillHandCards(heartHand);\n testDealer.getBotB().fillHandCards(spadeHand);\n testDealer.getBotC().fillHandCards(clubHand);\n testDealer.getUser().fillHandCards(diamondHand);\n\n testDealer.distributePassedCards(userPassedCards);\n\n assertEquals(13, testDealer.getUserHandCards().size());\n assertEquals(13, testDealer.getBotA().getHandCards().size());\n assertEquals(13, testDealer.getBotB().getHandCards().size());\n assertEquals(13, testDealer.getBotC().getHandCards().size());\n\n assertEquals(\"QUEEN of CLUBS[pickable by botA]\", testDealer.getBotA().getHandCards().get(0).toString());\n assertEquals(\"KING of CLUBS[pickable by botA]\", testDealer.getBotA().getHandCards().get(1).toString());\n assertEquals(\"ACE of CLUBS[pickable by botA]\", testDealer.getBotA().getHandCards().get(2).toString());\n\n assertEquals(\"QUEEN of DIAMONDS[pickable by botB]\", testDealer.getBotB().getHandCards().get(0).toString());\n assertEquals(\"KING of DIAMONDS[pickable by botB]\", testDealer.getBotB().getHandCards().get(1).toString());\n assertEquals(\"ACE of DIAMONDS[pickable by botB]\", testDealer.getBotB().getHandCards().get(2).toString());\n\n assertEquals(\"QUEEN of HEARTS[pickable by botC]\", testDealer.getBotC().getHandCards().get(10).toString());\n assertEquals(\"KING of HEARTS[pickable by botC]\", testDealer.getBotC().getHandCards().get(11).toString());\n assertEquals(\"ACE of HEARTS[pickable by botC]\", testDealer.getBotC().getHandCards().get(12).toString());\n\n assertEquals(\"QUEEN of SPADES[pickable by user]\", testDealer.getUser().getHandCards().get(10).toString());\n assertEquals(\"KING of SPADES[pickable by user]\", testDealer.getUser().getHandCards().get(11).toString());\n assertEquals(\"ACE of SPADES[pickable by user]\", testDealer.getUser().getHandCards().get(12).toString());\n }",
"@Test\r\n public void testPlayer_getCautiousStrategyCardCard_numeric_matchColorNotNumber() {\n player2 = new Player(\"Player Two\", true);\r\n player2.setHand(strategyHand.getAllCards());\r\n\r\n // let the cpc be a yellow three\r\n // get rid of all non-numeric cards and the green three so the yellow six is the most attractive option\r\n player2.getHand().discard(wild);\r\n player2.getHand().discard(wildDrawFour);\r\n player2.getHand().discard(yellowReverse);\r\n player2.getHand().discard(redDrawTwo);\r\n player2.getHand().discard(greenThree);\r\n\r\n assertTrue(player2.getCautiousStrategyCard(yellowThree, yellowThree.getColor()).equals(yellowSix));\r\n }",
"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 }",
"private void badMatch() {\n\t\tArrayList<Integer> faceValues = new ArrayList<Integer>();\n\t\tInteger firstSelectableCardPos = null;\n\t\t\n\t\tfor (int card = 0; card < CARDS_SUM; card++) {\n\t\t\tPlayingCard thisCard = ((PlayingCard) getActivity().findViewById(solo.getImage(card).getId()));\n\t\t\t\n\t\t\t// cheat by finding card face without turning card over\n\t\t\tint face = thisCard.getCard();\n\t\t\tfaceValues.add(face);\n\t\t\t\n\t\t\t// can't select all cards\n\t\t\tif (thisCard.isLocked() || thisCard.getVisible()) {\n\t\t\t\tcontinue;\n\t\t\t} else if (firstSelectableCardPos == null) {\n\t\t\t\tfirstSelectableCardPos = card;\n\t\t\t}\n\t\t\t\n\t\t\t// if this is a different card, select the bad pair\n\t\t\tif (faceValues.get(firstSelectableCardPos) != face) {\n\t\t\t\tsolo.clickOnImage(firstSelectableCardPos);\n\t\t\t\tsolo.clickOnImage(card);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}",
"public boolean computerCardCheck(Card card)\n {\n int diff = Card.valueOfCard(computerCard) - Card.valueOfCard(card);\n // If player wins\n if( diff == 1 || diff == -1)\n {\n return true;\n }\n return false;\n }",
"boolean hasPlaySingleCardResponse();",
"@Test\n void pass3CardsRound2(){\n Dealer testDealer = new Dealer();\n testDealer.initDealer();\n testDealer.setRoundCount(2);\n \n List<Card> heartHand, spadeHand, clubHand, diamondHand,userPassedCards;\n\n heartHand = new ArrayList<Card>();\n spadeHand = new ArrayList<Card>();\n clubHand = new ArrayList<Card>();\n diamondHand = new ArrayList<Card>();\n userPassedCards = new ArrayList<Card>();\n \n userPassedCards.add(new Card(Suit.DIAMONDS, Rank.ACE, true));\n userPassedCards.add(new Card(Suit.DIAMONDS, Rank.KING, true));\n userPassedCards.add(new Card(Suit.DIAMONDS, Rank.QUEEN, true));\n\n \n for(Card c:userPassedCards) {\n c.setOwnerOfCard(\"user\");\n }\n\n for (Rank rank : Rank.values()) {\n heartHand.add(new Card(Suit.HEARTS, rank, true));\n }\n\n for (Rank rank : Rank.values()) {\n spadeHand.add(new Card(Suit.SPADES, rank, true));\n }\n\n for (Rank rank : Rank.values()) {\n clubHand.add(new Card(Suit.CLUBS, rank, true));\n }\n\n for (Rank rank : Rank.values()) {\n diamondHand.add(new Card(Suit.DIAMONDS, rank, true));\n }\n \n testDealer.getBotA().fillHandCards(heartHand);\n testDealer.getBotB().fillHandCards(spadeHand);\n testDealer.getBotC().fillHandCards(clubHand);\n testDealer.getUser().fillHandCards(diamondHand);\n\n testDealer.distributePassedCards(userPassedCards);\n\n assertEquals(13, testDealer.getUserHandCards().size());\n assertEquals(13, testDealer.getBotA().getHandCards().size());\n assertEquals(13, testDealer.getBotB().getHandCards().size());\n assertEquals(13, testDealer.getBotC().getHandCards().size());\n\n assertEquals(\"QUEEN of SPADES[pickable by botA]\", testDealer.getBotA().getHandCards().get(0).toString());\n assertEquals(\"KING of SPADES[pickable by botA]\", testDealer.getBotA().getHandCards().get(1).toString());\n assertEquals(\"ACE of SPADES[pickable by botA]\", testDealer.getBotA().getHandCards().get(2).toString());\n\n assertEquals(\"QUEEN of CLUBS[pickable by botB]\", testDealer.getBotB().getHandCards().get(0).toString());\n assertEquals(\"KING of CLUBS[pickable by botB]\", testDealer.getBotB().getHandCards().get(1).toString());\n assertEquals(\"ACE of CLUBS[pickable by botB]\", testDealer.getBotB().getHandCards().get(2).toString());\n System.out.println(testDealer.getBotC().getHandCards());\n assertEquals(\"QUEEN of DIAMONDS[pickable by botC]\", testDealer.getBotC().getHandCards().get(10).toString());\n assertEquals(\"KING of DIAMONDS[pickable by botC]\", testDealer.getBotC().getHandCards().get(11).toString());\n assertEquals(\"ACE of DIAMONDS[pickable by botC]\", testDealer.getBotC().getHandCards().get(12).toString());\n System.out.println(testDealer.getUser().getHandCards());\n assertEquals(\"QUEEN of HEARTS[pickable by user]\", testDealer.getUser().getHandCards().get(10).toString());\n assertEquals(\"KING of HEARTS[pickable by user]\", testDealer.getUser().getHandCards().get(11).toString());\n assertEquals(\"ACE of HEARTS[pickable by user]\", testDealer.getUser().getHandCards().get(12).toString());\n }",
"@Override\r\n\tprotected int giveCardProtected(ArrayList<Card> hand) {\n\t\treturn getRandomCard(hand);\r\n\t}",
"@Override\n public boolean isBlackjack() {\n return ( (countCards()==2) && (higherScore()==21) );\n }",
"public static int resultBlackjack()\n\t{\n\t\t//return 0 for no black jack, return 1 for player blackjack, return for dealer blackjack, return 3 for double blackjack\n\t\tboolean player =isBlackjack(playersCards),dealer=isBlackjack(dealersCards);\n\t\tif(!player && !dealer)\n\t\t\treturn 0;\n\t\telse if(player && !dealer)\n\t\t\treturn 1;\n\t\telse if(!player && dealer)\n\t\t\treturn 2;\n\t\telse\n\t\t\treturn 3;\n\t}",
"@Test\n public void testDrawOneCard() {\n System.out.println(\"drawOneCard\");\n Deck instance = new Deck();\n Card expResult = new Card(cardColors.CLUB, cardValues.ACE);\n Card result = instance.drawOneCard();\n assertEquals(expResult, result);\n // TEST 1 : draw a card from an empty deck\n // TEST 2 : add a card, draw it and check it's the good one.\n instance = new Deck();\n Card card = new Card(cardColors.HEART, cardValues.THREE);\n int expResulti = 0;\n instance.addOneCard(card);\n Card drawnCard = instance.drawOneCard();\n assertEquals(expResulti, card.compare(drawnCard));\n /* TEST 3 : add an existing card. Draw this card, be sure that the \n second one is still there */\n boolean expResultb = true;\n assertEquals(expResultb, instance.into(card));\n\n }",
"static int getComputerCard(Card playerCard) {\n //The computer will iterate through different possible cards it might choose to play.\n //This represents a chosen card at any given time.\n Card possibleCard = null;\n //The position in the computer's hand where the possibleCard is stored.\n int cardPosition = 0;\n //True if the computer has a card of higher value than the player's.\n boolean hasHigherCard = false;\n //Iterate through the computer's hand, trying to find a card higher than the player's\n for (int i = 0; i < highCardGame.getHand(0).getNumCards(); i++) {\n if (playerCard.compareTo(highCardGame.getHand(0).inspectCard(i)) < 0) {\n //The computer has a higher card.\n if (possibleCard != null) {\n //If this card is lower than the possible card, but can still beat the player, then replace possible card.\n if (possibleCard.compareTo(highCardGame.getHand(0).inspectCard(i)) > 0) {\n possibleCard = new Card(highCardGame.getHand(0).inspectCard(i));\n cardPosition = i;\n }\n } else {\n //If the computer has not yet chosen a possible card, choose this one.\n possibleCard = new Card(highCardGame.getHand(0).inspectCard(i));\n hasHigherCard = true;\n cardPosition = i;\n }\n }\n }\n if (!hasHigherCard) {\n //If the computer does not have a card that can beat the player, then feed the lowest card\n //that the computer has to the player.\n for (int i = 0; i < highCardGame.getHand(0).getNumCards(); i++)\n if (playerCard.compareTo(highCardGame.getHand(0).inspectCard(i)) >= 0) {\n if (possibleCard != null) {\n if (possibleCard.compareTo(highCardGame.getHand(0).inspectCard(i)) > 0) {\n possibleCard = new Card(highCardGame.getHand(0).inspectCard(i));\n cardPosition = i;\n }\n } else {\n possibleCard = highCardGame.getHand(0).inspectCard(i);\n cardPosition = i;\n }\n }\n }\n return cardPosition;\n }",
"@Test\n public void play_OnePairVsOnePair() throws Exception {\n Hand hand1 = new Hand();\n hand1.addCard(new Card(Card.SUIT_SPADES, Card.CARD_6));\n hand1.addCard(new Card(Card.SUIT_HEARTS, Card.CARD_7));\n hand1.addCard(new Card(Card.SUIT_DIAMONDS, Card.CARD_8));\n hand1.addCard(new Card(Card.SUIT_HEARTS, Card.CARD_8));\n hand1.addCard(new Card(Card.SUIT_DIAMONDS, Card.CARD_ACE));\n Hand hand2 = new Hand();\n hand2.addCard(new Card(Card.SUIT_DIAMONDS, Card.CARD_6));\n hand2.addCard(new Card(Card.SUIT_CLUBS, Card.CARD_7));\n hand2.addCard(new Card(Card.SUIT_SPADES, Card.CARD_9));\n hand2.addCard(new Card(Card.SUIT_CLUBS, Card.CARD_9));\n hand2.addCard(new Card(Card.SUIT_DIAMONDS, Card.CARD_10));\n assertEquals(hand2, FiveCardDraw.play(hand1, hand2));\n }",
"@Test\n void play_BranchThree()\n {\n dealer = 21;\n player = 22;\n result = BlackjackSimple.play(dealer, player);\n\n assertEquals(dealer, result);\n }",
"@Test\n\tpublic void TestDeal() {\n\t\tArrayList<Player> testPlayers = game.getPlayers();\n\t\tArrayList<Card> allCards = new ArrayList<Card>();\n\t\tSet<Card> allCardsSet = new HashSet<Card>();\n\t\tint handSize = testPlayers.get(0).getCards().size();\n\t\tboolean correctSize = true;\n\t\t\n\t\tfor(Player p : testPlayers) {\n\t\t\tallCards.addAll(p.getCards());\n\t\t\tif(Math.abs(p.getCards().size() - handSize) > 1)\n\t\t\t\tcorrectSize = false;\n\t\t}\n\t\tallCardsSet.addAll(allCards);\n\t\t\n\t\tAssert.assertEquals(correctSize, true);\n\t\tAssert.assertEquals(allCards.size(), 21);\n\t\tAssert.assertEquals(allCards.size(), allCardsSet.size());\n\t}",
"Card dealOneCard();",
"public static void checkBlackjack()\n\t{\n\t\tint result=resultBlackjack();\n\t\tif(result==1)\n\t\t{\n\t\t\tcurrentVal.setText(\"Blackjack!\");\n\t\t\tdealerVal.setText(String.valueOf(calculateHand(dealersCards)));\n\t\t\tbet*=2;\n\t\t\tfor(int i=1;i<dealersCards.size();i++)\n\t\t\t\tdealerCardImg[i].setIcon(new ImageIcon(Gameplay.class.getResource(getCard(dealersCards.get(i)))));\n\t\t\twin();\n\t\t\tlblUpdate.setText(\"Blackjack! You win twice your bet!\");\n\t\t\tclearHands();\n\t\t\tbetting();\n\t\t}\n\t\telse if(result==2)\n\t\t{\n\t\t\tdealerVal.setText(\"Blackjack!\");\n\t\t\tfor(int i=1;i<dealersCards.size();i++)\n\t\t\t\tdealerCardImg[i].setIcon(new ImageIcon(Gameplay.class.getResource(getCard(dealersCards.get(i)))));\n\t\t\tlose();\n\t\t\tlblUpdate.setText(\"Dealer got a blackjack. You automatically lose.\");\n\t\t\tclearHands();\n\t\t\tbetting();\n\t\t}\n\t\telse if(result==3)\n\t\t{\n\t\t\tdealerVal.setText(\"Blackjack!\");\n\t\t\tcurrentVal.setText(\"Blackjack!\");\n\t\t\tlblUpdate.setText(\"You and the dealer got blackjacks! No money exchanges hands.\");\n\t\t\tfor(int i=1;i<dealersCards.size();i++)\n\t\t\t\tdealerCardImg[i].setIcon(new ImageIcon(Gameplay.class.getResource(getCard(dealersCards.get(i)))));\n\t\t\tpush();\n\t\t\tclearHands();\n\t\t\tbetting();\n\t\t}\n\t}",
"@Test\n public void testCardCanPlay_TRUE_VALUE() {\n System.out.println(\"cardCanPlay TRUE VALUE\");\n UnoCard cardSelection = new UnoCard(UnoCardColour.RED, UnoCardValue.TWO);\n UnoCard drawCard = new UnoCard(UnoCardColour.BLUE, UnoCardValue.TWO);\n UnoCardColour wildColour = UnoCardColour.BLUE;\n boolean result = utils.cardCanPlay(cardSelection, drawCard, wildColour);\n assertEquals(true, result);\n }",
"private boolean inSameSuit() {\n for (int i = 0; i < cards.length-2; i++) {\n if (cards[i].charAt(1) != cards[i + 1].charAt(1)) {\n return false;\n }\n }\n \n return true;\n }",
"public int straightTest(boolean pair)\n\t{\n\t\tboolean straight = false, ace = false;\n\t\tint index = 0, lim = 2, confirm = -1;\n\t\tint[] test;\n\t\t\n\t\t// If there is an ace, test high and low end\n\t\tif (intRep[0] == 12)\n\t\t{\n\t\t\ttest = new int[8];\n\t\t\ttest[7] = -1;\t// Two card is valued 0\n\t\t\tace = true;\n\t\t\tlim = 3;\n\t\t\t\n\t\t\tfor (int i=0; i<intRep.length; i++)\n\t\t\t\ttest[i] = intRep[i];\n\t\t}\n\t\telse { test = Arrays.copyOf(intRep, intRep.length); }\n\t\t\n\t\tif (pair)\n\t\t{\n\t\t\t// Run twice to avoid trips/twopair\n\t\t\ttest = removePair(test);\n\t\t\ttest = removePair(test);\n\t\t}\n\t\t\n\t\twhile (index<=lim && (!straight))\n\t\t{\n\t\t\tif ((test[index] - test[index+1] == 1) &&\n\t\t\t\t(test[index+1] - test[index+2] == 1) &&\n\t\t\t\t(test[index+2] - test[index+3] == 1) &&\n\t\t\t\t(test[index+3] - test[index+4] == 1) )\n\t\t\t{\n\t\t\t\tstraight = true;\n\t\t\t\tconfirm = index;\n\t\t\t\thandScore = 40000;\n\t\t\t\thandScore += 100 * test[index];\n\t\t\t}\n\t\t\telse index++;\n\t\t}\n\t\t\n\t\treturn confirm;\n\t}",
"private int playerTurn() {\n List<Card> drawnCards = new LinkedList<>();\n boolean exit = false;\n\n // Ask the player to draw more cards\n do {\n // Draw cards\n Card drawn = drawCard();\n drawnCards.add(drawn);\n Ui.cls();\n Ui.println(\"You drew a \" + drawn.getName());\n Ui.pause();\n\n // Shows current cards and drawn cards\n Ui.cls();\n Ui.println(getHeader());\n Ui.println();\n Ui.print(\"Cards:\");\n // Draw every card\n for (int i = 0; i < drawnCards.size(); i++) {\n Ui.print(\" \" + drawnCards.get(i));\n if (i + 1 < drawnCards.size()) {\n Ui.print(\",\");\n }\n }\n // Value of cards\n Ui.println(\"Value: \" + highestPossibleValue(drawnCards));\n Ui.println();\n\n // Check for too much points\n if (highestPossibleValue(drawnCards) > 21) {\n Ui.println(\"Unfortunately you got more than 21 points, resulting in a total of 0 points!\");\n Ui.pause();\n break;\n } else {\n Ui.println(\"Would you like to draw another card?\");\n Ui.println(\"1) Take another card\");\n Ui.println(\"2) Stop taking cards\");\n }\n\n // Input\n boolean quitInput = false;\n while (!quitInput) {\n int menuChoice = Ui.getValidInt();\n\n switch (menuChoice) {\n case 1:\n quitInput = true;\n break;\n case 2:\n exit = true;\n quitInput = true;\n break;\n default:\n break;\n }\n }\n\n } while (!exit);\n\n if (highestPossibleValue(drawnCards) > 21) {\n return 0;\n } else {\n return highestPossibleValue(drawnCards);\n }\n }",
"@Test\n public void testCardCanPlay_FALSE_VALUE() {\n System.out.println(\"cardCanPlay FALSE VALUE\");\n UnoCard cardSelection = new UnoCard(UnoCardColour.RED, UnoCardValue.TWO);\n UnoCard drawCard = new UnoCard(UnoCardColour.BLUE, UnoCardValue.THREE);\n UnoCardColour wildColour = UnoCardColour.BLUE;\n boolean result = utils.cardCanPlay(cardSelection, drawCard, wildColour);\n assertEquals(false, result);\n }",
"private int drawCards(){\n int input = JOptionPane.showConfirmDialog(null, FirstPlayer.showHand() + SecondPlayer.showHand() +\n \"Would you like to continue the game?\\n\", \"Draw another card?\", \n JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);\n return input;\n }",
"@Test\n void pass3CardsRound4(){\n Dealer testDealer = new Dealer();\n testDealer.initDealer();\n testDealer.setRoundCount(4);\n \n List<Card> heartHand, spadeHand, clubHand, diamondHand,userPassedCards;\n\n heartHand = new ArrayList<Card>();\n spadeHand = new ArrayList<Card>();\n clubHand = new ArrayList<Card>();\n diamondHand = new ArrayList<Card>();\n userPassedCards = new ArrayList<Card>();\n \n userPassedCards.add(new Card(Suit.DIAMONDS, Rank.ACE, true));\n userPassedCards.add(new Card(Suit.DIAMONDS, Rank.KING, true));\n userPassedCards.add(new Card(Suit.DIAMONDS, Rank.QUEEN, true));\n\n \n for(Card c:userPassedCards) {\n c.setOwnerOfCard(\"user\");\n }\n\n for (Rank rank : Rank.values()) {\n heartHand.add(new Card(Suit.HEARTS, rank, true));\n }\n\n for (Rank rank : Rank.values()) {\n spadeHand.add(new Card(Suit.SPADES, rank, true));\n }\n\n for (Rank rank : Rank.values()) {\n clubHand.add(new Card(Suit.CLUBS, rank, true));\n }\n\n for (Rank rank : Rank.values()) {\n diamondHand.add(new Card(Suit.DIAMONDS, rank, true));\n }\n \n testDealer.getBotA().fillHandCards(heartHand);\n testDealer.getBotB().fillHandCards(spadeHand);\n testDealer.getBotC().fillHandCards(clubHand);\n testDealer.getUser().fillHandCards(diamondHand);\n\n testDealer.distributePassedCards(userPassedCards);\n\n assertEquals(13, testDealer.getUserHandCards().size());\n assertEquals(13, testDealer.getBotA().getHandCards().size());\n assertEquals(13, testDealer.getBotB().getHandCards().size());\n assertEquals(13, testDealer.getBotC().getHandCards().size());\n\n assertEquals(\"TWO of HEARTS[pickable by botA]\", testDealer.getBotA().getHandCards().get(0).toString());\n assertEquals(\"THREE of HEARTS[pickable by botA]\", testDealer.getBotA().getHandCards().get(1).toString());\n assertEquals(\"FOUR of HEARTS[pickable by botA]\", testDealer.getBotA().getHandCards().get(2).toString());\n\n assertEquals(\"TWO of SPADES[pickable by botB]\", testDealer.getBotB().getHandCards().get(0).toString());\n assertEquals(\"THREE of SPADES[pickable by botB]\", testDealer.getBotB().getHandCards().get(1).toString());\n assertEquals(\"FOUR of SPADES[pickable by botB]\", testDealer.getBotB().getHandCards().get(2).toString());\n\n assertEquals(\"QUEEN of CLUBS[pickable by botC]\", testDealer.getBotC().getHandCards().get(10).toString());\n assertEquals(\"KING of CLUBS[pickable by botC]\", testDealer.getBotC().getHandCards().get(11).toString());\n assertEquals(\"ACE of CLUBS[pickable by botC]\", testDealer.getBotC().getHandCards().get(12).toString());\n\n assertEquals(\"QUEEN of DIAMONDS[pickable by user]\", testDealer.getUser().getHandCards().get(10).toString());\n assertEquals(\"KING of DIAMONDS[pickable by user]\", testDealer.getUser().getHandCards().get(11).toString());\n assertEquals(\"ACE of DIAMONDS[pickable by user]\", testDealer.getUser().getHandCards().get(12).toString());\n }",
"public abstract boolean doTurn(Deck theDeck);",
"public void evaluateHand(){only public for testing\n //hand types will be\n //1 royal flush\n //2 straight flush\n //3 four of a kind\n //4 full house\n //5 flush\n //6 straight\n //7 three of a kind\n //8 two pair\n //9 pair\n //10 high card\n //hand secondary values will have to some how account for\n //the lead card of a flush or straight or the bigger pair\n //\n HandType = 0;\n\n //----------checking flush----------\n boolean flush = true;//will flip the vriable when proven wrong\n //if Hand.suites all equal\n for(Card c : Hand) {\n if (!c.getSuite().contains(Hand[0].getSuite())) {\n flush = false;\n }\n }\n //--Handtype = 5//flush\n if(flush){\n HandType=5;\n }\n\n //----------checking pair, two pair, boat,three of a kind, four of a kind----------\n int countmatches=0;\n HashMap<Integer, ArrayList<Card>> maskd = new HashMap<>();\n int[] mask = new int[5];\n int currentmask=1;\n maskd.put(0, new ArrayList<>());\n mask[0]=0;\n maskd.get(0).add(this.Hand[0]);\n //if any two hand.value equal\n for(int comp = 0; comp<Hand.length;comp++){//comparitor\n for(int check = comp+1; check<Hand.length;check++) {//checker\n //System.out.print(\"{\"+comp+check+\"}\");\n if(0==Hand[comp].compareTo(Hand[check])){\n //System.out.println(\"pair\"+Hand[comp]+Hand[check]);\n countmatches++;\n /*if(pairprimary==0&&!(pairprimary==Hand[check].getValue())){\n pairprimary=Hand[check].getValue();\n }else if(pairsecondary==0){\n pairsecondary=Hand[check].getValue();\n }//this wont work for boats\n */\n //create mask?\n if(mask[comp]==0){\n mask[comp]=currentmask;\n maskd.put(currentmask,new ArrayList<>());\n maskd.get(currentmask).add(this.Hand[comp]);\n currentmask++;\n if(maskd.get(0).contains(this.Hand[comp])){\n maskd.get(0).remove(this.Hand[comp]);\n }\n }\n mask[check]=mask[comp];\n if(!maskd.get(mask[comp]).contains(this.Hand[check])) {\n if(maskd.get(0).contains(this.Hand[check]))\n maskd.get(0).remove(this.Hand[check]);\n maskd.get(mask[comp]).add(this.Hand[check]);\n }\n continue;\n }\n if(!maskd.get(0).contains(this.Hand[check]))\n maskd.get(0).add(this.Hand[check]);\n }\n }\n\n //for(int m:maskd.keySet())\n // System.out.print(\"\"+m+\":\"+maskd.get(m));\n //System.out.println(\"\");\n\n if(HandType==0)\n switch (countmatches){ //basically i'm counting the collisions\n case 1: HandType=9;break;//one pair\n case 2: HandType=8;break;//two pair\n case 3: HandType=7;break;//triple\n case 4: HandType=4;break;//boat\n case 6: HandType=3;break;//four of a kind\n case 10: HandType=-1;break;//five of a kind\n }//reorder cards by mask?\n if(countmatches>0){\n Card[] newhand = new Card[5];\n int bigger = 0;\n if(currentmask==3) {//two pair boat\n //two pair\n if (maskd.get(1).get(0).getValue()\n > maskd.get(2).get(0).getValue()) {\n bigger = 1;\n } else {\n bigger = 2;\n }\n\n //boat\n if (maskd.get(1).size() == 3) {\n bigger = 1;\n }\n if (maskd.get(2).size() == 3) {\n bigger = 2;\n }\n }else {\n //one pair???\n bigger = 1;\n }\n\n for(int i = 0; i<5;i++){\n //if(maskd.containsKey(bigger)) {\n if(!maskd.get(bigger).isEmpty()) {\n newhand[i] = maskd.get(bigger).get(0);\n //if (maskd.get(bigger).size() > 0) {\n maskd.get(bigger).remove(0);\n //} else {\n // bigger = Math.abs(bigger - 3);\n //}\n }else{\n if(maskd.containsKey(Math.abs(bigger-3))){\n if(!maskd.get(Math.abs(bigger-3)).isEmpty()){\n bigger = Math.abs(bigger-3);\n }else{\n bigger = 0;\n }\n }else{\n bigger = 0;\n }\n i--;\n }\n //}\n\n }//end for loop\n\n //end pair bits\n\n //System.out.println(newhand);\n this.Hand=newhand;\n }//end reshuffle hand if statement\n //----------checking for straight----------\n //if first card is ace and second card is a 5, treat ace as one\n if(Hand[0].getValue()==14&&Hand[1].getValue()==5) {\n Hand[0] = new Card(\"Ace\", Hand[0].getSuite(), 1);\n //Hand[0].Value=1;\n this.sortHand();\n this.flipHand();\n }\n //go through hand and see if all 5 values are consecutive\n int n = Hand[0].getValue();\n boolean straight = true;\n for(int i = 1;i<Hand.length; i++){\n n--;\n if(!(Hand[i].getValue()==n)){\n straight=false;\n }\n }\n if(straight){\n //if above true\n //--if handtype = 5\n if(HandType==5) {\n //----if card1 is ace\n if (Hand[0].getValue() == 14) {\n //------handtype = 1 //royal flush\n HandType = 1;\n } else {\n //----else\n HandType=2;\n //------handtype = 2 //straight flush\n }\n }else {\n //--else //not a flush\n HandType=6;\n //----handtype = 6 //straight\n }\n }\n\n //----------checking high card----------\n //if handtype = 0\n if(HandType==0) {\n HandType=10;\n //--hand card = 10\n }\n }",
"@Test\n void pass3CardsRound3(){\n Dealer testDealer = new Dealer();\n testDealer.initDealer();\n testDealer.setRoundCount(3);\n \n List<Card> heartHand, spadeHand, clubHand, diamondHand,userPassedCards;\n\n heartHand = new ArrayList<Card>();\n spadeHand = new ArrayList<Card>();\n clubHand = new ArrayList<Card>();\n diamondHand = new ArrayList<Card>();\n userPassedCards = new ArrayList<Card>();\n \n userPassedCards.add(new Card(Suit.DIAMONDS, Rank.ACE, true));\n userPassedCards.add(new Card(Suit.DIAMONDS, Rank.KING, true));\n userPassedCards.add(new Card(Suit.DIAMONDS, Rank.QUEEN, true));\n\n \n for(Card c:userPassedCards) {\n c.setOwnerOfCard(\"user\");\n }\n\n for (Rank rank : Rank.values()) {\n heartHand.add(new Card(Suit.HEARTS, rank, true));\n }\n\n for (Rank rank : Rank.values()) {\n spadeHand.add(new Card(Suit.SPADES, rank, true));\n }\n\n for (Rank rank : Rank.values()) {\n clubHand.add(new Card(Suit.CLUBS, rank, true));\n }\n\n for (Rank rank : Rank.values()) {\n diamondHand.add(new Card(Suit.DIAMONDS, rank, true));\n }\n \n testDealer.getBotA().fillHandCards(heartHand);\n testDealer.getBotB().fillHandCards(spadeHand);\n testDealer.getBotC().fillHandCards(clubHand);\n testDealer.getUser().fillHandCards(diamondHand);\n\n testDealer.distributePassedCards(userPassedCards);\n\n assertEquals(13, testDealer.getUserHandCards().size());\n assertEquals(13, testDealer.getBotA().getHandCards().size());\n assertEquals(13, testDealer.getBotB().getHandCards().size());\n assertEquals(13, testDealer.getBotC().getHandCards().size());\n\n assertEquals(\"QUEEN of CLUBS[pickable by botA]\", testDealer.getBotA().getHandCards().get(0).toString());\n assertEquals(\"KING of CLUBS[pickable by botA]\", testDealer.getBotA().getHandCards().get(1).toString());\n assertEquals(\"ACE of CLUBS[pickable by botA]\", testDealer.getBotA().getHandCards().get(2).toString());\n\n assertEquals(\"QUEEN of DIAMONDS[pickable by botB]\", testDealer.getBotB().getHandCards().get(0).toString());\n assertEquals(\"KING of DIAMONDS[pickable by botB]\", testDealer.getBotB().getHandCards().get(1).toString());\n assertEquals(\"ACE of DIAMONDS[pickable by botB]\", testDealer.getBotB().getHandCards().get(2).toString());\n\n assertEquals(\"QUEEN of HEARTS[pickable by botC]\", testDealer.getBotC().getHandCards().get(10).toString());\n assertEquals(\"KING of HEARTS[pickable by botC]\", testDealer.getBotC().getHandCards().get(11).toString());\n assertEquals(\"ACE of HEARTS[pickable by botC]\", testDealer.getBotC().getHandCards().get(12).toString());\n\n assertEquals(\"QUEEN of SPADES[pickable by user]\", testDealer.getUser().getHandCards().get(10).toString());\n assertEquals(\"KING of SPADES[pickable by user]\", testDealer.getUser().getHandCards().get(11).toString());\n assertEquals(\"ACE of SPADES[pickable by user]\", testDealer.getUser().getHandCards().get(12).toString());\n }",
"private static boolean isShuffleWorking(Deck deck,Card newCard,Card newCard2){\n\t\tdeck.shuffle();\n\t\tboolean isCorrect=true;\n\t\tif(newCard.getSuit().equals(newCard2.getSuit()) &&\n\t\t\t\tnewCard.getRank()==newCard2.getRank()){\n\t\t\t\t\tisCorrect=false;\n\t\t\t\t\treturn isCorrect;\n\t\t}\n\t\tfor(int i=0;i<53;i++){\n\t\t\tdeck.getOneCard();\n\t\t}\n\t\tif(deck.nUsed!=1){\n\t\t\tisCorrect=false;\n\t\t}\n\t\treturn isCorrect;\n\t}",
"@Override\n public boolean anotherPlayIsPossible()\n {\n \t\n List<Integer> test = cardIndexes();\n return containsSum13(test) || containsK(test);\n \n }",
"public int playHand(Hand hand){\r\n\r\n if( this.getRank() > hand.getRank()){\r\n System.out.println();\r\n System.out.println(\"Black: \" + this.getHand() + \" White: \" + hand.getHand());\r\n System.out.println(\"Black wins!\");\r\n return 1;\r\n }\r\n\r\n else if(this.getRank() < hand.getRank()){\r\n System.out.println();\r\n System.out.println(\"Black: \" + this.getHand() + \" White: \" + hand.getHand());\r\n System.out.println(\"White wins!\");\r\n return -1;\r\n }\r\n else{\r\n System.out.println();\r\n System.out.println(\"Black: \" + this.getHand() + \" White: \" + hand.getHand());\r\n\r\n if(this.getHighCard() > hand.getHighCard()){\r\n System.out.println(\"Black Wins!\");\r\n return 1;\r\n }\r\n else if(hand.getHighCard() > this.getHighCard()){\r\n System.out.println(\"white Wins!\");\r\n }\r\n System.out.print(\"Tie!\");\r\n return 0;\r\n }\r\n\r\n }",
"@Test\n public void fiveRankHandChooserHighCardTest() {\n PokerHand hand = new PokerHand();\n hand.addCard(new Card(Card.Rank.ACE, Card.Suit.HEARTS));\n hand.addCard(new Card(Card.Rank.QUEEN, Card.Suit.HEARTS));\n hand.addCard(new Card(Card.Rank.EIGHT, Card.Suit.SPADES));\n hand.addCard(new Card(Card.Rank.SIX, Card.Suit.HEARTS));\n hand.addCard(new Card(Card.Rank.TEN, Card.Suit.DIAMONDS));\n\n PokerHand.HandType result = hand.fiveRankHandChooser();\n\n Assert.assertTrue(result == PokerHand.HandType.HIGHCARD);\n }",
"public int evaluateWinner() {\n int winner = -1; //-1 house, 0 tie, 1 player\n boolean playerBlackjack = false;\n\n //Player got winnable score\n if (playerScore <= 21) {\n\n //Dealer got a winnable score\n if (dealerScore <= 21) {\n\n //Dealer got blackjack\n if (dealerScore == 21) {\n //Player also got blackjack, tie\n if (playerScore == 21) {\n winner = 0;\n }\n //Player did not have blackjack, loses\n else {\n winner = -1;\n }\n }\n //Player got blackjack, but dealer did not\n else if (playerScore == 21) {\n playerBlackjack = true;\n winner = 1;\n }\n //Tie\n else if (dealerScore == playerScore) {\n winner = 0;\n }\n //Player scored higher than dealer, but did not get blackjack\n else if (playerScore > dealerScore) {\n winner = 1;\n }\n }\n //Dealer went over 21\n else {\n //If player got blackjack\n if (playerScore == 21) {\n playerBlackjack = true;\n }\n\n winner = 1;\n }\n }\n\n //House won\n if (winner == -1) {\n if (playerCash <= 0)\n restartGame();\n else\n return winner;\n }\n //Tie\n else if (winner == 0) {\n playerCash += playerBet;\n return winner;\n }\n //Player won\n else {\n if (playerBlackjack) {\n //Player won, give back original bet AND blackjack earnings\n playerCash += (playerBet + (playerBet * 1.5));\n } else {\n //Player won, give back bet AND earnings\n playerCash += (playerBet + playerBet);\n }\n\n return winner;\n }\n\n return winner;\n }",
"private boolean validFullHouse() {\n int highestTwo, highestThree;\n highestTwo = highestThree = -1;\n for (Integer key : this.cardOccurrence.keySet()) {\n int value = this.cardOccurrence.get(key);\n if (value == 2 && key > highestTwo)\n highestTwo = key;\n else if (value == 3 && key > highestThree) {\n //If there exists a higher 3 count, the old 3 count might be bigger than the twoCount\n if(highestThree > highestTwo)\n highestTwo = highestThree;\n highestThree = key;\n }\n }\n if (highestTwo == -1 || highestThree == -1) {\n return false;\n }\n //FullHouse only possible with 2s and 3s\n\n ArrayList<String> validHand = new ArrayList<>();\n int twosCount, threesCount;\n twosCount = threesCount = 0;\n for(int i = 0; i < this.cards.size(); i ++) {\n Card c = this.cards.get(i);\n if(c.sameValue(highestTwo) && twosCount < 2){\n twosCount++;\n validHand.add(c.toString());\n }\n else if(c.sameValue(highestThree) && threesCount < 3) {\n threesCount++;\n validHand.add(c.toString());\n }\n }\n //If above conditional didn't trigger, must be valid FullHouse of some sort\n this.cardHand = new CardHand(validHand.toArray(new String[0]));\n return true;\n }",
"boolean hasSingleBet();",
"public Card enemyPlayCard(){ //Is it really worth the effort to give the enemy a full deck/temp hand? Having 2-4 basic abilities that vary should be enough.\n if(!(enemyHand.isEmpty())){\n return enemyHand.get(0);\n } else {\n return null;\n }\n }",
"public boolean isWin_LordDeWorde(){\r\n // player got LordSelachii card\r\n Player playerHoldCard = null;\r\n for(Player player : discWorld.getPlayer_HASH().values()){\r\n if(player.getPersonalityCardID() == 4){\r\n playerHoldCard = player;\r\n break;\r\n }\r\n }\r\n \r\n if(playerHoldCard != null){\r\n int numPlayers = discWorld.getPlayer_HASH().size();\r\n \r\n int numCityAreaCard = 0;\r\n \r\n for(Integer areaID : playerHoldCard.getCityAreaCardList()){\r\n Area area = discWorld.getArea_HASH().get(areaID);\r\n if(area.getDemonList().size() == 0){\r\n numCityAreaCard++;\r\n }\r\n }\r\n \r\n if (numPlayers == 2) {\r\n if(numCityAreaCard >= 7){\r\n return true;\r\n }\r\n } else if (numPlayers == 3) {\r\n if(numCityAreaCard >= 5){\r\n return true;\r\n }\r\n } else if (numPlayers == 4) {\r\n if(numCityAreaCard >= 4){\r\n return true;\r\n }\r\n }\r\n }\r\n \r\n return false;\r\n }",
"public boolean checkWin (int totalPieces){\n\t\treturn isFull();\n\t}",
"@Test\n public void play_HighCardVsHighCard() throws Exception {\n Hand hand1 = new Hand();\n hand1.addCard(new Card(Card.SUIT_CLUBS, Card.CARD_3));\n hand1.addCard(new Card(Card.SUIT_SPADES, Card.CARD_6));\n hand1.addCard(new Card(Card.SUIT_HEARTS, Card.CARD_7));\n hand1.addCard(new Card(Card.SUIT_DIAMONDS, Card.CARD_9));\n hand1.addCard(new Card(Card.SUIT_HEARTS, Card.CARD_10));\n Hand hand2 = new Hand();\n hand2.addCard(new Card(Card.SUIT_DIAMONDS, Card.CARD_3));\n hand2.addCard(new Card(Card.SUIT_DIAMONDS, Card.CARD_6));\n hand2.addCard(new Card(Card.SUIT_CLUBS, Card.CARD_7));\n hand2.addCard(new Card(Card.SUIT_SPADES, Card.CARD_9));\n hand2.addCard(new Card(Card.SUIT_CLUBS, Card.CARD_JACK));\n assertEquals(hand2, FiveCardDraw.play(hand1, hand2));\n }",
"boolean hasAlreadCheckCard();",
"public static boolean isPoker(){\n return (frequencyCount[4]==1);\n }",
"public void testGetHand() throws Exception {\r\n// System.out.println(getClass().getSimpleName() + \": getHand\");\r\n//\r\n// HandRank hr = hand.getHandRank();\r\n// Card[] result = hr.getHand();\r\n// System.out.println(hr.getHandType());\r\n// System.out.println(\"hand:\" + Arrays.toString(result));\r\n// Assert.isTrue(hr.getHandType() == HandType.HIGH);\r\n//\r\n// SimpleHandAggregator sha = new SimpleHandAggregator();\r\n// System.out.println(sha.scoreHand(hand));\r\n }",
"public int trickWinner(){\n Card.NUMBER one = player1Play.getValue();\n Card.NUMBER two = player2Play.getValue();\n Card.NUMBER three = player3Play.getValue();\n Card.NUMBER four = player4Play.getValue();\n Card.SUIT oneSuit = player1Play.getSuit();\n Card.SUIT twoSuit = player2Play.getSuit();\n Card.SUIT threeSuit = player3Play.getSuit();\n Card.SUIT fourSuit = player4Play.getSuit();\n int[] value = new int[4];\n value[0] = Card.getValsVal(one, oneSuit, currentTrumpSuit);\n value[1] = Card.getValsVal(two, twoSuit, currentTrumpSuit);\n value[2] = Card.getValsVal(three, threeSuit, currentTrumpSuit);\n value[3] = Card.getValsVal(four, fourSuit, currentTrumpSuit);\n if(player1Play.getSuit() == firstPlayedSuit && firstPlayedSuit != currentTrumpSuit && value[0] != 7){\n value[0] += 10;\n }\n if(player2Play.getSuit() == firstPlayedSuit && firstPlayedSuit != currentTrumpSuit && value[0] != 7){\n value[1] += 10;\n }\n if(player3Play.getSuit() == firstPlayedSuit && firstPlayedSuit != currentTrumpSuit && value[0] != 7){\n value[2] += 10;\n }\n if(player4Play.getSuit() == firstPlayedSuit && firstPlayedSuit != currentTrumpSuit && value[0] != 7){\n value[3] += 10;\n }\n if(player1Play.getSuit() == currentTrumpSuit || value[0] == 7){\n value[0] += 20;\n }\n if(player2Play.getSuit() == currentTrumpSuit || value[1] == 7){\n value[1] += 20;\n }\n if(player3Play.getSuit() == currentTrumpSuit || value[2] == 7){\n value[2] += 20;\n }\n if(player4Play.getSuit() == currentTrumpSuit || value[3] == 7){\n value[3] += 20;\n }\n int winner = 0;\n int winVal = 0;\n for(int i = 0; i < 4; i++){\n if(value[i] > winVal){\n winVal = value[i];\n winner = i;\n }\n }\n return winner;\n }",
"public void testCanPlayOn() {\n \n DrawCard redDraw2 = new DrawCard(Card.COLOUR_RED, 2);\n \n // create another 4 normal cards\n \n Card card1 = new Card(Card.COLOUR_BLUE, 5);\n Card card2 = new Card(Card.COLOUR_BLUE,2);\n \n //card 1 and card 2 should yield false on the method\n assertFalse(redDraw2.canPlayOn(card1));\n assertFalse(redDraw2.canPlayOn(card2));\n \n Card card3 = new Card(Card.COLOUR_RED, 5);\n Card card4 = new Card(Card.COLOUR_RED,2);\n \n // card 3 and card 4 should gives true\n \n assertTrue(redDraw2.canPlayOn(card3));\n assertTrue(redDraw2.canPlayOn(card4));\n \n }"
] | [
"0.75144076",
"0.6827024",
"0.67469424",
"0.6697358",
"0.6679343",
"0.6608894",
"0.65943694",
"0.6480828",
"0.6465366",
"0.6457245",
"0.6433399",
"0.64145505",
"0.6398387",
"0.63899356",
"0.6375386",
"0.63574696",
"0.63571686",
"0.6347381",
"0.63335913",
"0.63222814",
"0.6321269",
"0.63178027",
"0.6316416",
"0.63142467",
"0.6291627",
"0.62520546",
"0.62516814",
"0.62486964",
"0.62253565",
"0.6223175",
"0.62171763",
"0.62102765",
"0.6207689",
"0.62073076",
"0.6201766",
"0.6200735",
"0.61971605",
"0.6193713",
"0.61885226",
"0.61870474",
"0.6185481",
"0.61834526",
"0.6175237",
"0.61695004",
"0.6168735",
"0.6167294",
"0.6162741",
"0.6154798",
"0.61469424",
"0.61396897",
"0.6126946",
"0.6121618",
"0.6112162",
"0.6094071",
"0.6093467",
"0.6085446",
"0.6084405",
"0.60820675",
"0.6073134",
"0.6062666",
"0.6056781",
"0.6056699",
"0.60523283",
"0.6049067",
"0.604763",
"0.60443765",
"0.60443234",
"0.60355",
"0.6029813",
"0.6029177",
"0.6020582",
"0.60177904",
"0.6017782",
"0.60122436",
"0.60004234",
"0.59993726",
"0.59975123",
"0.5995743",
"0.5994549",
"0.599409",
"0.5989863",
"0.5988886",
"0.5981136",
"0.5979923",
"0.5979525",
"0.59755355",
"0.59692216",
"0.59649754",
"0.5957489",
"0.59530187",
"0.5951994",
"0.5948211",
"0.5948195",
"0.5943619",
"0.5942936",
"0.593936",
"0.5938252",
"0.5937295",
"0.5935577",
"0.59342843"
] | 0.69229025 | 1 |
This test depends on looping many times to determine that a random selection has changed. If this test fails, simply run it again it should not fail more than once in a blue moon. | @Test
public void testPlayer_getDumbStrategyCard_differentWinners() {
player2 = new Player("", true);
player2.setHand(strategyHand.getAllCards());
boolean differentLegalCardFound = false;
Card firstDiscard = player2.getDumbStrategyCard(yellowSix, yellowSix.getColor());
for(int i = 0; i < 25; i++) {
Card loopCard = player2.getDumbStrategyCard(yellowSix, yellowSix.getColor());
if(!loopCard.equals(firstDiscard)) {
differentLegalCardFound = true;
}
}
assertTrue(differentLegalCardFound);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\n \tpublic void testTargetRandomSelection() {\n \tComputerPlayer player = new ComputerPlayer();\n \t// Pick a location with no rooms in target, just three targets\n \tboard.calcTargets(23, 7, 2);\n \tint loc_24_8Tot = 0;\n \tint loc_22_8Tot = 0;\n \tint loc_21_7Tot = 0;\n \t// Run the test 100 times\n \tfor (int i=0; i<100; i++) {\n \t\tBoardCell selected = player.pickLocation(board.getTargets());\n \t\tif (selected == board.getRoomCellAt(24, 8))\n \t\t\tloc_24_8Tot++;\n \t\telse if (selected == board.getRoomCellAt(22, 8))\n \t\t\tloc_22_8Tot++;\n \t\telse if (selected == board.getRoomCellAt(21, 7))\n \t\t\tloc_21_7Tot++;\n \t\telse\n \t\t\tfail(\"Invalid target selected\");\n \t}\n \t// Ensure we have 100 total selections (fail should also ensure)\n \tassertEquals(100, loc_24_8Tot + loc_22_8Tot + loc_21_7Tot);\n \t// Ensure each target was selected more than once\n \tassertTrue(loc_24_8Tot > 10);\n \tassertTrue(loc_22_8Tot > 10);\n \tassertTrue(loc_21_7Tot > 10);\t\t\t\t\t\t\t\n }",
"@Test\n\tpublic void furtherSelectionTest() {\n\t\tSelectionController selectionController = new SelectionController();\n\t\tint[] selection = { 1, 2, 3, 4, 5, 6 };\n\t\tint[] unSelecion = { 1, 2, 3 };\n\t\tint[] resultSelection = { 4, 5, 6 };\n\t\tint[] negativeSelection = { -1 };\n\n\t\t// select something and unselect parts of it\n\t\tselectionController.select(selection);\n\t\tassertArrayEquals(\"Selection was different\", selection, selectionController.getSelection());\n\t\tselectionController.unselect(unSelecion);\n\t\tassertArrayEquals(\"Selection was different after unselection\", resultSelection,\n\t\t\t\tselectionController.getSelection());\n\n\t\t// do a reselection\n\t\tselectionController.reselect(unSelecion);\n\t\tassertArrayEquals(\"Selection was different after reselection\", unSelecion, selectionController.getSelection());\n\n\t\tassertTrue(\"Item 1 is selected\", selectionController.isSelected(1));\n\t\tassertTrue(\"Item 2 is selected\", selectionController.isSelected(2));\n\t\tassertTrue(\"Item 3 is selected\", selectionController.isSelected(3));\n\t\tassertFalse(\"Item 4 is not selected\", selectionController.isSelected(4));\n\t\tassertFalse(\"Item 5 is not selected\", selectionController.isSelected(5));\n\t\tassertFalse(\"Item 6 is not selected\", selectionController.isSelected(6));\n\n\t\t// unselect all elements\n\t\tselectionController.unselect(unSelecion);\n\t\tassertFalse(\"Nothing was selected\", selectionController.isSomethingSelected());\n\t\tassertEquals(\"The array should have length zero\", 0, selectionController.getSelection().length);\n\n\t\t// select something negative\n\t\tselectionController.select(negativeSelection);\n\t\tassertFalse(\"Nothing should be selected\", selectionController.isSomethingSelected());\n\t\tassertEquals(\"The array should have length zero after selection\", 0, selectionController.getSelection().length);\n\n\t\t// reselect something negative\n\t\tselectionController.select(selection);\n\t\tselectionController.reselect(negativeSelection);\n\t\tassertFalse(\"Nothing should be reselected\", selectionController.isSomethingSelected());\n\t\tassertEquals(\"The array should have length zero after reselection\", 0,\n\t\t\t\tselectionController.getSelection().length);\n\n\t}",
"@Test\r\n public void testPlayer_selectNewColor_dumb() {\r\n player2 = new Player(\"\", true);\r\n player2.setStrategy(Player.STRATEGY_DUMB);\r\n player2.setHand(strategyHand.getAllCards());\r\n player2.setLastPlayedCard(wild);\r\n String firstRandomColor = player2.selectNewColor();\r\n boolean differentColorFound = false;\r\n for(int i = 0; i < 25; i++) {\r\n String nextRandomColor = player2.selectNewColor();\r\n if(!nextRandomColor.equalsIgnoreCase(firstRandomColor)) {\r\n differentColorFound = true;\r\n }\r\n }\r\n assertTrue(differentColorFound);\r\n }",
"@Test\n\tpublic void myRandomTest() throws IllegalArgumentException, IllegalAccessException {\n\t\t\n\t\tif (Configuration.featureamp &&\n\t\t\t\tConfiguration.playengine &&\n\t\t\t\tConfiguration.choosefile &&\n\t\t\t\tConfiguration.mp3 &&\n\t\t\t\tConfiguration.gui &&\n\t\t\t\tConfiguration.skins &&\n\t\t\t\tConfiguration.light &&\n\t\t\t\tConfiguration.filesupport &&\n\t\t\t\tConfiguration.showtime &&\n\t\t\t\tConfiguration.tracktime) {\n\t\t\n\t\tstart();\n\t\tint n = gui.myRandom(1, 1);\n\t\tassertTrue(n == 1);\n\n\t\tn = gui.myRandom(2, 2);\n\t\tassertTrue(n == 2);\n\n\t\tn = gui.myRandom(0, 0);\n\t\tassertTrue(n == 0);\n\t\t\n\t\tn = gui.myRandom(4, 4);\n\t\tassertTrue(n == 4);\n\n\t\tn = gui.myRandom(1000, 1001);\n\t\tassertTrue(n == 1000 || n == 1001);\n\t\t\n\t\t}\n\t}",
"@Test\r\n\tpublic void randomTest() {\r\n\t\tItem item = new Item();\r\n\t\ttry {\r\n\t\t\tItem tempSet[] = item.getRandom(0);\r\n\t\t\tassertNotSame(tempSet.length, 0);\r\n\t\t} catch (SQLException e) {\r\n\t\t\tfail(\"Failed to execute search of random items: SQLException\");\r\n\t\t}\r\n\t}",
"@Test //loop test 2 passes\n\tpublic void testLoop2pass() {\n\t\t//create an inn, add two items, and simulate one day\n\t\tGildedRose inn = new GildedRose();\n\t\tinn.setItem(new Item(\"+5 Dexterity Vest\", 10, 20));\n\t\tinn.setItem(new Item(\"Sulfuras, Hand of Ragnaros\", 0, 80));\n\t\tinn.oneDay();\n\t\t\n\t\t//access a list of items, get the quality of the second set\n\t\tList<Item> items = inn.getItems();\n\t\tint quality = items.get(1).getQuality();\n\t\t\n\t\t//assert quality remains the same\n\t\tassertEquals(\"Failed quality for Sulfuras\", 80, quality);\n\t}",
"public static void runRandom() throws Exception {\r\n\t\ti = (int) (Math.random()*10)+1;\r\n\t\tfor (int a = 1;a <= i;a++) {\r\n\t\t\ttestRun(a);\r\n\t\t\tSystem.out.println(\"\\n\\n\");\r\n\t\t}\r\n\t\t\r\n\t}",
"@Test\n\tpublic void initialSelectionTest() {\n\t\tSelectionController selectionController = new SelectionController();\n\t\tint[] selection = { 1, 2, 3, 4, 5, 6 };\n\t\tint[] emptySelecion = {};\n\n\t\t// do a selection\n\t\tselectionController.select(selection);\n\t\tassertArrayEquals(\"Selection was different\", selectionController.getSelection(), selection);\n\t\tassertTrue(\"There was something selected\", selectionController.isSomethingSelected());\n\t\tassertEquals(\"Incorrect count of elements\", 6, selectionController.getSelectedCount());\n\n\t\t// reset the selection\n\t\tselectionController.reset();\n\t\tassertArrayEquals(\"Selection was different\", selectionController.getSelection(), emptySelecion);\n\t\tassertFalse(\"There was nothing selected\", selectionController.isSomethingSelected());\n\t\tassertEquals(\"Incorrect count of elements\", 0, selectionController.getSelectedCount());\n\t}",
"public void run() {\n RandomizedContext current = RandomizedContext.current();\n try {\n current.push(c.randomness);\n runSingleTest(notifier, c);\n } catch (Throwable t) {\n Rethrow.rethrow(augmentStackTrace(t)); \n } finally {\n current.pop();\n }\n }",
"@Test\n public void iterate0() {\n runAndWait(() -> {\n int err = 0;\n RBTree<Integer> tree = new RBTree<>();\n List<Integer> list = new ArrayList<>(List.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10));\n Collections.shuffle(list);\n tree.addAll(list);\n Collections.sort(list);\n int i = 0;\n for (int val : tree) {\n if (i >= list.size()) {\n fail(\"The tree iterated over more elements than the initial list!\");\n }\n if (val != list.get(i)) {\n System.err.println(\"Expected the value \" + list.get(i) + \", but found \" + val);\n err++;\n }\n i++;\n }\n assertEquals(\"There were \" + err + \" errors!\", 0, err);\n }, 64, 1000);\n \n }",
"@Test\n public void radioTest() throws InterruptedException {\n driver.get(\"http://practice.cybertekschool.com/radio_buttons\");\n List<WebElement> list = driver.findElements(By.name(\"sport\"));\n\n System.out.println(\"verify none of them selected by default\");\n System.out.println(list.size());\n //checking all the sport checkboxes are not checked\n for (int i = 0; i < list.size(); i++) {\n Assert.assertFalse(list.get(i).isSelected());\n }\n\n System.out.println(\"Start randomly selecting radio buttons\");\n\n //randomly clicking and verifying\n\n for (int q = 0; q < 5; q++) {\n\n Thread.sleep(5000);\n Random ran = new Random();\n int num = ran.nextInt(4);\n list.get(num).click();\n System.out.println(\"Selecting button number: \" + (num + 1));\n\n for (int i = 0; i < list.size(); i++) {\n if (i == num) {\n Assert.assertTrue(list.get(num).isSelected());\n } else {\n Assert.assertFalse(list.get(i).isSelected());\n }\n }\n\n }\n }",
"public void set_random_choice()\r\n\t{\r\n\t\tfor (int i=0 ; i<size ; i++)\r\n\t\t{\r\n\t\t\tnumbers.add(get_not_selected_random_digit());\r\n\t\t}\r\n\t}",
"public void doTestRun(int finalState) {\n\t\tint initialState = (int) (Math.random() * this.rows);\n\t\tint nextState = -1;\n\t\t\n\t\tif(initialState == finalState) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tSystem.out.println(\"Spawning at: \" + initialState);\n\t\t\n\t\twhile(initialState != finalState) {\n\t\t\tint maxReward = -100000;\n\t\t\tnextState = initialState;\n\t\t\t\n\t\t\tfor(int j = 0; j < this.columns; j++) {\n\t\t\t\tif(this.qGrid[initialState][j] > maxReward) {\n\t\t\t\t\tmaxReward = this.qGrid[initialState][j];\n\t\t\t\t\tnextState = getStateActionMap(initialState, j);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tint tState = initialState;\n\t\t\tinitialState = nextState;\n\t\t\tnextState = tState;\n\t\t\t\n\t\t\tSystem.out.println(\"Taking next step from \" + nextState + \" to \" + initialState + \"! For reward: \" + this.grid[nextState][initialState]);\n\t\t}\n\t\t\n\n\t}",
"public void testGame1EmulateIncorrectAnswers() {\n int[] indicators;\n MainPage mainPage = getMainPage();\n GameObjectImpl game1 = mainPage.gameOpen(1);\n game1.waitIndicatorsLoad();\n indicators = game1.getIndicators();\n int qtyTasksBeforeCycle = indicators[3];\n int tasksFailedBeforeCycle = indicators[1];\n for(int iter = 0; iter < qtyTasksBeforeCycle - 1; iter++) {\n game1.waitTaskBegin();\n try {\n Thread.sleep(500);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n indicators = game1.getIndicators();\n int varTasksPassedBegin = indicators[0];\n int varTasksFailedBegin = indicators[1];\n int varTasksRemainBegin = indicators[2];\n int qtyTasksInLoopBegin = indicators[3];\n\n String[] partsOfTask = game1.getPartsOfTask();\n String firstNumberVar = partsOfTask[0];\n String secondNumberVar = partsOfTask[1];\n String operationVar = partsOfTask[2];\n int actualResult = game1.getResultWithKeys(firstNumberVar, secondNumberVar, operationVar);\n // press wrong button\n String strActualResult = Integer.toString(actualResult + 1);\n for (int i = 0; i < strActualResult.length(); i++) {\n String subStr = strActualResult.substring(i, i + 1);\n game1.pressButton((subStr));\n }\n //press correct button\n strActualResult = Integer.toString(actualResult);\n for (int i = 0; i < strActualResult.length(); i++) {\n String subStr = strActualResult.substring(i, i + 1);\n game1.pressButton((subStr));\n }\n indicators = game1.getIndicators();\n int varTasksPassedEnd = indicators[0];\n int varTasksFailedEnd = indicators[1];\n int varTasksRemainEnd = indicators[2];\n int qtyTasksInLoopEnd = indicators[3];\n\n assert varTasksRemainEnd == varTasksRemainBegin : \"positiveTestCorrectAnswers: tasks remain\";//\n assert varTasksFailedEnd == (varTasksFailedBegin + 1) : \"positiveTestCorrectAnswers: tasks failed\";\n assert varTasksPassedEnd == varTasksPassedBegin : \"positiveTestCorrectAnswers: tasks passed\";\n assert qtyTasksInLoopEnd == qtyTasksInLoopBegin + 1 : \"negativeTestWrongAnswers: tasks all\";\n }\n indicators = game1.getIndicators();\n int varTasksFailedAfterCycle = indicators[1];\n int qtyTasksAfterCycle = indicators[3];\n assert varTasksFailedAfterCycle - tasksFailedBeforeCycle == qtyTasksAfterCycle - qtyTasksBeforeCycle\n : \"positiveTestCorrectAnswers: tasks summ\" ;//\n game1.clickCloseGame();\n\n }",
"@Test\r\n public void testPlayer_setRandomStrategy_2() {\r\n player2 = new Player(\"\", true);\r\n player2.setRandomStrategy();\r\n String firstStrategy = player2.getStrategy();\r\n boolean strategyReplaced = false;\r\n // generate 20 random strategies and assert at least one of them comes back different.\r\n for(int i = 0; i < 20; i++) {\r\n player2.setRandomStrategy();\r\n if (!player2.getStrategy().equalsIgnoreCase(firstStrategy)) {\r\n strategyReplaced = true;\r\n }\r\n }\r\n assertTrue(strategyReplaced);\r\n }",
"@Test\r\n\tpublic void testChooseResultWithChange() {\r\n\t\tMontyHall monty = new MontyHall();\r\n\t\tmonty.setTheDoorWithCar(0);\r\n\t\tmonty.setChanged(true);\r\n\r\n\t\tmonty.setUserChoosedDoor(0);\r\n\t\tassertNotEquals(0, monty.getTheDoorChoosedBycompere());\r\n\t\tassertEquals(false, monty.winThePrize());\r\n\r\n\t\tmonty.setUserChoosedDoor(1);\r\n\t\tassertEquals(2, monty.getTheDoorChoosedBycompere());\r\n\t\tassertEquals(true, monty.winThePrize());\r\n\r\n\t\tmonty.setUserChoosedDoor(2);\r\n\t\tassertEquals(1, monty.getTheDoorChoosedBycompere());\r\n\t\tassertEquals(true, monty.winThePrize());\r\n\t}",
"@Test //covers loop test with one pass through the loop\n\tpublic void exampleTest() {\n\t\tGildedRose inn = new GildedRose();\n\t\tinn.setItem(new Item(\"+5 Dexterity Vest\", 10, 20));\n\t\tinn.oneDay();\n\t\t\n\t\t//access a list of items, get the quality of the one set\n\t\tList<Item> items = inn.getItems();\n\t\tint quality = items.get(0).getQuality();\n\t\t\n\t\t//assert quality has decreased by one\n\t\tassertEquals(\"Failed quality for Dexterity Vest\", 19, quality);\n\t}",
"@Test\r\n\tpublic void testChangeTheOriginalChooseIsBetterThanNotChange() {\r\n\t\tMontyHall monty = new MontyHall();\r\n\t\tmonty.setChanged(true);\r\n\t\tfloat rateOfChange = monty.rateOfWinThePrizeWithChangeTheOriginalChoose(10);\r\n\t\tmonty.setChanged(false);\r\n\t\tfloat rateOfNotChange = monty.rateOfWinThePrizeWithoutChangeTheOriginalChoose(10);\r\n\t\tassertTrue(rateOfChange > rateOfNotChange);\r\n\r\n\t\t/* count is 100 */\r\n\t\tmonty.setChanged(true);\r\n\t\trateOfChange = monty.rateOfWinThePrizeWithChangeTheOriginalChoose(100);\r\n\t\tmonty.setChanged(false);\r\n\t\trateOfNotChange = monty.rateOfWinThePrizeWithoutChangeTheOriginalChoose(100);\r\n\t\tassertTrue(rateOfChange > rateOfNotChange);\r\n\r\n\t\t/* count is 10000 */\r\n\t\tmonty.setChanged(true);\r\n\t\trateOfChange = monty.rateOfWinThePrizeWithChangeTheOriginalChoose(10000);\r\n\t\tmonty.setChanged(false);\r\n\t\trateOfNotChange = monty.rateOfWinThePrizeWithoutChangeTheOriginalChoose(10000);\r\n\t\tassertTrue(rateOfChange > rateOfNotChange);\r\n\r\n\t\t/* count is 1000000 */\r\n\t\tmonty.setChanged(true);\r\n\t\trateOfChange = monty.rateOfWinThePrizeWithChangeTheOriginalChoose(1000000);\r\n\t\tmonty.setChanged(false);\r\n\t\trateOfNotChange = monty.rateOfWinThePrizeWithoutChangeTheOriginalChoose(1000000);\r\n\t\tassertTrue(rateOfChange > rateOfNotChange);\r\n\t}",
"@Test\n public void testDiceThrown() {\n testDie(game.diceThrown(), 1, 2);\n game.nextTurn();\n testDie(game.diceThrown(), 1, 2);\n game.nextTurn();\n testDie(game.diceThrown(), 3, 4);\n game.nextTurn();\n testDie(game.diceThrown(), 3, 4);\n game.nextTurn();\n testDie(game.diceThrown(), 5, 6);\n game.nextTurn();\n testDie(game.diceThrown(), 1, 2);\n game.nextTurn();\n\n }",
"@Override\n\tpublic void randomChanged(boolean random) {\n\t\t\n\t}",
"private void findResourcesFake() {\r\n\t\t\r\n\t\tRandom random = new Random();\t\r\n\t\t\r\n\t\t\t\t\t\t\r\n\t\tif (random.nextInt() % 10 == 0) {PoCOnline.setSelected(true); loadContainerOnline.setSelected(true);}\t\r\n\t\tif (random.nextInt() % 10 == 0) {fillRedOnline.setSelected(true);}\r\n\t\tif (random.nextInt() % 10 == 0) {fillYellowOnline.setSelected(true);}\r\n\t\tif (random.nextInt() % 10 == 0) {fillBlueOnline.setSelected(true);}\r\n\t\tif (random.nextInt() % 10 == 0) {testOnline.setSelected(true);}\r\n\t\tif (random.nextInt() % 10 == 0) {lidOnline.setSelected(true);}\r\n\t\tif (random.nextInt() % 10 == 0) {dispatchOnline.setSelected(true);}\t\t\r\n\t\t\r\n\t\t\r\n\t}",
"@Test\r\n\t public void feelingLucky() {\r\n\t \t Assert.fail();\r\n\t Assert.fail();\r\n\t }",
"@Override\r\n\tpublic void doTimeStep() {\n\t\tthis.run(Critter.getRandomInt(8));\r\n\t}",
"@Test\n\t public void randomItem() throws InterruptedException\n\t {\n\t\t \n\t\t productpage = new ProductPage(driver);\n\t\t productpage.clickOnSomePrompt();\n\t\t productdetails = productpage.clickOnRandomItem();\n\t\t\tboolean status = productdetails.isProductDEtailsPageDisplayed();\n\t\t\tAssertionHelper.updateTestStatus(status);\n\t\t\tTestBaseRunner.result = TestBaseRunner.passOrFail(status);\n\t\t\tExcelReadWrtite.updateResult(\"testData.xlsx\", \"TestScripts\", \"randomItem\", result);\n\t }",
"public void testSelectIndex() {\n showFrame(box);\n for (int i=0;i < MAX_ENTRIES;i += MAX_ENTRIES / 10) {\n selectedIndex = -1;\n tester.actionSelectIndex(box, i);\n assertEquals(\"Wrong index selected\", i, selectedIndex);\n }\n }",
"private void simulateFailOrSleep() throws Exception {\n if ((failProbability != null) && (sleepProbability != null) && (sleepMilisec != null)) {\n int number = new Random().nextInt(100);\n if (number < failProbability) throw new Exception(\"Simulated Exception in Customer Service\");\n else {\n number = new Random().nextInt(100);\n if (number < sleepProbability) Thread.sleep(sleepMilisec);\n }\n }\n }",
"private void random() {\n\n\t}",
"@Test\n public void genRandom() {\n runAndWait(() -> genRandom(10_000, 500, 1), 32, 2000);\n runAndWait(() -> genRandom(10_000, 500, 100), 32, 2000);\n runAndWait(() -> genRandom(250_000, 4000, 50), 4, 5_000);\n }",
"@Test\n public void test4_multiple_value_select_dropdown() throws InterruptedException{\n\n //3. Select all the options from multiple select dropdown.\n // Locate the dropdown\n\n Select multipleSelectDropdown = new Select(driver.findElement(By.xpath(\"//select[@name='Languages']\")));\n\n //Creating a list of web elements to store all of the options inside of this dropdown\n\n List<WebElement> allOptions = multipleSelectDropdown.getOptions();\n\n //Loop through the options to select all of them\n\n for(WebElement eachOption : allOptions){\n Thread.sleep(500);\n eachOption.click(); // this will click each option with every iteration\n\n //4. Print out all selected values.\n System.out.println(\"Selected: \" + eachOption.getText());\n\n //Asserting the option is actually selected or not\n Assert.assertTrue(eachOption.isSelected(), \"The option: \"+eachOption.getText()+\" is not selected!\");\n\n }\n //5. Deselect all values.\n multipleSelectDropdown.deselectAll();\n\n for(WebElement eachOption : allOptions){\n //Assert.assertTrue(!eachOption.isSelected()); //it will be false boolean value, with ! we make it \"true\"\n\n // assertFalse method looks for \"false\" boolean value to pass the test.\n Assert.assertFalse(eachOption.isSelected());\n }\n }",
"@Test\r\n\tpublic void testChooseResultWithUnChangeCarPositionSecond() {\r\n\t\tMontyHall monty = new MontyHall();\r\n\t\tmonty.setTheDoorWithCar(1);\r\n\t\tmonty.setChanged(false);\r\n\t\tmonty.setUserChoosedDoor(0);\r\n\t\tassertEquals(2, monty.getTheDoorChoosedBycompere());\r\n\t\tassertEquals(false, monty.winThePrize());\r\n\r\n\t\tmonty.setUserChoosedDoor(1);\r\n\t\tassertNotEquals(1, monty.getTheDoorChoosedBycompere());\r\n\t\tassertEquals(true, monty.winThePrize());\r\n\r\n\t\tmonty.setUserChoosedDoor(2);\r\n\t\tassertEquals(0, monty.getTheDoorChoosedBycompere());\r\n\t\tassertEquals(false, monty.winThePrize());\r\n\t}",
"private void random() {\n GameState gs = cc.getGameState();\n ArrayList<int[]> moves = cc.getPlayerMoves(player);\n ArrayList<GameState> states = nextStates(moves, gs);\n for (int[] m : moves) {\n GameState next = checkMove(m, cc);\n states.add(next);\n }\n Random rand = new Random(System.nanoTime());\n int i = rand.nextInt(states.size());\n cc.setAIMove(states.get(i));\n }",
"@Test\n void test() {\n Game g = init(\"gen_2p_02\");\n List<Player> players = g.getData().getPlayers();\n wrappedIllegalCommand(g, players.get(0), \"tool 6\");\n wrappedLegalCommand(g, players.get(0), \"pick 1\");\n assertTrue(g.isUndoAvailable());\n wrappedLegalCommand(g, players.get(0), \"tool 6\");\n assertFalse(g.isUndoAvailable());\n lightestShade(g, players);\n notLightestShade(g, players);\n }",
"@Test\n public void radnomtest() throws Throwable {\n\n long startTime = Calendar.getInstance().getTimeInMillis();\n long elapsed = Calendar.getInstance().getTimeInMillis() - startTime;\n\n\n System.out.println(\"Start testing...\");\n\n\n for (int iteration = 0; elapsed < TestTimeout; iteration++) {\n long randomseed =10;//System.currentTimeMillis();\n //\t\t\tSystem.out.println(\" Seed:\"+randomseed );\n Random random = new Random(randomseed);\n\n int startHour=13;\n int startMinute=30;\n int startDay=10;\n int startMonth=4;\n int startYear=2017;\n String title=\"Birthday Party\";\n String description=ValuesGenerator.getString(random);\n //Construct a new Appointment object with the initial data\t \n Appt appt = new Appt(startHour,\n startMinute ,\n startDay ,\n startMonth ,\n startYear ,\n title,\n description);\n if ((iteration % 50) == 0){\n appt.setDescription(null);\n }\n for (int i = 0; i < NUM_TESTS; i++) {\n String methodName = ApptRandomTest.RandomSelectMethod(random);\n if (methodName.equals(\"isValid\")){\n int hour=(int) ValuesGenerator.getRandomIntBetween(random, 0, 23);\n appt.setStartHour(hour);\t\t\t\t\t\t \n int minute=(int) ValuesGenerator.getRandomIntBetween(random, 0, 59);\n appt.setStartMinute(minute);\t\t\t\t\t\t \n int day=(int) ValuesGenerator.getRandomIntBetween(random, 1, 31);\n appt.setStartDay(day);\t\t\t\t\t\t \n int month=(int) ValuesGenerator.getRandomIntBetween(random, 1, 12);\n appt.setStartMonth(month);\n //change to invalid hours\n hour=(int) ValuesGenerator.getRandomIntBetween(random, -10, -1);\n appt.setStartHour(hour);\n hour=(int) ValuesGenerator.getRandomIntBetween(random, 0, 23);\n appt.setStartHour(hour);\n hour=(int) ValuesGenerator.getRandomIntBetween(random, 24, 30);\n appt.setStartHour(hour);\n hour=(int) ValuesGenerator.getRandomIntBetween(random, 0, 23);\n appt.setStartHour(hour);\n //change to invalid minutes\n minute=(int) ValuesGenerator.getRandomIntBetween(random, -20, -1);\n appt.setStartMinute(minute);\n minute=(int) ValuesGenerator.getRandomIntBetween(random, 0, 59);\n appt.setStartMinute(minute);\n minute=(int) ValuesGenerator.getRandomIntBetween(random, 60, 70);\n appt.setStartMinute(minute);\n minute=(int) ValuesGenerator.getRandomIntBetween(random, 0, 59);\n appt.setStartMinute(minute);\n //change to invalid days\n day=(int) ValuesGenerator.getRandomIntBetween(random, -10, 0);\n appt.setStartDay(day);\n day=(int) ValuesGenerator.getRandomIntBetween(random, 1, 31);\n appt.setStartDay(day);\n day=(int) ValuesGenerator.getRandomIntBetween(random, 32, 40);\n appt.setStartDay(day);\n day=(int) ValuesGenerator.getRandomIntBetween(random, 1, 31);\n appt.setStartDay(day);\n //change to invalid months\n month=(int) ValuesGenerator.getRandomIntBetween(random, -10, 0);\n appt.setStartMonth(month);\t\t\t\t\t\t \n month=(int) ValuesGenerator.getRandomIntBetween(random, 1, 12);\n appt.setStartMonth(month);\n month=(int) ValuesGenerator.getRandomIntBetween(random, 12, 20);\n appt.setStartMonth(month);\n month=(int) ValuesGenerator.getRandomIntBetween(random, 1, 12);\n appt.setStartMonth(month);\n }\n\n }\n\n elapsed = (Calendar.getInstance().getTimeInMillis() - startTime);\n if((iteration%10000)==0 && iteration!=0 )\n System.out.println(\"elapsed time: \"+ elapsed + \" of \"+TestTimeout);\n\n }\n\n\n System.out.println(\"Done testing...\");\n }",
"@Test\n public void testResetGame(){\n scoresModel.resetGame();\n try {\n scoresModel.resetGame();\n for(int i = 0; i < ScoresModel.maxNumOfAttempts; i++) {\n assertEquals(scoresModel.attemptsScore[i], 0);\n }\n for(int i = 0; i < ScoresModel.maxNumOfFrames; i++){\n assertEquals(scoresModel.frameTypes[i], FrameType.NOT_PLAYED);\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n }",
"@Test\r\n\tpublic void testRunAllSucceedSecond() throws Exception {\n\t\tRandom randomGen = Mockito.mock(Random.class);\r\n\t\twhen(randomGen.nextInt(2)).thenReturn(0);\r\n\t\tReflectionTestUtils.setField(semaphoreGatedRunner, \"randomGen\", randomGen);\r\n\t\tsemaphoreGatedRunner.setMaxNumberRunners(2);\r\n\r\n\t\twhen(mockSemaphoreDao.attemptToAcquireLock(semaphoreKey + \"-1\", timeoutMS)).thenReturn(null);\r\n\t\tString token = \"someToken\";\r\n\t\twhen(mockSemaphoreDao.attemptToAcquireLock(semaphoreKey + \"-0\", timeoutMS)).thenReturn(token);\r\n\t\t// run\r\n\t\tCallable<Void> call = Mockito.mock(Callable.class);\r\n\t\tsemaphoreGatedRunner.attemptToRunAllSlots(call, null);\r\n\t\tverify(call).call();\r\n\t\tverify(mockSemaphoreDao).attemptToAcquireLock(semaphoreKey + \"-1\", timeoutMS);\r\n\t\tverify(mockSemaphoreDao).attemptToAcquireLock(semaphoreKey + \"-0\", timeoutMS);\r\n\t\tverify(mockSemaphoreDao).releaseLock(semaphoreKey + \"-0\", token);\r\n\t\tverify(mockSemaphoreDao, never()).releaseLock(eq(semaphoreKey + \"-1\"), anyString());\r\n\t\tverifyNoMoreInteractions(mockSemaphoreDao);\r\n\t}",
"@Test\n\tpublic void testUpdatesSeeds() {\n\t\t//Arrange\n\t\tint startLoc[] = new int[]{2};\n\t\tint otherLocs[] = new int[]{0,1,3,4};\n\t\t\t\n\t\tMockito.when(randMock.generateRandomNumber(1, 4, seed)).thenReturn(startLoc);\n\t\tMockito.when(randMock.generateRandomNumber(10, 5, seed+1)).thenReturn(otherLocs);\n\t\t\t\n\t\t//Act\n\t\tlong seed = 2;\n\t\t\t\n\t\t//Assert\n\t\tassertEquals(seed, iteratorObj.startVisits());\n\t}",
"@Test\n public void test(){\n tmp = new Die(\"Red\",5);\n choose.modifyDie(tmp);\n assertEquals(4,tmp.getDieNumber());\n choose = new ChooseDieModifier(new DieEnhancer());\n choose.modifyDie(tmp);\n assertEquals(5,tmp.getDieNumber());\n choose = new ChooseDieModifier(new TurnTheDieOpposite());\n choose.modifyDie(tmp);\n assertEquals(2,tmp.getDieNumber());\n choose = new ChooseDieModifier(new RollDie());\n Die tmp2 = new Die(tmp.getDieColor(),tmp.getDieNumber());\n int i;\n int max=1000000;\n boolean testPassed=false;\n for(i=0;i<max;i++){\n choose.modifyDie(tmp);\n if(tmp.getDieNumber()!=tmp2.getDieNumber()){\n testPassed=true;\n i = max;\n }\n }\n assertTrue(testPassed);\n }",
"@Test\n public void test100True() {\n long start = System.currentTimeMillis();\n for (int i = 0; i < 100; i++) {\n RandomGUID myGUID = new RandomGUID(true);\n System.out.println(\"Seeding String=\" + myGUID.valueBeforeMD5);\n System.out.println(\"rawGUID=\" + myGUID.valueAfterMD5);\n System.out.println(\"RandomGUID=\" + myGUID.toString());\n }\n System.out.println(Ansi.ansi().eraseScreen().render(String.format(\"100 条@|blue 耗时 |@@|yellow %s |@@|blue 毫秒|@\", System.currentTimeMillis() - start)));\n }",
"@Test\r\n public void test3() throws Exception {\r\n int[] random = getRandomlyFromArray(new int[] {1, 2, 3, 4, 5, 6, 7, 8}, 3);\r\n String prepend = \"\";\r\n for (int i : random) {\r\n System.out.print(prepend + i);\r\n prepend = \", \";\r\n }\r\n System.out.println();\r\n \r\n try {\r\n getRandomlyFromArray(new int[] {1}, 2);\r\n Assert.fail(\"Should have thrown an exception\");\r\n } catch (Exception e) {\r\n // expected\r\n }\r\n }",
"private void getRandomNumber() {\n\t\tRandom generator = new Random();\n\t\trandomNumber = generator.nextInt(POSSIBLE_CHOICE.length);\n\t}",
"@Test\n public void selectReplacesSelectionOnlyOnce() throws Exception {\n ArgumentCaptor<Set> itemsCaptor = ArgumentCaptor.forClass(Set.class);\n\n // WHEN\n listView.select(Lists.newArrayList(A));\n verify(listener, only()).onItemSelection(itemsCaptor.capture());\n\n // THEN\n Set<?> items = itemsCaptor.getValue();\n assertThat(items, allOf(hasSize(1), contains(A)));\n }",
"@Test\n public void testFitnessProportionateSelection()\n {\n }",
"public void setSelection(int index) {\n/* 95 */ throw new RuntimeException(\"Stub!\");\n/* */ }",
"@Test(timeout = 500)\n\tpublic void testGetModuloOne() {\n\t\tAssert.fail();\n\t}",
"@Test\n\tpublic void testEvilPuzzleGeneration() {\n\t}",
"void testRandColor(Tester t) {\r\n initData();\r\n t.checkExpect(this.game2.randColor(), Color.ORANGE);\r\n t.checkExpect(this.game3.randColor(), Color.RED);\r\n t.checkExpect(this.game5.randColor(), Color.PINK);\r\n }",
"@Test\n public void f14SelectAssetTest() {\n FlowPane assets;\n int i = 0;\n Random random = new Random();\n\n //select 4 random assets out of the first 12 visible assets in the window\n do {\n clickOn(\"#thumbnailTab\").moveBy(300, 500);\n scroll(10, VerticalDirection.UP).sleep(2000);\n\n assets = (FlowPane) scene.getRoot().lookup(\"#assetsThumbPane\");\n clickOn(assets.getChildren().get(random.nextInt(12)));\n sleep(1000).clickOn(\"#serialNumberOutput\").sleep(1000);\n clickOn(\"#backBtn\");\n\n } while (++i < 4);\n\n assertTrue(\"There are selectable assets on the main page.\", assets.getChildren().size() > 0);\n }",
"@Test\r\n\tpublic void test() {\r\n\t\tfor(int i=0;i<100;i++) {\r\n\t\t\tinsert();\r\n\t\t}\r\n\t\tselectAll();\r\n\t}",
"@Test(timeout = 4000)\n public void test43() throws Throwable {\n DynamicSelectModel dynamicSelectModel0 = new DynamicSelectModel();\n dynamicSelectModel0.reset();\n }",
"public static void testRun(int a) throws Exception {\r\n\t\tRandomProperties.randomAll();\r\n\t\tThread.sleep(1000);\r\n\t\tSystem.out.println(\"the guys-\" + a + \" name is :\" + RandomProperties.getName());\r\n\t\tThread.sleep(300);\r\n\t\tSystem.out.println(\"the guys-\" + a + \" age is :\" + RandomProperties.getAge());\r\n\t\tThread.sleep(300);\r\n\t\tSystem.out.println(\"the guys-\" + a + \" ID is :\" + RandomProperties.getID());\r\n\t\tThread.sleep(300);\r\n\t\tSystem.out.println(\"the guys-\" + a + \" sex is :\" + RandomProperties.getGender());\r\n\t\tThread.sleep(1000);\r\n\t}",
"public void testSelect_4()\n throws Exception {\n BestChromosomesSelector selector = new BestChromosomesSelector(conf);\n selector.setDoubletteChromosomesAllowed(true);\n // the following original rate controls that only 30% of the chromosomes\n // will be considered for selection as given with BestChromosomesSelector.\n // The last 70% will be added as doublettes in this case.\n selector.setOriginalRate(0.3d);\n // add first chromosome\n // --------------------\n Gene gene = new BooleanGene(conf);\n gene.setAllele(Boolean.valueOf(true));\n Chromosome thirdBestChrom = new Chromosome(conf, gene, 7);\n thirdBestChrom.setFitnessValue(10);\n selector.add(thirdBestChrom);\n // add second chromosome\n // ---------------------\n gene = new BooleanGene(conf);\n gene.setAllele(Boolean.valueOf(false));\n Chromosome bestChrom = new Chromosome(conf, gene, 3);\n bestChrom.setFitnessValue(12);\n selector.add(bestChrom);\n // add third chromosome\n // ---------------------\n gene = new IntegerGene(conf);\n gene.setAllele(new Integer(444));\n Chromosome secondBestChrom = new Chromosome(conf, gene, 3);\n secondBestChrom.setFitnessValue(11);\n selector.add(secondBestChrom);\n // receive top 1 (= best) chromosome\n // ---------------------------------\n Population pop = new Population(conf);\n selector.select(1, null, pop);\n IChromosome[] bestChroms = pop.toChromosomes();\n assertEquals(1, bestChroms.length);\n assertEquals(bestChrom, bestChroms[0]);\n // receive top 4 chromosomes with original rate = 0.3\n // --------------------------------------------------\n pop.getChromosomes().clear();\n selector.select(4, null, pop);\n bestChroms = pop.toChromosomes();\n assertEquals(4, bestChroms.length);\n assertEquals(bestChrom, bestChroms[0]);\n assertEquals(bestChrom, bestChroms[1]); //because of originalRate = 0.3\n assertEquals(secondBestChrom, bestChroms[2]);\n assertEquals(thirdBestChrom, bestChroms[3]);\n // Non-unique chromosomes should have been returned, although not the same\n // but a cloned instance!\n assertEquals(bestChroms[0], bestChroms[1]);\n // receive top 4 chromosomes with original rate = 1\n // ------------------------------------------------\n pop.getChromosomes().clear();\n selector.setOriginalRate(1.0d);\n selector.select(4, null, pop);\n bestChroms = pop.toChromosomes();\n assertEquals(4, bestChroms.length);\n assertEquals(bestChrom, bestChroms[0]);\n assertEquals(secondBestChrom, bestChroms[1]);\n assertEquals(thirdBestChrom, bestChroms[2]);\n assertEquals(bestChrom, bestChroms[3]);\n }",
"@Test\n public void pickUpSomeGoldTest() {\n\tassertNotEquals(0,score);\n }",
"@Test\r\n\tpublic void testChooseResultWithChangeCarPositionSecond() {\r\n\t\tMontyHall monty = new MontyHall();\r\n\t\tmonty.setTheDoorWithCar(1);\r\n\t\tmonty.setChanged(true);\r\n\t\tmonty.setUserChoosedDoor(0);\r\n\t\tassertEquals(2, monty.getTheDoorChoosedBycompere());\r\n\t\tassertEquals(true, monty.winThePrize());\r\n\r\n\t\tmonty.setUserChoosedDoor(1);\r\n\t\tassertNotEquals(1, monty.getTheDoorChoosedBycompere());\r\n\t\tassertEquals(false, monty.winThePrize());\r\n\r\n\t\tmonty.setUserChoosedDoor(2);\r\n\t\tassertEquals(0, monty.getTheDoorChoosedBycompere());\r\n\t\tassertEquals(true, monty.winThePrize());\r\n\t}",
"private void randomTest(){\n\n int time = 5 ;\n\n test(time) ;\n }",
"@Test\r\n\tpublic void testChooseResultWithUnChangeCarPositionThird() {\r\n\t\tMontyHall monty = new MontyHall();\r\n\t\tmonty.setTheDoorWithCar(2);\r\n\t\tmonty.setChanged(false);\r\n\t\tmonty.setUserChoosedDoor(0);\r\n\t\tassertEquals(1, monty.getTheDoorChoosedBycompere());\r\n\t\tassertEquals(false, monty.winThePrize());\r\n\r\n\t\tmonty.setUserChoosedDoor(1);\r\n\t\tassertEquals(0, monty.getTheDoorChoosedBycompere());\r\n\t\tassertEquals(false, monty.winThePrize());\r\n\r\n\t\tmonty.setUserChoosedDoor(2);\r\n\t\tassertNotEquals(2, monty.getTheDoorChoosedBycompere());\r\n\t\tassertEquals(true, monty.winThePrize());\r\n\t}",
"@Test\n\tpublic void argumentTest() {\n\t\tSelectionController selectionController = new SelectionController();\n\t\ttry {\n\t\t\tselectionController.select(null);\n\t\t\tAssert.fail(\"The new selection was null\");\n\t\t} catch (NullPointerException e) {\n\t\t}\n\n\t\ttry {\n\t\t\tselectionController.unselect(null);\n\t\t\tAssert.fail(\"The new unselection was null\");\n\t\t} catch (NullPointerException e) {\n\t\t}\n\n\t\ttry {\n\t\t\tselectionController.reselect(null);\n\t\t\tAssert.fail(\"The new reselection was null\");\n\t\t} catch (NullPointerException e) {\n\t\t}\n\t}",
"@Test(expected = IllegalArgumentException.class)\n public void testChangeColorTwiceSameTime() {\n model1.addShape(Rectangle.createRectangle(\"R\", new Point.Double(500, 200),\n new Color(0, 0, 0), 0, 10, 10, 10));\n model1.addAction(new ChangeColorAction(\"R\", 10, 100,\n new Color(0, 0, 0), new Color(10, 10, 10)));\n model1.addAction(new ChangeColorAction(\"R\", 50, 120,\n new Color(0, 0, 0), new Color(10, 10, 10)));\n }",
"@Test\n public void test20False() {\n long start = System.currentTimeMillis();\n for (int i = 1; i <= 20; i++) {\n RandomGUID myguid = new RandomGUID(false);\n System.out.println(i + \" \" + myguid.toString());\n }\n System.out.println(Ansi.ansi().eraseScreen().render(String.format(\"20 条@|blue 耗时 |@@|yellow %s |@@|blue 毫秒|@\", System.currentTimeMillis() - start)));\n }",
"@Test //loop test 0 passes\n\tpublic void testLoop0pass() {\n\t\tGildedRose inn = new GildedRose();\n\t\tinn.oneDay();\n\t\t\n\t\t//access a list of items, get the quality\n\t\tList<Item> items = inn.getItems();\n\t\tint quality = -100;\n\t\tif(! items.isEmpty()) { //check if items is empty, if not get the first item's quality\n\t\t\titems.get(0).getQuality();\n\t\t}\n\t\t//assert quality is -100\n\t\tassertEquals(\"Quality -100 with 0 loop passes\", -100, quality);\n\t}",
"@Test(expected = LockUnavilableException.class)\r\n\tpublic void testRunAllFail() throws Exception {\n\t\tRandom randomGen = Mockito.mock(Random.class);\r\n\t\twhen(randomGen.nextInt(2)).thenReturn(0);\r\n\t\tReflectionTestUtils.setField(semaphoreGatedRunner, \"randomGen\", randomGen);\r\n\t\tsemaphoreGatedRunner.setMaxNumberRunners(2);\r\n\r\n\t\twhen(mockSemaphoreDao.attemptToAcquireLock(semaphoreKey + \"-1\", timeoutMS)).thenReturn(null);\r\n\t\twhen(mockSemaphoreDao.attemptToAcquireLock(semaphoreKey + \"-0\", timeoutMS)).thenReturn(null);\r\n\t\t// run\r\n\t\tCallable<Void> call = Mockito.mock(Callable.class);\r\n\t\ttry {\r\n\t\t\tsemaphoreGatedRunner.attemptToRunAllSlots(call, null);\r\n\t\t} finally {\r\n\t\t\tverify(call, never()).call();\r\n\t\t\tverify(mockSemaphoreDao).attemptToAcquireLock(semaphoreKey + \"-1\", timeoutMS);\r\n\t\t\tverify(mockSemaphoreDao).attemptToAcquireLock(semaphoreKey + \"-0\", timeoutMS);\r\n\t\t\tverify(mockSemaphoreDao, never()).releaseLock(anyString(), anyString());\r\n\t\t\tverifyNoMoreInteractions(mockSemaphoreDao);\r\n\t\t}\r\n\t}",
"@Test(timeout = 4000)\n public void test30() throws Throwable {\n DynamicSelectModel dynamicSelectModel0 = new DynamicSelectModel();\n DynamicSelectModel dynamicSelectModel1 = dynamicSelectModel0.enumeration(\"WSi5n[Vxv}\");\n dynamicSelectModel0.validate();\n assertSame(dynamicSelectModel0, dynamicSelectModel1);\n }",
"@Test\n public void randomTransitionsIncludesAllEligibleTransitionsInRoughProportion() throws PetriNetComponentException {\n \tPetriNet petriNet = APetriNet.with(AToken.called(\"Default\").withColor(Color.BLACK)).and(\n \t\t\tAPlace.withId(\"P1\").containing(1, \"Default\").token()).\n \t\t\tand(APlace.withId(\"P2\")).and(APlace.withId(\"P3\")).\n \t\t\tand(AnImmediateTransition.withId(\"T1\")).and(AnImmediateTransition.withId(\"T2\")).and(\n \t\t\tANormalArc.withSource(\"P1\").andTarget(\"T1\").with(\"1\", \"Default\").token()).and(\n \t\t\tANormalArc.withSource(\"T1\").andTarget(\"P2\").with(\"1\", \"Default\").token()).and(\n \t\t\tANormalArc.withSource(\"P1\").andTarget(\"T2\").with(\"1\", \"Default\").token()).andFinally(\n \t\t\tANormalArc.withSource(\"T2\").andTarget(\"P3\").with(\"1\", \"Default\").token());\n \t\n \tAnimator animator = new PetriNetAnimator(petriNet);\n \tTransition t = null; \n \tint t1 = 0; \n \tint t2 = 0; \n \tfor (int i = 0; i < 10; i++) {\n \t\tt = animator.getRandomEnabledTransition();\n \t\tif (t.getId().equalsIgnoreCase(\"T1\")) t1++;\n \t\telse t2++;\n\t\t}\n \tassertTrue(t1 > 0); \n \tassertTrue(t2 > 0); \n }",
"public void generateComputerChoice() {\n\t\tgetRandomNumber();\n\t\tsetComputerChoice();\n\t}",
"@Test\r\n\tpublic void testRunAllSucceedFirst() throws Exception {\n\t\tRandom randomGen = Mockito.mock(Random.class);\r\n\t\twhen(randomGen.nextInt(2)).thenReturn(0);\r\n\t\tReflectionTestUtils.setField(semaphoreGatedRunner, \"randomGen\", randomGen);\r\n\t\tsemaphoreGatedRunner.setMaxNumberRunners(2);\r\n\r\n\t\tString token = \"someToken\";\r\n\t\twhen(mockSemaphoreDao.attemptToAcquireLock(semaphoreKey + \"-1\", timeoutMS)).thenReturn(token);\r\n\t\t// run\r\n\t\tCallable<Void> call = Mockito.mock(Callable.class);\r\n\t\tsemaphoreGatedRunner.attemptToRunAllSlots(call, null);\r\n\t\tverify(call).call();\r\n\t\tverify(mockSemaphoreDao).attemptToAcquireLock(semaphoreKey + \"-1\", timeoutMS);\r\n\t\tverify(mockSemaphoreDao).releaseLock(semaphoreKey + \"-1\", token);\r\n\t\tverifyNoMoreInteractions(mockSemaphoreDao);\r\n\t}",
"@Test\n public void testShuffle() {\n System.out.println(\"shuffle\");\n // can't really test something random\n }",
"@Test\n public void TEST_FR_SELECTDIFFICULTY_UI() {\n GameData.gameDifficulty = \"unchanged\";\n ChooseDifficultyUI testUI = new ChooseDifficultyUI();\n clickButton(testUI, 1, \"easy\");\n clickButton(testUI, 2, \"medium\");\n clickButton(testUI, 3, \"hard\");\n }",
"@Test\n public void f10ModelPerformanceTest() {\n clickOn(\"#assetTypeMenuBtn\").sleep(1000);\n\n //select first asset type\n Node node = lookup(\"#columnName\").nth(1).query();\n clickOn(node).sleep(1000);\n\n //go to model tab\n clickOn(scene.getRoot().lookup(\"#modelTab\")).sleep(1000);\n\n //Modify sliders\n Slider trainSlider = (Slider) scene.getRoot().lookup(\"#trainSlider\");\n clickOn(trainSlider);\n type(KeyCode.TAB).type(KeyCode.RIGHT);\n type(KeyCode.TAB).type(KeyCode.RIGHT);\n moveBy(0, 10).clickOn().sleep(500).moveBy(0, 100).scroll(80, VerticalDirection.UP);\n\n FlowPane models = (FlowPane) scene.getRoot().lookup(\"#modelsThumbPane\");\n Pane additiveRegModel = (Pane) models.getChildren().get(5);\n Button evalButton = (Button) additiveRegModel.getChildren().get(additiveRegModel.getChildren().size() - 1);\n\n Text rmse = (Text) additiveRegModel.getChildren().get(additiveRegModel.getChildren().size() - 2);\n clickOn(rmse).sleep(3000);\n String oldRmseVal = rmse.getText();\n int i = 0;\n\n clickOn(evalButton);\n //incrementally check for 30 seconds to see if rmse has been updated\n do {\n if (rmse.getText().equals(oldRmseVal)) {\n sleep(2000);\n } else {\n break;\n }\n } while (++i < 15);\n\n clickOn(rmse).sleep(3000);\n\n assertNotNull(\"Evaluate button exists\", evalButton);\n assertNotNull(\"RMSE exists\", rmse);\n assertFalse(\"Assert current RMSE is different than old RMSE\", rmse.getText().equals(oldRmseVal));\n }",
"@Test\n public void test20True() {\n long start = System.currentTimeMillis();\n for (int i = 1; i <= 20; i++) {\n RandomGUID myguid = new RandomGUID(true);\n System.out.println(i + \" \" + myguid.toString());\n }\n System.out.println(Ansi.ansi().eraseScreen().render(String.format(\"20 条@|blue 耗时 |@@|yellow %s |@@|blue 毫秒|@\", System.currentTimeMillis() - start)));\n }",
"public void setSelection(int start, int stop) {\n/* 89 */ throw new RuntimeException(\"Stub!\");\n/* */ }",
"@Test\r\n public void startNextOptionTest()\r\n {\r\n presenter.onClickNext();\r\n\r\n Assert.assertEquals(stub.getNextCounter(), 1);\r\n }",
"@Test\n public void test2_verify_state_dropdown() throws InterruptedException{\n // we need to locate the dropdown\n\n Select stateDropdown = new Select(driver.findElement(By.xpath(\"//select[@id='state']\")));\n //3. Select Illinois --> selecting by visible text\n Thread.sleep(1000);\n stateDropdown.selectByVisibleText(\"Illinois\");\n\n //4. Select Virginia --> selecting by value\n Thread.sleep(1000);\n stateDropdown.selectByValue(\"VA\");\n\n //5. Select California --> select by index\n Thread.sleep(1000);\n stateDropdown.selectByIndex(5);\n //6. Verify final selected option is California.\n String expectedResult = \"California\";\n String actualResult = stateDropdown.getFirstSelectedOption().getText();\n\n Assert.assertEquals(actualResult, expectedResult, \"Actual vs expected is not equal!\");\n //Use all Select options. (visible text, value, index)\n }",
"@Test\n public void invalidTableEgress() throws InterruptedException {\n for (int i = 100; i < 110; ++i) {\n this.sfcOfRendererDataListener.onDataTreeChanged(createSfcOfRendererConfig(100, i));\n Thread.sleep(SLEEP); // otherwise the failure is not detected\n verifySettersNotCalled();\n }\n }",
"public SNGTestCases Options_TC1017() throws InterruptedException{\n \tString flavour = \"Electrical\";\n \t\n \tforDebugger();\n \twaitForElement(By.id(\"com.pointedsquares.gamy5.android:id/header_name\"),120);\n \ttry{\n \t\twaitForElement(By.xpath(\"//android.widget.TextView[contains(@text , 'Academics') and contains(@resource-id , 'itemTitle')]\") , 5);\n \t}catch(Exception ex){\n \t\tdriver.scrollTo(\"Academics\");\n \t}\n \tdriver.findElement(By.xpath(\"//android.widget.TextView[contains(@text , 'Academics') and contains(@resource-id , 'itemTitle')]/following-sibling::android.widget.TextView[contains(@text , 'More')]\")).click();\n \twaitForElement(By.id(\"com.pointedsquares.gamy5.android:id/search_all\"), 10);\n \tdriver.findElement(By.id(\"com.pointedsquares.gamy5.android:id/search_all\")).click();\n \tdriver.findElement(By.id(\"com.pointedsquares.gamy5.android:id/search_all\")).sendKeys(flavour);\n \tdriver.findElement(By.xpath(\"//android.widget.TextView[contains(@resource-id , 'flavour_name_list') and contains(@text , 'Electrical Engineering')]\")).click();\n \twaitForElement(By.xpath(\"//android.widget.TextView[contains(@resource-id , 'stake_amount') and contains(@text , '500')]\"),5);\n \tdriver.findElement(By.xpath(\"//android.widget.TextView[contains(@resource-id , 'stake_amount') and contains(@text , '500')]\")).click();\n \twaitForElement(By.xpath(\"//android.widget.TextView[contains(@resource-id , 'message_text') and contains(@text , 'You are about to play Electrical Engineering game with 500 coins stake.')]\"), 5);\n \tdriver.findElement(By.xpath(\"//android.widget.TextView[contains(@resource-id , 'message_text') and contains(@text , 'You are about to play Electrical Engineering game with 500 coins stake.')]\")).click();\n \tdriver.findElement(By.id(\"com.pointedsquares.gamy5.android:id/positive_button\")).click();\n \twaitForVisibilityOf(By.xpath(\"//android.widget.TextView[contains(@resource-id , 'response') and contains(@text , 'Finding room for you...')]\"));\n \tThread.sleep(5000);\n \ttry{\n \t\twaitForElement(By.xpath(\"//android.widget.TextView[contains(@resource-id , 'response') and contains(@text , 'Still Waiting.....')]\") , 2);\n \t}catch(Exception ex){\n \t\t\n \t}\n \twaitForVisibilityOf(By.id(\"com.pointedsquares.gamy5.android:id/choice_linear\"));\n \tList<WebElement> choices = driver.findElements(By.xpath(\"//android.widget.LinearLayout[contains(@resource-id , 'choice_linear')]/*\"));\n \t\n \tboolean noOfChoice = true;\n \tif(choices.size()!=4){\n \t\t\n \t\tnoOfChoice = false;\n \t}\n \tassertTrue(noOfChoice , \"Choice not equal to 4\");\n \t\n \tThread.sleep(7000);\n \treturn new SNGTestCases(driver);\n }",
"@Test\n public void testResetAndCanRetry() {\n assertTrue(rc.attempt());\n assertTrue(rc.attempt());\n assertTrue(rc.attempt());\n rc.reset();\n\n assertTrue(rc.attempt());\n assertTrue(rc.attempt());\n assertTrue(rc.attempt());\n assertFalse(rc.attempt());\n assertFalse(rc.attempt());\n assertFalse(rc.attempt());\n }",
"@Test(expected = ChangeException.class)\n public void testGiveChangeException()throws ChangeException{\n instance.scanItem(0.55);\n instance.scanItem(1.27);\n instance.giveChange();\n }",
"public void doSomeRandomization() {\n\t\tlbOp.setSelectedKey(\"+\");\n\t\tRandom random = new Random(System.currentTimeMillis());\n\t\tinpValue1.setNumber((double)random.nextInt(1000));\n\t\tinpValue2.setNumber((double)random.nextInt(1000));\n\t\tcalculate();\n\t}",
"@Test\n public void testRecursionsFailure() throws Exception {\n assertTrue(doRecursions(false));\n }",
"@Test\n public void RunwayAddRemoveTest(){\n for(Airport a : controller.get_airports()){\n controller.remove_Airport(a);\n Logger.Log(\"Removing Runway \" + a.toString());\n }\n\n Airport testAirport = new Airport(\"Test Airport\", \"TST\");\n controller.add_airport(testAirport);\n\n RunwayParameters testRP = new RunwayParameters(3901, 3901, 3500, 3000);\n\n\n Random random = new Random();\n int bound = 10;\n Logger.Log(\"Using upper bound for runway add + remove test [\" + bound + \"].\");\n\n ArrayList<Runway> runways = new ArrayList<>();\n for(int x = 0; x < bound; x++){\n String d1 = x + \"L\";\n String d2 = x + \"R\";\n\n Logger.Log(\"Adding virtual runway\");\n VirtualRunway vr1 = new VirtualRunway(d1, testRP);\n VirtualRunway vr2 = new VirtualRunway(d2, testRP);\n Runway runway = new Runway(vr1, vr2);\n runways.add(runway);\n Logger.Log(\"Adding \" + runway.toString());\n controller.add_Runway(runway, testAirport.getAirport_id());\n }\n\n ArrayList<Runway> recoveredRunways = new ArrayList<Runway>(Arrays.asList(controller.get_runways()));\n\n outer:\n for(int x = 0; x < bound; x++){\n for(Runway db_copy : recoveredRunways) {\n if(db_copy.toString().equals(runways.get(x).toString())){\n continue outer;\n }\n }\n fail(\"Failed to find Runway \" + runways.get(x) + \"in database!\");\n }\n\n\n Logger.Log(\"Test Passed! \" + bound + \" Runways added to database and removed again.\");\n controller = null;\n }",
"@Test\n public void shouldDropUnselectedLabelIndexes() throws Exception\n {\n // GIVEN\n LabelIndex[] types = LabelIndex.values();\n Set<Node> expectedNodes = new HashSet<>();\n for ( int i = 0; i < 5; i++ )\n {\n // WHEN\n GraphDatabaseService db = db( random.among( types ) );\n Node node = createNode( db );\n expectedNodes.add( node );\n\n // THEN\n assertNodes( db, expectedNodes );\n db.shutdown();\n }\n }",
"@Test\r\n\tpublic void testChooseResultWithUnChangeCarPositionFrist() {\r\n\t\tMontyHall monty = new MontyHall();\r\n\t\tmonty.setChanged(false);\r\n\t\tmonty.setTheDoorWithCar(0);\r\n\t\tmonty.setUserChoosedDoor(0);\r\n\t\tassertNotEquals(0, monty.getTheDoorChoosedBycompere());\r\n\t\tassertEquals(true, monty.winThePrize());\r\n\r\n\t\tmonty.setUserChoosedDoor(1);\r\n\t\tassertEquals(2, monty.getTheDoorChoosedBycompere());\r\n\t\tassertEquals(false, monty.winThePrize());\r\n\r\n\t\tmonty.setUserChoosedDoor(2);\r\n\t\tassertEquals(1, monty.getTheDoorChoosedBycompere());\r\n\t\tassertEquals(false, monty.winThePrize());\r\n\t}",
"@Test\n public void setShuffleButtonState() {\n expandPanel();\n\n onView(withId(R.id.shuffle)).perform(click()); //Set state to shuffled\n\n onView(withId(R.id.shuffle)).check(matches(withHighlightState(true)));\n }",
"@Test\n public void testCardSelectionIsValid_TRUE() throws Exception {\n System.out.println(\"cardSelectionIsValid not valid\");\n UnoCard cardSelection = new UnoCard(UnoCardColour.BLUE, UnoCardValue.TWO);\n UnoCard drawCard = new UnoCard(UnoCardColour.BLUE, UnoCardValue.ONE);\n UnoCardColour wildColour = UnoCardColour.BLUE;\n utils.cardSelectionIsValid(cardSelection, drawCard, wildColour);\n }",
"@Test\n public void RandomBallLocationStopped() {\n final boolean seenAll[] = new boolean[1];\n seenAll[0] = false;\n\n WheelObserver wheelObserver = new WheelObserver() {\n Set<Integer> seen = new HashSet<Integer>();\n public void stopped(final int location) {\n if (location < 0 || location > 36)\n throw new IllegalArgumentException();\n seen.add(location);\n if (seen.size() == 37) seenAll[0] = true;\n }\n };\n RouletteWheel wheel = new RouletteWheel(wheelObserver);\n\n for (int x = 0; x < 1000; x++)\n {\n wheel.spin(0);\n wheel.tick(20000);\n }\n\n assertTrue(seenAll[0]);\n }",
"@Override\n\tpublic double compete() {\n\t\tdouble result=MyTools.getRandomNum(10, 20); \t\n\t\tsetThisResult(result);\n\t\treturn result;\n\t}",
"private void randomizePuzzle() {\n\t\t// Choose random puzzles, shuffle the options.\n\t\tthis.puzzle = BarrowsPuzzleData.PUZZLES[(int) (Math.random() * BarrowsPuzzleData.PUZZLES.length)];\n\t\tthis.shuffledOptions = shuffleIntArray(puzzle.getOptions());\n\t}",
"private static void pickAllThings(Robot r)\n {\n while(r.canPickThing())\n {\n r.pickThing();\n }\n }",
"@Test\n public void badChoicePunisher() {\n Edge[] edgelist = {new Edge(new int[] {1, 7}), new Edge(new int[] {1, 8}),\n new Edge(new int[] {7, 3}), new Edge(new int[] {3, 2}), new Edge(new int[] {2, 4}),\n new Edge(new int[] {2, 5})};\n timeMethod(edgelist, 8, 2);\n\n\n Edge[] edgelist1 = {new Edge(new int[] {1, 6}), new Edge(new int[] {1, 7}),\n new Edge(new int[] {6, 3}), new Edge(new int[] {3, 2}), new Edge(new int[] {2, 4}),\n new Edge(new int[] {2, 5})};\n timeMethod(edgelist1, 7, 1);\n\n Edge[] edgelist2 = {new Edge(new int[] {1, 6}), new Edge(new int[] {1, 7}),\n new Edge(new int[] {6, 3}), new Edge(new int[] {3, 2}), new Edge(new int[] {2, 4}),\n new Edge(new int[] {2, 5}), new Edge(new int[] {2, 8})};\n timeMethod(edgelist2, 8, 2);\n\n Edge[] edgelist3 = {new Edge(new int[] {1, 6}), new Edge(new int[] {1, 7}),\n new Edge(new int[] {6, 3}), new Edge(new int[] {3, 2}), new Edge(new int[] {2, 4}),\n new Edge(new int[] {2, 5})};\n timeMethod(edgelist3, 7, 1);\n }",
"@Test\r\n\tpublic void executeReinforcement() {\r\n\r\n\t\tInteger reinforcementArmy = playerOne.getStrategyType().calculateReinforcementArmy();\r\n\r\n\t\tHashSet<String> countriesOwned = playerOne.getStrategyType().gameData.gameMap\r\n\t\t\t\t.getConqueredCountries(playerOne.getStrategyType().getPlayerID());\r\n\r\n\t\tArrayList<String> countriesOwnedList = new ArrayList<>(countriesOwned);\r\n\r\n\t\tHashMap<String, Integer> expectedArmyCountPerCountryAfterReinforcement = new HashMap<>();\r\n\r\n\t\tfor (String country : countriesOwnedList) {\r\n\t\t\texpectedArmyCountPerCountryAfterReinforcement.put(country,\r\n\t\t\t\t\tplayerOne.getStrategyType().gameData.gameMap.getCountry(country).getCountryArmyCount());\r\n\t\t}\r\n\r\n\t\twhile (reinforcementArmy > 0) {\r\n\r\n\t\t\tInteger randomReinforcementCount = 0;\r\n\t\t\tInteger randomCountryIndex = random.nextInt(countriesOwnedList.size());\r\n\r\n\t\t\tString randomCountry = countriesOwnedList.get(randomCountryIndex);\r\n\r\n\t\t\twhile (randomReinforcementCount == 0) {\r\n\t\t\t\trandomReinforcementCount = random.nextInt(reinforcementArmy + 1);\r\n\t\t\t}\r\n\r\n\t\t\tInteger randomCountryArmyCountBeforeFortification = expectedArmyCountPerCountryAfterReinforcement\r\n\t\t\t\t\t.get(randomCountry);\r\n\r\n\t\t\tInteger randomCountryArmyCountAfterFortification = randomCountryArmyCountBeforeFortification\r\n\t\t\t\t\t+ randomReinforcementCount;\r\n\r\n\t\t\texpectedArmyCountPerCountryAfterReinforcement.put(randomCountry, randomCountryArmyCountAfterFortification);\r\n\r\n\t\t\treinforcementArmy -= randomReinforcementCount;\r\n\r\n\t\t}\r\n\r\n\t\tplayerOne.getStrategyType().executeReinforcement();\r\n\r\n\t\tHashMap<String, Integer> actualArmyCountPerCountryAfterReinforcement = new HashMap<>();\r\n\r\n\t\tfor (String country : countriesOwnedList) {\r\n\t\t\tactualArmyCountPerCountryAfterReinforcement.put(country,\r\n\t\t\t\t\tplayerOne.getStrategyType().gameData.gameMap.getCountry(country).getCountryArmyCount());\r\n\t\t}\r\n\r\n\t\tassertEquals(actualArmyCountPerCountryAfterReinforcement, expectedArmyCountPerCountryAfterReinforcement);\r\n\t\t// assertTrue(strongerCountryAfterReinforcement >\r\n\t\t// strongerCountryBeforeReinforcement);\r\n\r\n\t}",
"public void testRanges() throws Exception {\n int num = atLeast(1000);\n for (int i = 0; i < num; i++) {\n BytesRef lowerVal = new BytesRef(TestUtil.randomUnicodeString(random()));\n BytesRef upperVal = new BytesRef(TestUtil.randomUnicodeString(random()));\n if (upperVal.compareTo(lowerVal) < 0) {\n assertSame(upperVal, lowerVal, random().nextBoolean(), random().nextBoolean());\n } else {\n assertSame(lowerVal, upperVal, random().nextBoolean(), random().nextBoolean());\n }\n }\n }",
"@Then(\"^items displayed as per choice made$\")\n\tpublic void items_displayed_as_per_choice_made() throws Throwable {\n\t\tString str = driver.findElement(By.xpath(\"//*[@id=\\\"center_column\\\"]/h1/span[2]\")).getText();\n\t\tassertEquals(\"7 results have been found.\", str);\n\t\tdriver.quit();\n\t}",
"public static void multiRunTest(){\n /* Input resources.\n * For each String:\n * - the first character is the name of the first image.\n * - the second character is the name of the second image.\n */\n String[] inputs = new String[]{\n \"ab\",\n \"cd\",\n \"ef\",\n \"gh\",\n \"il\",\n \"mn\"\n };\n \n BlueRand random = new BlueRand();\n random.setOutputFile(\"sample/output/multiRuns_output.txt\");\n random.setOutputImage(\"sample/output/multiRuns_output.bmp\");\n random.overwriteOutputFile(false); \n //random.deleteInputFiles(true);\n try {\n\t for (String s : inputs){\n\t random.setInputImages(\"sample/input/\"+s.charAt(0)+\".jpg\",\n\t \"sample/input/\"+s.charAt(1)+\".jpg\"); \n\t ArrayList<Byte> output = random.generateRandom();\n\t System.out.println(\"run finished... Bytes generated: \" + output.size());\n\t }\n } catch (BlueRandException e){\n \tSystem.out.println(e.getMessage());\n }\n }",
"@Test\n public void randomRecipeTest() {\n onView(withContentDescription(\"Open navigation drawer\")).perform(click());\n //Open the search bar at the top\n onView(withText(\"Find a Random Recipe!\")).perform(click());\n onView(withId(R.id.recipe_title)).check(matches(isDisplayed()));\n\n //Exit to the main activity\n pressBack();\n }",
"@Test(priority =21)\n\t public void newtest2() throws InterruptedException\n\t {\n\t\tThread.sleep(3000);\n\t\tdriver.findElement(By.name(\"nombre\")).sendKeys(\"manualchange\");\n\t\tThread.sleep(3000);\n driver.findElement(By.linkText(\"Generate\")).click();\n Thread.sleep(5000); \n driver.findElement(By.linkText(\"click here\")).click();\n Thread.sleep(5000);\n\t }",
"protected void initializeExecutionRandomness() {\r\n\r\n\t}",
"@Test\n\tpublic void testNormalPuzzleGeneration() {\n\t}",
"public void step()\n\t{\n\t\t// Reservoir sampling by generating ordered list of numbers\n\t\t// randomly pick a number within length and use that as index\n\t\tRandom rand = new Random();\n\t\tArrayList<Integer> numbers = new ArrayList<Integer>();\n\t\tfor(int i = 0; i < listOfCells.size(); i++) { numbers.add(i); }\n\t\t\n\t\t// Randomly sample from reservoir until empty\n\t\twhile(numbers.size() > 0)\n\t\t{\n\t\t\tint picked_index = rand.nextInt(numbers.size());\n\t\t\tint picked_val = numbers.get(picked_index);\n\t\t\t\n\t\t\t//TODO: Maybe call a function on cell of random action that might occur\n\t\t\t//\tConsider only returning object when necessary, (how it is now)\n\t\t\tPlantCell newObject = listOfCells.get(picked_val).doAction();\n\t\t\tif(newObject != null)\n\t\t\t{\n//\t\t\t\tSystem.out.println(\"New cell generated!\");\n\t\t\t\tlistOfCells.add(newObject);\n\t\t\t}\n\t\t\t\n\t\t\t//Kill spawning cell if its health drops <= 0\n\t\t\t//should die right away to make room for other cell\n\t\t\tif(listOfCells.get(picked_val).getHealth() <= 0)\n\t\t\t{\n\t\t\t\tenvironmentPointer.map[listOfCells.get(picked_val).getX()][listOfCells.get(picked_val).getY()] = null;\n\t\t\t\tlistOfCells.set(picked_val, null); //Set to null as to preserve list integrity for reservoir sampling, will be removed later\n\t\t\t}\n\t\t\t\n\t\t\tnumbers.remove(picked_index);\n\t\t}\n\t\t\n\t\t// All recently dead cells are now null in our cell list, so we are removing them from the list now\n\t\tfor(int i = 0; i < listOfCells.size(); i++)\n\t\t{\n\t\t\tif(listOfCells.get(i) == null)\n\t\t\t{\n\t\t\t\tlistOfCells.remove(i);\n\t\t\t\ti--; //Adjust for changing size\n\t\t\t}\n\t\t}\n\t}",
"public void testSelect_0()\n throws Exception {\n BestChromosomesSelector selector = new BestChromosomesSelector(conf);\n Gene gene = new IntegerGene(conf);\n gene.setAllele(new Integer(444));\n Chromosome secondBestChrom = new Chromosome(conf, gene, 3);\n secondBestChrom.setFitnessValue(11);\n selector.add(secondBestChrom);\n gene = new BooleanGene(conf);\n gene.setAllele(Boolean.valueOf(false));\n Chromosome bestChrom = new Chromosome(conf, gene, 3);\n bestChrom.setFitnessValue(12);\n selector.add(bestChrom);\n selector.select(1, null, new Population(conf));\n }",
"@Test\n public void endGameDetectionTrue() {\n logic.setDirection(1);\n for (int i = 0; i < 100; i++) {\n logic.eatFoodForTesting();\n logic.gameLogic();\n }\n assertFalse(logic.gameLogic());\n }",
"@Test\n\t@TestProperties(name = \"Clear element ${by}:${locator} selection\", paramsInclude = { \"by\", \"locator\" })\n\tpublic void clearSelections() {\n\t\tthrow new IllegalStateException(\"Unimplemenetd\");\n\t}",
"private static boolean KawigiEdit_RunTest(\n int testNum, int p0, int p1, boolean hasAnswer, int[] p2) {\n System.out.print(\"Test \" + testNum + \": [\" + p0 + \",\" + p1);\n System.out.println(\"]\");\n RearrangeAndIncrement obj;\n int[] answer;\n obj = new RearrangeAndIncrement();\n long startTime = System.currentTimeMillis();\n answer = obj.change(p0, p1);\n long endTime = System.currentTimeMillis();\n boolean res;\n res = true;\n System.out.println(\"Time: \" + (endTime - startTime) / 1000.0 + \" seconds\");\n if (hasAnswer) {\n System.out.println(\"Desired answer:\");\n System.out.print(\"\\t\" + \"{\");\n for (int i = 0; p2.length > i; ++i) {\n if (i > 0) {\n System.out.print(\",\");\n }\n System.out.print(p2[i]);\n }\n System.out.println(\"}\");\n }\n System.out.println(\"Your answer:\");\n System.out.print(\"\\t\" + \"{\");\n for (int i = 0; answer.length > i; ++i) {\n if (i > 0) {\n System.out.print(\",\");\n }\n System.out.print(answer[i]);\n }\n System.out.println(\"}\");\n if (hasAnswer) {\n if (answer.length != p2.length) {\n res = false;\n } else {\n for (int i = 0; answer.length > i; ++i) {\n if (answer[i] != p2[i]) {\n res = false;\n }\n }\n }\n }\n if (!res) {\n System.out.println(\"DOESN'T MATCH!!!!\");\n } else if ((endTime - startTime) / 1000.0 >= 2) {\n System.out.println(\"FAIL the timeout\");\n res = false;\n } else if (hasAnswer) {\n System.out.println(\"Match :-)\");\n } else {\n System.out.println(\"OK, but is it right?\");\n }\n System.out.println(\"\");\n return res;\n }",
"@Test(groups = \"smoke\")\n public void testKeepSelected() {\n String textSource = pickList.advanced().getSourceList().getItem(0).getText();\n pickList.add(0);\n ListItem item = pickList.advanced().getTargetList().getItem(0);\n assertTrue(item.getRootElement().getAttribute(\"class\").contains(\"rf-pick-sel\"));\n assertEquals(item.getText(), textSource);\n\n pickList.remove(0);\n item = pickList.advanced().getSourceList().getItem(ChoicePickerHelper.byIndex().last());\n assertTrue(item.getRootElement().getAttribute(\"class\").contains(\"rf-pick-sel\"));\n assertEquals(item.getText(), textSource);\n assertEquals(Utils.getIndexOfElement(item.getRootElement()), pickList\n .advanced().getSourceList().size() - 1, \"Index of removed item.\");\n }"
] | [
"0.7167262",
"0.6713701",
"0.6630352",
"0.6386354",
"0.6201514",
"0.61248344",
"0.60839564",
"0.6082365",
"0.6037024",
"0.59782845",
"0.5941966",
"0.5941828",
"0.58866096",
"0.5872392",
"0.5870861",
"0.5867345",
"0.5862639",
"0.5852303",
"0.58352983",
"0.5828",
"0.58265674",
"0.5779623",
"0.5757111",
"0.5755018",
"0.57507604",
"0.5742578",
"0.57127446",
"0.57036823",
"0.568854",
"0.568684",
"0.5686236",
"0.56743085",
"0.5671728",
"0.5658415",
"0.5651185",
"0.5636741",
"0.55950624",
"0.559078",
"0.55893135",
"0.5587648",
"0.55722016",
"0.5563847",
"0.5548992",
"0.5543494",
"0.5541504",
"0.5539172",
"0.5533488",
"0.5531993",
"0.5529751",
"0.55293334",
"0.5520609",
"0.55193615",
"0.5518062",
"0.5516761",
"0.5516435",
"0.551303",
"0.55123293",
"0.55020577",
"0.54987687",
"0.54944384",
"0.5485103",
"0.5482977",
"0.54768586",
"0.5456699",
"0.54556334",
"0.5450561",
"0.5447718",
"0.5445047",
"0.5444036",
"0.5443154",
"0.5439715",
"0.54397076",
"0.5436107",
"0.5432866",
"0.5428365",
"0.5427238",
"0.54269564",
"0.54241204",
"0.5423859",
"0.5419401",
"0.5418859",
"0.5418404",
"0.5413695",
"0.5413637",
"0.54124004",
"0.540648",
"0.53929776",
"0.5391445",
"0.5389885",
"0.5385691",
"0.5383069",
"0.5382779",
"0.538264",
"0.53824544",
"0.53813964",
"0.5378129",
"0.5371604",
"0.53671813",
"0.53640467",
"0.5359387",
"0.535695"
] | 0.0 | -1 |
This test depends on looping many times to determine that a random selection has changed. If this test fails, simply run it again it should not fail more than once in a blue moon. | @Test
public void testPlayer_selectNewColor_dumb() {
player2 = new Player("", true);
player2.setStrategy(Player.STRATEGY_DUMB);
player2.setHand(strategyHand.getAllCards());
player2.setLastPlayedCard(wild);
String firstRandomColor = player2.selectNewColor();
boolean differentColorFound = false;
for(int i = 0; i < 25; i++) {
String nextRandomColor = player2.selectNewColor();
if(!nextRandomColor.equalsIgnoreCase(firstRandomColor)) {
differentColorFound = true;
}
}
assertTrue(differentColorFound);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\n \tpublic void testTargetRandomSelection() {\n \tComputerPlayer player = new ComputerPlayer();\n \t// Pick a location with no rooms in target, just three targets\n \tboard.calcTargets(23, 7, 2);\n \tint loc_24_8Tot = 0;\n \tint loc_22_8Tot = 0;\n \tint loc_21_7Tot = 0;\n \t// Run the test 100 times\n \tfor (int i=0; i<100; i++) {\n \t\tBoardCell selected = player.pickLocation(board.getTargets());\n \t\tif (selected == board.getRoomCellAt(24, 8))\n \t\t\tloc_24_8Tot++;\n \t\telse if (selected == board.getRoomCellAt(22, 8))\n \t\t\tloc_22_8Tot++;\n \t\telse if (selected == board.getRoomCellAt(21, 7))\n \t\t\tloc_21_7Tot++;\n \t\telse\n \t\t\tfail(\"Invalid target selected\");\n \t}\n \t// Ensure we have 100 total selections (fail should also ensure)\n \tassertEquals(100, loc_24_8Tot + loc_22_8Tot + loc_21_7Tot);\n \t// Ensure each target was selected more than once\n \tassertTrue(loc_24_8Tot > 10);\n \tassertTrue(loc_22_8Tot > 10);\n \tassertTrue(loc_21_7Tot > 10);\t\t\t\t\t\t\t\n }",
"@Test\n\tpublic void furtherSelectionTest() {\n\t\tSelectionController selectionController = new SelectionController();\n\t\tint[] selection = { 1, 2, 3, 4, 5, 6 };\n\t\tint[] unSelecion = { 1, 2, 3 };\n\t\tint[] resultSelection = { 4, 5, 6 };\n\t\tint[] negativeSelection = { -1 };\n\n\t\t// select something and unselect parts of it\n\t\tselectionController.select(selection);\n\t\tassertArrayEquals(\"Selection was different\", selection, selectionController.getSelection());\n\t\tselectionController.unselect(unSelecion);\n\t\tassertArrayEquals(\"Selection was different after unselection\", resultSelection,\n\t\t\t\tselectionController.getSelection());\n\n\t\t// do a reselection\n\t\tselectionController.reselect(unSelecion);\n\t\tassertArrayEquals(\"Selection was different after reselection\", unSelecion, selectionController.getSelection());\n\n\t\tassertTrue(\"Item 1 is selected\", selectionController.isSelected(1));\n\t\tassertTrue(\"Item 2 is selected\", selectionController.isSelected(2));\n\t\tassertTrue(\"Item 3 is selected\", selectionController.isSelected(3));\n\t\tassertFalse(\"Item 4 is not selected\", selectionController.isSelected(4));\n\t\tassertFalse(\"Item 5 is not selected\", selectionController.isSelected(5));\n\t\tassertFalse(\"Item 6 is not selected\", selectionController.isSelected(6));\n\n\t\t// unselect all elements\n\t\tselectionController.unselect(unSelecion);\n\t\tassertFalse(\"Nothing was selected\", selectionController.isSomethingSelected());\n\t\tassertEquals(\"The array should have length zero\", 0, selectionController.getSelection().length);\n\n\t\t// select something negative\n\t\tselectionController.select(negativeSelection);\n\t\tassertFalse(\"Nothing should be selected\", selectionController.isSomethingSelected());\n\t\tassertEquals(\"The array should have length zero after selection\", 0, selectionController.getSelection().length);\n\n\t\t// reselect something negative\n\t\tselectionController.select(selection);\n\t\tselectionController.reselect(negativeSelection);\n\t\tassertFalse(\"Nothing should be reselected\", selectionController.isSomethingSelected());\n\t\tassertEquals(\"The array should have length zero after reselection\", 0,\n\t\t\t\tselectionController.getSelection().length);\n\n\t}",
"@Test\n\tpublic void myRandomTest() throws IllegalArgumentException, IllegalAccessException {\n\t\t\n\t\tif (Configuration.featureamp &&\n\t\t\t\tConfiguration.playengine &&\n\t\t\t\tConfiguration.choosefile &&\n\t\t\t\tConfiguration.mp3 &&\n\t\t\t\tConfiguration.gui &&\n\t\t\t\tConfiguration.skins &&\n\t\t\t\tConfiguration.light &&\n\t\t\t\tConfiguration.filesupport &&\n\t\t\t\tConfiguration.showtime &&\n\t\t\t\tConfiguration.tracktime) {\n\t\t\n\t\tstart();\n\t\tint n = gui.myRandom(1, 1);\n\t\tassertTrue(n == 1);\n\n\t\tn = gui.myRandom(2, 2);\n\t\tassertTrue(n == 2);\n\n\t\tn = gui.myRandom(0, 0);\n\t\tassertTrue(n == 0);\n\t\t\n\t\tn = gui.myRandom(4, 4);\n\t\tassertTrue(n == 4);\n\n\t\tn = gui.myRandom(1000, 1001);\n\t\tassertTrue(n == 1000 || n == 1001);\n\t\t\n\t\t}\n\t}",
"@Test\r\n\tpublic void randomTest() {\r\n\t\tItem item = new Item();\r\n\t\ttry {\r\n\t\t\tItem tempSet[] = item.getRandom(0);\r\n\t\t\tassertNotSame(tempSet.length, 0);\r\n\t\t} catch (SQLException e) {\r\n\t\t\tfail(\"Failed to execute search of random items: SQLException\");\r\n\t\t}\r\n\t}",
"@Test //loop test 2 passes\n\tpublic void testLoop2pass() {\n\t\t//create an inn, add two items, and simulate one day\n\t\tGildedRose inn = new GildedRose();\n\t\tinn.setItem(new Item(\"+5 Dexterity Vest\", 10, 20));\n\t\tinn.setItem(new Item(\"Sulfuras, Hand of Ragnaros\", 0, 80));\n\t\tinn.oneDay();\n\t\t\n\t\t//access a list of items, get the quality of the second set\n\t\tList<Item> items = inn.getItems();\n\t\tint quality = items.get(1).getQuality();\n\t\t\n\t\t//assert quality remains the same\n\t\tassertEquals(\"Failed quality for Sulfuras\", 80, quality);\n\t}",
"@Test\n\tpublic void initialSelectionTest() {\n\t\tSelectionController selectionController = new SelectionController();\n\t\tint[] selection = { 1, 2, 3, 4, 5, 6 };\n\t\tint[] emptySelecion = {};\n\n\t\t// do a selection\n\t\tselectionController.select(selection);\n\t\tassertArrayEquals(\"Selection was different\", selectionController.getSelection(), selection);\n\t\tassertTrue(\"There was something selected\", selectionController.isSomethingSelected());\n\t\tassertEquals(\"Incorrect count of elements\", 6, selectionController.getSelectedCount());\n\n\t\t// reset the selection\n\t\tselectionController.reset();\n\t\tassertArrayEquals(\"Selection was different\", selectionController.getSelection(), emptySelecion);\n\t\tassertFalse(\"There was nothing selected\", selectionController.isSomethingSelected());\n\t\tassertEquals(\"Incorrect count of elements\", 0, selectionController.getSelectedCount());\n\t}",
"public static void runRandom() throws Exception {\r\n\t\ti = (int) (Math.random()*10)+1;\r\n\t\tfor (int a = 1;a <= i;a++) {\r\n\t\t\ttestRun(a);\r\n\t\t\tSystem.out.println(\"\\n\\n\");\r\n\t\t}\r\n\t\t\r\n\t}",
"public void run() {\n RandomizedContext current = RandomizedContext.current();\n try {\n current.push(c.randomness);\n runSingleTest(notifier, c);\n } catch (Throwable t) {\n Rethrow.rethrow(augmentStackTrace(t)); \n } finally {\n current.pop();\n }\n }",
"@Test\n public void iterate0() {\n runAndWait(() -> {\n int err = 0;\n RBTree<Integer> tree = new RBTree<>();\n List<Integer> list = new ArrayList<>(List.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10));\n Collections.shuffle(list);\n tree.addAll(list);\n Collections.sort(list);\n int i = 0;\n for (int val : tree) {\n if (i >= list.size()) {\n fail(\"The tree iterated over more elements than the initial list!\");\n }\n if (val != list.get(i)) {\n System.err.println(\"Expected the value \" + list.get(i) + \", but found \" + val);\n err++;\n }\n i++;\n }\n assertEquals(\"There were \" + err + \" errors!\", 0, err);\n }, 64, 1000);\n \n }",
"public void set_random_choice()\r\n\t{\r\n\t\tfor (int i=0 ; i<size ; i++)\r\n\t\t{\r\n\t\t\tnumbers.add(get_not_selected_random_digit());\r\n\t\t}\r\n\t}",
"@Test\n public void radioTest() throws InterruptedException {\n driver.get(\"http://practice.cybertekschool.com/radio_buttons\");\n List<WebElement> list = driver.findElements(By.name(\"sport\"));\n\n System.out.println(\"verify none of them selected by default\");\n System.out.println(list.size());\n //checking all the sport checkboxes are not checked\n for (int i = 0; i < list.size(); i++) {\n Assert.assertFalse(list.get(i).isSelected());\n }\n\n System.out.println(\"Start randomly selecting radio buttons\");\n\n //randomly clicking and verifying\n\n for (int q = 0; q < 5; q++) {\n\n Thread.sleep(5000);\n Random ran = new Random();\n int num = ran.nextInt(4);\n list.get(num).click();\n System.out.println(\"Selecting button number: \" + (num + 1));\n\n for (int i = 0; i < list.size(); i++) {\n if (i == num) {\n Assert.assertTrue(list.get(num).isSelected());\n } else {\n Assert.assertFalse(list.get(i).isSelected());\n }\n }\n\n }\n }",
"public void doTestRun(int finalState) {\n\t\tint initialState = (int) (Math.random() * this.rows);\n\t\tint nextState = -1;\n\t\t\n\t\tif(initialState == finalState) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tSystem.out.println(\"Spawning at: \" + initialState);\n\t\t\n\t\twhile(initialState != finalState) {\n\t\t\tint maxReward = -100000;\n\t\t\tnextState = initialState;\n\t\t\t\n\t\t\tfor(int j = 0; j < this.columns; j++) {\n\t\t\t\tif(this.qGrid[initialState][j] > maxReward) {\n\t\t\t\t\tmaxReward = this.qGrid[initialState][j];\n\t\t\t\t\tnextState = getStateActionMap(initialState, j);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tint tState = initialState;\n\t\t\tinitialState = nextState;\n\t\t\tnextState = tState;\n\t\t\t\n\t\t\tSystem.out.println(\"Taking next step from \" + nextState + \" to \" + initialState + \"! For reward: \" + this.grid[nextState][initialState]);\n\t\t}\n\t\t\n\n\t}",
"public void testGame1EmulateIncorrectAnswers() {\n int[] indicators;\n MainPage mainPage = getMainPage();\n GameObjectImpl game1 = mainPage.gameOpen(1);\n game1.waitIndicatorsLoad();\n indicators = game1.getIndicators();\n int qtyTasksBeforeCycle = indicators[3];\n int tasksFailedBeforeCycle = indicators[1];\n for(int iter = 0; iter < qtyTasksBeforeCycle - 1; iter++) {\n game1.waitTaskBegin();\n try {\n Thread.sleep(500);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n indicators = game1.getIndicators();\n int varTasksPassedBegin = indicators[0];\n int varTasksFailedBegin = indicators[1];\n int varTasksRemainBegin = indicators[2];\n int qtyTasksInLoopBegin = indicators[3];\n\n String[] partsOfTask = game1.getPartsOfTask();\n String firstNumberVar = partsOfTask[0];\n String secondNumberVar = partsOfTask[1];\n String operationVar = partsOfTask[2];\n int actualResult = game1.getResultWithKeys(firstNumberVar, secondNumberVar, operationVar);\n // press wrong button\n String strActualResult = Integer.toString(actualResult + 1);\n for (int i = 0; i < strActualResult.length(); i++) {\n String subStr = strActualResult.substring(i, i + 1);\n game1.pressButton((subStr));\n }\n //press correct button\n strActualResult = Integer.toString(actualResult);\n for (int i = 0; i < strActualResult.length(); i++) {\n String subStr = strActualResult.substring(i, i + 1);\n game1.pressButton((subStr));\n }\n indicators = game1.getIndicators();\n int varTasksPassedEnd = indicators[0];\n int varTasksFailedEnd = indicators[1];\n int varTasksRemainEnd = indicators[2];\n int qtyTasksInLoopEnd = indicators[3];\n\n assert varTasksRemainEnd == varTasksRemainBegin : \"positiveTestCorrectAnswers: tasks remain\";//\n assert varTasksFailedEnd == (varTasksFailedBegin + 1) : \"positiveTestCorrectAnswers: tasks failed\";\n assert varTasksPassedEnd == varTasksPassedBegin : \"positiveTestCorrectAnswers: tasks passed\";\n assert qtyTasksInLoopEnd == qtyTasksInLoopBegin + 1 : \"negativeTestWrongAnswers: tasks all\";\n }\n indicators = game1.getIndicators();\n int varTasksFailedAfterCycle = indicators[1];\n int qtyTasksAfterCycle = indicators[3];\n assert varTasksFailedAfterCycle - tasksFailedBeforeCycle == qtyTasksAfterCycle - qtyTasksBeforeCycle\n : \"positiveTestCorrectAnswers: tasks summ\" ;//\n game1.clickCloseGame();\n\n }",
"@Test\r\n public void testPlayer_setRandomStrategy_2() {\r\n player2 = new Player(\"\", true);\r\n player2.setRandomStrategy();\r\n String firstStrategy = player2.getStrategy();\r\n boolean strategyReplaced = false;\r\n // generate 20 random strategies and assert at least one of them comes back different.\r\n for(int i = 0; i < 20; i++) {\r\n player2.setRandomStrategy();\r\n if (!player2.getStrategy().equalsIgnoreCase(firstStrategy)) {\r\n strategyReplaced = true;\r\n }\r\n }\r\n assertTrue(strategyReplaced);\r\n }",
"@Test\r\n\tpublic void testChooseResultWithChange() {\r\n\t\tMontyHall monty = new MontyHall();\r\n\t\tmonty.setTheDoorWithCar(0);\r\n\t\tmonty.setChanged(true);\r\n\r\n\t\tmonty.setUserChoosedDoor(0);\r\n\t\tassertNotEquals(0, monty.getTheDoorChoosedBycompere());\r\n\t\tassertEquals(false, monty.winThePrize());\r\n\r\n\t\tmonty.setUserChoosedDoor(1);\r\n\t\tassertEquals(2, monty.getTheDoorChoosedBycompere());\r\n\t\tassertEquals(true, monty.winThePrize());\r\n\r\n\t\tmonty.setUserChoosedDoor(2);\r\n\t\tassertEquals(1, monty.getTheDoorChoosedBycompere());\r\n\t\tassertEquals(true, monty.winThePrize());\r\n\t}",
"@Test //covers loop test with one pass through the loop\n\tpublic void exampleTest() {\n\t\tGildedRose inn = new GildedRose();\n\t\tinn.setItem(new Item(\"+5 Dexterity Vest\", 10, 20));\n\t\tinn.oneDay();\n\t\t\n\t\t//access a list of items, get the quality of the one set\n\t\tList<Item> items = inn.getItems();\n\t\tint quality = items.get(0).getQuality();\n\t\t\n\t\t//assert quality has decreased by one\n\t\tassertEquals(\"Failed quality for Dexterity Vest\", 19, quality);\n\t}",
"@Test\r\n\tpublic void testChangeTheOriginalChooseIsBetterThanNotChange() {\r\n\t\tMontyHall monty = new MontyHall();\r\n\t\tmonty.setChanged(true);\r\n\t\tfloat rateOfChange = monty.rateOfWinThePrizeWithChangeTheOriginalChoose(10);\r\n\t\tmonty.setChanged(false);\r\n\t\tfloat rateOfNotChange = monty.rateOfWinThePrizeWithoutChangeTheOriginalChoose(10);\r\n\t\tassertTrue(rateOfChange > rateOfNotChange);\r\n\r\n\t\t/* count is 100 */\r\n\t\tmonty.setChanged(true);\r\n\t\trateOfChange = monty.rateOfWinThePrizeWithChangeTheOriginalChoose(100);\r\n\t\tmonty.setChanged(false);\r\n\t\trateOfNotChange = monty.rateOfWinThePrizeWithoutChangeTheOriginalChoose(100);\r\n\t\tassertTrue(rateOfChange > rateOfNotChange);\r\n\r\n\t\t/* count is 10000 */\r\n\t\tmonty.setChanged(true);\r\n\t\trateOfChange = monty.rateOfWinThePrizeWithChangeTheOriginalChoose(10000);\r\n\t\tmonty.setChanged(false);\r\n\t\trateOfNotChange = monty.rateOfWinThePrizeWithoutChangeTheOriginalChoose(10000);\r\n\t\tassertTrue(rateOfChange > rateOfNotChange);\r\n\r\n\t\t/* count is 1000000 */\r\n\t\tmonty.setChanged(true);\r\n\t\trateOfChange = monty.rateOfWinThePrizeWithChangeTheOriginalChoose(1000000);\r\n\t\tmonty.setChanged(false);\r\n\t\trateOfNotChange = monty.rateOfWinThePrizeWithoutChangeTheOriginalChoose(1000000);\r\n\t\tassertTrue(rateOfChange > rateOfNotChange);\r\n\t}",
"@Test\n public void testDiceThrown() {\n testDie(game.diceThrown(), 1, 2);\n game.nextTurn();\n testDie(game.diceThrown(), 1, 2);\n game.nextTurn();\n testDie(game.diceThrown(), 3, 4);\n game.nextTurn();\n testDie(game.diceThrown(), 3, 4);\n game.nextTurn();\n testDie(game.diceThrown(), 5, 6);\n game.nextTurn();\n testDie(game.diceThrown(), 1, 2);\n game.nextTurn();\n\n }",
"private void findResourcesFake() {\r\n\t\t\r\n\t\tRandom random = new Random();\t\r\n\t\t\r\n\t\t\t\t\t\t\r\n\t\tif (random.nextInt() % 10 == 0) {PoCOnline.setSelected(true); loadContainerOnline.setSelected(true);}\t\r\n\t\tif (random.nextInt() % 10 == 0) {fillRedOnline.setSelected(true);}\r\n\t\tif (random.nextInt() % 10 == 0) {fillYellowOnline.setSelected(true);}\r\n\t\tif (random.nextInt() % 10 == 0) {fillBlueOnline.setSelected(true);}\r\n\t\tif (random.nextInt() % 10 == 0) {testOnline.setSelected(true);}\r\n\t\tif (random.nextInt() % 10 == 0) {lidOnline.setSelected(true);}\r\n\t\tif (random.nextInt() % 10 == 0) {dispatchOnline.setSelected(true);}\t\t\r\n\t\t\r\n\t\t\r\n\t}",
"@Override\n\tpublic void randomChanged(boolean random) {\n\t\t\n\t}",
"@Test\r\n\t public void feelingLucky() {\r\n\t \t Assert.fail();\r\n\t Assert.fail();\r\n\t }",
"@Override\r\n\tpublic void doTimeStep() {\n\t\tthis.run(Critter.getRandomInt(8));\r\n\t}",
"@Test\n\t public void randomItem() throws InterruptedException\n\t {\n\t\t \n\t\t productpage = new ProductPage(driver);\n\t\t productpage.clickOnSomePrompt();\n\t\t productdetails = productpage.clickOnRandomItem();\n\t\t\tboolean status = productdetails.isProductDEtailsPageDisplayed();\n\t\t\tAssertionHelper.updateTestStatus(status);\n\t\t\tTestBaseRunner.result = TestBaseRunner.passOrFail(status);\n\t\t\tExcelReadWrtite.updateResult(\"testData.xlsx\", \"TestScripts\", \"randomItem\", result);\n\t }",
"public void testSelectIndex() {\n showFrame(box);\n for (int i=0;i < MAX_ENTRIES;i += MAX_ENTRIES / 10) {\n selectedIndex = -1;\n tester.actionSelectIndex(box, i);\n assertEquals(\"Wrong index selected\", i, selectedIndex);\n }\n }",
"private void simulateFailOrSleep() throws Exception {\n if ((failProbability != null) && (sleepProbability != null) && (sleepMilisec != null)) {\n int number = new Random().nextInt(100);\n if (number < failProbability) throw new Exception(\"Simulated Exception in Customer Service\");\n else {\n number = new Random().nextInt(100);\n if (number < sleepProbability) Thread.sleep(sleepMilisec);\n }\n }\n }",
"private void random() {\n\n\t}",
"@Test\n public void genRandom() {\n runAndWait(() -> genRandom(10_000, 500, 1), 32, 2000);\n runAndWait(() -> genRandom(10_000, 500, 100), 32, 2000);\n runAndWait(() -> genRandom(250_000, 4000, 50), 4, 5_000);\n }",
"@Test\n public void test4_multiple_value_select_dropdown() throws InterruptedException{\n\n //3. Select all the options from multiple select dropdown.\n // Locate the dropdown\n\n Select multipleSelectDropdown = new Select(driver.findElement(By.xpath(\"//select[@name='Languages']\")));\n\n //Creating a list of web elements to store all of the options inside of this dropdown\n\n List<WebElement> allOptions = multipleSelectDropdown.getOptions();\n\n //Loop through the options to select all of them\n\n for(WebElement eachOption : allOptions){\n Thread.sleep(500);\n eachOption.click(); // this will click each option with every iteration\n\n //4. Print out all selected values.\n System.out.println(\"Selected: \" + eachOption.getText());\n\n //Asserting the option is actually selected or not\n Assert.assertTrue(eachOption.isSelected(), \"The option: \"+eachOption.getText()+\" is not selected!\");\n\n }\n //5. Deselect all values.\n multipleSelectDropdown.deselectAll();\n\n for(WebElement eachOption : allOptions){\n //Assert.assertTrue(!eachOption.isSelected()); //it will be false boolean value, with ! we make it \"true\"\n\n // assertFalse method looks for \"false\" boolean value to pass the test.\n Assert.assertFalse(eachOption.isSelected());\n }\n }",
"@Test\r\n\tpublic void testChooseResultWithUnChangeCarPositionSecond() {\r\n\t\tMontyHall monty = new MontyHall();\r\n\t\tmonty.setTheDoorWithCar(1);\r\n\t\tmonty.setChanged(false);\r\n\t\tmonty.setUserChoosedDoor(0);\r\n\t\tassertEquals(2, monty.getTheDoorChoosedBycompere());\r\n\t\tassertEquals(false, monty.winThePrize());\r\n\r\n\t\tmonty.setUserChoosedDoor(1);\r\n\t\tassertNotEquals(1, monty.getTheDoorChoosedBycompere());\r\n\t\tassertEquals(true, monty.winThePrize());\r\n\r\n\t\tmonty.setUserChoosedDoor(2);\r\n\t\tassertEquals(0, monty.getTheDoorChoosedBycompere());\r\n\t\tassertEquals(false, monty.winThePrize());\r\n\t}",
"private void random() {\n GameState gs = cc.getGameState();\n ArrayList<int[]> moves = cc.getPlayerMoves(player);\n ArrayList<GameState> states = nextStates(moves, gs);\n for (int[] m : moves) {\n GameState next = checkMove(m, cc);\n states.add(next);\n }\n Random rand = new Random(System.nanoTime());\n int i = rand.nextInt(states.size());\n cc.setAIMove(states.get(i));\n }",
"@Test\n void test() {\n Game g = init(\"gen_2p_02\");\n List<Player> players = g.getData().getPlayers();\n wrappedIllegalCommand(g, players.get(0), \"tool 6\");\n wrappedLegalCommand(g, players.get(0), \"pick 1\");\n assertTrue(g.isUndoAvailable());\n wrappedLegalCommand(g, players.get(0), \"tool 6\");\n assertFalse(g.isUndoAvailable());\n lightestShade(g, players);\n notLightestShade(g, players);\n }",
"@Test\n public void radnomtest() throws Throwable {\n\n long startTime = Calendar.getInstance().getTimeInMillis();\n long elapsed = Calendar.getInstance().getTimeInMillis() - startTime;\n\n\n System.out.println(\"Start testing...\");\n\n\n for (int iteration = 0; elapsed < TestTimeout; iteration++) {\n long randomseed =10;//System.currentTimeMillis();\n //\t\t\tSystem.out.println(\" Seed:\"+randomseed );\n Random random = new Random(randomseed);\n\n int startHour=13;\n int startMinute=30;\n int startDay=10;\n int startMonth=4;\n int startYear=2017;\n String title=\"Birthday Party\";\n String description=ValuesGenerator.getString(random);\n //Construct a new Appointment object with the initial data\t \n Appt appt = new Appt(startHour,\n startMinute ,\n startDay ,\n startMonth ,\n startYear ,\n title,\n description);\n if ((iteration % 50) == 0){\n appt.setDescription(null);\n }\n for (int i = 0; i < NUM_TESTS; i++) {\n String methodName = ApptRandomTest.RandomSelectMethod(random);\n if (methodName.equals(\"isValid\")){\n int hour=(int) ValuesGenerator.getRandomIntBetween(random, 0, 23);\n appt.setStartHour(hour);\t\t\t\t\t\t \n int minute=(int) ValuesGenerator.getRandomIntBetween(random, 0, 59);\n appt.setStartMinute(minute);\t\t\t\t\t\t \n int day=(int) ValuesGenerator.getRandomIntBetween(random, 1, 31);\n appt.setStartDay(day);\t\t\t\t\t\t \n int month=(int) ValuesGenerator.getRandomIntBetween(random, 1, 12);\n appt.setStartMonth(month);\n //change to invalid hours\n hour=(int) ValuesGenerator.getRandomIntBetween(random, -10, -1);\n appt.setStartHour(hour);\n hour=(int) ValuesGenerator.getRandomIntBetween(random, 0, 23);\n appt.setStartHour(hour);\n hour=(int) ValuesGenerator.getRandomIntBetween(random, 24, 30);\n appt.setStartHour(hour);\n hour=(int) ValuesGenerator.getRandomIntBetween(random, 0, 23);\n appt.setStartHour(hour);\n //change to invalid minutes\n minute=(int) ValuesGenerator.getRandomIntBetween(random, -20, -1);\n appt.setStartMinute(minute);\n minute=(int) ValuesGenerator.getRandomIntBetween(random, 0, 59);\n appt.setStartMinute(minute);\n minute=(int) ValuesGenerator.getRandomIntBetween(random, 60, 70);\n appt.setStartMinute(minute);\n minute=(int) ValuesGenerator.getRandomIntBetween(random, 0, 59);\n appt.setStartMinute(minute);\n //change to invalid days\n day=(int) ValuesGenerator.getRandomIntBetween(random, -10, 0);\n appt.setStartDay(day);\n day=(int) ValuesGenerator.getRandomIntBetween(random, 1, 31);\n appt.setStartDay(day);\n day=(int) ValuesGenerator.getRandomIntBetween(random, 32, 40);\n appt.setStartDay(day);\n day=(int) ValuesGenerator.getRandomIntBetween(random, 1, 31);\n appt.setStartDay(day);\n //change to invalid months\n month=(int) ValuesGenerator.getRandomIntBetween(random, -10, 0);\n appt.setStartMonth(month);\t\t\t\t\t\t \n month=(int) ValuesGenerator.getRandomIntBetween(random, 1, 12);\n appt.setStartMonth(month);\n month=(int) ValuesGenerator.getRandomIntBetween(random, 12, 20);\n appt.setStartMonth(month);\n month=(int) ValuesGenerator.getRandomIntBetween(random, 1, 12);\n appt.setStartMonth(month);\n }\n\n }\n\n elapsed = (Calendar.getInstance().getTimeInMillis() - startTime);\n if((iteration%10000)==0 && iteration!=0 )\n System.out.println(\"elapsed time: \"+ elapsed + \" of \"+TestTimeout);\n\n }\n\n\n System.out.println(\"Done testing...\");\n }",
"@Test\n public void testResetGame(){\n scoresModel.resetGame();\n try {\n scoresModel.resetGame();\n for(int i = 0; i < ScoresModel.maxNumOfAttempts; i++) {\n assertEquals(scoresModel.attemptsScore[i], 0);\n }\n for(int i = 0; i < ScoresModel.maxNumOfFrames; i++){\n assertEquals(scoresModel.frameTypes[i], FrameType.NOT_PLAYED);\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n }",
"@Test\r\n\tpublic void testRunAllSucceedSecond() throws Exception {\n\t\tRandom randomGen = Mockito.mock(Random.class);\r\n\t\twhen(randomGen.nextInt(2)).thenReturn(0);\r\n\t\tReflectionTestUtils.setField(semaphoreGatedRunner, \"randomGen\", randomGen);\r\n\t\tsemaphoreGatedRunner.setMaxNumberRunners(2);\r\n\r\n\t\twhen(mockSemaphoreDao.attemptToAcquireLock(semaphoreKey + \"-1\", timeoutMS)).thenReturn(null);\r\n\t\tString token = \"someToken\";\r\n\t\twhen(mockSemaphoreDao.attemptToAcquireLock(semaphoreKey + \"-0\", timeoutMS)).thenReturn(token);\r\n\t\t// run\r\n\t\tCallable<Void> call = Mockito.mock(Callable.class);\r\n\t\tsemaphoreGatedRunner.attemptToRunAllSlots(call, null);\r\n\t\tverify(call).call();\r\n\t\tverify(mockSemaphoreDao).attemptToAcquireLock(semaphoreKey + \"-1\", timeoutMS);\r\n\t\tverify(mockSemaphoreDao).attemptToAcquireLock(semaphoreKey + \"-0\", timeoutMS);\r\n\t\tverify(mockSemaphoreDao).releaseLock(semaphoreKey + \"-0\", token);\r\n\t\tverify(mockSemaphoreDao, never()).releaseLock(eq(semaphoreKey + \"-1\"), anyString());\r\n\t\tverifyNoMoreInteractions(mockSemaphoreDao);\r\n\t}",
"@Test\n\tpublic void testUpdatesSeeds() {\n\t\t//Arrange\n\t\tint startLoc[] = new int[]{2};\n\t\tint otherLocs[] = new int[]{0,1,3,4};\n\t\t\t\n\t\tMockito.when(randMock.generateRandomNumber(1, 4, seed)).thenReturn(startLoc);\n\t\tMockito.when(randMock.generateRandomNumber(10, 5, seed+1)).thenReturn(otherLocs);\n\t\t\t\n\t\t//Act\n\t\tlong seed = 2;\n\t\t\t\n\t\t//Assert\n\t\tassertEquals(seed, iteratorObj.startVisits());\n\t}",
"@Test\n public void test(){\n tmp = new Die(\"Red\",5);\n choose.modifyDie(tmp);\n assertEquals(4,tmp.getDieNumber());\n choose = new ChooseDieModifier(new DieEnhancer());\n choose.modifyDie(tmp);\n assertEquals(5,tmp.getDieNumber());\n choose = new ChooseDieModifier(new TurnTheDieOpposite());\n choose.modifyDie(tmp);\n assertEquals(2,tmp.getDieNumber());\n choose = new ChooseDieModifier(new RollDie());\n Die tmp2 = new Die(tmp.getDieColor(),tmp.getDieNumber());\n int i;\n int max=1000000;\n boolean testPassed=false;\n for(i=0;i<max;i++){\n choose.modifyDie(tmp);\n if(tmp.getDieNumber()!=tmp2.getDieNumber()){\n testPassed=true;\n i = max;\n }\n }\n assertTrue(testPassed);\n }",
"@Test\r\n public void test3() throws Exception {\r\n int[] random = getRandomlyFromArray(new int[] {1, 2, 3, 4, 5, 6, 7, 8}, 3);\r\n String prepend = \"\";\r\n for (int i : random) {\r\n System.out.print(prepend + i);\r\n prepend = \", \";\r\n }\r\n System.out.println();\r\n \r\n try {\r\n getRandomlyFromArray(new int[] {1}, 2);\r\n Assert.fail(\"Should have thrown an exception\");\r\n } catch (Exception e) {\r\n // expected\r\n }\r\n }",
"private void getRandomNumber() {\n\t\tRandom generator = new Random();\n\t\trandomNumber = generator.nextInt(POSSIBLE_CHOICE.length);\n\t}",
"@Test\n public void test100True() {\n long start = System.currentTimeMillis();\n for (int i = 0; i < 100; i++) {\n RandomGUID myGUID = new RandomGUID(true);\n System.out.println(\"Seeding String=\" + myGUID.valueBeforeMD5);\n System.out.println(\"rawGUID=\" + myGUID.valueAfterMD5);\n System.out.println(\"RandomGUID=\" + myGUID.toString());\n }\n System.out.println(Ansi.ansi().eraseScreen().render(String.format(\"100 条@|blue 耗时 |@@|yellow %s |@@|blue 毫秒|@\", System.currentTimeMillis() - start)));\n }",
"@Test\n public void selectReplacesSelectionOnlyOnce() throws Exception {\n ArgumentCaptor<Set> itemsCaptor = ArgumentCaptor.forClass(Set.class);\n\n // WHEN\n listView.select(Lists.newArrayList(A));\n verify(listener, only()).onItemSelection(itemsCaptor.capture());\n\n // THEN\n Set<?> items = itemsCaptor.getValue();\n assertThat(items, allOf(hasSize(1), contains(A)));\n }",
"@Test\n public void testFitnessProportionateSelection()\n {\n }",
"public void setSelection(int index) {\n/* 95 */ throw new RuntimeException(\"Stub!\");\n/* */ }",
"@Test(timeout = 500)\n\tpublic void testGetModuloOne() {\n\t\tAssert.fail();\n\t}",
"@Test\n\tpublic void testEvilPuzzleGeneration() {\n\t}",
"void testRandColor(Tester t) {\r\n initData();\r\n t.checkExpect(this.game2.randColor(), Color.ORANGE);\r\n t.checkExpect(this.game3.randColor(), Color.RED);\r\n t.checkExpect(this.game5.randColor(), Color.PINK);\r\n }",
"@Test\n public void f14SelectAssetTest() {\n FlowPane assets;\n int i = 0;\n Random random = new Random();\n\n //select 4 random assets out of the first 12 visible assets in the window\n do {\n clickOn(\"#thumbnailTab\").moveBy(300, 500);\n scroll(10, VerticalDirection.UP).sleep(2000);\n\n assets = (FlowPane) scene.getRoot().lookup(\"#assetsThumbPane\");\n clickOn(assets.getChildren().get(random.nextInt(12)));\n sleep(1000).clickOn(\"#serialNumberOutput\").sleep(1000);\n clickOn(\"#backBtn\");\n\n } while (++i < 4);\n\n assertTrue(\"There are selectable assets on the main page.\", assets.getChildren().size() > 0);\n }",
"@Test\r\n\tpublic void test() {\r\n\t\tfor(int i=0;i<100;i++) {\r\n\t\t\tinsert();\r\n\t\t}\r\n\t\tselectAll();\r\n\t}",
"@Test(timeout = 4000)\n public void test43() throws Throwable {\n DynamicSelectModel dynamicSelectModel0 = new DynamicSelectModel();\n dynamicSelectModel0.reset();\n }",
"public static void testRun(int a) throws Exception {\r\n\t\tRandomProperties.randomAll();\r\n\t\tThread.sleep(1000);\r\n\t\tSystem.out.println(\"the guys-\" + a + \" name is :\" + RandomProperties.getName());\r\n\t\tThread.sleep(300);\r\n\t\tSystem.out.println(\"the guys-\" + a + \" age is :\" + RandomProperties.getAge());\r\n\t\tThread.sleep(300);\r\n\t\tSystem.out.println(\"the guys-\" + a + \" ID is :\" + RandomProperties.getID());\r\n\t\tThread.sleep(300);\r\n\t\tSystem.out.println(\"the guys-\" + a + \" sex is :\" + RandomProperties.getGender());\r\n\t\tThread.sleep(1000);\r\n\t}",
"public void testSelect_4()\n throws Exception {\n BestChromosomesSelector selector = new BestChromosomesSelector(conf);\n selector.setDoubletteChromosomesAllowed(true);\n // the following original rate controls that only 30% of the chromosomes\n // will be considered for selection as given with BestChromosomesSelector.\n // The last 70% will be added as doublettes in this case.\n selector.setOriginalRate(0.3d);\n // add first chromosome\n // --------------------\n Gene gene = new BooleanGene(conf);\n gene.setAllele(Boolean.valueOf(true));\n Chromosome thirdBestChrom = new Chromosome(conf, gene, 7);\n thirdBestChrom.setFitnessValue(10);\n selector.add(thirdBestChrom);\n // add second chromosome\n // ---------------------\n gene = new BooleanGene(conf);\n gene.setAllele(Boolean.valueOf(false));\n Chromosome bestChrom = new Chromosome(conf, gene, 3);\n bestChrom.setFitnessValue(12);\n selector.add(bestChrom);\n // add third chromosome\n // ---------------------\n gene = new IntegerGene(conf);\n gene.setAllele(new Integer(444));\n Chromosome secondBestChrom = new Chromosome(conf, gene, 3);\n secondBestChrom.setFitnessValue(11);\n selector.add(secondBestChrom);\n // receive top 1 (= best) chromosome\n // ---------------------------------\n Population pop = new Population(conf);\n selector.select(1, null, pop);\n IChromosome[] bestChroms = pop.toChromosomes();\n assertEquals(1, bestChroms.length);\n assertEquals(bestChrom, bestChroms[0]);\n // receive top 4 chromosomes with original rate = 0.3\n // --------------------------------------------------\n pop.getChromosomes().clear();\n selector.select(4, null, pop);\n bestChroms = pop.toChromosomes();\n assertEquals(4, bestChroms.length);\n assertEquals(bestChrom, bestChroms[0]);\n assertEquals(bestChrom, bestChroms[1]); //because of originalRate = 0.3\n assertEquals(secondBestChrom, bestChroms[2]);\n assertEquals(thirdBestChrom, bestChroms[3]);\n // Non-unique chromosomes should have been returned, although not the same\n // but a cloned instance!\n assertEquals(bestChroms[0], bestChroms[1]);\n // receive top 4 chromosomes with original rate = 1\n // ------------------------------------------------\n pop.getChromosomes().clear();\n selector.setOriginalRate(1.0d);\n selector.select(4, null, pop);\n bestChroms = pop.toChromosomes();\n assertEquals(4, bestChroms.length);\n assertEquals(bestChrom, bestChroms[0]);\n assertEquals(secondBestChrom, bestChroms[1]);\n assertEquals(thirdBestChrom, bestChroms[2]);\n assertEquals(bestChrom, bestChroms[3]);\n }",
"@Test\n public void pickUpSomeGoldTest() {\n\tassertNotEquals(0,score);\n }",
"@Test\r\n\tpublic void testChooseResultWithChangeCarPositionSecond() {\r\n\t\tMontyHall monty = new MontyHall();\r\n\t\tmonty.setTheDoorWithCar(1);\r\n\t\tmonty.setChanged(true);\r\n\t\tmonty.setUserChoosedDoor(0);\r\n\t\tassertEquals(2, monty.getTheDoorChoosedBycompere());\r\n\t\tassertEquals(true, monty.winThePrize());\r\n\r\n\t\tmonty.setUserChoosedDoor(1);\r\n\t\tassertNotEquals(1, monty.getTheDoorChoosedBycompere());\r\n\t\tassertEquals(false, monty.winThePrize());\r\n\r\n\t\tmonty.setUserChoosedDoor(2);\r\n\t\tassertEquals(0, monty.getTheDoorChoosedBycompere());\r\n\t\tassertEquals(true, monty.winThePrize());\r\n\t}",
"@Test\r\n\tpublic void testChooseResultWithUnChangeCarPositionThird() {\r\n\t\tMontyHall monty = new MontyHall();\r\n\t\tmonty.setTheDoorWithCar(2);\r\n\t\tmonty.setChanged(false);\r\n\t\tmonty.setUserChoosedDoor(0);\r\n\t\tassertEquals(1, monty.getTheDoorChoosedBycompere());\r\n\t\tassertEquals(false, monty.winThePrize());\r\n\r\n\t\tmonty.setUserChoosedDoor(1);\r\n\t\tassertEquals(0, monty.getTheDoorChoosedBycompere());\r\n\t\tassertEquals(false, monty.winThePrize());\r\n\r\n\t\tmonty.setUserChoosedDoor(2);\r\n\t\tassertNotEquals(2, monty.getTheDoorChoosedBycompere());\r\n\t\tassertEquals(true, monty.winThePrize());\r\n\t}",
"private void randomTest(){\n\n int time = 5 ;\n\n test(time) ;\n }",
"@Test\n\tpublic void argumentTest() {\n\t\tSelectionController selectionController = new SelectionController();\n\t\ttry {\n\t\t\tselectionController.select(null);\n\t\t\tAssert.fail(\"The new selection was null\");\n\t\t} catch (NullPointerException e) {\n\t\t}\n\n\t\ttry {\n\t\t\tselectionController.unselect(null);\n\t\t\tAssert.fail(\"The new unselection was null\");\n\t\t} catch (NullPointerException e) {\n\t\t}\n\n\t\ttry {\n\t\t\tselectionController.reselect(null);\n\t\t\tAssert.fail(\"The new reselection was null\");\n\t\t} catch (NullPointerException e) {\n\t\t}\n\t}",
"@Test(expected = IllegalArgumentException.class)\n public void testChangeColorTwiceSameTime() {\n model1.addShape(Rectangle.createRectangle(\"R\", new Point.Double(500, 200),\n new Color(0, 0, 0), 0, 10, 10, 10));\n model1.addAction(new ChangeColorAction(\"R\", 10, 100,\n new Color(0, 0, 0), new Color(10, 10, 10)));\n model1.addAction(new ChangeColorAction(\"R\", 50, 120,\n new Color(0, 0, 0), new Color(10, 10, 10)));\n }",
"@Test\n public void test20False() {\n long start = System.currentTimeMillis();\n for (int i = 1; i <= 20; i++) {\n RandomGUID myguid = new RandomGUID(false);\n System.out.println(i + \" \" + myguid.toString());\n }\n System.out.println(Ansi.ansi().eraseScreen().render(String.format(\"20 条@|blue 耗时 |@@|yellow %s |@@|blue 毫秒|@\", System.currentTimeMillis() - start)));\n }",
"@Test //loop test 0 passes\n\tpublic void testLoop0pass() {\n\t\tGildedRose inn = new GildedRose();\n\t\tinn.oneDay();\n\t\t\n\t\t//access a list of items, get the quality\n\t\tList<Item> items = inn.getItems();\n\t\tint quality = -100;\n\t\tif(! items.isEmpty()) { //check if items is empty, if not get the first item's quality\n\t\t\titems.get(0).getQuality();\n\t\t}\n\t\t//assert quality is -100\n\t\tassertEquals(\"Quality -100 with 0 loop passes\", -100, quality);\n\t}",
"@Test(expected = LockUnavilableException.class)\r\n\tpublic void testRunAllFail() throws Exception {\n\t\tRandom randomGen = Mockito.mock(Random.class);\r\n\t\twhen(randomGen.nextInt(2)).thenReturn(0);\r\n\t\tReflectionTestUtils.setField(semaphoreGatedRunner, \"randomGen\", randomGen);\r\n\t\tsemaphoreGatedRunner.setMaxNumberRunners(2);\r\n\r\n\t\twhen(mockSemaphoreDao.attemptToAcquireLock(semaphoreKey + \"-1\", timeoutMS)).thenReturn(null);\r\n\t\twhen(mockSemaphoreDao.attemptToAcquireLock(semaphoreKey + \"-0\", timeoutMS)).thenReturn(null);\r\n\t\t// run\r\n\t\tCallable<Void> call = Mockito.mock(Callable.class);\r\n\t\ttry {\r\n\t\t\tsemaphoreGatedRunner.attemptToRunAllSlots(call, null);\r\n\t\t} finally {\r\n\t\t\tverify(call, never()).call();\r\n\t\t\tverify(mockSemaphoreDao).attemptToAcquireLock(semaphoreKey + \"-1\", timeoutMS);\r\n\t\t\tverify(mockSemaphoreDao).attemptToAcquireLock(semaphoreKey + \"-0\", timeoutMS);\r\n\t\t\tverify(mockSemaphoreDao, never()).releaseLock(anyString(), anyString());\r\n\t\t\tverifyNoMoreInteractions(mockSemaphoreDao);\r\n\t\t}\r\n\t}",
"@Test(timeout = 4000)\n public void test30() throws Throwable {\n DynamicSelectModel dynamicSelectModel0 = new DynamicSelectModel();\n DynamicSelectModel dynamicSelectModel1 = dynamicSelectModel0.enumeration(\"WSi5n[Vxv}\");\n dynamicSelectModel0.validate();\n assertSame(dynamicSelectModel0, dynamicSelectModel1);\n }",
"@Test\n public void randomTransitionsIncludesAllEligibleTransitionsInRoughProportion() throws PetriNetComponentException {\n \tPetriNet petriNet = APetriNet.with(AToken.called(\"Default\").withColor(Color.BLACK)).and(\n \t\t\tAPlace.withId(\"P1\").containing(1, \"Default\").token()).\n \t\t\tand(APlace.withId(\"P2\")).and(APlace.withId(\"P3\")).\n \t\t\tand(AnImmediateTransition.withId(\"T1\")).and(AnImmediateTransition.withId(\"T2\")).and(\n \t\t\tANormalArc.withSource(\"P1\").andTarget(\"T1\").with(\"1\", \"Default\").token()).and(\n \t\t\tANormalArc.withSource(\"T1\").andTarget(\"P2\").with(\"1\", \"Default\").token()).and(\n \t\t\tANormalArc.withSource(\"P1\").andTarget(\"T2\").with(\"1\", \"Default\").token()).andFinally(\n \t\t\tANormalArc.withSource(\"T2\").andTarget(\"P3\").with(\"1\", \"Default\").token());\n \t\n \tAnimator animator = new PetriNetAnimator(petriNet);\n \tTransition t = null; \n \tint t1 = 0; \n \tint t2 = 0; \n \tfor (int i = 0; i < 10; i++) {\n \t\tt = animator.getRandomEnabledTransition();\n \t\tif (t.getId().equalsIgnoreCase(\"T1\")) t1++;\n \t\telse t2++;\n\t\t}\n \tassertTrue(t1 > 0); \n \tassertTrue(t2 > 0); \n }",
"public void generateComputerChoice() {\n\t\tgetRandomNumber();\n\t\tsetComputerChoice();\n\t}",
"@Test\r\n\tpublic void testRunAllSucceedFirst() throws Exception {\n\t\tRandom randomGen = Mockito.mock(Random.class);\r\n\t\twhen(randomGen.nextInt(2)).thenReturn(0);\r\n\t\tReflectionTestUtils.setField(semaphoreGatedRunner, \"randomGen\", randomGen);\r\n\t\tsemaphoreGatedRunner.setMaxNumberRunners(2);\r\n\r\n\t\tString token = \"someToken\";\r\n\t\twhen(mockSemaphoreDao.attemptToAcquireLock(semaphoreKey + \"-1\", timeoutMS)).thenReturn(token);\r\n\t\t// run\r\n\t\tCallable<Void> call = Mockito.mock(Callable.class);\r\n\t\tsemaphoreGatedRunner.attemptToRunAllSlots(call, null);\r\n\t\tverify(call).call();\r\n\t\tverify(mockSemaphoreDao).attemptToAcquireLock(semaphoreKey + \"-1\", timeoutMS);\r\n\t\tverify(mockSemaphoreDao).releaseLock(semaphoreKey + \"-1\", token);\r\n\t\tverifyNoMoreInteractions(mockSemaphoreDao);\r\n\t}",
"@Test\n public void testShuffle() {\n System.out.println(\"shuffle\");\n // can't really test something random\n }",
"@Test\n public void TEST_FR_SELECTDIFFICULTY_UI() {\n GameData.gameDifficulty = \"unchanged\";\n ChooseDifficultyUI testUI = new ChooseDifficultyUI();\n clickButton(testUI, 1, \"easy\");\n clickButton(testUI, 2, \"medium\");\n clickButton(testUI, 3, \"hard\");\n }",
"@Test\n public void f10ModelPerformanceTest() {\n clickOn(\"#assetTypeMenuBtn\").sleep(1000);\n\n //select first asset type\n Node node = lookup(\"#columnName\").nth(1).query();\n clickOn(node).sleep(1000);\n\n //go to model tab\n clickOn(scene.getRoot().lookup(\"#modelTab\")).sleep(1000);\n\n //Modify sliders\n Slider trainSlider = (Slider) scene.getRoot().lookup(\"#trainSlider\");\n clickOn(trainSlider);\n type(KeyCode.TAB).type(KeyCode.RIGHT);\n type(KeyCode.TAB).type(KeyCode.RIGHT);\n moveBy(0, 10).clickOn().sleep(500).moveBy(0, 100).scroll(80, VerticalDirection.UP);\n\n FlowPane models = (FlowPane) scene.getRoot().lookup(\"#modelsThumbPane\");\n Pane additiveRegModel = (Pane) models.getChildren().get(5);\n Button evalButton = (Button) additiveRegModel.getChildren().get(additiveRegModel.getChildren().size() - 1);\n\n Text rmse = (Text) additiveRegModel.getChildren().get(additiveRegModel.getChildren().size() - 2);\n clickOn(rmse).sleep(3000);\n String oldRmseVal = rmse.getText();\n int i = 0;\n\n clickOn(evalButton);\n //incrementally check for 30 seconds to see if rmse has been updated\n do {\n if (rmse.getText().equals(oldRmseVal)) {\n sleep(2000);\n } else {\n break;\n }\n } while (++i < 15);\n\n clickOn(rmse).sleep(3000);\n\n assertNotNull(\"Evaluate button exists\", evalButton);\n assertNotNull(\"RMSE exists\", rmse);\n assertFalse(\"Assert current RMSE is different than old RMSE\", rmse.getText().equals(oldRmseVal));\n }",
"public void setSelection(int start, int stop) {\n/* 89 */ throw new RuntimeException(\"Stub!\");\n/* */ }",
"@Test\n public void test20True() {\n long start = System.currentTimeMillis();\n for (int i = 1; i <= 20; i++) {\n RandomGUID myguid = new RandomGUID(true);\n System.out.println(i + \" \" + myguid.toString());\n }\n System.out.println(Ansi.ansi().eraseScreen().render(String.format(\"20 条@|blue 耗时 |@@|yellow %s |@@|blue 毫秒|@\", System.currentTimeMillis() - start)));\n }",
"@Test\r\n public void startNextOptionTest()\r\n {\r\n presenter.onClickNext();\r\n\r\n Assert.assertEquals(stub.getNextCounter(), 1);\r\n }",
"@Test\n public void test2_verify_state_dropdown() throws InterruptedException{\n // we need to locate the dropdown\n\n Select stateDropdown = new Select(driver.findElement(By.xpath(\"//select[@id='state']\")));\n //3. Select Illinois --> selecting by visible text\n Thread.sleep(1000);\n stateDropdown.selectByVisibleText(\"Illinois\");\n\n //4. Select Virginia --> selecting by value\n Thread.sleep(1000);\n stateDropdown.selectByValue(\"VA\");\n\n //5. Select California --> select by index\n Thread.sleep(1000);\n stateDropdown.selectByIndex(5);\n //6. Verify final selected option is California.\n String expectedResult = \"California\";\n String actualResult = stateDropdown.getFirstSelectedOption().getText();\n\n Assert.assertEquals(actualResult, expectedResult, \"Actual vs expected is not equal!\");\n //Use all Select options. (visible text, value, index)\n }",
"@Test\n public void invalidTableEgress() throws InterruptedException {\n for (int i = 100; i < 110; ++i) {\n this.sfcOfRendererDataListener.onDataTreeChanged(createSfcOfRendererConfig(100, i));\n Thread.sleep(SLEEP); // otherwise the failure is not detected\n verifySettersNotCalled();\n }\n }",
"public SNGTestCases Options_TC1017() throws InterruptedException{\n \tString flavour = \"Electrical\";\n \t\n \tforDebugger();\n \twaitForElement(By.id(\"com.pointedsquares.gamy5.android:id/header_name\"),120);\n \ttry{\n \t\twaitForElement(By.xpath(\"//android.widget.TextView[contains(@text , 'Academics') and contains(@resource-id , 'itemTitle')]\") , 5);\n \t}catch(Exception ex){\n \t\tdriver.scrollTo(\"Academics\");\n \t}\n \tdriver.findElement(By.xpath(\"//android.widget.TextView[contains(@text , 'Academics') and contains(@resource-id , 'itemTitle')]/following-sibling::android.widget.TextView[contains(@text , 'More')]\")).click();\n \twaitForElement(By.id(\"com.pointedsquares.gamy5.android:id/search_all\"), 10);\n \tdriver.findElement(By.id(\"com.pointedsquares.gamy5.android:id/search_all\")).click();\n \tdriver.findElement(By.id(\"com.pointedsquares.gamy5.android:id/search_all\")).sendKeys(flavour);\n \tdriver.findElement(By.xpath(\"//android.widget.TextView[contains(@resource-id , 'flavour_name_list') and contains(@text , 'Electrical Engineering')]\")).click();\n \twaitForElement(By.xpath(\"//android.widget.TextView[contains(@resource-id , 'stake_amount') and contains(@text , '500')]\"),5);\n \tdriver.findElement(By.xpath(\"//android.widget.TextView[contains(@resource-id , 'stake_amount') and contains(@text , '500')]\")).click();\n \twaitForElement(By.xpath(\"//android.widget.TextView[contains(@resource-id , 'message_text') and contains(@text , 'You are about to play Electrical Engineering game with 500 coins stake.')]\"), 5);\n \tdriver.findElement(By.xpath(\"//android.widget.TextView[contains(@resource-id , 'message_text') and contains(@text , 'You are about to play Electrical Engineering game with 500 coins stake.')]\")).click();\n \tdriver.findElement(By.id(\"com.pointedsquares.gamy5.android:id/positive_button\")).click();\n \twaitForVisibilityOf(By.xpath(\"//android.widget.TextView[contains(@resource-id , 'response') and contains(@text , 'Finding room for you...')]\"));\n \tThread.sleep(5000);\n \ttry{\n \t\twaitForElement(By.xpath(\"//android.widget.TextView[contains(@resource-id , 'response') and contains(@text , 'Still Waiting.....')]\") , 2);\n \t}catch(Exception ex){\n \t\t\n \t}\n \twaitForVisibilityOf(By.id(\"com.pointedsquares.gamy5.android:id/choice_linear\"));\n \tList<WebElement> choices = driver.findElements(By.xpath(\"//android.widget.LinearLayout[contains(@resource-id , 'choice_linear')]/*\"));\n \t\n \tboolean noOfChoice = true;\n \tif(choices.size()!=4){\n \t\t\n \t\tnoOfChoice = false;\n \t}\n \tassertTrue(noOfChoice , \"Choice not equal to 4\");\n \t\n \tThread.sleep(7000);\n \treturn new SNGTestCases(driver);\n }",
"@Test\n public void testResetAndCanRetry() {\n assertTrue(rc.attempt());\n assertTrue(rc.attempt());\n assertTrue(rc.attempt());\n rc.reset();\n\n assertTrue(rc.attempt());\n assertTrue(rc.attempt());\n assertTrue(rc.attempt());\n assertFalse(rc.attempt());\n assertFalse(rc.attempt());\n assertFalse(rc.attempt());\n }",
"@Test(expected = ChangeException.class)\n public void testGiveChangeException()throws ChangeException{\n instance.scanItem(0.55);\n instance.scanItem(1.27);\n instance.giveChange();\n }",
"public void doSomeRandomization() {\n\t\tlbOp.setSelectedKey(\"+\");\n\t\tRandom random = new Random(System.currentTimeMillis());\n\t\tinpValue1.setNumber((double)random.nextInt(1000));\n\t\tinpValue2.setNumber((double)random.nextInt(1000));\n\t\tcalculate();\n\t}",
"@Test\n public void testRecursionsFailure() throws Exception {\n assertTrue(doRecursions(false));\n }",
"@Test\n public void shouldDropUnselectedLabelIndexes() throws Exception\n {\n // GIVEN\n LabelIndex[] types = LabelIndex.values();\n Set<Node> expectedNodes = new HashSet<>();\n for ( int i = 0; i < 5; i++ )\n {\n // WHEN\n GraphDatabaseService db = db( random.among( types ) );\n Node node = createNode( db );\n expectedNodes.add( node );\n\n // THEN\n assertNodes( db, expectedNodes );\n db.shutdown();\n }\n }",
"@Test\n public void RunwayAddRemoveTest(){\n for(Airport a : controller.get_airports()){\n controller.remove_Airport(a);\n Logger.Log(\"Removing Runway \" + a.toString());\n }\n\n Airport testAirport = new Airport(\"Test Airport\", \"TST\");\n controller.add_airport(testAirport);\n\n RunwayParameters testRP = new RunwayParameters(3901, 3901, 3500, 3000);\n\n\n Random random = new Random();\n int bound = 10;\n Logger.Log(\"Using upper bound for runway add + remove test [\" + bound + \"].\");\n\n ArrayList<Runway> runways = new ArrayList<>();\n for(int x = 0; x < bound; x++){\n String d1 = x + \"L\";\n String d2 = x + \"R\";\n\n Logger.Log(\"Adding virtual runway\");\n VirtualRunway vr1 = new VirtualRunway(d1, testRP);\n VirtualRunway vr2 = new VirtualRunway(d2, testRP);\n Runway runway = new Runway(vr1, vr2);\n runways.add(runway);\n Logger.Log(\"Adding \" + runway.toString());\n controller.add_Runway(runway, testAirport.getAirport_id());\n }\n\n ArrayList<Runway> recoveredRunways = new ArrayList<Runway>(Arrays.asList(controller.get_runways()));\n\n outer:\n for(int x = 0; x < bound; x++){\n for(Runway db_copy : recoveredRunways) {\n if(db_copy.toString().equals(runways.get(x).toString())){\n continue outer;\n }\n }\n fail(\"Failed to find Runway \" + runways.get(x) + \"in database!\");\n }\n\n\n Logger.Log(\"Test Passed! \" + bound + \" Runways added to database and removed again.\");\n controller = null;\n }",
"@Test\r\n\tpublic void testChooseResultWithUnChangeCarPositionFrist() {\r\n\t\tMontyHall monty = new MontyHall();\r\n\t\tmonty.setChanged(false);\r\n\t\tmonty.setTheDoorWithCar(0);\r\n\t\tmonty.setUserChoosedDoor(0);\r\n\t\tassertNotEquals(0, monty.getTheDoorChoosedBycompere());\r\n\t\tassertEquals(true, monty.winThePrize());\r\n\r\n\t\tmonty.setUserChoosedDoor(1);\r\n\t\tassertEquals(2, monty.getTheDoorChoosedBycompere());\r\n\t\tassertEquals(false, monty.winThePrize());\r\n\r\n\t\tmonty.setUserChoosedDoor(2);\r\n\t\tassertEquals(1, monty.getTheDoorChoosedBycompere());\r\n\t\tassertEquals(false, monty.winThePrize());\r\n\t}",
"@Test\n public void testCardSelectionIsValid_TRUE() throws Exception {\n System.out.println(\"cardSelectionIsValid not valid\");\n UnoCard cardSelection = new UnoCard(UnoCardColour.BLUE, UnoCardValue.TWO);\n UnoCard drawCard = new UnoCard(UnoCardColour.BLUE, UnoCardValue.ONE);\n UnoCardColour wildColour = UnoCardColour.BLUE;\n utils.cardSelectionIsValid(cardSelection, drawCard, wildColour);\n }",
"@Test\n public void setShuffleButtonState() {\n expandPanel();\n\n onView(withId(R.id.shuffle)).perform(click()); //Set state to shuffled\n\n onView(withId(R.id.shuffle)).check(matches(withHighlightState(true)));\n }",
"private void randomizePuzzle() {\n\t\t// Choose random puzzles, shuffle the options.\n\t\tthis.puzzle = BarrowsPuzzleData.PUZZLES[(int) (Math.random() * BarrowsPuzzleData.PUZZLES.length)];\n\t\tthis.shuffledOptions = shuffleIntArray(puzzle.getOptions());\n\t}",
"@Override\n\tpublic double compete() {\n\t\tdouble result=MyTools.getRandomNum(10, 20); \t\n\t\tsetThisResult(result);\n\t\treturn result;\n\t}",
"@Test\n public void RandomBallLocationStopped() {\n final boolean seenAll[] = new boolean[1];\n seenAll[0] = false;\n\n WheelObserver wheelObserver = new WheelObserver() {\n Set<Integer> seen = new HashSet<Integer>();\n public void stopped(final int location) {\n if (location < 0 || location > 36)\n throw new IllegalArgumentException();\n seen.add(location);\n if (seen.size() == 37) seenAll[0] = true;\n }\n };\n RouletteWheel wheel = new RouletteWheel(wheelObserver);\n\n for (int x = 0; x < 1000; x++)\n {\n wheel.spin(0);\n wheel.tick(20000);\n }\n\n assertTrue(seenAll[0]);\n }",
"private static void pickAllThings(Robot r)\n {\n while(r.canPickThing())\n {\n r.pickThing();\n }\n }",
"@Test\n public void badChoicePunisher() {\n Edge[] edgelist = {new Edge(new int[] {1, 7}), new Edge(new int[] {1, 8}),\n new Edge(new int[] {7, 3}), new Edge(new int[] {3, 2}), new Edge(new int[] {2, 4}),\n new Edge(new int[] {2, 5})};\n timeMethod(edgelist, 8, 2);\n\n\n Edge[] edgelist1 = {new Edge(new int[] {1, 6}), new Edge(new int[] {1, 7}),\n new Edge(new int[] {6, 3}), new Edge(new int[] {3, 2}), new Edge(new int[] {2, 4}),\n new Edge(new int[] {2, 5})};\n timeMethod(edgelist1, 7, 1);\n\n Edge[] edgelist2 = {new Edge(new int[] {1, 6}), new Edge(new int[] {1, 7}),\n new Edge(new int[] {6, 3}), new Edge(new int[] {3, 2}), new Edge(new int[] {2, 4}),\n new Edge(new int[] {2, 5}), new Edge(new int[] {2, 8})};\n timeMethod(edgelist2, 8, 2);\n\n Edge[] edgelist3 = {new Edge(new int[] {1, 6}), new Edge(new int[] {1, 7}),\n new Edge(new int[] {6, 3}), new Edge(new int[] {3, 2}), new Edge(new int[] {2, 4}),\n new Edge(new int[] {2, 5})};\n timeMethod(edgelist3, 7, 1);\n }",
"@Test\r\n\tpublic void executeReinforcement() {\r\n\r\n\t\tInteger reinforcementArmy = playerOne.getStrategyType().calculateReinforcementArmy();\r\n\r\n\t\tHashSet<String> countriesOwned = playerOne.getStrategyType().gameData.gameMap\r\n\t\t\t\t.getConqueredCountries(playerOne.getStrategyType().getPlayerID());\r\n\r\n\t\tArrayList<String> countriesOwnedList = new ArrayList<>(countriesOwned);\r\n\r\n\t\tHashMap<String, Integer> expectedArmyCountPerCountryAfterReinforcement = new HashMap<>();\r\n\r\n\t\tfor (String country : countriesOwnedList) {\r\n\t\t\texpectedArmyCountPerCountryAfterReinforcement.put(country,\r\n\t\t\t\t\tplayerOne.getStrategyType().gameData.gameMap.getCountry(country).getCountryArmyCount());\r\n\t\t}\r\n\r\n\t\twhile (reinforcementArmy > 0) {\r\n\r\n\t\t\tInteger randomReinforcementCount = 0;\r\n\t\t\tInteger randomCountryIndex = random.nextInt(countriesOwnedList.size());\r\n\r\n\t\t\tString randomCountry = countriesOwnedList.get(randomCountryIndex);\r\n\r\n\t\t\twhile (randomReinforcementCount == 0) {\r\n\t\t\t\trandomReinforcementCount = random.nextInt(reinforcementArmy + 1);\r\n\t\t\t}\r\n\r\n\t\t\tInteger randomCountryArmyCountBeforeFortification = expectedArmyCountPerCountryAfterReinforcement\r\n\t\t\t\t\t.get(randomCountry);\r\n\r\n\t\t\tInteger randomCountryArmyCountAfterFortification = randomCountryArmyCountBeforeFortification\r\n\t\t\t\t\t+ randomReinforcementCount;\r\n\r\n\t\t\texpectedArmyCountPerCountryAfterReinforcement.put(randomCountry, randomCountryArmyCountAfterFortification);\r\n\r\n\t\t\treinforcementArmy -= randomReinforcementCount;\r\n\r\n\t\t}\r\n\r\n\t\tplayerOne.getStrategyType().executeReinforcement();\r\n\r\n\t\tHashMap<String, Integer> actualArmyCountPerCountryAfterReinforcement = new HashMap<>();\r\n\r\n\t\tfor (String country : countriesOwnedList) {\r\n\t\t\tactualArmyCountPerCountryAfterReinforcement.put(country,\r\n\t\t\t\t\tplayerOne.getStrategyType().gameData.gameMap.getCountry(country).getCountryArmyCount());\r\n\t\t}\r\n\r\n\t\tassertEquals(actualArmyCountPerCountryAfterReinforcement, expectedArmyCountPerCountryAfterReinforcement);\r\n\t\t// assertTrue(strongerCountryAfterReinforcement >\r\n\t\t// strongerCountryBeforeReinforcement);\r\n\r\n\t}",
"public void testRanges() throws Exception {\n int num = atLeast(1000);\n for (int i = 0; i < num; i++) {\n BytesRef lowerVal = new BytesRef(TestUtil.randomUnicodeString(random()));\n BytesRef upperVal = new BytesRef(TestUtil.randomUnicodeString(random()));\n if (upperVal.compareTo(lowerVal) < 0) {\n assertSame(upperVal, lowerVal, random().nextBoolean(), random().nextBoolean());\n } else {\n assertSame(lowerVal, upperVal, random().nextBoolean(), random().nextBoolean());\n }\n }\n }",
"@Then(\"^items displayed as per choice made$\")\n\tpublic void items_displayed_as_per_choice_made() throws Throwable {\n\t\tString str = driver.findElement(By.xpath(\"//*[@id=\\\"center_column\\\"]/h1/span[2]\")).getText();\n\t\tassertEquals(\"7 results have been found.\", str);\n\t\tdriver.quit();\n\t}",
"public static void multiRunTest(){\n /* Input resources.\n * For each String:\n * - the first character is the name of the first image.\n * - the second character is the name of the second image.\n */\n String[] inputs = new String[]{\n \"ab\",\n \"cd\",\n \"ef\",\n \"gh\",\n \"il\",\n \"mn\"\n };\n \n BlueRand random = new BlueRand();\n random.setOutputFile(\"sample/output/multiRuns_output.txt\");\n random.setOutputImage(\"sample/output/multiRuns_output.bmp\");\n random.overwriteOutputFile(false); \n //random.deleteInputFiles(true);\n try {\n\t for (String s : inputs){\n\t random.setInputImages(\"sample/input/\"+s.charAt(0)+\".jpg\",\n\t \"sample/input/\"+s.charAt(1)+\".jpg\"); \n\t ArrayList<Byte> output = random.generateRandom();\n\t System.out.println(\"run finished... Bytes generated: \" + output.size());\n\t }\n } catch (BlueRandException e){\n \tSystem.out.println(e.getMessage());\n }\n }",
"protected void initializeExecutionRandomness() {\r\n\r\n\t}",
"@Test\n public void randomRecipeTest() {\n onView(withContentDescription(\"Open navigation drawer\")).perform(click());\n //Open the search bar at the top\n onView(withText(\"Find a Random Recipe!\")).perform(click());\n onView(withId(R.id.recipe_title)).check(matches(isDisplayed()));\n\n //Exit to the main activity\n pressBack();\n }",
"@Test(priority =21)\n\t public void newtest2() throws InterruptedException\n\t {\n\t\tThread.sleep(3000);\n\t\tdriver.findElement(By.name(\"nombre\")).sendKeys(\"manualchange\");\n\t\tThread.sleep(3000);\n driver.findElement(By.linkText(\"Generate\")).click();\n Thread.sleep(5000); \n driver.findElement(By.linkText(\"click here\")).click();\n Thread.sleep(5000);\n\t }",
"@Test\n\tpublic void testNormalPuzzleGeneration() {\n\t}",
"public void step()\n\t{\n\t\t// Reservoir sampling by generating ordered list of numbers\n\t\t// randomly pick a number within length and use that as index\n\t\tRandom rand = new Random();\n\t\tArrayList<Integer> numbers = new ArrayList<Integer>();\n\t\tfor(int i = 0; i < listOfCells.size(); i++) { numbers.add(i); }\n\t\t\n\t\t// Randomly sample from reservoir until empty\n\t\twhile(numbers.size() > 0)\n\t\t{\n\t\t\tint picked_index = rand.nextInt(numbers.size());\n\t\t\tint picked_val = numbers.get(picked_index);\n\t\t\t\n\t\t\t//TODO: Maybe call a function on cell of random action that might occur\n\t\t\t//\tConsider only returning object when necessary, (how it is now)\n\t\t\tPlantCell newObject = listOfCells.get(picked_val).doAction();\n\t\t\tif(newObject != null)\n\t\t\t{\n//\t\t\t\tSystem.out.println(\"New cell generated!\");\n\t\t\t\tlistOfCells.add(newObject);\n\t\t\t}\n\t\t\t\n\t\t\t//Kill spawning cell if its health drops <= 0\n\t\t\t//should die right away to make room for other cell\n\t\t\tif(listOfCells.get(picked_val).getHealth() <= 0)\n\t\t\t{\n\t\t\t\tenvironmentPointer.map[listOfCells.get(picked_val).getX()][listOfCells.get(picked_val).getY()] = null;\n\t\t\t\tlistOfCells.set(picked_val, null); //Set to null as to preserve list integrity for reservoir sampling, will be removed later\n\t\t\t}\n\t\t\t\n\t\t\tnumbers.remove(picked_index);\n\t\t}\n\t\t\n\t\t// All recently dead cells are now null in our cell list, so we are removing them from the list now\n\t\tfor(int i = 0; i < listOfCells.size(); i++)\n\t\t{\n\t\t\tif(listOfCells.get(i) == null)\n\t\t\t{\n\t\t\t\tlistOfCells.remove(i);\n\t\t\t\ti--; //Adjust for changing size\n\t\t\t}\n\t\t}\n\t}",
"public void testSelect_0()\n throws Exception {\n BestChromosomesSelector selector = new BestChromosomesSelector(conf);\n Gene gene = new IntegerGene(conf);\n gene.setAllele(new Integer(444));\n Chromosome secondBestChrom = new Chromosome(conf, gene, 3);\n secondBestChrom.setFitnessValue(11);\n selector.add(secondBestChrom);\n gene = new BooleanGene(conf);\n gene.setAllele(Boolean.valueOf(false));\n Chromosome bestChrom = new Chromosome(conf, gene, 3);\n bestChrom.setFitnessValue(12);\n selector.add(bestChrom);\n selector.select(1, null, new Population(conf));\n }",
"@Test\n public void endGameDetectionTrue() {\n logic.setDirection(1);\n for (int i = 0; i < 100; i++) {\n logic.eatFoodForTesting();\n logic.gameLogic();\n }\n assertFalse(logic.gameLogic());\n }",
"@Test\n\t@TestProperties(name = \"Clear element ${by}:${locator} selection\", paramsInclude = { \"by\", \"locator\" })\n\tpublic void clearSelections() {\n\t\tthrow new IllegalStateException(\"Unimplemenetd\");\n\t}",
"@Test(groups = \"smoke\")\n public void testKeepSelected() {\n String textSource = pickList.advanced().getSourceList().getItem(0).getText();\n pickList.add(0);\n ListItem item = pickList.advanced().getTargetList().getItem(0);\n assertTrue(item.getRootElement().getAttribute(\"class\").contains(\"rf-pick-sel\"));\n assertEquals(item.getText(), textSource);\n\n pickList.remove(0);\n item = pickList.advanced().getSourceList().getItem(ChoicePickerHelper.byIndex().last());\n assertTrue(item.getRootElement().getAttribute(\"class\").contains(\"rf-pick-sel\"));\n assertEquals(item.getText(), textSource);\n assertEquals(Utils.getIndexOfElement(item.getRootElement()), pickList\n .advanced().getSourceList().size() - 1, \"Index of removed item.\");\n }",
"private static boolean KawigiEdit_RunTest(\n int testNum, int p0, int p1, boolean hasAnswer, int[] p2) {\n System.out.print(\"Test \" + testNum + \": [\" + p0 + \",\" + p1);\n System.out.println(\"]\");\n RearrangeAndIncrement obj;\n int[] answer;\n obj = new RearrangeAndIncrement();\n long startTime = System.currentTimeMillis();\n answer = obj.change(p0, p1);\n long endTime = System.currentTimeMillis();\n boolean res;\n res = true;\n System.out.println(\"Time: \" + (endTime - startTime) / 1000.0 + \" seconds\");\n if (hasAnswer) {\n System.out.println(\"Desired answer:\");\n System.out.print(\"\\t\" + \"{\");\n for (int i = 0; p2.length > i; ++i) {\n if (i > 0) {\n System.out.print(\",\");\n }\n System.out.print(p2[i]);\n }\n System.out.println(\"}\");\n }\n System.out.println(\"Your answer:\");\n System.out.print(\"\\t\" + \"{\");\n for (int i = 0; answer.length > i; ++i) {\n if (i > 0) {\n System.out.print(\",\");\n }\n System.out.print(answer[i]);\n }\n System.out.println(\"}\");\n if (hasAnswer) {\n if (answer.length != p2.length) {\n res = false;\n } else {\n for (int i = 0; answer.length > i; ++i) {\n if (answer[i] != p2[i]) {\n res = false;\n }\n }\n }\n }\n if (!res) {\n System.out.println(\"DOESN'T MATCH!!!!\");\n } else if ((endTime - startTime) / 1000.0 >= 2) {\n System.out.println(\"FAIL the timeout\");\n res = false;\n } else if (hasAnswer) {\n System.out.println(\"Match :-)\");\n } else {\n System.out.println(\"OK, but is it right?\");\n }\n System.out.println(\"\");\n return res;\n }"
] | [
"0.716668",
"0.67145175",
"0.6385688",
"0.6200205",
"0.61238253",
"0.60827786",
"0.6082272",
"0.60352606",
"0.59767216",
"0.5942972",
"0.59415716",
"0.58846706",
"0.5872104",
"0.58691514",
"0.5866626",
"0.58614635",
"0.5851184",
"0.58333635",
"0.5826667",
"0.58258224",
"0.57777405",
"0.57550055",
"0.57537293",
"0.57510865",
"0.5741515",
"0.5710573",
"0.5702686",
"0.5689471",
"0.5686279",
"0.56843346",
"0.56733936",
"0.56695896",
"0.5656654",
"0.564973",
"0.5633931",
"0.55934346",
"0.5589017",
"0.55883133",
"0.55880165",
"0.5573663",
"0.5561913",
"0.55506945",
"0.5541851",
"0.553946",
"0.55364394",
"0.5534119",
"0.5529966",
"0.5529935",
"0.552788",
"0.55215186",
"0.5517712",
"0.5517194",
"0.5516003",
"0.5514593",
"0.55142945",
"0.5510743",
"0.54998213",
"0.54981476",
"0.5493803",
"0.54854083",
"0.54811066",
"0.5477823",
"0.5455273",
"0.5453208",
"0.5450057",
"0.5446746",
"0.5446124",
"0.5442719",
"0.5442362",
"0.5440057",
"0.5438423",
"0.5436424",
"0.54319566",
"0.54274213",
"0.5425972",
"0.5425619",
"0.542363",
"0.5422329",
"0.5418905",
"0.5418373",
"0.5417381",
"0.54126376",
"0.54124206",
"0.54115146",
"0.5407547",
"0.53931534",
"0.5389843",
"0.53886926",
"0.53850794",
"0.5382862",
"0.5381574",
"0.5381345",
"0.53812754",
"0.5379046",
"0.5377562",
"0.53728676",
"0.5365566",
"0.53640425",
"0.53589344",
"0.5358722"
] | 0.6628764 | 2 |
Make the player, give it a hand. | @Test
public void testHasAtLeastTwoPlayableCards() {
Player player2 = new Player("Three Playable Cards Test", true);
Hand threePlayableCardsHand = strategyHand;
player2.setHand(threePlayableCardsHand.getAllCards());
// Make it harder to find playable cards:
player2.getHand().discard(new Card(Card.COLORLESS, Card.WILD, cvm));
player2.getHand().discard(new Card(Card.COLORLESS, Card.WILD_DRAW_FOUR, cvm));
Card currentPlayedCard_1 = new Card(Card.YELLOW, Card.ONE, cvm);
assertTrue(player2.hasAtLeastTwoPlayableCards(currentPlayedCard_1, Card.BLUE));
Card currentPlayedCard_2 = new Card(Card.BLUE, Card.SEVEN, cvm);
assertFalse(player2.hasAtLeastTwoPlayableCards(currentPlayedCard_2, Card.BLUE));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Player() {\n hand = new Hand();\n }",
"public HumanPlayer(Hand hand, Card selected) {\n this.hand = hand;\n // Set up human player for interaction\n CardListener cardListener = new CardAdapter() {\n private Card card;\n\n public void leftDoubleClicked(Card card) {\n Whist.setCard(card);\n\t\t\t\thand.setTouchEnabled(false);\n\t\t\t}\n };\n hand.addCardListener(cardListener);\n }",
"public void play() {\r\n this.cardDeck = new JavaDeck();\r\n cardDeck.shuffle();\r\n dealerHand = new JavaHand(2);\r\n dealerHand.DiscardHand();\r\n addDealerCard();\r\n }",
"public Player() {\n//\t\thand = new Hand();\n\t\tthis.cardsInhand = new ArrayList<Card>();\n\t}",
"public Hand(){}",
"void setHand(Hand hand) {\n\t\t_hand = hand;\n\t}",
"void createPlayer(Player player);",
"public void newHand() {\n if(player.getSecondHand().size() > 0){\n player.emptySecondHand(deck);\n shuffle();\n }\n player.resetBet();\n dealer.resetBet();\n errorFlag = false;\n userMessage = \"Place your Bet\";\n againDisabled = true;\n dealDisabled = false;\n hitDisabled = true;\n splitDisabled = true;\n standDisabled = true;\n doubleDisabled = true;\n bettingDisabled = false;\n emptyHands();\n }",
"public Hand() {\r\n\t\t\r\n\t}",
"Player createPlayer();",
"public void welcome(Player player) {\n\t\tplayer.speak(\"Where am I? Why is a saw in front of me? Why is my left feet handcuffed? What happened! There is a letter. I should read it......\");\n\t\tplayer.addCarried(new Item(\"handcuff\", null, new String[]{\"isWearable\", \"isDressed\", \"isPortable\", \"isImpedient\"}, new boolean[]{false, true, false, true}, new String[]{\"wearTo\"}, new String[]{\"left feet\"}));\n\t}",
"@Override\r\n\tpublic void makeRandonMove() {\r\n\t\tif (randPlayer.getPlayerNumber() == game.getState().getTurn() && !game.getState().isFinished()) game.execute(randPlayer.requestAction(game.getState()));\r\n\t}",
"void makePlay(int player) {\n }",
"private void spawnPlayer() {\n\t\tplayer.show(true);\n\t\tplayer.resetPosition();\n\t\tplayerDead = false;\n\t\tplayerDeadTimeLeft = 0.0;\n\t}",
"private void makePlay() {\n\t\teating = true;\n\t\ttama.setLayoutX(200);\n\n\t\tplay = new Sprite(6, 6, 360, 379, new Image(\"file:./res/images/basketball.png\"), 1, 1000);\n\t\tplay.setLayoutX(140);\n\t\tplay.setLayoutY(190);\n\t\tplay.setScaleX(0.5);\n\t\tplay.setScaleY(0.5);\n\t\tgrid.getChildren().addAll(play);\n\t\tPauseTransition pause = new PauseTransition(Duration.millis(1000));\n\t\tpause.setOnFinished(e -> {\n\t\t\tgrid.getChildren().remove(play);\n\t\t\ttama.setLayoutX(190);\n\t\t\teating = false;\n\t\t\tmodel.getController().playWith();\n\t\t});\n\t\tpause.play();\n\n\t}",
"public void createNewPlayer()\n\t{\n\t\t// Set up all badges.\n\t\tm_badges = new byte[42];\n\t\tfor(int i = 0; i < m_badges.length; i++)\n\t\t\tm_badges[i] = 0;\n\t\tm_isMuted = false;\n\t}",
"@Override\n public void beHelpful() {\n this.playPiano();\n this.takeABow();\n }",
"public Player(){\r\n\t\tname = \"\";\r\n\t\tchip = 0;\r\n\t\tbet = 0;\r\n\t\tplayerHand = new PlayerHand();\r\n\t\ttable = null;\r\n\t}",
"private void manualCommand(String player) {\n try {\n Piece s = Piece.playerValueOf(player);\n _playing = false;\n _players[s.ordinal()] = new HumanPlayer(s, this);\n } catch (IllegalArgumentException excp) {\n error(\"unknown player: %s\", player);\n System.out.println();\n }\n }",
"public Hand() {\n }",
"public void givePlayerHand(int playerPosition, List<Card> playerHand) {\n rounds.get(currentRound).givePlayerHand(playerPosition, playerHand);\n }",
"public abstract CardAction play(Player p);",
"public Player()\n\t{\n\t\tmyName = DEFAULT_NAME;\n\t\tmyHand = new PokerHand(5);\n\t\tmyNumberWins = 0;\n\t\tmyAmAI = false;\n\t}",
"public abstract void makePlayer(Vector2 origin);",
"public void giveCard(Card c){\n\t\thand.add(c);\n\t}",
"private void createHumanPlayer() {\n humanPlayer = new Player(\"USER\");\n players[0] = humanPlayer;\n }",
"public void presentPlayer( CoinFlipper theHandle, String theName );",
"public void play() {\n field.draw();\n userTurn();\n if(! field.isFull()) {\n computerTurn();\n }\n }",
"public void addHand(Hand h)\n {\n hand.add(h);\n }",
"private void myTurn()\n\t{\n\t\t\n\t\tif (canPlay())\n\t\t{\n\t\t\tif (isTop())\n\t\t\t{\n\t\t\t\traise();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tequal();\n\t\t\t}\n\t\t}\n\t\ttable.nextPlayer();\n\t\t\n\t}",
"@Override\n public void playOneRound (Player player) {\n this.executeActions(this.actionChoosed(player), player);\n }",
"void createNewGame(Player player);",
"public HumanPlayer(int num){\r\n super(num);\r\n getHand().drawCards(7);\r\n }",
"Player() {\r\n setPlayerType(\"HUMAN\");\r\n\t}",
"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}",
"public War()\n {\n //create deck of cards\n deck.shuffle();\n \n //deal cards to two different hands\n while(!deck.isEmpty())\n {\n card=deck.dealCard();\n player1Hand.enqueue(card);\n \n card=deck.dealCard();\n player2Hand.enqueue(card);\n }\n \n }",
"public Hand () //No arg\n\t{\n\t\tthis.cardsInHand = 0;\n\t\tthis.handSize = 5;\n\t}",
"public void manualCommand(Piece p) {\r\n _playing = false;\r\n _players[p.ordinal()] = new HumanPlayer(p, this);\r\n }",
"public void startGame() {\n this.deck = new Deck();\n this.deck.shuffle(); //shuffle the deck\n Card card = this.deck.deal(this.getPlayerHand());\n card = this.deck.deal(this.getPlayerHand());\n card = this.deck.deal(this.getDealerHand());\n }",
"public Hand() {\n this.hole1 = new BlankCard();\n this.hole2 = new BlankCard();\n showCards = false;\n }",
"public void addToHand(PlayingCard card){\n\t\thand.add(card);\n\t}",
"public void play()\r\n\t{\r\n \r\n\t\tupdateMessage(\"Starting \" + name + \" between \"+ agent[0].name+ \" and \"+ agent[1].name+\".\");\r\n random = new Random(System.currentTimeMillis());\r\n\t\tint turn = random.nextInt(2);\r\n first=turn;\r\n\t\tint dimension=8;\r\n\t\t//System.out.println(agent[turn].name+ \" makes the first move.\");\r\n\t\t//initialize(false,dimension,dimension);\r\n set(agent[first].role);\r\n agent[0].setAvailable(agent[first].role, dimension);\r\n agent[1].setAvailable(agent[first].role, dimension);\r\n \r\n \r\n\t\t//showGameState();\r\n \r\n\t\twhile(!isFinished())\r\n\t\t{\r\n\t\t\tupdateMessage(agent[turn].name+ \"'s turn. \");\r\n\t\t\tagent[turn].makeMove(this);\r\n agent[(turn+1)%2].off(agent[turn].newx,agent[turn].newy );\r\n agent[(turn+1)%2].setNew((OTHELLO)this);\r\n \r\n \r\n\t\t\tshowGameState();\r\n\t\t\t\r\n\t\t\tturn = (turn+1)%2;\r\n\t\t}\r\n\t\t\r\n // System.out.println(\" final winner role: \"+winner.role+\" agent[0]: \"+agent[0].role+\" agent[1]: \"+agent[1].role);\r\n \r\n\t\t\r\n\t\tif(draw)\t\r\n\t\t\tupdateMessage(\"Game drawn!!\");\r\n else updateMessage(winner.name+ \" wins!!!\");\r\n\t\t\r\n\t}",
"@Override\r\n\tpublic void playCard() {\n\t\t\r\n\t}",
"public void play() {\n System.out.println(\"Player \" + this.name + \" started to play...\");\n System.out.println(\"Current balance: \" + getTotalAsset());\n\n // roll a dice to move\n int steps = rollDice();\n System.out.println(\"Player diced \" + steps);\n\n // move\n move(steps);\n Land land = Map.getLandbyIndex(position);\n\n // land triggered purchase or opportunity events\n land.trigger();\n\n System.out.println(\"Player \" + this.name + \"has finished.\");\n }",
"public void AddCardToHumanHand(){\n //Add the first card to the human hand\n handHuman.add(deck.get(0));\n\n //Remove card from deck\n deck.remove(0);\n }",
"@Override\n\tpublic void playCard() {\n\t\t\n\t}",
"public void letSmartComputerSetup() {\n //generates a random spot for the flag\n int randomRow = (int)(Math.random() * 2);\n int randomCol = (int)(Math.random() * 10);\n\n //adjusts the flag for the proper team\n if(state.getCurrentTeamsTurn().getTEAMNUMBER() == 0) {\n randomRow += 8;\n }\n\n //adds the flag to the board\n state.setLastTappedPieceButton(Rank.FLAG);\n state.tapOnSquare(randomRow, randomCol);\n state.tapOnSquare(randomRow, randomCol);\n\n //places bombs around the flag if possible\n state.setLastTappedPieceButton(Rank.BOMB);\n if(randomRow != 0) {\n state.tapOnSquare(randomRow - 1, randomCol);\n state.tapOnSquare(randomRow - 1, randomCol);\n }\n if(randomRow != 9) {\n state.tapOnSquare(randomRow + 1, randomCol);\n state.tapOnSquare(randomRow + 1, randomCol);\n }\n if(randomCol != 0) {\n state.tapOnSquare(randomRow, randomCol -1);\n state.tapOnSquare(randomRow, randomCol -1);\n }\n if(randomCol != 9) {\n state.tapOnSquare(randomRow, randomCol + 1);\n state.tapOnSquare(randomRow, randomCol + 1);\n }\n\n //transitions the player to play phase\n state.transitionPhases();\n }",
"public void play() {\n if (!isHungry()) {\n hunger += 2;\n mood += 2;\n fatigue += 3;\n\n if (!muted) {\n System.out.println(\"play\\t|\\tPlaying is fun!\");\n }\n }\n }",
"public void play() {\n\t\tplay(true, true);\n\t}",
"public void run() {\n\t initialise();\n\t // request play from player until finished\n\t playPlayersHand();\n\t // resolve the dealers hand according to the rules\n\t playDealersHand();\n\t \n\t showOutcome();\n\t }",
"public void playCard(IPlayer owner){\n // Wont play card unless a player has it\n if(command == \"Move1\"){\n owner.Move(owner.getPlayerDir());\n }\n else if(command == \"Move2\"){\n for (Integer i=0; i < 2; i++) {\n owner.Move(owner.getPlayerDir());\n }\n }\n else if(command == \"Move3\"){\n for (Integer i=0; i < 3; i++) {\n owner.Move(owner.getPlayerDir());\n }\n }\n else if (command == \"MoveBack\"){\n owner.Move(dirCtrl.invertDirection(owner.getPlayerDir()));\n }\n else if(command == \"TurnRight\"){\n owner.Turn(TurnDirection.RIGHT);\n }\n else if(command == \"TurnLeft\"){\n owner.Turn(TurnDirection.LEFT);\n }\n else if(command == \"Turn180\"){\n owner.Turn(TurnDirection.BACKWARDS);\n }\n }",
"public static void giveStuff(GamePlayer player) {\r\n\t\tItemStack sword = new ItemStack(Material.WOOD_SWORD);\r\n\t\tItemStack bow = new ItemStack(Material.BOW);\r\n\t\tItemStack arrow = new ItemStack(Material.ARROW);\r\n\t\tItemStack compass = new ItemStack(Material.COMPASS);\r\n\t\tItemMeta compassMeta = sword.getItemMeta();\r\n\t\tItemMeta swordMeta = sword.getItemMeta();\r\n\t\tItemMeta bowMeta = sword.getItemMeta();\r\n\t\t\r\n\t\tplayer.getPlayer().getInventory().clear();\r\n\t\tswordMeta.spigot().setUnbreakable(true);\r\n\t\tsword.setItemMeta(swordMeta);\r\n\t\tsword.setAmount(1);\r\n\t\t\r\n\t\tbowMeta.spigot().setUnbreakable(true);\r\n\t\tbowMeta.setDisplayName(\"§aSniper§r §7(One Shot Kill)\");\r\n\t\tbow.setItemMeta(bowMeta);\r\n\t\tbow.addUnsafeEnchantment(Enchantment.ARROW_DAMAGE, 10);\r\n\t\tbow.setAmount(1);\r\n\t\t\r\n\t\tarrow.setAmount(1);\r\n\t\t\r\n\t\tcompassMeta.setDisplayName(\"§aTarget Tracker\");\r\n\t\tcompass.setItemMeta(compassMeta);\r\n\t\tcompass.setAmount(1);\r\n\t\t\r\n player.getPlayer().getInventory().addItem(sword);\r\n player.getPlayer().getInventory().addItem(bow);\r\n player.getPlayer().getInventory().addItem(arrow);\r\n player.getPlayer().getInventory().addItem(compass);\r\n\t}",
"private void humanTurn() \n {\n \n playTurn();\n }",
"public deal()\n {\n player1Hand = 0;\n player2Hand = 0;\n dealerHand = 0;\n }",
"@Test\n public void testGiveHand() throws Exception {\n\n Deck giveHand = new Deck();\n giveHand.add(cardB);\n giveHand.add(cardB);\n giveHand.add(cardP);\n playerHuman.addCardToDeck(cardB);\n playerHuman.addCardToDeck(cardB);\n playerHuman.addCardToDeck(cardP);\n playerHuman.giveHand();\n org.junit.Assert.assertEquals(giveHand, playerHuman.getPlayHand());\n }",
"public void play() {\n\t\t\r\n\t}",
"public void giveUp() {\n if (!finished)\n player.kill();\n }",
"public void setHand(ArrayList<Card> c){//using this to so that the controller can set the hand to whatever amount the getCard() method give--- this will all happen in the controller\n\t\thand = c;//set the arraylist of cards into the hand we created in this Player class\n\t}",
"public CrazyEightHumanPlayer(String name, int handSize) {\n super(name, handSize);\n }",
"public void takeACard(Card card){\n hand.add(card);\n }",
"public TapeHead preparePlayer() {\n \treturn this.table.createHead(1);\t\n }",
"public void Play();",
"public void setup() {\r\n\t\thumanCardsPanel.setHumanCards(players.get(0).getCards());\r\n\t\tfor ( Player p : players ) {\r\n\t\t\tp.setBoard(board);\r\n\t\t\tp.setGame(this);\r\n\t\t}\r\n\t\tboard.setGame(this);\r\n\t\tboard.repaint();\r\n\t\tJOptionPane popup = new JOptionPane();\r\n\t\tString message = \"You are Miss Scarlet. Press Next Player to begin.\\n Hint: Use File > Detective Notes to help you win!\";\r\n\t\tpopup.showMessageDialog(this, message, \"Welcome to Clue!\", JOptionPane.INFORMATION_MESSAGE);\r\n\t}",
"private void playNextPlayer() {\n \n PlayerId nextPlayer = state.nextPlayer();\n players.get(nextPlayer).setHelp(state, handsOfCards.get(nextPlayer), nextPlayer);\n Card c = players.get(nextPlayer).cardToPlay(state, handsOfCards.get(nextPlayer));\n state = state.withNewCardPlayed(c);\n \n handsOfCards.put(nextPlayer, handsOfCards.get(nextPlayer).remove(c));\n players.get(nextPlayer).updateHand(handsOfCards.get(nextPlayer));\n \n for (Map.Entry<PlayerId, Player> pId: players.entrySet()) {\n pId.getValue().updateTrick(state.trick());\n }\n players.get(nextPlayer).resetHelp();\n }",
"public Player(String name, double chip){\r\n\t\tthis.name = name;\r\n\t\tthis.chip = chip; \r\n\t\tbet = 0;\r\n\t\tplayerHand = new PlayerHand();\r\n\t\ttable = null;\r\n\t}",
"@Override\n\tpublic void transferTo(Player player) {\n\t\tSystem.out.println(\"Hey you are in snake mouth, Now got to tail\");\n\t\tplayer.move(getTransferFactor()); \n\t\t\n\t\t\n\t}",
"public HandController(SessionController parent) {\n\tinitComponents();\n\t\n\tthis.sessionController = parent;\n\t\n\tthis.hand = new Hand(this);\n }",
"public Player preparePlayer(Player player)\n\t{\n\t\tplayer.createPlayer();\n\t\tplayer.body = world.createBody(player.getBodyDef());\n\t\tplayer.body.setUserData(player.sprite);\n\t\tplayer.body.createFixture(player.getFixtureDef());\n\t\tMassData m=new MassData();\n\t\tm.mass=player.MASS;\n\t\tplayer.body.setMassData(m);\n\t\tplayer.setContactFixture();\n\t\tplayer.contactFixture=player.body.createFixture(player.fixtureDef);\n\t\treturn player;\n\t}",
"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 }",
"public FakePlayer() {\n this(Minecraft.getMinecraft().thePlayer.worldObj);\n }",
"public final void play() {\n\t\tinitialize();\n\t\tstartPlay();\n\t\tendPlay();\n\t}",
"public void play(){\n\t\t\n\t}",
"public void pickUp(Player player) {\n player.setBox(this);\n }",
"private void autoCommand(String player) {\n try {\n Piece s = Piece.playerValueOf(player);\n _playing = false;\n _players[s.ordinal()] = new MachinePlayer(s, this);\n } catch (IllegalArgumentException excp) {\n error(\"unknown player: %s\", player);\n System.out.println();\n }\n }",
"void doAction(Player player);",
"public void play() {\n\t\tthis.initializeTurn();\n\t\twhile(this.getAction() > 0) {\n\t\t\tint choix = RandomInt.randomInt(1,6, this.rand);\n\t\t\tif(choix == 1) {\n\t\t\t\t//add building, preference of Machine\n\t\t\t\tint max = 0;\n\t\t\t\tint maxi = 0;\n\t\t\t\tboolean find = false;\n\t\t\t\tfor(int i = 0; i < this.getBoard().getFiveBuildingCards().size(); i++) {\n\t\t\t\t\tif(this.getBoard().getFiveBuildingCards().get(i) != null) {\n\t\t\t\t\t\tif(this.getBoard().getFiveBuildingCards().get(i) instanceof Machine) {\n\t\t\t\t\t\t\tmaxi = i;\n\t\t\t\t\t\t\tfind = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(this.getBoard().getFiveBuildingCards().get(i).getPoint() > max && !find) {\n\t\t\t\t\t\t\tmax = this.getBoard().getFiveBuildingCards().get(i).getPoint();\n\t\t\t\t\t\t\tmaxi = i;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis.addBuilding(this.getBoard().getFiveBuildingCards().get(maxi));\n\t\t\t\tDesignString.printBorder(\"Ouverture d'un chantier\");\n\t\t\t}\n\t\t\telse if(choix == 2 || choix == 3) {\n\t\t\t\t//add worker, preference of the lowest one\n\t\t\t\tint min = 999;\n\t\t\t\tint mini = 0;\n\t\t\t\tfor(int i = 0; i < this.getBoard().getFiveWorkerCards().size(); i++) {\n\t\t\t\t\tif(this.getBoard().getFiveWorkerCards().get(i) != null) {\n\t\t\t\t\t\tif(this.getBoard().getFiveWorkerCards().get(i).getCost() < min && this.getBoard().getFiveWorkerCards().get(i).getCost() >= this.getCoin()) {\n\t\t\t\t\t\t\tmin = this.getBoard().getFiveWorkerCards().get(i).getCost();\n\t\t\t\t\t\t\tmini = i;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(this.getBoard().getFiveWorkerCards().get(mini).getCost() >= this.getCoin()) {\n\t\t\t\t\tDesignString.printBorder(\"Échange action vers écus\");\n\t\t\t\t\tthis.actionToCoins(RandomInt.randomInt(1,this.getAction(), this.rand));\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\tDesignString.printBorder(\"Recrutement d'un ouvrier\");\n\t\t\t\t\tthis.hireWorker(this.getBoard().getFiveWorkerCards().get(mini));\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(choix == 4 || choix == 5 || choix == 6) {\n\t\t\t\t//worker to building. Preference to the started building. If it can't play, preference to action to coin\n\t\t\t\tIBuilding building = null;\n\t\t\t\tIWorker worker = null;\n\t\t\t\tif(this.getWorkerCards().size() > 0) {\n\t\t\t\t\tif(this.getStartedBuilding().size() > 0) {\n\t\t\t\t\t\tchoix = RandomInt.randomInt(0,2,this.rand);\n\t\t\t\t\t\tif(choix%2 == 0) {\n\t\t\t\t\t\t\tint max = 0;\n\t\t\t\t\t\t\tint maxi = 0;\n\t\t\t\t\t\t\tfor(int i = 0; i < this.getStartedBuilding().size(); i++) {\n\t\t\t\t\t\t\t\tif(this.getStartedBuilding().get(i) != null) {\n\t\t\t\t\t\t\t\t\tif(this.getStartedBuilding().get(i).getWorkerOn().size() > max) {\n\t\t\t\t\t\t\t\t\t\tmax = this.getStartedBuilding().get(i).getWorkerOn().size();\n\t\t\t\t\t\t\t\t\t\tmaxi = i;\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\tbuilding = this.getStartedBuilding().get(maxi);\n\n\t\t\t\t\t\t\tworker = this.getWorkerCards().get(RandomInt.randomInt(0,this.getWorkerCards().size()-1, this.rand));\n\n\t\t\t\t\t\t\twhile(worker != null && worker.getCost() > this.getCoin() && this.getAction() > 0) {\n\t\t\t\t\t\t\t\tworker = this.getWorkerCards().get(RandomInt.randomInt(0,this.getWorkerCards().size()-1, this.rand));\n\t\t\t\t\t\t\t\tchoix = RandomInt.randomInt(1,5,this.rand);\n\t\t\t\t\t\t\t\tif(choix == 1) {\n\t\t\t\t\t\t\t\t\tDesignString.printBorder(\"Échange action vers écus\");\n\t\t\t\t\t\t\t\t\tthis.actionToCoins(RandomInt.randomInt(1,this.getAction(), this.rand));\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\tif(this.getAction() >= this.getRemoveBuilding(building)) {\n\t\t\t\t\t\t\t\tDesignString.printBorder(\"Envoi d'un ouvrier sur un chantier\");\n\t\t\t\t\t\t\t\tthis.workerToBuilding(worker, building);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tbuilding = this.getBuildingsCards().get(RandomInt.randomInt(0,this.getBuildingsCards().size()-1, this.rand));\n\t\t\t\t\t\t\twhile(building == null) {\n\t\t\t\t\t\t\t\tbuilding = this.getBuildingsCards().get(RandomInt.randomInt(0,this.getBuildingsCards().size()-1, this.rand));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tworker = this.getWorkerCards().get(RandomInt.randomInt(0,this.getWorkerCards().size()-1, this.rand));\n\t\t\t\t\t\t\twhile(worker != null && worker.getCost() > this.getCoin() && this.getAction() > 0) {\n\t\t\t\t\t\t\t\tworker = this.getWorkerCards().get(RandomInt.randomInt(0,this.getWorkerCards().size()-1, this.rand));\n\t\t\t\t\t\t\t\tchoix = RandomInt.randomInt(1,5,this.rand);\n\t\t\t\t\t\t\t\tif(choix == 1) {\n\t\t\t\t\t\t\t\t\tDesignString.printBorder(\"Échange action vers écus\");\n\t\t\t\t\t\t\t\t\tthis.actionToCoins(RandomInt.randomInt(1,this.getAction(), this.rand));\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\tif(this.getAction() >= this.getRemoveBuilding(building)) {\n\t\t\t\t\t\t\t\tDesignString.printBorder(\"Envoi d'un ouvrier sur un chantier\");\n\t\t\t\t\t\t\t\tthis.workerToBuilding(worker, building);\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} else if(this.getBuildingsCards().size() > 0) {\n\t\t\t\t\t\tbuilding = this.getBuildingsCards().get(RandomInt.randomInt(0,this.getBuildingsCards().size()-1, this.rand));\n\t\t\t\t\t\twhile(building == null) {\n\t\t\t\t\t\t\tbuilding = this.getBuildingsCards().get(RandomInt.randomInt(0,this.getBuildingsCards().size()-1, this.rand));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tworker = this.getWorkerCards().get(RandomInt.randomInt(0,this.getWorkerCards().size()-1, this.rand));\n\t\t\t\t\t\twhile(worker != null && worker.getCost() > this.getCoin() && this.getAction() > 0) {\n\t\t\t\t\t\t\tworker = this.getWorkerCards().get(RandomInt.randomInt(0,this.getWorkerCards().size()-1, this.rand));\n\t\t\t\t\t\t\tchoix = RandomInt.randomInt(1,5,this.rand);\n\t\t\t\t\t\t\tif(choix == 1) {\n\t\t\t\t\t\t\t\tDesignString.printBorder(\"Échange action vers écus\");\n\t\t\t\t\t\t\t\tthis.actionToCoins(RandomInt.randomInt(1,this.getAction(), this.rand));\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\tif(this.getAction() >= this.getRemoveBuilding(building)) {\n\t\t\t\t\t\t\tDesignString.printBorder(\"Envoi d'un ouvrier sur un chantier\");\n\t\t\t\t\t\t\tthis.workerToBuilding(worker, building);\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 static void main(String[] args) {\n System.out.println(\"Create the player.\");\n }",
"@Override\n\tpublic void setPlayer(Player player) {\n\n\t}",
"public void playOne(VirtualPet player) {\n\t\tplayer.playPet();\n\t}",
"public void autoCommand(Piece p) {\r\n _playing = false;\r\n _players[p.ordinal()] = new MachinePlayer(p, this);\r\n }",
"public void handStarted(int position, GameState gs, Card[] cards) {\r\n }",
"public void welcomePlayer(Player p);",
"private void setupPlayer(Engine engine, SceneManager sceneManager) throws IOException {\n\t\t// Entity dolphinEntityOne = sceneManager.createEntity(\"dolphinEntityOne\",\n\t\t// \"playerModel.obj\");\n\t\tSkeletalEntity dolphinEntityOne = sceneManager.createSkeletalEntity(\"player\", \"player.rkm\", \"player.rks\");\n\t\tdolphinEntityOne.setPrimitive(Primitive.TRIANGLES);\n\n\t\t// load animations\n\t\tdolphinEntityOne.loadAnimation(\"player_running\", \"player_running.rka\");\n\t\tdolphinEntityOne.loadAnimation(\"player_shooting\", \"player_shooting.rka\");\n\t\tdolphinEntityOne.loadAnimation(\"player_jump\", \"player_jump.rka\");\n\t\tdolphinEntityOne.loadAnimation(\"stepLeft\", \"stepLeft.rka\");\n\t\tdolphinEntityOne.loadAnimation(\"stepRight\", \"stepRight.rka\");\n\t\tdolphinEntityOne.loadAnimation(\"standing\", \"player_standing.rka\");\n\t\tdolphinNodeOne = sceneManager.getRootSceneNode().createChildSceneNode(dolphinEntityOne.getName() + \"Node\");\n\t\tdolphinNodeOne.attachObject(dolphinEntityOne);\n\n\t\t// initialize 'charge' state\n\t\tplayerCharge.put(dolphinNodeOne, false);\n\t\tplayerStretchController = new StretchController();\n\t\tsceneManager.addController(playerStretchController);\n\t\tplayerOrbitController = new OrbitController(dolphinNodeOne, 1.0f, 0.5f, 0.0f, false);\n\t\tsceneManager.addController(playerOrbitController);\n\n\t\t// initialize position and scale\n\t\tVector3 randomLocation = randomLocationMonster();\n\t\tdolphinNodeOne.setLocalPosition(randomLocation);\n\t\tdolphinNodeOne.setLocalPosition(100f,0f,0f);\n\t\tdolphinNodeOne.scale(0.04f, 0.04f, 0.04f);\n\t\t\n\t\ttargetNode = dolphinNodeOne.createChildSceneNode(\"targetNode\");\n\t\ttargetNode.setLocalPosition(0.0f, 10.0f, 50.0f);\n\n\t\t// initialize textures\n\t\tTexture dolphinOneTexture = textureManager.getAssetByPath(\"playerModel.png\");\n\t\tTextureState dolphinOneTextureState = (TextureState) renderSystem.createRenderState(RenderState.Type.TEXTURE);\n\t\tdolphinOneTextureState.setTexture(dolphinOneTexture);\n\t\tdolphinEntityOne.setRenderState(dolphinOneTextureState);\n\t\tSystem.out.println(dolphinNodeOne.getName());\n\t\thealths.put(dolphinNodeOne.getName(), 100);\n\t\tplayPlayerStandingAnimation();\n\t}",
"public HowToPlay()\n { \n // Create a new world with 600x400 cells with a cell size of 1x1 pixels.\n super(763, 578, 1); \n //HowToPlay play = new HowToPlay();\n }",
"public Bid playHand(Bid b)\n {\n return strategy.chooseBid(b, hand, strategy.cheat(b, hand));\n }",
"@Override\n public void performAction(Player playerActingOn) {\n System.out.println(\"Perform action PlayerPlayingCard\");\n if (this.strengthBoost == 0)\n playerActingOn.gainInstantWin();\n playerActingOn.increaseStrengthGain(this.strengthBoost);\n }",
"public void generatePlayer()\n {\n board.getTile(8,0).insertPlayer(this.player);\n }",
"@Override\n public Card cardToPlay(TurnState state, CardSet hand) {\n //Causes the player to spend a certain amount of time for each card\n double currentTime = System.currentTimeMillis();\n Card card = underlyingPlayer.cardToPlay(state, hand);\n try {\n long totalTime;\n if ((totalTime = (minTime - ((long) System.currentTimeMillis() - (long) currentTime))) > 0) {\n Thread.sleep(totalTime);\n }\n } catch (InterruptedException e) {\n }\n return card;\n }",
"public abstract void switchHand(final Direction turn) throws IOException,\n\t\t\tInterruptedException;",
"private static void playBlackjack(Player player) {\n\t\t//Delete hands of previous games.\n\t\tplayer.getReady();\n\t\t\n\t\t//Create the dealer.\n\t\tDealer dealer = new Dealer();\n\t\t\n\t\t//Deal two cards to each player.\n\t\tplayer.addCard(deck.dealCard());\n\t\tplayer.addCard(deck.dealCard());\n\t\t\n\t\tdealer.addCard(deck.dealCard());\n\t\tdealer.addCard(deck.dealCard());\n\t\t\n\t\t//Check if anyone has Blackjack.\n\t\tif (dealer.hasBlackjack()) {\n\t\t\tconsole.println(\"Your hand:\" + player.getHand());\n\t\t\tconsole.println(\"Dealer hand:\" + dealer.getHand());\n\t\t\tconsole.println(\"\\n*******************\\n\" +\n\t\t\t\t\t\"Blackjack! You lose!!\" +\n\t\t\t\t\t\"\\n*******************\\n\");\n\t\t\tconsole.println(\"Press <Enter> to continue.\");\n\t\t\tplayer.pay();\n\t\t\treturn;\n\t\t}\n\t\tif (player.hasBlackjack()) {\n\t\t\tconsole.println(\"Dealer hand:\" + dealer.getHand());\n\t\t\tconsole.println(\"Your hand:\" + player.getHand());\n\t\t\tconsole.println(\"\\n*******************\\n\" +\n\t\t\t\t\t\"Blackjack! You lose!!\" +\n\t\t\t\t\t\"\\n*******************\\n\");\n\t\t\tconsole.println(\"Press <Enter> to continue.\");\n\t\t\tplayer.collect();\n\t\t\treturn;\n\t\t\t\n\t\t}\n\t\t\n\t\t//Now the real game begins. Player play first.\n\t\t//Must play all the hands until dealer's turn.\n\t\tboolean dealerTurn = false;\n\t\t\n\t\tconsole.println(String.format(\"\\n\\nDealer first card: %s\", dealer.getFirstCard()));\n\t\t\n\t\twhile (!dealerTurn) { //Player keep playing as long as she can/wants\n\t\t\t\n\t\t\t//Player can have multiple hands (after split). Should play all of them independently.\n\t\t\tOptional<Hand> optionalPlayingHand = player.getNextPlayableHand();\n\t\t\t\n\t\t\tif (optionalPlayingHand.isPresent()) {\n\t\t\t\t\n\t\t\t\tplayer.setCurrentHand(optionalPlayingHand.get());\n\t\t\t\t\n\t\t\t\tconsole.println(\"Your playing hand:\" + player.getHand());\n\t\t\t\tconsole.print(\"Please, select an option: \");\n\t\t\t\tconsole.println(\"(1) Hit (2) Stand (3) Double Down (4) Split (5) Surrender\");\n\t\t\t\tint option = scanner.nextInt();\n\t\t\t\t\n\t\t\t\tswitch (UserAction.valueOf(option)) {\n\t\t\t\t\tcase HIT:\n\t\t\t\t\t\tconsole.println(\"You've chosen: HIT\");\n\t\t\t\t\t\tplayer.hit(deck.dealCard());\n\t\t\t\t\t\tconsole.println(\"Your resulting hand:\" + player.getHand());\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase STAND:\n\t\t\t\t\t\tconsole.println(\"You've chosen: STAND\");\n\t\t\t\t\t\tplayer.stand();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase SPLIT:\n\t\t\t\t\t\tconsole.println(\"You've chosen: SPLIT\");\n\t\t\t\t\t\tif (player.split(deck.dealCard(), deck.dealCard())) {\n\t\t\t\t\t\t\tconsole.println(\"Your hand has been split\");\n\t\t\t\t\t\t\tconsole.println(\"Your resulting hand:\" + player.getHand());\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconsole.println(\"Your hand can not be split. Try another option\\n\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase DOUBLE_DOWN:\n\t\t\t\t\t\tconsole.println(\"You've chosen: DOUBLE DOWN\");\n\t\t\t\t\t\tplayer.doubleDown(deck.dealCard());\n\t\t\t\t\t\tconsole.println(\"Your resulting hand:\" + player.getHand());\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase SURRENDER:\n\t\t\t\t\t\tconsole.println(\"You've chosen: SURRENDER\");\n\t\t\t\t\t\tif (player.surrender()) {\n\t\t\t\t\t\t\tconsole.println(\"Lose half of your bet.\");\n\t\t\t\t\t\t\tconsole.println(\"Dealer hand:\" + dealer.getHand());\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconsole.println(\"You cannot surrender. Try another option\\n\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\tdealerTurn = true;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//All player's hands are standing or busted\n\t\tfor (Hand hand : player.getHands()) {\n\t\t\tconsole.println(\"Your hand: \" + hand + \" Status: \" + hand.getStatus());\n\t\t}\n\t\t\n\t\tconsole.println(\"\\nDealer hand:\" + dealer.getHand());\n\t\t\n\t\tif (player.isBusted()) {\n\t\t\tconsole.println(\"\\n************\\n\" +\n\t\t\t\t\t\"You lose!!\" +\n\t\t\t\t\t\"\\n************\\n\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tconsole.println(\"\\nDealer turn.\\n\");\n\t\t//Dealer's turn.\n\t\twhile (dealerTurn) {\n\t\t\tUserAction dealerAction = dealer.getNextAction();\n\t\t\tswitch (dealerAction) {\n\t\t\t\tcase HIT:\n\t\t\t\t\tconsole.println(\"Dealer HIT\");\n\t\t\t\t\tdealer.hit(deck.dealCard());\n\t\t\t\t\tconsole.println(\"Dealer resulting hand:\" + dealer.getHand());\n\t\t\t\t\tbreak;\n\t\t\t\tcase STAND:\n\t\t\t\t\tconsole.println(\"Dealer STAND\");\n\t\t\t\t\tdealer.stand();\n\t\t\t\t\tdealerTurn = false;\n\t\t\t\t\tbreak;\n\t\t\t\tcase DONE:\n\t\t\t\t\tdealerTurn = false;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tconsole.println(\"Dealer hand:\" + dealer.getHand());\n\t\tif (dealer.isBusted()) {\n\t\t\t//Dealer is busted. Player wins!\n\t\t\tconsole.println(\"\\n************\\n\" +\n\t\t\t\t\t\"You win!!\" +\n\t\t\t\t\t\"\\n************\\n\");\n\t\t\tplayer.collect();\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t//Check if dealer won\n\t\tif (dealer.hasBlackjack()) {\n\t\t\tconsole.println(\"\\n******************************************************\\n\" +\n\t\t\t\t\t\"There is a tie!. Dealer wins. Its a casino after all\" +\n\t\t\t\t\t\"\\n******************************************************\\n\");\n\t\t\tplayer.pay();\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tconsole.println(\"\\n*****************************************************************\\n\");\n\t\tfor (Hand hand : player.getNonBustedHands()) {\n\t\t\tif (hand.getValue() > dealer.getValue()) {\n\t\t\t\t//Player has a better hand. Hand wins.\n\t\t\t\tconsole.println(\"You have a winner hand :\" + hand);\n\t\t\t\tplayer.collect(hand);\n\t\t\t} else {\n\t\t\t\t//Player's hand lose\n\t\t\t\tconsole.println(\"You have a losing hand :\" + hand);\n\t\t\t\tif (hand.getValue() == dealer.getValue()) {\n\t\t\t\t\tconsole.println(\"Remember: in a tie, you lose!\");\n\t\t\t\t}\n\t\t\t\tplayer.pay(hand);\n\t\t\t}\n\t\t}\n\t\tconsole.println(\"\\n*****************************************************************\\n\");\n\t}",
"public UserPlayer(){\n this.playerNum = 0;\n this.isLead = false;\n this.playerHand = new Hand();\n this.suitUserChose = null;\n }",
"public Hand getHand() {\n return hand;\n }",
"public Hand getHand() {\n return hand;\n }",
"@Override\r\n\tpublic void playMonumentCard() {\n\t\t\r\n\t}",
"@Override\n\tpublic void interact(Entity obj) {\n\t\tif (obj instanceof Player) {\n\t\t\tPlayer player = (Player) obj;\n\t\t\tstate = state.pickUp(this, player);\n\t\t}\n\t}",
"private static Sprite makeHuman() {\n Sprite torso = new RectangleSprite(0, 0, 200, 350, 20.0F, false, \"torso\");\n Sprite head = new RectangleSprite(0, 0, 150, 200, 200.0F, true, \"head\");\n Sprite leftUpperLeg = new RectangleSprite(0, 0, 50, 225, 20.0F, true, \"leftupperleg\");\n Sprite rightUpperLeg = new RectangleSprite(0, 0, 50, 225, 20.0F, true, \"rightupperleg\");\n Sprite leftLowerLeg = new RectangleSprite(0, 0, 50, 200, 20.0F, true, \"leftlowerleg\");\n Sprite rightLowerLeg = new RectangleSprite(0, 0, 50, 200, 20.0F, true, \"rightlowerleg\");\n Sprite leftFoot = new RectangleSprite(0, 0, 80, 35, 20.0F, true, \"leftfoot\");\n Sprite rightFoot = new RectangleSprite(0, 0, 80, 35, 20.0F, true, \"rightfoot\");\n Sprite leftUpperArm = new RectangleSprite(0,0, 200, 50, 20.0F, true,\"leftupperarm\");\n Sprite rightUpperArm = new RectangleSprite(0,0, 200, 50, 20.0F, true,\"rightupperarm\");\n Sprite leftLowerArm = new RectangleSprite(0,0, 175, 50, 20.0F, true,\"leftlowerarm\");\n Sprite rightLowerArm = new RectangleSprite(0,0, 175, 50, 20.0F, true,\"rightlowerarm\");\n Sprite leftHand = new RectangleSprite(0, 0, 50, 50, 20.0F, true, \"lefthand\");;\n Sprite rightHand = new RectangleSprite(0, 0, 50, 50, 20.0F, true, \"righthand\");;\n\n // Translate Torso\n Matrix torsoMatrix = new Matrix();\n torsoMatrix.postTranslate(700, 500);\n torso.transform(torsoMatrix);\n\n // Translate Head\n Matrix headMatrix = new Matrix();\n headMatrix.postTranslate(30, -200);\n head.transform(headMatrix);\n\n // Translate Left hand\n Matrix leftHandMatrix = new Matrix();\n leftHandMatrix.postTranslate(-50, 0);\n leftHand.transform(leftHandMatrix);\n\n // Translate Right hand\n Matrix rightHandMatrix = new Matrix();\n rightHandMatrix.postTranslate(175, 0);\n rightHand.transform(rightHandMatrix);\n\n // Translate Left Upper Arm\n Matrix leftUpperArmMatrix = new Matrix();\n leftUpperArmMatrix.postTranslate(-200, 0);\n leftUpperArm.transform(leftUpperArmMatrix);\n\n // Translate Right Upper Arm\n Matrix rightUpperArmMatrix = new Matrix();\n rightUpperArmMatrix.postTranslate(200, 0);\n rightUpperArm.transform(rightUpperArmMatrix);\n\n // Translate Left Lower Arm\n Matrix leftLowerArmMatrix = new Matrix();\n leftLowerArmMatrix.postTranslate(-175, 0);\n leftLowerArm.transform(leftLowerArmMatrix);\n\n // Translate Right Lower Arm\n Matrix rightLowerArmMatrix = new Matrix();\n rightLowerArmMatrix.postTranslate(200, 0);\n rightLowerArm.transform(rightLowerArmMatrix);\n\n // Translate Left Upper Leg\n Matrix leftUpperLegMatrix = new Matrix();\n leftUpperLegMatrix.postTranslate(10, 350);\n leftUpperLeg.transform(leftUpperLegMatrix);\n\n // Translate Right Upper Leg\n Matrix rightUpperLegMatrix = new Matrix();\n rightUpperLegMatrix.postTranslate(140, 350);\n rightUpperLeg.transform(rightUpperLegMatrix);\n\n // Translate Left Lower Leg\n Matrix leftLowerLegMatrix = new Matrix();\n leftLowerLegMatrix.postTranslate(0, 225);\n leftLowerLeg.transform(leftLowerLegMatrix);\n\n // Translate Right Lower Leg\n Matrix rightLowerLegMatrix = new Matrix();\n rightLowerLegMatrix.postTranslate(0, 225);\n rightLowerLeg.transform(rightLowerLegMatrix);\n\n // Translate Left Foot\n Matrix leftFootMatrix = new Matrix();\n leftFootMatrix.postTranslate(-50, 190);\n leftFoot.transform(leftFootMatrix);\n\n // Translate Right Foot\n Matrix rightFootMatrix = new Matrix();\n rightFootMatrix.postTranslate(20, 190);\n rightFoot.transform(rightFootMatrix);\n\n\n // Set Min/Max Rotation for all body parts\n head.max_degree = 50;\n head.min_degree = -50;\n leftUpperLeg.min_degree = -90;\n leftUpperLeg.max_degree = 90;\n rightUpperLeg.min_degree = -90;\n rightUpperLeg.max_degree = 90;\n leftLowerLeg.min_degree = -90;\n leftLowerLeg.max_degree = 90;\n rightLowerLeg.min_degree = -90;\n rightLowerLeg.max_degree = 90;\n leftFoot.min_degree = -35;\n leftFoot.max_degree = 35;\n rightFoot.max_degree = 35;\n rightFoot.min_degree = -35;\n leftLowerArm.min_degree = -135;\n leftLowerArm.max_degree = 135;\n rightLowerArm.min_degree = -135;\n rightLowerArm.max_degree = 135;\n leftHand.min_degree = -35;\n leftHand.max_degree = 35;\n rightHand.min_degree = -35;\n rightHand.max_degree = 35;\n //leftUpperArm.min_degree = -360;\n //leftUpperArm.max_degree = 360;\n\n // Define Torso's children\n torso.addChild(head);\n torso.addChild(leftUpperArm);\n torso.addChild(rightUpperArm);\n torso.addChild(leftUpperLeg);\n torso.addChild(rightUpperLeg);\n\n // Define Upper Arm Children\n leftUpperArm.addChild(leftLowerArm);\n rightUpperArm.addChild(rightLowerArm);\n\n // Define hand Relationship\n leftLowerArm.addChild(leftHand);\n rightLowerArm.addChild(rightHand);\n\n // Define Upper Leg Children\n leftUpperLeg.addChild(leftLowerLeg);\n rightUpperLeg.addChild(rightLowerLeg);\n leftLowerLeg.addChild(leftFoot);\n rightLowerLeg.addChild(rightFoot);\n return torso;\n }",
"@Override\n public void enter() {\n ballPursuit = new Pursuit(player, 1, 1.0, fsmAI.ball);\n player.steeringBehaviorsManager.addBehavior(ballPursuit);\n }",
"public void playTurn() {\r\n\r\n }",
"private void startTurn() {\n \n handsOfCards.clear();\n shuffleAndGiveCards();\n \n Color trump= Color.ALL.get(trumpRng.nextInt(Color.COUNT));\n findFirstPlayer();\n\n for (Map.Entry<PlayerId, Player> pId: players.entrySet()) {\n pId.getValue().setTrump(trump);\n }\n \n if(isFirstTurn) {\n state = TurnState.initial(trump, Score.INITIAL, firstPlayer);\n }\n else {\n state = TurnState.initial(trump, state.score().nextTurn(), firstPlayer);\n }\n }",
"private void play(Poker pokerInstance, int action) {\n if (this.playing) {\n if (action == Poker.ACTION_BET) {\n actionBet(pokerInstance, 50);\n } else if (action == Poker.ACTION_FOLLOW) {\n actionFollow(pokerInstance);\n } else if (action == Poker.ACTION_CHECK) {\n actionCheck();\n } else if (action == Poker.ACTION_BED) {\n actionLeave();\n }\n }\n }",
"public void setAsPlayer(){\n\t\tthis.isPlayer = true;\n\t}"
] | [
"0.698644",
"0.6645504",
"0.6333755",
"0.6260479",
"0.6250391",
"0.6239201",
"0.622043",
"0.6192841",
"0.6158051",
"0.6149951",
"0.6133489",
"0.6033814",
"0.60287327",
"0.6025396",
"0.6001259",
"0.59908724",
"0.5987783",
"0.59252757",
"0.5922857",
"0.591638",
"0.5877568",
"0.58662504",
"0.58527195",
"0.5839178",
"0.5827307",
"0.58214796",
"0.5820117",
"0.58108044",
"0.58041155",
"0.5782281",
"0.5765069",
"0.5762089",
"0.57614523",
"0.5756231",
"0.57515454",
"0.5746058",
"0.57380325",
"0.5724807",
"0.5723907",
"0.57201564",
"0.57091403",
"0.5709075",
"0.57028615",
"0.56954867",
"0.5690615",
"0.5688525",
"0.5678123",
"0.5677965",
"0.5672562",
"0.5671475",
"0.5669816",
"0.5668049",
"0.5666355",
"0.56555796",
"0.5653128",
"0.5635156",
"0.56346387",
"0.5622644",
"0.56222844",
"0.5601131",
"0.5599741",
"0.55903333",
"0.559026",
"0.5589393",
"0.5588074",
"0.5587268",
"0.5581767",
"0.5581015",
"0.55645996",
"0.55592406",
"0.555688",
"0.5548655",
"0.55426884",
"0.5541564",
"0.5536919",
"0.553226",
"0.5530555",
"0.55291086",
"0.552152",
"0.550785",
"0.55038047",
"0.54973495",
"0.54962844",
"0.5494046",
"0.5490036",
"0.5486655",
"0.5486653",
"0.5486605",
"0.5480147",
"0.54760265",
"0.5474938",
"0.5469825",
"0.5469825",
"0.54635257",
"0.5457904",
"0.5457173",
"0.54558825",
"0.54546577",
"0.54518163",
"0.5450726",
"0.5450647"
] | 0.0 | -1 |
/ View view1 = new GUIView(); View view2 = new GUIView(); View view3 = new GUIView(); view1.connect("P1","127.0.0.1", Constants.SOCKET, "1"); view2.connect("P2","127.0.0.1", Constants.SOCKET, "1"); view3.connect("P3","127.0.0.1", Constants.SOCKET, "1"); Thread.sleep(6000); view1.getPlayerInput().put(Constants.POWERUP, Arrays.asList("Red_Newton")); | @Test
public void testServerApp() throws InterruptedException {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void multiPlayerChosen(){\n IP = view.ipTF.getText();\n ConnectingViewController connecting = new ConnectingViewController(this, IP);\n connecting.showView();\n this.hideView();\n }",
"public interface View {\n /**\n * Prints that Client lost the connection to Server and quits the application\n */\n void serverLostConnection();\n\n /**\n * Asks User for Server's IP address and Port\n */\n void askServerInfo();\n\n /**\n * Asks User for setting up a Username\n */\n void askUsername();\n\n /**\n * Asks user for Game modality: single player, create a multi player lobby or join to a lobby\n */\n void askMenu();\n\n /**Prints to the lobby members that a Player joined it\n * @param username the new Joiner's username\n */\n void notifyPlayerJoined(String username);\n\n /**\n * runs the waitStartGameString() method\n */\n void askStartGame();\n\n /**\n * Wait for Lobby Owner digit \"START\"/\"start\" and then calls LightController method to start the MultiPlayer Game\n */\n void waitStartGameString();\n\n /**\n * Notifies the Lobby Owner that Server successfully created the Lobby\n */\n void showCreatorWaitingRoom();\n\n /**Notifies the User that successfully joined to the Lobby and prints the list of members\n * @param usernames the Lobby Member's username ArrayList\n */\n void showWaitingRoom(ArrayList<String> usernames);\n\n /**\n * Shows to disconnected User that LightController is trying to reconnect to Server\n */\n void showReconnectionToGame();\n\n /**\n * Shows to User to wait it's turn in a Multi Player Game session\n */\n void waitingForMyTurn();\n\n /**Prints the available Lobby list in Server with their relatives ID\n * @param lobbies a Lobby ArrayList\n */\n void askLobbyID(ArrayList<Lobby> lobbies);\n\n /**Notifies to all others Users that a Player is disconnected\n * @param username the disconnected Player's username\n */\n void notifyPlayerDisconnected(String username);\n\n /**Notifies to all others Users that a Player is reconnected\n * @param username the reconnected Player's username\n */\n void notifyPlayerReconnected(String username);\n\n /**Notifies to all others Users that the Lobby Creator is disconnected\n */\n void notifyCreatorDisconnected();\n\n /**Asks to User to choose 2 of 4 LightLeaderCard received by LightController\n * and eventually 0 to 2 LightResources\n * @param quartet the 4-length LightLeaderCards ArrayList\n * @param numResources the number of Resources user has to choose\n * @param faithPoints true if User's Player has earned a FaithPoint\n */\n void askStartItems(ArrayList<LightLeaderCard> quartet, int numResources, boolean faithPoints);\n\n /**Asks User to do an action in the turn\n */\n void askTurn();\n\n /**\n * Prints the menu to calls LightController method to ask for a LeaderCard activation\n */\n void askLeaderCardActivation();\n\n /**\n * Prints the menu to calls LightController method to ask for a LeaderCard threw\n */\n void askLeaderCardThrowing();\n\n /**\n * Prints the menu to calls LightController method to ask for a Resources purchase at the Market\n */\n void askBuyResources();\n\n /**\n * Prints the menu to calls LightController method to ask for a DevelopmentCard purchase at the Market\n */\n void askBuyDevCards();\n\n /**\n * Prints the menu to calls LightController method to ask for a DevelopmentCard production\n */\n void askDevCardProduction();\n\n /**\n * Prints the menu to calls LightController method to ask for a DevelopmentBoard production\n */\n void askDefaultProduction();\n\n /**\n * Calls the LightController method to end the turn\n */\n void askEndTurn();\n\n /**Notifies the User of the Resources list purchased from the Market that were not added to Warehouse\n * @param threwResources a LightResource ArrayList\n */\n void showThrewResources(ArrayList<LightResource> threwResources);\n\n /**Shows an error message\n * @param message a String containing the message\n */\n void showError(String message);\n\n /**Shows a success message\n * @param message a String containing the message\n */\n void showSuccess(String message);\n\n /**Shows the Multi Player Game session winner, the final rank and quits the application\n * @param winner the winner Player's username\n * @param rank a String containing the final rank\n */\n void showRanking(String winner, String rank);\n\n /**Shows the final message in Single Player session and quit the application\n * @param message a String containing if the User won against Lorenzo or not\n */\n void endSinglePlayerGame(String message);\n\n /**\n * Quits the application\n */\n void endGame();\n\n /**Shows others Player action relatives to turn starting and turn ending\n * @param message a String containing\n */\n void showOthersActions(String message);\n\n /**Shows the Lorenzo actions in the Single player Game session\n * @param lollo the LightLorenzo instance containing all the actions it did in its turn\n */\n void showLorenzoActions(LightLorenzo lollo);\n\n /**Shows the new Player's CardSlots to all Users\n * @param username the LightPlayer's username\n * @param cardSlots the LightPlayer's new LightCardSlots\n */\n void updateCardSlots(String username, LightCardSlots cardSlots);\n\n /**Shows the new Player's WarehouseDepot to all Users\n * @param username the LightPlayer's username\n * @param warehouseDepot the LightPlayer's new LightWarehouseDepot\n */\n void updateWarehouseDepot(String username, LightWarehouseDepot warehouseDepot);\n\n /**Shows the new Player's Strongbox to all Users\n * @param username the LightPlayer's username\n * @param strongbox the LightPlayer's new LightStrongbox\n */\n void updateStrongbox(String username, LightStrongbox strongbox);\n\n /**Shows the new Player's FaithTrack to all Users\n * @param username the LightPlayer's username\n * @param faithTrack the LightPlayer's new LightFaithTrack\n */\n void updateFaithTrack(String username, LightFaithTrack faithTrack);\n\n /**Shows the new Player's LeaderSlot to all Users\n * @param username the LightPlayer's username\n * @param leaderSlot the LightPlayer's new LightLeaderCards\n */\n void updateLeaderSlot(String username, ArrayList<LightLeaderCard> leaderSlot);\n\n /**Shows the new LightDevelopmentBoard\n * @param board a LightDevelopmentBoard instance\n */\n void updateDevBoard(LightDevelopmentBoard board);\n\n /**Shows the new LightMarketBoard\n * @param market a LightMarket instance\n */\n void updateMarketBoard(LightMarketBoard market);\n}",
"private static void createAndShowGUI() {\n\t\t\t\t// GUIView Moves\n\t\t\t\tGUIViewMoves guiViewMoves = new GUIViewMoves();\n\t\t\t\t\n\t\t\t\t// GUIView Jugs, center the jugs\n\t\t\t\tGUIViewJugs guiViewJug0 = new GUIViewJugs(0);\n\t\t\t\tguiViewJug0.setHorizontalAlignment(JLabel.CENTER);\n\t\t\t\tguiViewJug0.setVerticalAlignment(JLabel.CENTER);; \n\t\t\t \n\t\t\t\tGUIViewJugs guiViewJug1 = new GUIViewJugs(1); \n\t\t\t\tguiViewJug1.setHorizontalAlignment(JLabel.CENTER);\n\t\t\t\tguiViewJug1.setVerticalAlignment(JLabel.CENTER);\n\t\t\t \n\t\t\t\tGUIViewJugs guiViewJug2 = new GUIViewJugs(2); \n\t\t\t\tguiViewJug2.setHorizontalAlignment(JLabel.CENTER);\n\t\t\t\tguiViewJug2.setVerticalAlignment(JLabel.CENTER);\n\t\t\t\n\t\t\t\t// Model\n\t\t\t\tJugPuzzle model = new JugPuzzle();\n\n\t\t\t\t// Hook the model to the view.\n\t\t\t\tmodel.addObserver(guiViewMoves);\n\t\t\t\tmodel.addObserver(guiViewJug0);\n\t\t\t\tmodel.addObserver(guiViewJug1);\n\t\t\t\tmodel.addObserver(guiViewJug2);\n\t\t\t\t\n\t\t\t\t// Create frame.\n\t\t\t\tJFrame frame = new JFrame(\"Jug Game!\");\n\t\t\n\t\t\t\t// Close option.\n\t\t\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\t\t\t\n\t\t\t\t// Create two panels, one for the moves and the other for the buttons.\n\t\t\t\t// Labels and buttons go on the grid panel and the moves and restart/quit buttons go on the other panel.\n\t\t\t\tJPanel movesAndButtons = new JPanel();\n\t\t\t\tJPanel grid = new JPanel();\n\t\t\t\t\n\t\t\t\t// A container.\n\t\t\t\tContainer c = frame.getContentPane();\n\t\t\t\t\n\t\t\t\t// Layout for the grid.\n\t\t\t\tGridLayout topGrid = new GridLayout(2,3);\n\t\t\t\tgrid.setLayout(topGrid);\n\t\t\t\t\n\t\t\t\t// Layout for the buttons and moves.\n\t\t\t\tmovesAndButtons.setLayout(new BoxLayout(movesAndButtons, FlowLayout.CENTER));\n\n\t\t\t\t// Panels for buttons and moves.\n\t\t\t\tJPanel movesPanel = new JPanel(); // Moves panel, GUI View.\n\t\t\t\tJPanel quitRestartPanel = new JPanel(); // Quit and Restart panel.\n\t\n\t\t\t\t// Add panels to the layout.\n\t\t\t\tmovesAndButtons.add(movesPanel, BorderLayout.SOUTH);\n\t\t\t\tmovesAndButtons.add(quitRestartPanel, BorderLayout.NORTH);\n\t\t\t\tJButton restart, quit, eight, five, three;\n\t\t\t\n\t\t\t // Initialize buttons,\n\t\t\t\teight = new JButton(\"8\");\n\t\t\t five = new JButton(\"5\");\n\t\t\t three = new JButton(\"3\");\n\t\t\t restart = new JButton(\"Restart\");\n\t\t\t quit = new JButton(\"Quit\");\n\t\t\t \n\t\t\t // Add to grid.\n\t\t\t grid.add(guiViewJug0);\n\t\t\t grid.add(guiViewJug1);\n\t\t\t grid.add(guiViewJug2);\n\t\t\t grid.add(eight);\n\t\t\t grid.add(five);\n\t\t\t grid.add(three);\n\t\t\t\t\n\t\t\t\t// Add to the panels.\n\t\t\t movesPanel.add(guiViewMoves);\n\t\t\t\tquitRestartPanel.add(restart);\n\t\t\t\tquitRestartPanel.add(quit);\n\t\t\t\t\n\t\t\t\t// Add the container which adds to the frame.\n\t\t\t\tc.add(grid, BorderLayout.NORTH);\n\t\t\t\tc.add(movesAndButtons, BorderLayout.SOUTH);\n\t\t\t\t\n\t\t\t\t// ActionListeners \n\t\t\t\tJugPuzzleActionListener e = new JugPuzzleActionListener(model);\n\t\t\t\tQuitActionListener end = new QuitActionListener();\n\t\t\t\tRestartActionListener fresh = new RestartActionListener();\n\t\t\t\t\n\t\t\t\teight.addActionListener(e);\n\t\t\t\teight.setActionCommand(\"0\");\n\t\t\t\t\n\t\t\t\tfive.addActionListener(e);\n\t\t\t\tfive.setActionCommand(\"1\");\n\t\t\t\t\n\t\t\t\tthree.addActionListener(e);\n\t\t\t\tthree.setActionCommand(\"2\");\n\t\t\t\t\n\t\t\t\trestart.addActionListener(fresh);\n\t\t\t\tquit.addActionListener(end);\n\t\t\t\t\n\t\t\t\t// Pack and see frame\n\t\t\t\tframe.pack();\n\t\t\t\tframe.setSize(480, 150);\n\t\t\t\tframe.setResizable(false);\n\t\t\t\tframe.setVisible(true);\t\n\t\t\t}",
"public MainMenuController()\n {\n ArrayList<JButton> menuList = new ArrayList();\n \n //Setup default colors\n player1Color = Color.RED;\n player2Color = Color.BLUE;\n \n //Setup the start button\n startButton = new JButton(\"Start\");\n startButton.setBackground(Color.GREEN);\n menuList.add(startButton);\n \n startButton.addActionListener((ActionEvent ae) -> {\n uControll = new UltimateController();\n uControll.start(player1Color, player2Color);\n this.setupGameWindow();\n menuPanel.close();\n });\n \n //Setup multiplayer button\n JButton multiButton = new JButton(\"Network Play\");\n multiButton.setBackground(new Color(0,255,200));\n menuList.add(multiButton);\n multiButton.addActionListener((ActionEvent ae) -> {\n View.Multiplayer mp = new View.Multiplayer();\n mp.setParentWindow(menuPanel);\n mp.launchWindow();\n menuPanel.close();\n });\n \n //Setup the settings button\n JButton settingButton = new JButton(\"Settings\");\n settingButton.setBackground(Color.orange);\n menuList.add(settingButton);\n settingButton.addActionListener((ActionEvent ae) -> {\n setGUI = new View.SettingGUI(player1Color, player2Color);\n setupSettingWindow();\n });\n \n //Setup the how to play button\n howToButton = new JButton(\"How to Play\");\n howToButton.setBackground(Color.LIGHT_GRAY);\n menuList.add(howToButton);\n howToButton.addActionListener((ActionEvent ae) -> {\n //Create a frame\n JFrame newWindow = new JFrame(\"How to Play\"); \n View.HowToPlayPanel hPlay = new View.HowToPlayPanel();\n newWindow.add(hPlay);\n newWindow.setSize(1200,550);\n \n //Make the return button work\n hPlay.getReturnBtn().addActionListener((ActionEvent ae2) -> {\n newWindow.dispose();\n });\n \n newWindow.setVisible(true);\n newWindow.requestFocus();\n });\n \n //Setup the Quit button\n quitButton = new JButton(\"Quit\");\n quitButton.setBackground(Color.RED);\n menuList.add(quitButton);\n \n quitButton.addActionListener((ActionEvent ae) -> {\n System.out.println(\"Quit the program\");\n System.exit(0);\n });\n \n startButton.setBounds(570, 300, 120, 45);\n howToButton.setBounds(570, 375, 120, 45);\n quitButton.setBounds(570, 450, 120, 45);\n \n menuPanel = new MenuPanel(menuList);\n }",
"public void connectRobot(View view) {\n Button connectButton = (Button) view;\n LinearLayout robotInfo = (LinearLayout) findViewById(R.id.robotInfo);\n if (networkThread == null || !networkThread.connected()) {\n // Get IP from dropdown list\n Spinner dropdown = (Spinner) findViewById(R.id.robotsDropdown);\n String IP = (String) dropdown.getSelectedItem();\n if (IP == null) {\n return;\n }\n // Start thread with robot connection\n networkThread = NetworkThread.getInstance();\n networkThread.setIP(IP);\n networkThread.setHandler(handler);\n new Thread(networkThread).start();\n\n // Change button text and show robot info if connected\n if (networkThread != null && networkThread.connected()) {\n // Get info from the robot\n JSONObject json = new JSONObject();\n try {\n json.put(\"type\", \"info\");\n } catch (JSONException e) {\n e.printStackTrace();\n }\n networkThread.addToSend(json);\n\n connectButton.setText(\"Disconnect\");\n robotInfo.setVisibility(View.VISIBLE);\n }\n } else {\n // Close thread\n if (networkThread != null) {\n networkThread.closeThread();\n }\n // Change button text and hide robot info\n connectButton.setText(\"Connect\");\n robotInfo.setVisibility(View.INVISIBLE);\n }\n }",
"public interface View extends Task {\r\n\r\n\tpublic void setUserPoints();\r\n\t/**\r\n\t * <h1> startView <h1> <p>\r\n\t * start conversation\r\n\t */\r\n\tpublic void startView() throws IOException;\r\n\t\r\n\t/**\r\n\t * <h1> displayCurrentState<h1> <p>\r\n\t * redraw canvas and show the new state\r\n\t * \r\n\t */\r\n\tpublic void displayCurrentState(State game);\r\n\t\r\n\t/**\r\n\t * return user action\r\n\t */\r\n\tpublic String getUserAction();\r\n\t\r\n\t/**\r\n\t * <h1>gameOver<h1><p>\r\n\t * print if the game is over\r\n\t */\r\n\tpublic void gameOver(int gameOver);\r\n\t\r\n\tpublic void printHint(String hint);\r\n\t\r\n\t/**\r\n\t * <h1> setButtonSelection <h1>\r\n\t * get message from canvas which button selected\r\n\t * \r\n\t */\r\n\tpublic void setButtonSelection(String action);\r\n\t\r\n\t/**\r\n\t * <h1> changeLableText <h1><p>\r\n\t * get score of Reversi game add show score on window \r\n\t */\r\n\tpublic void changeLableText(int playerScore,int computerScore);\r\n\t\r\n\tpublic void getExeptionMessage(String message);\r\n\t\r\n\t/**\r\n\t * insert properties\r\n\t */\r\n\tpublic void insertProperties();\r\n}",
"public void processConnection() {\n\t\texecutorService.execute(() -> {\n\t\t\twhile (true) {\n\t\t\t\ttry {\n\t String msg = input.readLine();\n\t \n\t if (msg != null) {\n\t\t if(msg.startsWith(Constants.GAMESTART)) {\t\t\t\t\t// Makes the gameClientUIController if the message\n\t\t \tPlatform.runLater(() -> {\t\t\t\t\t\t\t\t// \"gamestart\" is recived from the gameserver.\n\t\t \t\tint n = Integer.parseInt(msg.substring(10, 11));\t// and sets the connection to the game controller\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t \t\t\tFXMLLoader loader = new FXMLLoader();\n\t \t\t\ttry {\n\t\t \t\t\tfor (int i=0; i<Main.gameTabs.getTabs().size(); i++) {\n\t\t \t\t\t\tif (Main.gameTabs.getTabs().get(i).getId().equals(hostName)) {\n\t\t \t\t\t\t\tMain.gameTabs.getTabs().get(i).setContent(\n\t\t \t\t\t\t\t\t\tloader.load(getClass().getResource(\"GameClient.fxml\").openStream()));\n\t\t \t\t\t\t\tgameClientUIController = loader.getController();\n\t\t\t \t\t\t\tgameClientUIController.setConnetion(output, input);\n\t\t\t \t\t\t\tgameClientUIController.setPlayer(n);\n\t\t \t\t\t\t}\n\t\t \t\t\t}\n\t \t\t\t} catch (IOException e) {\n\t \t\t\t\tMain.LOGGER.log(Level.WARNING, \"Unable to receive message from server\", e);\n\t \t\t\t}\t\n\t\t \t});\n\t\t }\n\t\t else if(msg.startsWith(Constants.GAMENAME)) {\n\t\t\t\t\t\t\tPlatform.runLater(() -> {\n\t\t\t\t\t\t\t\tint n = Integer.parseInt(msg.substring(9, 10));\n\t \t\t\tString tmpNavn = msg.substring(10, msg.length());\n\t \t\t\tgameClientUIController.setPlayerName(n, tmpNavn); \t\t\n\t\t\t\t\t\t\t});\n\t\t }\n\t\t else if(msg.startsWith(Constants.DICEVALUE)) {\n\t\t\t\t\t\t\tPlatform.runLater(() -> {\n\t\t\t\t\t\t\t\tint diceVal = Integer.parseInt(msg.substring(10,11));\n\t \t\t\tint player = Integer.parseInt(msg.substring(11,12));\n\t\t\t \tint pawn = Integer.parseInt(msg.substring(12,13));\n\t\t\t \tgameClientUIController.getDiceValue(diceVal, player, pawn);\n\t\t \t});\n\t\t }\n\t\t else if(msg.startsWith(Constants.DISCONNECT)) {\n\t\t \tPlatform.runLater(() -> {\n\t\t \t\tint player = Integer.parseInt(msg.substring(11,12));\n\t\t \t\tgameClientUIController.setPlayerDisconnect(player);\n\t\t \t});\n\t\t }\n\t\t else if(msg.startsWith(Constants.GAMEOVER)) {\n\t\t\t\t\t\t\tPlatform.runLater(() -> {\n\t\t\t\t\t\t\t\tgameClientUIController.gameover();\t\n\t\t \t});\n\t\t }\n\t\t else if (msg.startsWith(Constants.JOIN)) {\n\t\t \tif (!msg.substring(5).equals(hostName.substring(4))) {\n\t\t \t\tPlatform.runLater(() -> {\n\t\t\t\t \tswitch (caseNr) {\n\t\t\t\t \tcase 1: \t\t\t\t\t\n\t\t\t\t \t\tcreateGameLobbyController.cleanUp(msg.substring(5));\t// Adds the player name to the lobby\n\t\t\t\t \t\tbreak;\n\t\t\t\t \tcase 2: \n\t\t\t\t\t\t\t\t\t\thostGameLobbyController.cleanUp(msg.substring(5));\n\t\t\t\t \t\tbreak;\n\t\t\t\t \tcase 3: \n\t\t\t\t\t\t\t\t\t\tplayerGameLobbyController.cleanUp(msg.substring(5));\t\n\t\t\t\t \t\tbreak;\n\t\t\t\t \tdefault: break;\n\t\t\t\t \t}\n\t\t \t\t});\n\t\t \t}\n\t\t }\n\t\t else if (msg.startsWith(Constants.LEAVEGAME)) {\n\t\t \tPlatform.runLater(() -> {\n\t\t\t \tswitch (caseNr) {\n\t\t\t \tcase 1: \t\t\t\t\t\n\t\t\t \t\tcreateGameLobbyController.cleanRemove(msg.substring(10));\t//removes the player from lobby\n\t\t\t \t\tbreak;\n\t\t\t \tcase 2: \n\t\t\t\t\t\t\t\t\thostGameLobbyController.cleanRemove(msg.substring(10));\n\t\t\t \t\tbreak;\n\t\t\t \tcase 3: \n\t\t\t\t\t\t\t\t\tplayerGameLobbyController.cleanRemove(msg.substring(10));\t\n\t\t\t \t\tbreak;\n\t\t\t \tdefault: break;\n\t\t\t \t}\n\t \t\t});\n\t\t }\n\t\t else if (msg.equals(Constants.QUITGAME)) {\n\t\t \tfor (int i=0; i<Main.gameHandler.size(); i++) {\n\t\t \t\tif (Main.gameHandler.get(i).getHostName().equals(hostName)) {\n\t\t \t\t\tMain.gameHandler.get(i).closeTab();\n\t\t\t\t }\n\t\t \t}\n\t\t }\n\t\t Thread.sleep(250);\n\t } \n\t } catch (IOException ioe) {\n\t \tMain.LOGGER.log(Level.WARNING, \"Unable to receive message from server\", ioe);\n\t } catch (Exception e) {\n\t\t\t\t\tMain.LOGGER.log(Level.WARNING, \"Unable to sleep\", e);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}",
"GameGUI() {\r\n _randomSource = new Random();\r\n _players = new Player[2];\r\n _input = new BufferedReader(new InputStreamReader(System.in));\r\n _players[0] = new HumanPlayer(BP, this);\r\n _players[1] = new MachinePlayer(WP, this);\r\n _playing = false;\r\n }",
"public void onStartNewGame(View view) {\n\n grid.setVisibility(View.VISIBLE);\n\n button1.setText(\"·\");\n button2.setText(\"·\");\n button3.setText(\"·\");\n button4.setText(\"·\");\n button5.setText(\"·\");\n button6.setText(\"·\");\n button7.setText(\"·\");\n button8.setText(\"·\");\n button9.setText(\"·\");\n }",
"public void doNewGame(View view) {\n mainHelper.restart();\n }",
"@Override\n public void run(){\n Settings.setGameSettings(new Player(0,Color.RED,1800, \"Player 1\",true),\n new Player(1,Color.BLUE,1800, \"Player 2\",false),1800,25);\n MenuFrame menuFrame = new MenuFrame();\n }",
"public NetGameView() {\n\t\tnet = new Net(0, 0);\n\t\tt = new Text(\"\" + score);\n\t\tFont font = Font.font(\"Verdana\", FontWeight.EXTRA_BOLD, 50);\n\t\tt.setFont(font);\n\t\tButton mapButton = new Button(\"Return\");\n\t\tButton tutorial = new Button(\"Show Tutorial\");\n\t\tGroup root = new Group();\n\t\tgameThree = new Scene(root);\n\t\tfishAlert.getDialogPane().setMinHeight(Region.USE_PREF_SIZE);\n\t\tenemyAlert.getDialogPane().setMinHeight(Region.USE_PREF_SIZE);\n\t\ttrashAlert.getDialogPane().setMinHeight(Region.USE_PREF_SIZE);\n\t\tcontrolAlert.getDialogPane().setMinHeight(Region.USE_PREF_SIZE);\n\t\tfishAlert.setGraphic(new ImageView(new Image(\"Game_Sprites/fish_bass_left.png\")));\n\t\tenemyAlert.setGraphic(new ImageView(new Image(\"Game_Sprites/fish_catfish_left_0.png\")));\n\t\ttrashAlert.setGraphic(new ImageView(new Image(\"Game_Sprites/trashbag.png\")));\n\t\t\n\t\t\n\t\troot.addEventFilter(MouseEvent.MOUSE_MOVED, e -> {\n\t\t\t// System.out.println(e.getSceneX() + \" \" + e.getSceneY());\n\t\t\tnet.setX(e.getSceneX() - 140);\n\t\t\tnet.setY(e.getSceneY() - 140);\n\n\t\t});\n\n\t\tCanvas canvas = new Canvas(canvasWidth, canvasHeight);\n\t\troot.getChildren().add(canvas);\n\n\t\tmapButton.setOnAction(new EventHandler<ActionEvent>() {\n\t\t\tpublic void handle(ActionEvent e) {\n\t\t\t\tgameLevel = Level.MAP;\n\n\t\t\t}\n\t\t});\n\t\ttutorial.setOnAction(new EventHandler<ActionEvent>() {\n\t\t\tpublic void handle(ActionEvent e) {\n\t\t\t\tcontrolAlert.showAndWait();\n\t\t\t\talert4 = false;\n\t\t\t\tfishAlert.showAndWait();\n\t\t\t\talert1 = false;\n\t\t\t\tenemyAlert.showAndWait();\n\t\t\t\talert2 = false;\n\t\t\t\ttrashAlert.showAndWait();\n\t\t\t\talert3 = false;\n\t\t\t\tscore = 0;\n\t\t\t}\n\t\t});\n\t\tcontrolAlert.initOwner(gameThree.getWindow());\n\t\t\n\t\tfishAlert.setContentText(\"Avoid removing Bass from their natural habitat through irresponsible fishing. Picking up these will lose you points.\");\n\t\tenemyAlert.setContentText(\"Catfish are a known invasive species in the estuary, remove them by using the net! Picking up these will gain you points.\");\n\t\ttrashAlert.setContentText(\"Trash and other pollutants litter the esturary, do your part and help clean it up! Picking up these will gain you points.\");\n\t\tcontrolAlert.setContentText(\"Remove fish and trash by moving the net over the item you want to pick up\");\n\t\t\n\t\troot.getChildren().add(mapButton);\n\t\troot.getChildren().add(tutorial);\n\t\ttutorial.setTranslateX(50);\n\t\ttutorial.setTranslateY(50);\n\t\tmapButton.setTranslateX(50);\n\t\tmapButton.setTranslateY(80);\n\t\tmapButton.setVisible(true);\n\n\t\tgc = canvas.getGraphicsContext2D();\n\n\t\tfor (int i = 0; i < 5; i++) {\n\t\t\tcollectables.add(new NormalFishCollect());\n\t\t}\n\t\tfor (int i = 0; i < 5; i++) {\n\t\t\tenemies.add(new EnemyFishCollect());\n\t\t}\n\t\tfor (int i = 0; i < 5; i++) {\n\t\t\ttrashList.add(new TrashCollect());\n\t\t}\n\n\t\timportImages();\n\t\troot.getChildren().add(t);\n\t\tt.setTranslateX(20);\n\t\tt.setTranslateY(40);\n\n\t}",
"@Override\n public void send(Gui view) {\n view.update(this);\n }",
"public TTTDemo() {\n\t \n \tsetDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n \tgetContentPane().setLayout(null);\n \tsetBounds(450, 250, 250, 175);\n\n\n\t\tplayer1OptionsView1 = new JRadioButton(\"View 1\");\n\t\tplayer1OptionsView1.setBounds(6, 46, 109, 23);\n\t\tplayer1OptionsView1.setSelected(true);\n\t\n\t\tplayer1OptionsView2 = new JRadioButton(\"View 2\");\n\t\tplayer1OptionsView2.setBounds(6, 72, 109, 23);\n\t\tplayer1OptionsView2.setSelected(false);\n\n\t\tplayer2OptionsView1 = new JRadioButton(\"View 1\");\n\t\tplayer2OptionsView1.setBounds(117, 46, 109, 23);\n\t\tplayer2OptionsView1.setSelected(true);\n\t\n\t\tplayer2OptionsView2 = new JRadioButton(\"View 2\");\n\t\tplayer2OptionsView2.setBounds(117, 72, 109, 23);\n\t\tplayer2OptionsView2.setSelected(false);\n\n\t\tJButton startGameBtn = new JButton(\"Start Game\");\n\t\tstartGameBtn.setBounds(10, 103, 214, 23);\n\t\tstartGameBtn.addActionListener(this);\n\t\t\n\t\tJLabel lblNewLabel1 = new JLabel(\"Player 1:\");\n\t\tlblNewLabel1.setBounds(10, 11, 60, 14);\n\t\t\n\t\tJLabel lblNewLabel2 = new JLabel(\"Player 2:\");\n\t\tlblNewLabel2.setBounds(121, 11, 60, 14);\n\t\n\t\tplayer1Options = new ButtonGroup();\n\t\tplayer1Options.add(player1OptionsView1);\n\t\tplayer1Options.add(player1OptionsView2);\n\n\t\tplayer2Options = new ButtonGroup();\n\t\tplayer2Options.add(player2OptionsView1);\n\t\tplayer2Options.add(player2OptionsView2);\n\t\n\t\tgetContentPane().add(player1OptionsView1);\n\t\tgetContentPane().add(player1OptionsView2);\n\t\tgetContentPane().add(player2OptionsView1);\n\t\tgetContentPane().add(player2OptionsView2);\n\t\t\n\t\tgetContentPane().add(startGameBtn);\n\t\tgetContentPane().add(lblNewLabel1);\n\t\tgetContentPane().add(lblNewLabel2);\n\n\t\tsetResizable(false);\n setVisible(true);\n }",
"private static void go_play()throws AWTException {\n\t\ttry{\r\n\t\t\t//Robot robot = new Robot();\r\n\r\n\t\t\trobot.keyPress(KeyEvent.VK_SPACE);\r\n\t\t\trobot.keyRelease(KeyEvent.VK_SPACE);\r\n\t\t}\r\n\t\tcatch(IllegalArgumentException e1) {\r\n\t\t\tSystem.err.println(\"Use: java Renderer <Local IPAddress> <Localport> <Remote IPAddress> <Remote Port>\");\r\n\t\t}\r\n\r\n\t}",
"void showReconnectionToGame();",
"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 void singlePlayerChosen(){\n DifficultyViewController dif = new DifficultyViewController(this);\n dif.showView();\n this.hideView();\n }",
"public void start() {\n // set player number\n playerNumber = clientTUI.getInt(\"set player number (2-4):\");\n while (true) {\n try {\n game = new Game();\n game.setPlayerNumber(playerNumber - 1);\n host = this.clientTUI.getString(\"server IP address:\");\n port = this.clientTUI.getInt(\"server port number:\");\n clientName = this.clientTUI.getString(\"your name:\");\n player = clientTUI.getBoolean(\"are you human (or AI): (true/false)\") ?\n new HumanPlayer(clientName) : new ComputerPlayer(clientName);\n game.join(player);\n // initialize the game\n game.init();\n while (clientName.indexOf(' ') >= 0) {\n clientName = this.clientTUI.getString(\"re-input your name without space:\");\n }\n this.createConnection();\n this.sendJoin(clientName);\n this.handleJoin();\n if (handshake) {\n run();\n } else {\n if (!this.clientTUI.getBoolean(\"Do you want to open a new connection?\")) {\n shutdown();\n break;\n }\n }\n } catch (ServerUnavailableException e) {\n clientTUI.showMessage(\"A ServerUnavailableException error occurred: \" + e.getMessage());\n if (!clientTUI.getBoolean(\"Do you want to open a new connection?\")) {\n shutdown();\n break;\n }\n }\n }\n clientTUI.showMessage(\"Exiting...\");\n }",
"public Connect4View() {\n\t\tgame = new TilePane();\n\t\tcontroller = new SingleController(game);\n\t\tcontroller.getModel().addObserver(this);\n\t\tgameFinished = false;\n\t}",
"public void start(Stage primaryStage, MainMenuGUI mainMenuGUI, Socket socket) {\n stage = primaryStage;\n this.mainMenuGUI = mainMenuGUI;\n this.socket = socket;\n\n BorderPane borderPane = new BorderPane();\n\n ToolBar toolBar = new ToolBar();\n\n Button backButton = new Button(\"Back\");\n backButton.setOnAction(event -> mainMenuGUI.start());\n\n toolBar.getItems().add(backButton);\n\n Separator separator = new Separator();\n separator.setOrientation(Orientation.VERTICAL);\n\n VBox vBox = new VBox();\n vBox.setAlignment(Pos.CENTER);\n HBox hBox = new HBox();\n hBox.setPadding(new Insets(0, 0, 0, 13));\n hBox.prefWidthProperty().bind(toolBar.widthProperty().subtract(60));\n\n Label roomCodeLabel = new Label(\"Game code: \");\n roomCodeLabel.setAlignment(Pos.CENTER);\n roomCodeLabel.setFont(Font.font(\"Arial\", FontWeight.LIGHT, 20));\n\n TextField textField = new TextField();\n textField.setPrefWidth(92);\n\n Button buttonJoinGame = new Button(\"Join game\");\n buttonJoinGame.setAlignment(Pos.CENTER);\n buttonJoinGame.setOnAction(event -> joinGameRoom(textField.getText()));\n\n Separator separator2 = new Separator();\n separator2.setOrientation(Orientation.VERTICAL);\n\n Button buttonRefreshGames = new Button(\"Refresh games \");\n buttonRefreshGames.setOnAction(event -> setAvailableGames());\n\n hBox.getChildren().addAll(separator, roomCodeLabel, textField, buttonJoinGame, separator2, buttonRefreshGames);\n hBox.setSpacing(8);\n\n borderPane.setTop(toolBar);\n\n Label joinPublicGame = new Label(\"Public games\");\n joinPublicGame.setTextAlignment(TextAlignment.CENTER);\n joinPublicGame.setFont(Font.font(\"Arial\", FontWeight.BOLD, 30));\n\n listView = new ListView<>();\n\n setAvailableGames();\n\n toolBar.getItems().add(hBox);\n\n vBox.getChildren().addAll(joinPublicGame, listView);\n vBox.setPadding(new Insets(10));\n\n borderPane.setCenter(vBox);\n\n Scene scene = new Scene(borderPane, 500, 490);\n stage.setTitle(\"Join game\");\n stage.setScene(scene);\n stage.show();\n }",
"public void prepareTheGame(){\n Thread t=new Thread( () -> {\n System.out.println(\"Preparing the game of lobby number \" + lobbyID);\n Collections.shuffle(nicknames);\n\n Controller controller = new Controller(nicknames, view);\n\n view.setController(controller);\n view.setClientConnectionToController();\n\n controller.play();\n }\n );\n\n t.start();\n }",
"public void updateUI(){\n\t\t\n\t\ttimeTV.setText(\"\"+String.format(\"\" + gameClock%10));\n\t\ttimeTV2.setText(\"\"+ gameClock/10+\".\");\n\t\tif (currentGameEngine!=null) {\n\t\t\tmultLeft.setText(\"multiplier: \"+currentGameEngine.getMultiplier()+\"X\");\n\t\t\tscoreTV.setText(\"\"+currentGameEngine.getScore());\n\t\t} else {\n\t\t\tscoreTV.setText(\"0\");\n\t\t}\n\n\t\t//errorTV.setText(\"\"+mFrameNum);\n\t\t\n\t\t\n\t}",
"public void run() {\r\n\t\twhile(true) {\r\n\t\t\t\r\n\t\t\tInterface.exMatrice2.Commander(\"python matrice.py\");\r\n\t\t\tString[] a1 = Interface.exMatrice2.retour.split(\"/\");\r\n\t\t\tthis.Yaw=a1[1];\r\n\t\t\tthis.Pitch=a1[0];\r\n\t\t\tthis.Roll=a1[2];\r\n\t\t\tSystem.out.println(\"yaw: \"+a1[1]);\r\n\t\t\tInterface.rotX=Double.parseDouble(Yaw);\r\n\t\t\tInterface.rotY=-1*Double.parseDouble(Pitch);\r\n\t\t\tInterface.rotZ=Double.parseDouble(Roll);\r\n\t\t\tInterface.singe.mouvement(Interface.rotX, Interface.rotY, Interface.rotZ, new Vector3d(Interface.transX, Interface.transY, Interface.transZ), Interface.scale);\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tInterface.exPression.Commander(\"python MS5803_14BA.py\");\r\n\t\t\tSystem.out.println(\"1\");\r\n\t\t\tString[] a = Interface.exPression.retour.split(\"/\");\r\n\t\t\tthis.Pression=a[0];\r\n\t\t\tthis.TemperatureC=a[1];\r\n\t\t\tthis.TemperatureF=a[2];\r\n\t\t\tInterface.pre=Pression;\r\n\t\t\tInterface.tempC=TemperatureC;\r\n\t\t\tInterface.tempF=TemperatureF;\r\n\t\t\tInterface.pression.setText(\" Pression = \"+Interface.pre);\r\n\t\t\tInterface.pression.repaint();\r\n\t\t\tInterface.temperatureC.setText(\" TemperatureC = \"+Interface.tempC);\r\n\t\t\tInterface.temperatureC.repaint();\r\n\t\t\tInterface.temperatureF.setText(\" TemperatureF = \"+Interface.tempF);\r\n\t\t\tInterface.temperatureF.repaint();\r\n\t\t\t\r\n\t\t\t\r\n\t\t}\r\n\t}",
"public static void main(String[] args) {\n\t\tfinal Device lamp = new Device(\"Lamp\", \"Lamp\",\"Lamp\" ,\"img/lamp.png\");\r\n\t\t\r\n\t\t//2. Register the 2 functions\r\n\t\tlamp.registerFunction(\"SwitchOn\", \"Function exposed to server\");\r\n\t\tlamp.registerFunction(\"SwitchOff\", \"Function exposed to server for switching off the device\");\r\n\t\t\r\n\t\t//3. Set the type of communication layer. In this case it is a java implementation of websocket.\r\n\t\t//Depending the environment the driver is running, other implementation of the websocket layer can be injected\r\n\t\tlamp.setWebsocketLayer(new JavaWebsocketLayer(lamp));\r\n\t\t\r\n\t\t//a simple text label to display if lamp is on or off.\r\n\t\t//in a real lamp, instead displaying a label, the microcontroller will send an electric signal to a switch\r\n\t\tfinal JLabel state = new JLabel();\r\n\t\t\r\n\t\t//4. Add function handlers to execute the captured events\r\n\t\t//this implementation of the handler simply diplays Switched on or Switched off\r\n\t\tlamp.addFunctionHandler(new FunctionHandler() {\r\n\t\t\t\r\n\t\t\t@Override\r\n\t\t\tpublic void execute(String name, Map<String, String> input) {\r\n\t\t\t\ttry{\r\n\t\t\t\t\r\n\t\t\t\t\tif(name.equals(\"SwitchOn\")){\r\n\t\t\t\t\t\tstate.setIcon(new ImageIcon(new URL(\"http://72.13.93.222:8080/hatzouf/img/light-on.png\")));\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tstate.setIcon(new ImageIcon(new URL(\"http://72.13.93.222:8080/hatzouf/img/light-off.png\")));\r\n\t\t\t\t\t}\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\t\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\t//5. This handler is executed when the device is connected and ready for use.\r\n\t\tlamp.onReady(new OnReady() {\r\n\t\t\t\r\n\t\t\t@Override\r\n\t\t\tpublic void ready() {\r\n\t\t\t\tJFrame frame = new JFrame(\"Lamp\");\r\n\t\t\t\tframe.getContentPane().add(state, BorderLayout.NORTH);\r\n\t\t\t\tframe.setSize(300, 275);\r\n\t\t\t\tframe.setVisible(true);\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\t//6. connect the device to the hatzouf server\r\n\t\tlamp.connect(\"ws://72.13.93.222:8080/hatzouf/websockets/iot\");\r\n\t\t\r\n\t}",
"@Override\n public void actionPerformed(ActionEvent arg) {\n\n String buttonName = arg.getActionCommand();\n final String device_IP = generalSet.getDevice_IP();\n final String host_IP = generalSet.getLocal_IP();\n\n if(\"重新选择测试设备\".equals(buttonName)){\n System.out.println(\"配侧设备IP:\"+generalSet.getAccompany_IP());\n MainJFrame.getInstance().switchWindow();\n }else if (\"一键测试\".equals(buttonName)) {\n new Thread(new Runnable() {\n @Override\n public void run() {\n // TODO Auto-generated method stub\n //generalSet 在构造方法中初始化\n allTest(generalSet.getQrCode_Info());\n }\n }).start();\n } else {\n for (int i = 0; i < buttonTitle.length; i++) {\n if (buttonTitle[i].equals(buttonName)) {\n final int lastIndex = buttonTitle.length - 1;\n switch (i) {\n case 0: {// 信息设置\n new Thread(new Runnable() {\n @Override\n public void run() { // 启动线程执行后续操作\n powerLine.info_set(generalSet.getQrCode_Info());\n }\n }).start();\n break;\n }\n case 1: { //WAN和LAN口测试\n new Thread(new Runnable() {\n @Override\n public void run() { // 启动线程执行后续操作\n// setGatewayInfo(gateway_IP, host_IP);\n powerLine.wan_Lan_test();\n }\n }).start();\n break;\n }\n case 2: { //载波测试\n new Thread(new Runnable() {\n @Override\n public void run() {\n// carrier_Test(gateway_IP, buttonTitle[3]);\n powerLine.carrier_test();\n }\n }).start();\n break;\n }\n case 3: { //wifi测试\n new Thread(new Runnable() {\n @Override\n public void run() {\n //MainJFrame.showMssageln(buttonTitle[2]);\n// wifi_Test(gateway_IP, host_IP);\n powerLine.wifi_test();\n }\n }).start();\n break;\n }\n\n }\n break;\n }\n }\n }\n }",
"GameResult start(Player uno , Player due , Model model ,Controller controller , ViewInterface view , gestioneInput io) throws IOException;",
"private void initViews() {\n TextView textViewPlayer1 = (TextView) findViewById(R.id.textView_player1);\n TextView textViewScorePlayer1 = (TextView) findViewById(R.id.textView_player1_score);\n ProgressBar progressBarPlayer1 = (ProgressBar) findViewById(R.id.progressBar_player1);\n\n TextView textViewPlayer2 = (TextView) findViewById(R.id.textView_player2);\n TextView textViewScorePlayer2 = (TextView) findViewById(R.id.textView_player2_score);\n ProgressBar progressBarPlayer2 = (ProgressBar) findViewById(R.id.progressBar_player2);\n\n ImageView imageViewDie = (ImageView) findViewById(R.id.imageView_die);\n\n TextView textViewAccumulated = (TextView) findViewById(R.id.textView_accumulated);\n TextView textViewPlayerTurn = (TextView) findViewById(R.id.textView_player_turn);\n TextView textViewStartTurn = (TextView) findViewById(R.id.textView_start_turn);\n\n Button buttonCollect = (Button) findViewById(R.id.button_collect);\n Button buttonThrow = (Button) findViewById(R.id.button_throw);\n\n // The views are stored in objects which handle its behaviour //\n BarScore barScorePlayer1 =\n new BarScore(textViewPlayer1, textViewScorePlayer1, progressBarPlayer1);\n BarScore barScorePlayer2 =\n new BarScore(textViewPlayer2, textViewScorePlayer2, progressBarPlayer2);\n ScoreBoard scoreBoard = new ScoreBoard(barScorePlayer1, barScorePlayer2);\n DieView dieView = new DieView(imageViewDie);\n GameInfo gameInfo =\n new GameInfo(textViewAccumulated, textViewPlayerTurn, textViewStartTurn);\n ButtonsToPlay buttons = new ButtonsToPlay(buttonThrow, buttonCollect);\n\n // These objects with views are GameObjects, so they are stored in a global array //\n gameObjects = new GameObject[]{scoreBoard, dieView, gameInfo, buttons};\n\n // The AlertDialog to show the winner message or exit message -> onBackPressed() //\n gameAlertDialog = new GameAlertDialog(this, game, gameObjects);\n\n // Listeners //\n buttonThrow.setOnClickListener(new ThrowListener(game, gameAlertDialog, gameObjects));\n buttonCollect.setOnClickListener(new CollectListener(game, gameObjects));\n textViewStartTurn.setOnClickListener(new StartTurnListener(game, gameObjects));\n }",
"public void connect(View view) {\n if (game.isConnected()) {\n showMessage(\"Already connected!\");\n setupRoles();\n return;\n }\n EditText text = (EditText) findViewById(R.id.ip_address);\n @SuppressWarnings(\"ConstantConditions\") String ip = text.getText().toString();\n if (ip.equals(\"\")) {\n showMessage(\"Please enter an IP-Address\");\n return;\n }\n showProgressDialog();\n game.connect(ip, this);\n }",
"public static void main(String[] args) {\r\n int n = getUserInput(); \r\n ConwayView view = new ConwayView(n);\r\n ConwayModel model = new ConwayModel(n);\r\n ConwayController controller = new ConwayController(n , model, view);\r\n view.setVisible(true);\r\n controller.initializeGame();\r\n\t\tstartThreads(controller, n);\r\n }",
"public void playGame() {\n \t\n \t//Starts up window for graphical display of game\n MainWindow window = new MainWindow();\n window.launchWindow();\n \n boolean playing = true;\n int attacker, defender;\n Attack attack;\n Response response;\n /*\n * Each iteration of this loop is one player's turn.\n */\n while (playing) {\n /*\n * For now we do debug output. Before going ot production we would want to change this,\n * and at least shop showing all secret Ship placement at every turn.\n */\n //printDebugState(0);\n // printDebugState(1);\n\n attacker = currentPlayer;\n defender = otherPlayer(currentPlayer);\n\n \n /*\n * First gather an Attack\n */\n if (isAI[attacker]) { // It is an AI's turn\n attack = players[attacker].makeAttack(playerShips[1]); //makeAttack takes the players Ship array to check and see if it gets a hit\n } else { // It is a human's turnids[1\n attack = consoleGetAttack(attacker);\n }\n\n System.out.println(\"Player \" + currentPlayer +\n \" attacks at (\" + attack.getRow() + \",\" + attack.getColumn() + \")\");\n \n /*\n * Deliver the attack and collect the Response\n */\n if (isAI[defender]) { // The defender is an AI\n response = players[defender].receiveAttack(attack);\n } else { // It is a human's turn\n response = consoleGetResponse(attack, defender);\n }\n\n switch (response.getResult()) {\n case Response.HIT:\n System.out.println(\"It's a HIT!\");\n break;\n case Response.MISS:\n System.out.println(\"It's a MISS!\");\n break;\n case Response.SUNK:\n System.out.println(\"Ship sunk: \" + response.getShipName());\n \n break;\n case Response.ALLSUNK:\n System.out.println(\"Ship sunk: \" + response.getShipName());\n System.out.println(\"Game over; player \" + currentPlayer + \" wins!\");\n playing = false;\n break;\n }\n \n \n /*\n * Return the Response to the Attacker\n */\n if (isAI[currentPlayer]) { // It is an AI's turn\n players[currentPlayer].receiveResponse(response);\n } else { // It is a human's turn\n }\n\n /*\n * Finally update the UI's instance variables\n */\n if (response.getResult() == Response.MISS) {\n grids[currentPlayer].set(attack.getRow(), attack.getColumn(), Grid.MISS);\n } else {\n grids[currentPlayer].set(attack.getRow(), attack.getColumn(), Grid.HIT);\n }\n changeCurrentPlayer();\n } // while (true) -- Continue playing turns until the game ends\n }",
"private GuiTest() {\n // Load custom resources (fonts, etc.)\n ResourceLoader.loadResources();\n\n // Load the user accounts into the system\n UserController.getInstance().loadUsers();\n\n // Set up GuiController and the main window.\n GuiController.instantiate(1280, 720, \"FPTS\");\n\n char[] password = {'p', 'a', 's', 's', 'w', 'o', 'r', 'd'};\n UserController.getInstance().login(\"rhochmuth\", password);\n\n // Show the screen/window\n PortfolioController.getInstance().showAddHoldingView();\n GuiController.getInstance().showWindow();\n\n // Load the market information and update it every 2 minutes\n MarketController.getInstance().StartTimer();\n }",
"private void serverConfigurations() {\n\n client = new Client();\n client.start();\n\n Network.register(client);\n\n client.addListener(new Listener() {\n public void connected(Connection connection) {\n }\n\n public void received(Connection connection, Object object) {\n if (object instanceof IsFull)\n transitionTo(mainMenu);\n if (object instanceof Abort) {\n //\n }\n\n if (object instanceof CanStart)\n Platform.runLater(() -> transitionTo(mainGame));\n\n if (object instanceof WhoseTurn) {\n WhoseTurn whoseTurn = (WhoseTurn) object;\n Platform.runLater(() -> setTurnLabel(whoseTurn.name));\n }\n if (object instanceof ConnectedPlayers) {\n System.out.println(\"CONNECTED PLAYERS\");\n ConnectedPlayers players = (ConnectedPlayers) object;\n Platform.runLater(() -> {\n textArea.clear();\n for (String name : players.names)\n textArea.appendText(name + \"\\n\");\n }\n );\n }\n\n if (object instanceof ReadyForShips)\n Platform.runLater(() -> transitionTo(setShips));\n\n if (object instanceof OthersSpecs) {\n OthersSpecs othersSpecs = (OthersSpecs) object;\n\n Platform.runLater(() -> {\n\n ene1.serverID = othersSpecs.ene1;\n ene1.name = othersSpecs.ene1n;\n ene1.labeln.setText(ene1.name);\n cWl1.setText(ene1.name);\n\n ene2.serverID = othersSpecs.ene2;\n ene2.name = othersSpecs.ene2n;\n ene2.labeln.setText(ene2.name);\n cWl2.setText(ene2.name);\n\n });\n\n }\n\n if (object instanceof YourBoardToPaint)\n //System.out.println(\"MY BOARD TO PAINT\");\n Platform.runLater(() -> mGSelfBoard.updateTiles(((YourBoardToPaint) object).board));\n\n if (object instanceof EnemiesBoardsToPaint) {\n //System.out.println(\"ENEMIES BOARDS TO PAINT\");\n Platform.runLater(() -> {\n ene1.b.startTiles(((EnemiesBoardsToPaint) object).board1);\n ene2.b.startTiles(((EnemiesBoardsToPaint) object).board2);\n });\n }\n\n if (object instanceof EnemyBoardToPaint) {\n Platform.runLater(() -> {\n EnemyBoardToPaint ebp = (EnemyBoardToPaint) object;\n updateEnemyBoard(ebp.id, ebp.newAttackedBoard);\n System.out.println(\"ENEMY BOARD TO PAINT WITH INDEX \" + ebp.id);\n });\n }\n\n if (object instanceof AnAttackResponse) {\n Platform.runLater(() -> {\n lastAttacked.b.updateTiles(((AnAttackResponse) object).newAttackedBoard);\n iCanAttack = ((AnAttackResponse) object).again;\n doSounds(((AnAttackResponse) object).actualHit, ((AnAttackResponse) object).shipHit);\n });\n }\n\n if (object instanceof YourTurn) {\n Platform.runLater(() -> {\n iCanAttack = true;\n setTurnLabel(\"My TURN!!\");\n });\n }\n\n if (object instanceof YouDead) {\n Platform.runLater(() -> {\n lost(\"You died a horrible death. RIP you\");\n transitionTo(mainMenu);\n });\n }\n\n if (object instanceof PlayerDied) {\n Platform.runLater(() -> {\n removeEnemy(((PlayerDied) object).who);\n });\n }\n\n if (object instanceof YouWon) {\n Platform.runLater(() -> {\n Alert lost = new Alert(Alert.AlertType.CONFIRMATION);\n lost.setContentText(\"YOU BEAT THEM ALL\");\n lost.showAndWait();\n won();\n });\n }\n\n if (object instanceof ChatMessage) {\n Platform.runLater(() -> {\n EnemyLocal toUpdate = ene1;\n if (((ChatMessage) object).saidIt == ene2.serverID) {\n toUpdate = ene2;\n }\n toUpdate.conversation.setText(toUpdate.conversation.getText() + ((ChatMessage) object).message);\n });\n }\n }\n });\n\n }",
"public void doStartComputerGame(View view) {\n mainHelper.playAgainstComputer();\n setContentView(R.layout.activity_table);\n mainHelper.start();\n }",
"public AAAStepUp()\n {\n display = Display.getDisplay(this);\n stepReciver=new StepReciver(this);\n deamonClient= new DeamonClient(this);\n watch=new Watcher(this);\n watch.notifyWatchertoStart();\n watch.notifyWatchertoStepupDeamon();\n \n\n\n startlist=new List(\"StepUp:\", List.IMPLICIT);\n startlist.append(\"Start\", null);\n startlist.append(\"Progress\", null);\n //$$ startlist.append(\"History\", null);\n \n\n\n\n stepview= new StepsView(this);\n proglistview= new ProgressListView(this);\n historyview=new HistoryView(this);\n profileview=new ProfileView(this);\n newgroupview= new newGroupView(this);\n dailyprogress= new DailyProgress (this);\n weeklyprogress= new WeekProgress(this);\n teamprogress= new TeamProgress(this);\n\n\n\n formRunning = new Form(\"Connecting to StepUp Database\");\n formRunning.append(new Gauge(\"Connecting\",false,Gauge.INDEFINITE,Gauge.CONTINUOUS_RUNNING));\n\ncreateCommands();\naddCommands();\n \n }",
"public void startProgram() {\n this.displayBanner();\n// prompt the player to enter their name Retrieve the name of the player\n String playersName = this.getPlayersName();\n// create and save the player object\n User user = ProgramControl.createPlayer(playersName);\n// Display a personalized welcome message\n this.displayWelcomeMessage(user);\n// Display the Main menu.\n MainMenuView mainMenu = new MainMenuView();\n mainMenu.display();\n }",
"private void setupGUI() {\r\n\t\tnetPaintClient = new NetPaintClient(out, clientName);\t\r\n\t\tnetPaintClient.addWindowListener(new WindowAdapter(){\r\n\t\tpublic void windowClosing(WindowEvent arg0) {\r\n\t\t\ttry {\r\n\t\t\t\tout.writeObject(new DisconnectCommand(clientName));\r\n\t\t\t\tout.close();\r\n\t\t\t\tin.close();\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n\t}",
"@FXML\n private void setOut(){\n\n updateGUI();\n drivingTransition.play();\n Main.gang.setMoving(true);\n\n HealthClass.checkGameOver();\n\n if (Runtime.getRuntime().availableProcessors() + Main.main.startingThreads > Thread.activeCount()) TravelTask();\n }",
"@Override\n public void update(Observable o, Object o1) {\n TetrisController.UpdateType type = (TetrisController.UpdateType) o1;\n\n switch (type) {\n case INIT_SIGNAL:\n chatController.deleteObserver(this);\n chatController.deleteObserver(playerListModel);\n chatController.tearDown();\n tetrisController.deleteObserver(this);\n final GameFieldJFrame gameField = new GameFieldJFrame(tetrisController, tetrisController.getInputSampler(), tetrisController.getLocalSimulationStateInterface(), tetrisController.getOtherSimulationStateInterfaces());\n\n SwingUtilities.invokeLater(new Runnable() {\n\n @Override\n public void run() {\n gameField.setVisible(true);\n dispose();\n }\n });\n break;\n case EXCEPTION_THROWN:\n break;\n case CHAT_MESSAGE_RECEIVED:\n writeChatMessage(chatController.getChatMessage());\n break;\n case SESSION_ADDED:\n writeServerMessage(chatController.getAddedSession().getNickname() + \" enters\");\n break;\n case SESSION_REMOVED:\n writeServerMessage(chatController.getRemovedSession().getNickname() + \" has left\");\n break;\n }\n }",
"public static void main(String[] args) {\n //Starts the choice class\n choice();\n //This runs the single player mode\n if (whichProgramToStart == 0) {\n\n JFrame frame = new JFrame(\"Single Player\");\n frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n frame.setLayout(new BorderLayout());\n SinglePlayerPongPanel singlePongPanel = new SinglePlayerPongPanel();\n frame.add(singlePongPanel, BorderLayout.CENTER);\n frame.setResizable(false);\n frame.setSize(500, 500);\n frame.setVisible(true);\n\n } //This runs the online multiplayer mode\n else if (whichProgramToStart == 1) {\n\n JFrame frame = new JFrame(\"Online Multiplayer\");\n frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n frame.setLayout(new BorderLayout());\n OnlineMultiplayer onlineMultiplayer = new OnlineMultiplayer();\n frame.add(onlineMultiplayer, BorderLayout.CENTER);\n frame.setResizable(false);\n frame.setSize(500, 500);\n frame.setVisible(true);\n\n } //This runs the local multiplayer mode\n else if (whichProgramToStart == 2) {\n\n JFrame frame = new JFrame(\"Local Multiplayer\");\n frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n frame.setLayout(new BorderLayout());\n LocalMultiplayer localMultiplayer = new LocalMultiplayer();\n frame.add(localMultiplayer, BorderLayout.CENTER);\n frame.setResizable(false);\n frame.setSize(500, 500);\n frame.setVisible(true);\n }\n }",
"@Override\n public void run() {\n while(true) {\n /* if(logic.ganoJ1()){ \n Dialogo1 d1= new Dialogo1(new JFrame(), true); \n System.out.println(\"gano j1\");\n d1.setVisible(true);\n this.stop();\n }\n if(logic.ganoJ2()){ \n Dialogo2 d2= new Dialogo2(new JFrame(), true); \n System.out.println(\"gano j2\");\n d2.setVisible(true);\n this.stop();\n }*/\n logic.update();\n try {\n //1000 / 50 = 20 (50 fps)\n Thread.sleep(20);\n } catch (InterruptedException ex) {}\n }\n }",
"public void PVAI(String name){ //for player vs ai\r\n \r\n welcome.remove(p1first);\r\n welcome.remove(p2first); //removing all necessary buttons\r\n welcome.remove(hORt);\r\n welcome.updateUI();\r\n \r\n if(choseEasyAI == true){ //for easy ai\r\n if(name.equals(name1)&&numTurns==0){\r\n instructions.setText(\"<html>\" + name1 + \"<html> you are going first! <br><br> Please click the column number you wish to place your checker in. </html>\");\r\n whoseTurn = 1; //when the user goes first\r\n welcome.remove(input);\r\n welcome.updateUI();\r\n canGo = true;\r\n }\r\n else if(numTurns==0){\r\n changeBoard(4, 3, color1, color2); //if the AI were to go first, set its checker in the middle (because thats always the best move)\r\n welcome.remove(input);\r\n welcome.updateUI();\r\n whoseTurn = 1; //AI's turn\r\n canGo = true;\r\n instructions.setText(\"<html>Please click the column number\"+\"</br>\"+\" you wish to place your checker in. </html>\");\r\n }\r\n }\r\n //FOR THE HARD AI\r\n else{\r\n AINumber = 4; //if the user chose HARD AI, and the user is going first\r\n if(name.equals(name1)&&numTurns==0){\r\n instructions.setText(\"<html>\" + name1 + \"<html> you are going first! <br><br> Please click the column number you wish to place your checker in. </html>\");\r\n whoseTurn = 1;\r\n welcome.remove(input);\r\n welcome.updateUI();\r\n canGo = true;\r\n }\r\n else{\r\n changeBoard(4,3,color1,color2);\r\n welcome.remove(input);\r\n welcome.updateUI();\r\n whoseTurn = 1; //users turn\r\n canGo = true;\r\n instructions.setText(\"<html>Please click the column number\"+\"</br>\"+\" you wish to place your checker in. </html>\");\r\n }\r\n }\r\n }",
"private void startGame(){\n try {\n String playersName = fromServer.readUTF();\n lbPl1.setText(playersName.split(POINTS_DELIMITER)[0]);\n lbPl2.setText(playersName.split(POINTS_DELIMITER)[1]);\n lbWhiteStone.setIcon(whiteIcon);\n// lbWhiteStone.setText(playersName.split(POINTS_DELIMITER)[1]);\n lbBlackStone.setIcon(blackIcon);\n// lbBlackStone.setText(playersName.split(POINTS_DELIMITER)[0]);\n\n boardComponent.initiate();\n boardComponent.repaint();\n setScoreText();\n if(this.color == 0) {\n setMsgText(\"\");\n colorLabel.setText(\"You are a viewer.\");\n setButtons(false);\n btnNewGame.setEnabled(false);\n }\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"public void enterPlayerView(){\n\t\tplayerSeen=true;\r\n\t\tplayerMapped=true;\r\n\t}",
"void newGame() {\n\t\tstate = new model.State () ; \n\t\tif(host != null ) host.show(state) ; \n\t}",
"@Override\n public void loop() { //Starts this loop after you press the START Button\n /**\n * Functional control of up down lift with no limit switches Meet 0 ready\n */\n double liftposition = robot.liftUpDown.getCurrentPosition();\n double liftrotposition = robot.liftRotate.getCurrentPosition();\n telemetry.addData(\"Lift Position\",\"%5.2f\",liftposition);\n telemetry.addData(\"LiftRot Position\", \"%5.2f\", liftrotposition);\n // telemetry.addData(\"Block Stack\", BlockStack);\n telemetry.update();\n\n/**Main drive controls\n * Driver 1\n */\n\n/**\n * Drag servos\n */\n if (gamepad1.a){ //release\n robot.drag1.setPosition(0);\n robot.drag2.setPosition(1);\n } else if (gamepad1.b){//grab\n robot.drag1.setPosition(1);\n robot.drag2.setPosition(0);\n }\n\n/**Mast and Lift controls\n *\n *\n * Driver Two\n *\n *\n*/\n\n/**\n * Need controls to\n * Maybe predetermined locations based on number of pushes of a button.\n */\n\n /**\n * Functional arm rotation with limit switches and encoder limits. Meet 2 ready\n */\n\n //Twists lift up after verifying that rotate up limit switch is not engaged and that step count is less than 5400\n if ( gamepad2.dpad_up && robot.rotateup.getState() == true){\n robot.liftRotate.setPower(1.0);\n }\n else if (gamepad2.dpad_down && robot.rotatedown.getState() == true){ //Twists lift down\n robot.liftRotate.setPower(-1.0);\n }\n //required or lift rotate motor continues to run in last direction (breaks the motor shaft)\n else robot.liftRotate.setPower(0);\n\n /**\n * claw controls a= open b= close\n * FUNCTIONAL Meet 2 ready\n */\n if (gamepad2.a){\n robot.claw1.setPosition(0);\n robot.claw2.setPosition(1);\n } else if (gamepad2.b){\n robot.claw1.setPosition(1);\n robot.claw2.setPosition(0);\n }\n\n /**\n * Lift controls with limit switches and encoder position Meet 2 ready\n * right_trigger = lift\n * left_trigger = down\n */\n\n if ( gamepad2.right_trigger>= 0.2 && robot.liftup.getState()) {\n triggerpress=true;\n robot.liftUpDown.setMode(DcMotor.RunMode.RUN_USING_ENCODER);\n robot.liftUpDown.setPower(.9);\n robot.liftRotate.setPower(.15);\n }\n if (gamepad2.left_trigger>=0.2){\n triggerpress=true;\n robot.liftUpDown.setMode(DcMotor.RunMode.RUN_USING_ENCODER);\n robot.liftUpDown.setPower(-0.9);\n robot.liftRotate.setPower(-0.15);\n }\n if (gamepad2.left_trigger<.2 && gamepad2.right_trigger<.2 && triggerpress ){\n robot.liftUpDown.setPower(0);\n robot.liftRotate.setPower(0);\n triggerpress=false;\n }\n\n int x;\n int y;\n double motorDelayTime;\n //Necessary Debounce to keep bumper from being seen as multiple touches\n/* motorDelayTime=.1;\n if (robot.liftUpDown.getCurrentPosition()<50){\n BlockStack =0;\n }\n //skips servos unless runtime is greater than 20 ms.\n if( runtime.time() > motorDelayTime ) {\n //Need to move 5.5 inches on position 2, subsequent blocks will only need to move up 4 inches.\n x = robot.liftUpDown.getCurrentPosition();\n y= robot.liftRotate.getCurrentPosition();\n if (gamepad2.right_bumper ) {\n\n BlockStack= BlockStack + 1;\n robot.liftUpDown.setMode(DcMotor.RunMode.RUN_TO_POSITION);\n robot.liftUpDown.setTargetPosition(x + robot.floorheight);\n robot.liftUpDown.setPower(.9);\n robot.liftRotate.setTargetPosition(y + robot.floorheightrotate);\n robot.liftRotate.setPower(.1);\n bumperpress=true;\n\n //don't want to drive the cable too far loose checks that we can move a full block down\n } else if (gamepad2.left_bumper && x >= robot.floorheight ) {\n BlockStack= BlockStack - 1;\n robot.liftUpDown.setMode(DcMotor.RunMode.RUN_TO_POSITION);\n robot.liftUpDown.setTargetPosition(x - robot.floorheight);\n robot.liftUpDown.setPower(-.5);\n}\n\n runtime.reset();\n robot.liftUpDown.setMode(DcMotor.RunMode.RUN_USING_ENCODER);\n }*/\n\n /**\n * Limit switch tests that reset the encoders Meet 1 ready\n * * liftdown also allows the X button to work\n * * rotatedown also allows the Y button to work\n */\n\n if (robot.rotatedown.getState() == false) {\n robot.liftRotate.setMode(DcMotor.RunMode.STOP_AND_RESET_ENCODER);\n robot.liftRotate.setMode(DcMotor.RunMode.RUN_USING_ENCODER);\n }\n }",
"private void gameAdmin() {\n\t\tgamePause();\n\t\tsnakeFrame.snakePanel.player.close();\n\t\t try {\n\t\t\t\tRuntime.getRuntime().exec(\n\t\t\t\t\t\t \"cmd /c start http://localhost/snakegame/welcome.html \");\n\t\t\t} catch (IOException e1) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te1.printStackTrace();\n\t\t\t}\n\t\t\n\t}",
"@FXML\n\tpublic void play (ActionEvent e) {\n\t\twriteToAttendant.println(ClientAttendant.PLAY);\n\t\ttry {\n\t\t\tString nickname = readFromAttendant.readLine();\n\t\t\tString dec=readFromAttendant.readLine();\n\t\t\tint portGameHoster=Integer.parseInt(readFromAttendant.readLine());\n\t\t\tif(dec.equals(ClientAttendant.GAMEAVAILABLE)) {\n\t\t\t\topenGamePane();\n\t\t\t\treadFromAttendant.close();\n\t\t\t\twriteToAttendant.close();\n\t\t\t\tsocketToLoginSystem.close();\n\t\t\t\tstartGame(portGameHoster,nickname);\n\t\t\t}else if(dec.equals(ClientAttendant.GAMEFULL)) {\n\t\t\t\tStreamingController sc=new StreamingController();\n\t\t\t\tsc.openObserverPane();\n\t\t\t\treadFromAttendant.close();\n\t\t\t\twriteToAttendant.close();\n\t\t\t\tsocketToLoginSystem.close();\n\t\t\t\tsc.startStreaming(portGameHoster,nickname);\n\t\t\t}\n\t\t} catch (IOException e1) {\n\t\t\te1.printStackTrace();\n\t\t\tAlert al = new Alert(AlertType.ERROR);\n\t\t\tal.setTitle(\"Error en la conexión\");\n\t\t\tal.setHeaderText(\"Problemas con el servidor\");\n\t\t\tal.setContentText(\"No se ha podido establecer conexión con el servidor de logueo.\");\n\t\t\tal.showAndWait();\n\t\t}\n\t\t\n\t}",
"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 }",
"public void showLobby(ArrayList<String> players) throws IOException {\n String firstOpponentUsername = null, secondOpponentUsername;\n lobbyPane= FXMLLoader.load(Objects.requireNonNull(GodsController.class.getClassLoader().getResource(\"Fxml/Lobby.fxml\")));\n borderPane=(BorderPane) lobbyPane.getChildren().get(1);\n exitButton=(ImageView) borderPane.getBottom();\n playerStackPane=(StackPane) borderPane.getLeft();\n playerUsernameLabel=(Label) playerStackPane.getChildren().get(2);\n opponentsVBox=(VBox) borderPane.getRight();\n firstOpponentPane=(StackPane) opponentsVBox.getChildren().get(0);\n secondOpponentPane=(StackPane) opponentsVBox.getChildren().get(1);\n firstOpponentLabel=(Label) firstOpponentPane.getChildren().get(2);\n secondOpponentLabel=(Label) secondOpponentPane.getChildren().get(2);\n if(Client.getNumPlayers()==2) opponentsVBox.getChildren().remove(1);\n playerUsernameLabel.setText(Client.getUsername());\n for(String username :players ){\n if(!Client.getUsername().equals(username)) {\n if(firstOpponentUsername==null) {\n firstOpponentLabel.setText(firstOpponentUsername=username);\n }\n else secondOpponentLabel.setText(secondOpponentUsername = username);\n }\n }\n GUI.getGameStage().setScene(new Scene(lobbyPane));\n GUI.getGameStage().show();\n }",
"public void emitChangeView() {\n \n int view = getCurrentViewNumber();\n Object lpid = getLocalServerID();\n \n JDSUtility.debug(\"[emitChangeView()] s\" + lpid + \", at time \" + getClockValue() + \", is going to emit a change view message for (v + 1 = \" + (view + 1) + \")\");\n\n /* the replica makes sure that no timer is currently working. If the view change was trigged by a suspect of failure of the primary then probably it's \n been already true. */\n revokeSendBatch();\n revokeViewChange();\n\n /* an exponetial timeout has to be considered to guarantee liveness when the end-to-end delay is too long (it's prevent uncessary view-changes)*/\n PBFTTimeoutDetector ttask = (PBFTTimeoutDetector) getViewTimer().getTask();\n long timeout = (Long) ttask.get(\"TIMEOUT\");\n ttask.put(\"TIMEOUT\", 2 * timeout);\n\n /* the replica moves to the next view. After that, this replica isn't accepting any message from view v < v+1. */\n setCurrentViewNumber(view +1);\n \n /* clean-up the sets P (prepare set) and Q (pre-prepare set)*/\n preprepareset.clear();\n prepareset.clear();\n\n long lcwm = getLCWM();\n long hcwm = getHCWM();\n\n /* compute Q (pre-prepare set) and P (prepare set) */\n for(long seqn = lcwm + 1; seqn <=hcwm; seqn++){\n /*If I have a prepare then its digests will be added to pre-prepared and prepared sets */\n PBFTPrepare pr = getPrepareInfo().get(lpid, seqn);\n if(pr != null){\n PBFTPrePrepare pp = new PBFTPrePrepare(view, pr.getSequenceNumber(), null);\n pp.getDigests().addAll(pr.getDigests());\n preprepareset.add(pp);\n \n prepareset.add(new PBFTPrepare(pp, null));\n\n for(String digest: pp.getDigests()){\n getRequestInfo().assign(digest, RequestState.WAITING);\n getRequestInfo().assign(digest, (Long)null);\n }\n\n continue;\n }\n\n /*If I have a pre-prepare then its digests will be added to pre-prepared set*/\n PBFTPrePrepare ppr = getPrePrepareInfo().get(seqn);\n if(ppr != null){\n PBFTPrePrepare pp = new PBFTPrePrepare(view, ppr.getSequenceNumber(), null);\n pp.getDigests().addAll(ppr.getDigests());\n preprepareset.add(pp);\n \n for(String digest: pp.getDigests()){\n getRequestInfo().assign(digest, RequestState.WAITING);\n getRequestInfo().assign(digest, (Long)null);\n }\n } \n }\n\n \n try{\n doRollback();\n }catch(Exception e){\n e.printStackTrace();\n }\n\n /* update the controls for sequence number execution */\n getStateLog().setNextPrePrepareSEQ(lcwm + 1);\n getStateLog().setNextExecuteSEQ (lcwm + 1);\n\n PBFTChangeView cv = createChangeViewMessage();\n \n try {\n /* gets the root of the checkpoint partition tree */\n PartEntry centry = rStateManager.getPart(0, 0);\n\n /* adds the pair (last stable sequence number and state digest) to compose checkpoint set C */\n if(centry != null){\n cv.addCheckpoint(centry.getPartCheckpoint(), centry.getDigest());\n }else{\n cv.addCheckpoint(lcwm, \"\");\n }\n } catch (Exception ex) {\n Logger.getLogger(PBFTServer.class.getName()).log(Level.SEVERE, null, ex);\n cv.getCheckpointSet().clear();\n cv.addCheckpoint(lcwm, \"\");\n }\n\n /* add the pre-prepare set to current change-view message*/\n cv.getPrePrepareSet().clear();\n cv.getPrePrepareSet().addAll(preprepareset);\n\n /* add the prepare set to current change-view message*/\n cv.getPrepareSet().clear();\n cv.getPrepareSet().addAll(prepareset);\n\n /*emit the change view message to group of replicas */\n emit(cv, getLocalGroup().minus(getLocalProcess()));\n\n getChangeViewInfo().setMinimumViewNumber(view);\n getChangeViewInfo().put(cv);\n\n if(isPrimary()){\n getNewViewConstructor().addChangeView(cv);\n }else{\n finalizeNewViewConstructor();\n }\n\n getChangeViewInfo().gc(view);\n getChangeViewACKInfo().gc(view);\n getNewViewConstructor().gc(view);\n getNewViewInfo().gc(view);\n getPrePrepareInfo().gc(view);\n getPrepareInfo().gc(view);\n getPrePreparebackupInfo().gc(view);\n getCommitInfo().gc(view);\n\n\n emitChangeViewACK();\n\n\n uncertanty = true; \n }",
"private void newGame()\r\n {\r\n //close the current screen\r\n screen.dispose();\r\n //start back at the set up menu\r\n SetupView screen = new SetupView();\r\n SetupController controller = new SetupController(screen);\r\n screen.registerObserver(controller);\r\n }",
"@Override\n\tpublic void actionPerformed(ActionEvent arg0) {\n\t\tif(arg0.getActionCommand().equals(\"newGame\"))\n\t\t{\n\t\t\tSystem.out.println(\"开始新的游戏\");\t\t\n\t\t\tinitKey();\n\t\t\t\n\t\t\t\n\t\t\t//创建新的游戏战场\n\t\t\tmgp=new MyGamePanel(\"newGame\");\n\t\t\t\n\t\t\t//启动游戏面板线程\n\t\t\tThread t=new Thread(mgp);\n\t\t\tt.start();\n\t\t\t\n\t\t\t//删除旧的面板\n\t\t\tthis.remove(msp);\n\t\t\tthis.add(mgp);\n\n\t\t\t//注册监听\n\t\t\tthis.addKeyListener(mgp);\n\t\t\t\n\t\t\tthis.setVisible(true);\n\t\t\t\n\t\t}else if(arg0.getActionCommand().equals(\"exit\"))\n\t\t{\n\t\t\t//保存击毁敌人数量\n\t\t\tRecorder.keepRecording();\n\t\t\tSystem.out.println(\"退出游戏\");\n\t\t\t\n\t\t}else if(arg0.getActionCommand().equals(\"saveExit\"))\n\t\t{\n\t\t\tRecorder rd=new Recorder();\n\t\t\n\t\t\trd.setEts(mgp.ets);\n\t\t\trd.setHeros(mgp.heros);\n\t\t\trd.keepRecAndEnemyTank();\n\t\t\tSystem.out.println(\"保存游戏\");\n\t\t\t\n\t\t}else if(arg0.getActionCommand().equals(\"conGame\"))\n\t\t{\n\t\t\tinitKey();\n\t\t\tmgp=new MyGamePanel(\"con\");\n\t\t\t\n\t\t\tThread t=new Thread(mgp);\n\t\t\tt.start();\n\t\t\t\n\t\t\tthis.remove(msp);\n\t\t\tthis.add(mgp);\n\t\t\t\n\t\t\tthis.addKeyListener(mgp);\n\t\t\t\n\t\t\tthis.setVisible(true);\n\t\t\t\n\t\t\tSystem.out.println(\"接着玩游戏\");\n\t\t}else if(arg0.getActionCommand().equals(\"KeyInstall\"))\n\t\t{\n\t\t\tSystem.out.println(\"点击了用户设置按钮\");\n\t\t\tKeyInstall ki=new KeyInstall();\n\t\t\t\n\t\t}else if(arg0.getActionCommand().equals(\"LevelSetting\"))\n\t\t{\n\t\t\tSystem.out.println(\"用户点击了游戏难易设置\");\n\t\t\tLevelSetting ls=new LevelSetting();\n\t\t}else if(arg0.getActionCommand().equals(\"SavePoint\"))\n\t\t{\n\t\t\tSystem.out.println(\"用户点击了保存分数按钮\");\n\t\t\tMyGamePanel.isPause=!MyGamePanel.isPause;\n\t\t\tSavePoint sp=new SavePoint();\n\t\t\tString sumPoints=String.valueOf(MyGamePanel.sumPoint);\n\t\t\tsp.jf2.setText(sumPoints);\n\t\t\tsp.jf2.setEditable(false);\n\t\t}\n\t}",
"private UI_Layer() {\n System.out.println(\"UI_Layer Const\");\n renewGameThread(\"10\", \"140\");\n }",
"public static void main(String[] args) {\n//\n// remote.setCommand(garageDoorOpenCommand);\n// remote.buttonWasPressed();\n\n RemoteControl remoteControl = new RemoteControl();\n\n Light livingRoomLight = new Light(\"Living Room\");\n Light kitchenLight = new Light(\"Kitchen\");\n CeilingFan ceilingFan = new CeilingFan(\"Living Room\");\n GarageDoor garageDoor = new GarageDoor(\"\");\n Stereo stereo = new Stereo(\"Living Room\");\n\n LightOnCommands livingRoomLightsOn = new LightOnCommands(livingRoomLight);\n LightOffCommand livingRoomLightsOff = new LightOffCommand(livingRoomLight);\n LightOnCommands kitchenLightsOn = new LightOnCommands(kitchenLight);\n LightOffCommand kitchenLightsOff = new LightOffCommand(kitchenLight);\n\n CeilingFanOnCommand ceilingFanOnCommand = new CeilingFanOnCommand(ceilingFan);\n CeilingFanOffCommand ceilingFanOffCommand = new CeilingFanOffCommand(ceilingFan);\n\n GarageDoorOpenCommand garageDoorOpenCommand = new GarageDoorOpenCommand(garageDoor);\n GarageDoorCloseCommand garageDoorCloseCommand = new GarageDoorCloseCommand(garageDoor);\n\n StereoOnWithCdCommand stereoOnWithCdCommand = new StereoOnWithCdCommand(stereo);\n StereoOffCommand stereoOffCommand = new StereoOffCommand(stereo);\n\n\n remoteControl.setCommand(0, livingRoomLightsOn, livingRoomLightsOff);\n remoteControl.setCommand(1, kitchenLightsOn, kitchenLightsOff);\n remoteControl.setCommand(2, ceilingFanOnCommand, ceilingFanOffCommand);\n remoteControl.setCommand(3, stereoOnWithCdCommand, stereoOffCommand);\n\n System.out.println(remoteControl);\n\n remoteControl.onButtonWasPushed(0);\n remoteControl.offButtonWasPushed(0);\n remoteControl.onButtonWasPushed(1);\n remoteControl.offButtonWasPushed(1);\n remoteControl.onButtonWasPushed(2);\n remoteControl.offButtonWasPushed(2);\n remoteControl.onButtonWasPushed(3);\n remoteControl.offButtonWasPushed(3);\n }",
"@Override\n public void start(Stage primaryStage) throws Exception{\n\n // init the Human Player pane. that is the upper part of the UI showing the human player's money, department info and doctor info.\n Pane panePlayer = initHumanPlayerPane();\n // init the log window, this is the lower part of the UI showing game message for all the players\n Pane log_window = initLogWindow();\n // init the computer player pane, this pane shows is the middle part of the UI showing the two computer player info\n Pane pane_computer_player = initComputerPlayer();\n\n\n // put the human player pane, computer player pane, and log window into a vbox\n // see page 6 of the description for the diagram\n VBox pane = new VBox();\n pane.getChildren().addAll(panePlayer,pane_computer_player,log_window);\n\n // we are using stack pane here so that the background.jpg stays in the background, covered by the human player\n // pane, computer player panes, the log window and also all the buttons at the upper right corner of the UI\n StackPane upper = new StackPane();\n\n // put the background.jpg to be on the bottom layer of the StackPane \"upper\"\n Image image = new Image(\"file:background.jpg\");\n ImageView imageView_3 = new ImageView(image);\n upper.getChildren().add(imageView_3);\n // put the human player pane, computer player panes, the log window on the top of the background.jpg in the\n // StackPane \"upper\"\n upper.getChildren().add(pane);\n\n // we have a scene graph with the StackPane \"upper\" as the root, create a Scene object, put the Scene object\n // to the stage (the window showing the UI), and show the stage to display the window\n Scene scene = new Scene(upper, 1800, 1000);\n primaryStage.setTitle(\"Hospital Quest GUI version\");\n primaryStage.setScene(scene);\n primaryStage.show();\n\n // load the players from \"players.txt\" file\n game.gameData.loadGameData(\"players.txt\");\n humanPlayer = game.gameData.getPlayers().get(0);\n computerPlayer_1 = game.gameData.getPlayers().get(1);\n computerPlayer_2 = game.gameData.getPlayers().get(2);\n\n printResult.add(\"------------------------------------- Human player starts -------------------------------------\");\n\n // Update the listViewHospitalItems list that stores the human player's departments information\n // that list contains an array of strings, these strings store the info of the\n // departments in the hospital. Once this list is filled with correct department info by the\n // updateListViewHospitalItems() method, it can be set to the listViewHospital by\n // listViewHospital.setItems(listViewHospitalItems), and the information of this list will be displayed to the UI\n updateListViewHospitalItems();\n\n // Update the listViewDoctorItems list that stores the human player's doctor information\n // similar to the listViewHospitalItems list above, it contains an array of strings, these strings store the\n // info of the doctors of the human player. Once this list is filled with correct department info by the\n // updateListViewDoctorItems() method, it can be set to the listViewDoctor\n // listViewDoctor.setItems(listViewDoctorItems), and the information of this list will be displayed to the UI\n updateListViewDoctorItems();\n\n // update the listViewHospitalItems_1 and listViewHospitalItems_2 lists which hold the department info of\n // the two computer players. Once these two lists are updated by updateListViewComputerPlayer(), they\n // will be set by listViewHospital_1.setItems(listViewHospitalItems_1), and\n // listViewHospital_1.setItems(listViewHospitalItems_1), and the information of the two lists will be displayed\n // to the UI\n updateListViewComputerPlayer();\n\n // update the listViewMessageItems with the log messages in the printResult list, and show it to the UI\n updateListViewLogWindow();\n\n // Initialize the listeners for the two listViews, listViewHospital and listViewDoctor of the human player.\n // These two listViews are displayed on the UI for the human player. It is event-driven, whenever a user\n // selects a row from each of these listViews, the selecte row from the listViews will be copied\n // listViewSelectedHospital, and listViewSelectedDoctor.\n // For example if you select using mouse under \"My Hospital\" in the UI the item \"Fever 0 0 10 100 1000\"\n // then listViewSelectedHospital will be holding the string \"Fever 0 0 10 100 1000\".\n // If you select using mouse under \"My Doctors\" in the UI the item \"Joe Minister 0 500 Medical False\"\n // then listViewSelectedDoctor will be holding the string \"Joe Minister 0 500 Medical False\"\n initListView();\n\n // get the human player money through humanPlayer.getMoney();\n // then set the label for displaying money with this money amount (i.e. lbMyMoney.setText(\"My money: \" + money))\n updateHumanPlayerMoney();\n\n // get the computer player money through computerPlayer_1.getMoney() and computerPlayer_2.getMoney()\n // then set the labels for displaying money of the computer players accordingly\n // (i.e. lb_money_1.setText(\"My money: \" + money), lb_money_2.setText(\"My money: \" + money)) )\n updateComputerPlayerMoney();\n\n // load the appropriate hospital building figure for the human player, computer player 1 and computer player 2\n // see the description of the load_figure() method below for the details\n load_figure();\n\n startTurn(); // to start the game,\n }",
"private void paintNetworkMenu(){\n\t\tframe3.dispose();\n\t\t\n\t\tframe4 = new JFrame(\"Netzwerk\");\n\t\tframe4.setLocation(650,300);\n\t\tframe4.setSize(100, 100);\n\t\tJButton b1 = new JButton(\"Server\");\n\t\tJButton b2 = new JButton(\"Client\");\n\t\tJButton b3 = new JButton(\"Zurück\");\n\t\tframe4.add(BorderLayout.NORTH, b1);\n\t\tframe4.add(BorderLayout.CENTER, b2);\n\t\tframe4.add(BorderLayout.SOUTH, b3);\n\n\t\tframe4.pack();\n\t\tframe4.setVisible(true);\n\n\t\tb1.addActionListener(new ActionListener(){\n\t\t\tpublic void actionPerformed(ActionEvent arg0){\n\t\t\t\tserverMode = true;\n\t\t\t\tserver = new Server(4711, p);\n\t\t\t\tserver.start(); //Client starten; Auf gar keinen Fall mit run starten!\n\t\t\t\t\n\t\t\t}\n\t\t});\n\t\t\n\t\t\n\t\tb2.addActionListener(new ActionListener(){\n\t\t\tpublic void actionPerformed(ActionEvent arg1){ \n\t\t\t\tclientMode = true;\n\t\t\t\tclient = new Client(\"127.0.0.1\", p);\n\t\t\t\tclient.start(); //Thread starten; Auf gar keinen Fall mit run starten!\n\t\t\t}\n\t\t\t\n\t\t});\n\t\t\n\t\tb3.addActionListener(new ActionListener(){\n\t\t\tpublic void actionPerformed(ActionEvent arg1){ \n\t\t\t\tspiel_status=3;\n\t\t\t\tpaintMenu();\n\t\t\t\tframe4.setVisible(false);\n\t\t\t}\n\t\t\t\n\t\t});\n\t}",
"@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n playerView1 = new GUI.PlayerView();\n monsterView1 = new GUI.MonsterView();\n combatResultLabel = new javax.swing.JLabel();\n meetMonsterButton = new javax.swing.JButton();\n combatButton = new javax.swing.JButton();\n nextButton = new javax.swing.JButton();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n setTitle(\"Napakalaki Game\");\n setLocationByPlatform(true);\n\n playerView1.setBorder(javax.swing.BorderFactory.createEtchedBorder());\n\n monsterView1.setBorder(javax.swing.BorderFactory.createEtchedBorder());\n\n combatResultLabel.setFont(new java.awt.Font(\"Noto Sans\", 0, 18)); // NOI18N\n combatResultLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\n\n meetMonsterButton.setText(\"Meet the monster\");\n meetMonsterButton.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n meetMonsterButtonActionPerformed(evt);\n }\n });\n\n combatButton.setText(\"Combat!\");\n combatButton.setEnabled(false);\n combatButton.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n combatButtonActionPerformed(evt);\n }\n });\n\n nextButton.setText(\"Next turn\");\n nextButton.setEnabled(false);\n nextButton.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n nextButtonActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(playerView1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(monsterView1, javax.swing.GroupLayout.DEFAULT_SIZE, 743, Short.MAX_VALUE)\n .addComponent(combatResultLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGroup(layout.createSequentialGroup()\n .addComponent(meetMonsterButton)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(combatButton)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(nextButton)\n .addGap(0, 0, Short.MAX_VALUE))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(playerView1, javax.swing.GroupLayout.PREFERRED_SIZE, 467, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(monsterView1, javax.swing.GroupLayout.PREFERRED_SIZE, 292, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(combatResultLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 27, Short.MAX_VALUE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(meetMonsterButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(combatButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(nextButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addContainerGap())\n );\n\n pack();\n }",
"public static void main(String[] args) {\n People people0 = new People(\"Albert\", \"Einstein\", true);\n //People people1 = new People(\"Marie\",\"Curie\", false);\n ViewPeople view1 = new ViewPeople();\n\n ControlPeaple guiControl = new ControlPeaple(people0,view1);\n guiControl.startView();\n\n //System.out.println(people0);\n //System.out.println(people1);\n }",
"public void setupGui(){\n \t\n \t w1 = (RadioButton) guiView.findViewById(R.id.w1); \t\t \n \t w2 = (RadioButton) guiView.findViewById(R.id.w2);\n \t w3 = (RadioButton) guiView.findViewById(R.id.w3);\n \t w4 = (RadioButton) guiView.findViewById(R.id.w4);\n \t pb = (Button) guiView.findViewById(R.id.paint_button);\n \t plus = (Button) guiView.findViewById(R.id.plus_button);\n \t minus = (Button) guiView.findViewById(R.id.minus_button);\n \t \n \t \n \t //model select listener\n \t lis =new View.OnClickListener(){\n \t\t \n public void onClick(View v){\n \t RadioButton b = (RadioButton)v;\n \t String tmp=b.getHint().toString();\n \t int i = Integer.parseInt(tmp);\n \t setModel(i); \n }\n };\n w1.setOnClickListener(lis);\n w2.setOnClickListener(lis);\n w3.setOnClickListener(lis);\n w4.setOnClickListener(lis);\n \n w1.setHintTextColor(Color.TRANSPARENT);\n w2.setHintTextColor(Color.TRANSPARENT);\n w3.setHintTextColor(Color.TRANSPARENT);\n w4.setHintTextColor(Color.TRANSPARENT);\n \n w1.setChecked(true);\n \n //paint button listener\n pb.setOnClickListener(new View.OnClickListener(){\n public void onClick(View v){ \t \n \t paintWheel();\t \n }\n }); \n \n //plus button listener\n plus.setOnClickListener(new View.OnClickListener(){\n public void onClick(View v){ \t \n \t scaleUp();\t \n }\n }); \n \n //minus button listener\n minus.setOnClickListener(new View.OnClickListener(){\n public void onClick(View v){ \t \n \t scaleDown();\t \n }\n }); \n }",
"public SimpleGUI(String p_host, String p_name) {\r\n super();\r\n initialize();\r\n int porti=1099;\r\n String adresa=\"192.165.43.195\"; \r\n try\r\n {\r\n this.rem = (ServerInterface)Naming.lookup(\"rmi://\"+adresa+\":\"+porti+\"/RMD\");\r\n \t\r\n this.id = rem.EnterGame(p_name);\r\n System.out.println(\"Your id is : \"+ id);\r\n \t\r\n if(id == 0)\r\n {\r\n System.out.println(\"Max Connection reached\");\r\n \t\r\n }\r\n else\r\n {\r\n this.name = rem.getName(id);\r\n this.setTitle(\"Welcome \" + name);\r\n \t\r\n GiveCards();\r\n \t\r\n }\r\n \r\n }\r\n catch (MalformedURLException e)\r\n {\r\n System.err.println(\"MalformedURLException: \"+e.getMessage());\r\n }\r\n catch (RemoteException e)\r\n {\r\n System.err.println(\"RemoteException: \" + e.getMessage());\r\n }\r\n catch (NotBoundException e)\r\n {\r\n System.err.println(\"NotBoundException: \"+e.getMessage());\r\n }\r\n }",
"public void start(Stage primaryStage) {\r\n\t\ttry {\r\n\t\t\t/**\r\n\t\t\t * \r\n\t\t\t * collect players names for game mode person to person\r\n\t\t\t */\r\n\r\n\t\t\t// creating label First Number\r\n\t\t\tText player1 = new Text(\"First Player\");\r\n\r\n\t\t\t// creating label Second Number\r\n\t\t\tText player2 = new Text(\"Second Player\");\r\n\r\n\t\t\t// Creating Text Field for First Number\r\n\t\t\tTextField name1 = new TextField();\r\n\r\n\t\t\t// Creating Text Field for Second Number\r\n\t\t\tTextField name2 = new TextField();\r\n\r\n\t\t\t/**\r\n\t\t\t * collecting game setting -getting the desired level user of app need to play\r\n\t\t\t */\r\n\r\n\t\t\t/*\r\n\t\t\t * level buttons container -button level low or easy -button level normal or\r\n\t\t\t * medium -button level high or hard and all required setting for that\r\n\t\t\t */\r\n\t\t\tGridPane levelBtn = new GridPane();\r\n\t\t\t// Setting the padding\r\n\t\t\tlevelBtn.setPadding(new Insets(10, 10, 10, 10));\r\n\r\n\t\t\tButton level1 = new Button();\r\n\t\t\tlevel1.setMinSize(60, 60);\r\n\t\t\tImageView easy = new ImageView(\"File:C:\\\\Users\\\\Acer\\\\Desktop\\\\MsComputer\\\\Msc-Project\\\\pics\\\\low1.jpg\");\r\n\t\t\teasy.setFitWidth(60);\r\n\t\t\teasy.setFitHeight(60);\r\n\t\t\tlevel1.setGraphic(easy);\r\n\r\n\t\t\tButton level2 = new Button();\r\n\t\t\tlevel2.setMinSize(60, 60);\r\n\t\t\tImageView normal = new ImageView(\r\n\t\t\t\t\t\"File:C:\\\\Users\\\\Acer\\\\Desktop\\\\MsComputer\\\\Msc-Project\\\\pics\\\\normal2.png\");\r\n\t\t\tnormal.setFitWidth(60);\r\n\t\t\tnormal.setFitHeight(60);\r\n\t\t\tlevel2.setGraphic(normal);\r\n\r\n\t\t\tButton level3 = new Button();\r\n\t\t\tlevel3.setMinSize(60, 60);\r\n\t\t\tImageView hard = new ImageView(\"File:C:\\\\Users\\\\Acer\\\\Desktop\\\\MsComputer\\\\Msc-Project\\\\pics\\\\high1.png\");\r\n\t\t\thard.setFitWidth(60);\r\n\t\t\thard.setFitHeight(60);\r\n\t\t\tlevel3.setGraphic(hard);\r\n\r\n\t\t\tlevel1.setOnAction(e -> {\r\n\r\n\t\t\t\t/*\r\n\t\t\t\t * parameters of this state\r\n\t\t\t\t */\r\n\r\n\t\t\t\tBoardSize = 3;\r\n\t\t\t\tgLevel = 1;\r\n\t\t\t\tFramX = FramY = 600;\r\n\r\n\t\t\t\tSystem.out.println(nameP1);\r\n\t\t\t\tSystem.out.println(nameP2);\r\n\t\t\t\tgameSetting setGame = new gameSetting(nameP1, nameP2, gMode, gLevel, numGame, FramX, FramY, BoardSize);\r\n\r\n\t\t\t\tgameDriver run = new gameDriver();\r\n\t\t\t\trun.start(primaryStage);\r\n\r\n\t\t\t});\r\n\r\n\t\t\tlevel2.setOnAction(e -> {\r\n\r\n\t\t\t\tBoardSize = 5;\r\n\t\t\t\tgLevel = 1;\r\n\t\t\t\tFramX = FramY = 600;\r\n\r\n\t\t\t\tgameSetting setGame = new gameSetting(nameP1, nameP2, gMode, gLevel, numGame, FramX, FramY, BoardSize);\r\n\r\n\t\t\t\tgameDriver run1 = new gameDriver();\r\n\t\t\t\trun1.start(primaryStage);\r\n\r\n\t\t\t});\r\n\r\n\t\t\tlevel3.setOnAction(e -> {\r\n\r\n\t\t\t\tBoardSize = 9;\r\n\t\t\t\tgLevel = 2;\r\n\t\t\t\tFramX = FramY = 600;\r\n\r\n\t\t\t\tgameSetting setGame = new gameSetting(nameP1, nameP2, gMode, gLevel, numGame, FramX, FramY, BoardSize);\r\n\r\n\t\t\t\tgameDriver run2 = new gameDriver();\r\n\t\t\t\trun2.start(primaryStage);\r\n\r\n\t\t\t});\r\n\r\n\t\t\t// }\r\n\r\n\t\t\tlevelBtn.setPadding(new Insets(10, 10, 10, 10));\r\n\r\n\t\t\t// Setting the vertical and horizontal gaps between the columns\r\n\t\t\tlevelBtn.setVgap(20);\r\n\r\n\t\t\t// Setting the Grid alignment\r\n\t\t\tlevelBtn.setAlignment(Pos.CENTER);\r\n\r\n\t\t\t// Arranging all the nodes in the grid\r\n\t\t\tlevelBtn.add(level1, 0, 0);\r\n\t\t\tlevelBtn.add(level2, 0, 1);\r\n\t\t\tlevelBtn.add(level3, 0, 2);\r\n\r\n\t\t\tlevelBtn.setMinSize(200, 200);\r\n\r\n\t\t\t/**\r\n\t\t\t * main page which contain the desired mode or mode option for user of game\r\n\t\t\t * -person to person mode -person to android or computer mode all required\r\n\t\t\t * setting for that\r\n\t\t\t * \r\n\t\t\t */\r\n\t\t\t/*\r\n\t\t\t * image setting for representing mode\r\n\t\t\t */\r\n\t\t\tImageView pp = new ImageView(mode1);\r\n\t\t\tpp.setFitWidth(100);\r\n\t\t\tpp.setFitHeight(100);\r\n\r\n\t\t\tImageView pc = new ImageView(mode2);\r\n\t\t\tpc.setFitWidth(100);\r\n\t\t\tpc.setFitHeight(100);\r\n\r\n\t\t\t/*\r\n\t\t\t * grid pane contains all modes and relating setting\r\n\t\t\t */\r\n\t\t\tGridPane Mode = new GridPane();\r\n\t\t\tMode.setPadding(new Insets(10, 10, 10, 10));\r\n\t\t\tMode.setStyle(\"-fx-background-color: ANTIQUEWHITE;\");\r\n\r\n\t\t\t/*\r\n\t\t\t * button mode person to person and relating setting for this mode\r\n\t\t\t */\r\n\t\t\tButton P2P = new Button();\r\n\t\t\tP2P.setMinSize(100, 100);\r\n\t\t\tP2P.setStyle(\"-fx-background-color: ANTIQUEWHITE;\");\r\n\t\t\tP2P.setGraphic(pp);\r\n\r\n\t\t\tP2P.setOnAction(e -> {\r\n\r\n\t\t\t\t/*\r\n\t\t\t\t * Parameters this state\r\n\t\t\t\t */\r\n\t\t\t\tgMode = 1;\r\n\t\t\t\tnameP1 = name1.getText();\r\n\t\t\t\tnameP2 = name2.getText();\r\n\r\n\t\t\t\tif (name1.getText().isEmpty() || name2.getText().isEmpty()) {\r\n\r\n\t\t\t\t\tnameP1 = \"Player 1-Green\";\r\n\t\t\t\t\tnameP2 = \"player 2-Blue\";\r\n\t\t\t\t}\r\n\r\n\t\t\t\t/**\r\n\t\t\t\t * drawing all info and setting in single grid pane\r\n\t\t\t\t */\r\n\r\n\t\t\t\t/*\r\n\t\t\t\t * creating grid pane contains all elements to get player info in person to\r\n\t\t\t\t * person mode\r\n\t\t\t\t */\r\n\t\t\t\tGridPane gridPane = new GridPane();\r\n\r\n\t\t\t\t// Setting the padding\r\n\t\t\t\tgridPane.setPadding(new Insets(10, 10, 10, 10));\r\n\r\n\t\t\t\t// Setting the vertical and horizontal gaps between the columns\r\n\t\t\t\tgridPane.setVgap(5);\r\n\t\t\t\tgridPane.setHgap(5);\r\n\r\n\t\t\t\t// Setting the Grid alignment\r\n\t\t\t\tgridPane.setAlignment(Pos.CENTER);\r\n\r\n\t\t\t\t// Arranging all the nodes in the grid\r\n\t\t\t\tgridPane.add(player1, 0, 0);\r\n\t\t\t\tgridPane.add(name1, 1, 0);\r\n\t\t\t\tgridPane.add(player2, 0, 1);\r\n\t\t\t\tgridPane.add(name2, 1, 1);\r\n\r\n\t\t\t\t/*\r\n\t\t\t\t * creating border pane contains all elements in person to person mode page and\r\n\t\t\t\t * relating setting\r\n\t\t\t\t */\r\n\t\t\t\tBorderPane rProfile = new BorderPane();\r\n\t\t\t\trProfile.setTop(gridPane);\r\n\t\t\t\trProfile.setCenter(levelBtn);\r\n\t\t\t\trProfile.setStyle(\"-fx-background-color:ANTIQUEWHITE; -fx-text-fill: white;\");\r\n\r\n\t\t\t\t// set scene for person to person mode page\r\n\t\t\t\tpage2 = new Scene(rProfile, 300, 300);\r\n\t\t\t\tprimaryStage.setScene(page2);\r\n\r\n\t\t\t});\r\n\r\n\t\t\t/*\r\n\t\t\t * button mode person to computer and relating setting for this mode\r\n\t\t\t */\r\n\t\t\tButton P2C = new Button();\r\n\t\t\tP2C.setMinSize(100, 100);\r\n\t\t\tP2C.setStyle(\"-fx-background-color: ANTIQUEWHITE;\");\r\n\t\t\tP2C.setGraphic(pc);\r\n\r\n\t\t\tP2C.setOnAction(e -> {\r\n\r\n\t\t\t\t/*\r\n\t\t\t\t * Parameters this state\r\n\t\t\t\t */\r\n\t\t\t\tgMode = 2;\r\n\t\t\t\tnameP1 = \"Person\";\r\n\t\t\t\tnameP2 = \"Robot\";\r\n\t\t\t\t/*\r\n\t\t\t\t * creating border pane contains all elements in person to computer mode page\r\n\t\t\t\t * and relating setting\r\n\t\t\t\t */\r\n\t\t\t\tBorderPane rProfile = new BorderPane();\r\n\t\t\t\trProfile.setCenter(levelBtn);\r\n\t\t\t\trProfile.setStyle(\"-fx-background-color:ANTIQUEWHITE; -fx-text-fill: white;\");\r\n\r\n\t\t\t\t// set scene for person to computer mode page\r\n\t\t\t\tpage2 = new Scene(rProfile, 400, 400);\r\n\t\t\t\tprimaryStage.setScene(page2);\r\n\r\n\t\t\t});\r\n\r\n\t\t\tMode.add(P2P, 0, 0);\r\n\t\t\tMode.add(P2C, 1, 0);\r\n\t\t\t// Mode.setVgap(5);\r\n\t\t\tMode.setHgap(15);\r\n\t\t\tMode.setAlignment(Pos.CENTER);\r\n\t\t\t/*\r\n\t\t\t * Creating exist button to exist from game\r\n\t\t\t * and relating setting\r\n\t\t\t * \r\n\t\t\t */\r\n\t\t\tButton exist = new Button();\r\n\t\t\texist.setStyle(\"-fx-background-color: ANTIQUEWHITE;\");\r\n\t\t\texist.setMinSize(50, 50);\r\n\t\t\tImageView ext = new ImageView(\"File:C:\\\\Users\\\\Acer\\\\Desktop\\\\MsComputer\\\\Msc-Project\\\\pics\\\\out.png\");\r\n\t\t\text.setFitWidth(50);\r\n\t\t\text.setFitHeight(50);\r\n\t\t\texist.setGraphic(ext);\r\n\t\t\texist.setPadding(new Insets(10, 10, 10, 10));\r\n\t\t\texist.setOnAction(e -> {\r\n\t\t\t\t/*\r\n\t\t\t\t * exist the game\r\n\t\t\t\t */\r\n\t\t\t\tSystem.exit(-1);\r\n\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t/*\r\n\t\t\t * creating border pane as root contains all modes\r\n\t\t\t */\r\n\t\t\tBorderPane rMode = new BorderPane();\r\n\t\t\trMode.setCenter(Mode);\r\n\t\t\trMode.setTop(exist);\r\n\t\t\trMode.setStyle(\"-fx-background-color:ANTIQUEWHITE; -fx-text-fill: white;\");\r\n\r\n\t\t\t// set scene for mode page and welcom page\r\n\t\t\tpage1 = new Scene(rMode, 400, 300);\r\n\t\t\tprimaryStage.setTitle(\"Tic-Tac-Toe for Children\");\r\n//\t\t\tImagePattern pattern = new ImagePattern(background);\r\n//\t\t\tpage1.setFill(pattern);\r\n\t\t\tpage1.getStylesheets().addAll(this.getClass().getResource(\"application.css\").toExternalForm());\r\n\t\t\tprimaryStage.setScene(page1);\r\n\t\t\tprimaryStage.setX(500);\r\n\t\t\tprimaryStage.setY(100);\r\n\t\t\tprimaryStage.show();\r\n\t\t} catch (\r\n\r\n\t\tException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}",
"public void powerOn() { //power_on\n String json = new Gson().toJson(new TelevisionModel(TelevisionModel.Action.ON));\n String a = sendMessage(json);\n TelevisionModel teleM = new Gson().fromJson(a, TelevisionModel.class);\n System.out.println(\"Client Received \" + json);\n\n if (teleM.getAction() == TelevisionModel.Action.ON) {\n isTurningOn = teleM.getValue();\n ui.updateArea(teleM.getMessage());\n }\n }",
"void addListeners() {\n\n loginButton.addActionListener(new ActionListener() {\n @Override\n public void actionPerformed(ActionEvent e) {\n // TODO add loading bar\n String name = loginNameBox.getText();\n\n if (name.contains(\"Enter\")) {\n name = \"n00b\";\n }\n\n if(name.contains(\" \")){\n name = name.replace(' ','_');\n }\n try {\n loginBar.setVisible(true);\n //TODO add loading thread\n\n client = new Client(name);\n\n frame.setTitle(\"Player \" + client.getId() + \": (\" + client.getName() + \")\");\n frame.loginScreen.setVisible(false);\n frame.menuScreen.setVisible(true);\n\n updateThread = new Thread(new Runnable() { // TODO thread to update game state\n @Override\n public void run() {\n try {\n while (true) {\n frame.updateState();\n Thread.sleep(1000);\n }\n } catch (Exception e) {\n // e.printStackTrace();\n }\n }\n });\n\n String[] playerBall = client.whoIsBall();\n frame.ballState(false, playerBall[0]);\n updateThread.start();\n } catch (Exception error) {\n JOptionPane.showMessageDialog(null, error.getMessage());\n }\n\n }\n });\n\n loginNameBox.addKeyListener(new KeyAdapter() {\n @Override\n public void keyPressed(KeyEvent k) {\n if (loginNameBox.getText().contains(\"Enter\")) {\n loginNameBox.setText(\"\");\n }\n }\n });\n\n menuThrowButton.addActionListener(new ActionListener() {\n @Override\n public void actionPerformed(ActionEvent e) {\n client.throwToPlayer(menuPlayersComboBox.getSelectedItem().toString());\n }\n });\n\n menuRefreshButton.addActionListener(new ActionListener() {\n @Override\n public void actionPerformed(ActionEvent e) {\n updateComboBox();\n }\n\n });\n\n this.addWindowListener(new WindowAdapter() { // Executes when window is closed\n public void windowClosing(WindowEvent e) {\n // closes client connection if window closed\n try {\n if (updateThread.isAlive()) {\n updateThread.interrupt();\n }\n } catch (Exception ex) {\n }\n\n try {\n client.close();\n } catch (Exception ex) {\n }\n\n System.out.println(\"Goodbye\");\n }\n });\n }",
"private void createNetworkScreen() {\n\t\tnetworkSelectGroup = new VerticalGroup();\n\t\tif(MULTIPLAYER)\n\t\t\tnetworkSelectGroup.setVisible(true);\n\t\telse\n\t\t\tnetworkSelectGroup.setVisible(false);\n\t\t\n\t\tnetworkSelectGroup.setSize(WIDTH/2, HEIGHT/2);\n\t\tnetworkSelectGroup.setPosition(WIDTH/2 - networkSelectGroup.getWidth()/2, HEIGHT/2 - networkSelectGroup.getHeight()/2);\n\t\t\n\t\tTextButtonStyle smallStyle = new TextButtonStyle();\n\t\tsmallStyle.font = fontMedium;\n\t\t\n\t\tTextButton beServer = new TextButton(\"Create server\", smallStyle);\n\t\tbeServer.addListener(new InputListener(){\n\t\t\tpublic boolean touchDown(InputEvent event, float x, float y, int pointer, int button) {\n\t\t\t\tif(networkManager != null)\n\t\t\t\t\tnetworkManager.makeMeServer();\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t\n\t\t\tpublic void touchUp(InputEvent event, float x, float y, int pointer, int button) {\n\t\t\t\tnetworkSelectGroup.setVisible(false);\n\t\t\t\t\n\t\t\t}\n\t\t});\n\t\tTextButton beClient = new TextButton(\"Join server\", smallStyle);\n\t\tbeClient.addListener(new InputListener(){\n\t\t\tpublic boolean touchDown(InputEvent event, float x, float y, int pointer, int button) {\n\t\t\t\tif(networkManager != null)\n\t\t\t\t\tnetworkManager.makeMeClient();\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t\n\t\t\tpublic void touchUp(InputEvent event, float x, float y, int pointer, int button) {\n\t\t\t\tnetworkSelectGroup.setVisible(false);\n\t\t\t\tserverSelectGroup.setVisible(true);\n\t\t\t}\n\t\t});\n\t\t\n\t\tnetworkSelectGroup.addActor(beServer);\n\t\t\n\t\tnetworkSelectGroup.addActor(beClient);\n\n\t\t\n\t\tsmallStyle.font = fontSmall;\n\t\tTextButton notes = new TextButton(\"Connect both device to same\\n wifi network or create a hotspot\\n in one device and request another\\n one to join.\\n\\nUnder Construction\", smallStyle);\n\t\t//notes.setPosition(server, y, alignment);\n\t\tnetworkSelectGroup.addActor(notes);\n\n\n\t\t\n\t\tstage.addActor(networkSelectGroup);\n\t}",
"public void setup(){\n\n\t\t/*for(Integer group : this.onBeat.keySet()){\n\t\t\tthis.onBeat.put(group, false);\n\t\t}*/\n\t\tdspW=600;\n\t\t\n\t\t//CREATE TABS\n\t\tTab globalTab=controlP5.getTab(\"global\");\n\t\t\n\t\taddSlider(null,\"layer0bgAlpha.v\" ,0,0,1,5,18,80,h,globalTab,null).setCaptionLabel(\"bgAlpha 1\");\n\t\t\n\t\t//Top Buttons\n\t\tint y=3; \n\t\tint x=300;\n\t\taddButton(null,\"Save\",x,y,30,h,globalTab,null);\n\t\tx+=30+wMargin;\n\t\taddButton(null,\"Save All\",x,y,40,h,globalTab,null);\n\t\tx+=40+wMargin;\n\t\tx+=wMargin;\n\t\tif(Config.OSC){\n\t\t\taddButton(null,\"Send\",x,y,45,h,globalTab,null);\n\t\t\tx+=45+wMargin;\n\t\t\taddButton(null,\"SendAll\",x,y,45,h,globalTab,null);\n\t\t\tx+=45+wMargin;\n\t\t\tx+=wMargin;\n\t\t}\n\t\taddButton(null,\"Frame\",x,y,30,h,globalTab,null);\n\t\tx+=30+wMargin;\n\t\taddLabel(null,\"currentLayer\",\"\",x,y,globalTab,null);\n\t\tx+=12;\n\t\taddTextfield(null,\"layerType\",\"\",x,y-2,80,(int)(h*1.5),globalTab,null).setCaptionLabel(\"\");\n\t\tx+=80+wMargin; \n\t\taddTextfield(null,\"layerName\",\"\",x,y-2,80,(int)(h*1.5),globalTab,null).setCaptionLabel(\"\");\n\t\tx+=80+wMargin; \n\t\taddButton(null,\"relocate\",x,y,45,h,globalTab,null);\n\t\tx+=45+wMargin;\n\t\taddSlider(null,\"frames\" ,0,0,80,x,y,60,h,globalTab,null).setCaptionLabel(\"FPS\");\n\t\tx+=60+30+wMargin;\n\t\taddSlider(null,\"refresh\" ,10,0,500,x,y,60,h,globalTab,null).setCaptionLabel(\"Gui(ms)\");\n\t\tx+=90+wMargin; \n\t\taddToggle(null,\"LP\",true,10,300,h,h,globalTab,null);\n\t\t\n\t\t\n\t\t//Layers\n\t\tx=wMargin;\n\t\ty=hMargin+30;\n\t\taddLabel(null,\"Layers label\",\"Layers\",x,y,globalTab,null);\n\t\ty+=h+hMargin;\n\t\tx=5;\n\t\tfor(int i=0;i<app.layers.length;i++){\n\t\t\taddToggle(null,\"Layer Enabled \"+i,((i==0)?true:false),x,y+i*(h+hMargin),h,h,globalTab,null).setCaptionLabel(\"\");\n\t\t\taddButton(null,\"layer\"+(i)+\"fgDsp\", x+wMargin*4+h+3,y+i*(h+hMargin),h*2,h,globalTab,null).setCaptionLabel((1+i)+\"\");\n\t\t} \n\t\tx=h+2*wMargin+1; \n\t\t//layers\n\t\tString[] layerNames = new String[app.layers.length];\n\t\tint[] layerNumbers = new int[app.layers.length];\n\t\tfor(int i=0;i<app.layers.length;i++){\n\t\t\tlayerNames[i]=\"\";\n\t\t\tlayerNumbers[i]=(i);\n\t\t}\n\t\taddRadio(null,\"Layer Selected\",layerNames,x,y,null,null,globalTab,null).setLabel(\"\");\n\t\ty=34;x=60;\n\t\taddRadio(null,\"ghostLayer.v\",new String[]{\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"},x,y,null,null,globalTab,null); \n\n\n\t\t//Sound and FPS\n\t\tx=dspW+h+hMargin-5;\n\t\ty=windowH-(app.soundController.getGroups().size())*(h+hMargin)-50;\n\t\taddToggle(null,\"autoBeatSense\",true,x,y,h,h,globalTab,null).setCaptionLabel(\"\");\n\t\tx+=h+wMargin;\n\t\taddLabel(null,\"autoBeatSenseL\",\"Auto Sense\",x,y,globalTab,null);\n\t\taddSlider(null,\"beatSenseSense\" ,1.1f,0.5f,5,x+15,y,120,null,globalTab,null).setCaptionLabel(\"\");\n\n\t\t\n\t\t//SC groups\n\t\tx=dspW+h+hMargin-5;\n\t\ty=windowH-(app.soundController.getGroups().size())*(h+hMargin)-20;\n\t\tfor(int i=0;i<app.soundController.getGroups().size();i++){\n\t\t\taddToggle(null,\"bang-\"+i,false ,x,y+(i)*(h+hMargin),h,h,globalTab,null).setCaptionLabel(\"\");\n\t\t\tcontrolP5.getController(\"bang-\"+i).setColorActive(app.color(255,0,255));\n\t\t\taddSlider(null,\"score-\"+i ,0,0,20,x+50,y+(i)*(h+hMargin),w,null,globalTab,null).setCaptionLabel(\"\"); \n\t\t\taddSlider(null,\"beatsense-\"+i ,0,0,20,x+50+h+w,y+(i)*(h+hMargin),w/3,null,globalTab,null).setCaptionLabel(\"\");\n\n\t\t}\n\t\tx+=h+wMargin;\n\t\taddRadio(null,\"scGroup\",new String[]{\"g\",\"1\",\"2\",\"3\",\"4\",\"5\"},x,y,null,null,globalTab,null);\n\t\tx+=h+wMargin;\n\t\tx=dspW+h+hMargin-5;\n\t\ty=windowH-(app.soundController.getGroups().size()+1)*(h+hMargin);\n\t\taddLabel(null,\"SC Group : \",\"current : \",x,y-20,globalTab,null);\n\t\tx+=38+wMargin;\n\t\taddLabel(null,\"currentController\",\"\",x,y-20,globalTab,null);\n\t\ty+=h+hMargin;\n\n\t\t\n\t\t//global Buttons\n\t\tx=dspW+h+hMargin-5;\n\t\ty=windowH-(app.soundController.getGroups().size())*(h+hMargin)-80;\n\t\taddButton(null,\"bump+\",x,y+h+hMargin,35,null,globalTab,null) ; \n\t\tx+=40;\n\t\taddButton(null,\"bump-\",x,y+h+hMargin,35,null,globalTab,null) ;\n\t\tx+=40+wMargin;\n\t\taddButton(null,\"speed+\",x,y+h+hMargin,35,null,globalTab,null) ;\n\t\tx+=40;\n\t\taddButton(null,\"speed-\",x,y+h+hMargin,35,null,globalTab,null) ;\n\t\ty+=h+hMargin;\n\n\n\t\t//DSP Band Buttons\n\t\tif(app.soundController!=null && Config.DSP){\n\t\t\tif(bandWidth==0){\n\t\t\t\tcomputeBanWidth();\n\t\t\t}\n\t\t\tfor(int i=0;i<app.soundController.zoneEnabled().length;i++){\n\t\t\t\taddToggle(null,\"band\"+i,true,10+1+(bandWidth+1)*i,windowH-13-20,bandWidth,7,globalTab,null).setCaptionLabel(\"\");\n\t\t\t}\n\t\t}\n\n\n\t\t//LAYER TABS\n\t\tint tabX=80;\n\t\tint tabY=30;\n\t\tboolean first=false;\n\t\tfor(String layerType : Config.LAYER_TYPES.split(\"[, ]+\")){\n\t\t\tString tabName = first?\"default\":layerType;\n\t\t\tfirst=false;\n\t\t\tTab tab = controlP5.getTab(tabName);\n\t\t\ttab.setTitle(layerType.replace(\"Layer\", \"\").replace(\"NineBlockPattern\",\"Pattern\"));\n\t\t\tLayer layer;\n\t\t\ttry {\n\t\t\t\tlayer = Layer.newLayer(app, layerType);\n\t\t\t\tlayer.buildUI(this, tabX, tabY,tab,null);\n\t\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t} \n\t\t}\n\n\t}",
"public static void main(String[] args) {\n \n try {\n boolean useGUI = false;\n int i = -1;\n\n // Parse options. Add additional options here if you have to. Do not\n // forget to mention their usage in the help-string!\n while(args[++i].startsWith(\"-\")) {\n if(args[i].toLowerCase().equals(\"-help\")) {\n System.out.println(USAGE + String.format(\"%n%nwhere options include:\", args));\n System.out.println(\" -help Show this text.\");\n System.out.println(\" -gui Show a graphical user interface.\");\n System.exit(0);\n }\n else if(args[i].toLowerCase().equals(\"-gui\")) {\n useGUI = true;\n }\n }\n \n String mode = args[i++];\n String connectionType = args[i++];\n\n if(mode.toLowerCase().equals(\"server\"))\n {\n int port = Integer.parseInt(args[i++]);\n \n // Start server\n if(connectionType.toLowerCase().equals(\"tcp\"))\n {\n try\n {\n Player player = new Player();\n Server server = new ConnectionServerTCP(port, player);\n \n Thread cs = new Thread(server);\n cs.start();\n Log.log(\"Main: Starting Thread ConnectionServer (\"+cs.getName()+\")\");\n \n cs.join();\n \n Log.notice(\"Main: shuting down\");\n }\n catch(Exception e)\n {\n e.printStackTrace();\n }\n } else if(connectionType.toLowerCase().equals(\"udp\"))\n {\n try\n {\n Player player = new Player();\n Server server = new ConnectionServerTCP(port, player);\n \n Thread cs = new Thread(server);\n cs.start();\n Log.log(\"Main: Starting Thread ConnectionServer (\"+cs.getName()+\")\");\n \n cs.join();\n \n Log.notice(\"Main: shuting down\");\n }\n catch(Exception e)\n {\n e.printStackTrace();\n }\n } else if(connectionType.toLowerCase().equals(\"mc\"))\n {\n try\n {\n Player player = new Player();\n Server server = new ConnectionServerMC(port, player);\n \n Thread cs = new Thread(server);\n cs.start();\n Log.log(\"Main: Starting Thread ConnectionServer (\"+cs.getName()+\")\");\n \n cs.join();\n \n Log.notice(\"Main: shuting down\");\n }\n catch(Exception e)\n {\n e.printStackTrace();\n }\n }\n }\n else if(mode.toLowerCase().equals(\"client\"))\n {\n String host = args[i++];\n int port = Integer.parseInt(args[i++]);\n String username = args[i++];\n \n // Start client\n if(connectionType.toLowerCase().equals(\"tcp\"))\n {\n try\n {\n ClientGUI gui = new ClientGUI();\n RadioClientTCP client = new RadioClientTCP(gui);\n gui.setContext(client);\n \n Thread rc = new Thread(client);\n new Thread(gui).start();\n rc.start();\n Log.log(\"Main: Starting Thread RadioClient (\"+rc.getName()+\")\");\n \n //client.connect(new InetSocketAddress(host, port));\n \n rc.join();\n \n Log.notice(\"Main: shuting down\");\n }\n catch(Exception e)\n {\n e.printStackTrace();\n }\n } else if(connectionType.toLowerCase().equals(\"udp\"))\n {\n try\n {\n ClientGUI gui = new ClientGUI();\n RadioClientUDP client = new RadioClientUDP(gui);\n gui.setContext(client);\n \n Thread rc = new Thread(client);\n new Thread(gui).start();\n rc.start();\n Log.log(\"Main: Starting Thread RadioClient (\"+rc.getName()+\")\");\n \n //client.connect(new InetSocketAddress(host, port));\n \n rc.join();\n \n Log.notice(\"Main: shuting down\");\n }\n catch(Exception e)\n {\n e.printStackTrace();\n }\n } else if(connectionType.toLowerCase().equals(\"mc\"))\n {\n try\n {\n ClientGUI gui = new ClientGUI();\n RadioClientMC client = new RadioClientMC(gui);\n gui.setContext(client);\n \n Thread rc = new Thread(client);\n new Thread(gui).start();\n rc.start();\n Log.log(\"Main: Starting Thread RadioClient (\"+rc.getName()+\")\");\n \n //client.connect(new InetSocketAddress(host, port));\n \n rc.join();\n \n Log.notice(\"Main: shuting down\");\n }\n catch(Exception e)\n {\n e.printStackTrace();\n }\n }\n \n else\n throw new IllegalArgumentException(\"Illegal connection method\");\n }\n else\n throw new IllegalArgumentException(\"Illegal program mode\");\n }\n catch(ArrayIndexOutOfBoundsException e) {\n System.err.println(USAGE);\n }\n catch(NumberFormatException e) {\n System.err.println(USAGE);\n }\n catch(IllegalArgumentException e) {\n System.err.println(USAGE);\n }\n }",
"@Override\n public void start(Stage stage) throws Exception {\n window = stage;\n rootPane = new BorderPane(); //Spans the entire window.\n clientID = 1; //THE CLIENT ID IS OFFICIALLY 1\n //displayedLocationPane = new BorderPane(); //A displayedLocationPane\n //displayedLocationPane.setStyle(\"-fx-background-color: pink\");\n World guiWorld = new WorldImpl(); //This is the different world.\n GUIWorldManager worldManager = new GUIWorldManager(guiWorld);\n worldManager.makeCharactersInWorld(guiWorld);\n clientChar = guiWorld.getCharacter(clientID);\n LocationHome home = new LocationHome(clientChar); //Note: GUILocationPane\n\n //Creating characters\n for(PlayerCharacter each : guiWorld.getCharacters().values()) {\n guiCharacters.put(each.getId(), each); //Put the characters in a data structure so that they can be kept track of\n home.placePlayer(each); //home.placePlayer initially places a sprite on the board.\n each.addMovementListener(new MovementListener() {\n @Override\n public void thingMoved(int thingId, Position position) {\n //System.out.println(\"Movemade\");\n\n Platform.runLater(() -> {\n try {\n home.relocatePlayer(guiCharacters.get(thingId));\n } catch (NoSuchMethodException e) {\n e.printStackTrace();\n } catch (InvocationTargetException e) {\n e.printStackTrace();\n } catch (IllegalAccessException e) {\n e.printStackTrace();\n }\n });\n }\n });\n }\n\n\n\n System.out.println(\"Client Id: \" + clientID);\n clientChar = guiCharacters.get(clientID);\n home.attachDialoguePane();\n //rootPane.setStyle(\"-fx-background-color: pink\");\n //home.setStyle(\"-fx-background-color: pink\");\n //home.setStyle(\"-fx-background-color: green\");\n //displayedLocationPane.getChildren().addAll(home);\n rootPane.getChildren().addAll(home);\n Scene currScene = new Scene( rootPane, 1024, 1024 );//Passing the rootPane/group to currScene\n currScene.getStylesheets().add(\"/spoonstyle.css\");\n stage.setScene(currScene); //Make currScene contents visible\n GUIMovementKeys keyInputObj = new GUIMovementKeys(currScene);\n keyInputObj.addMovementKeysToScene(currScene, clientChar); //Makes the current scene capable of accepting input and moving the client player\n keyInputObj.setClientSprite(home.getClientSprite());\n keyInputObj.setAllSprites(home.getAllPlayerSpritesInLocation());\n stage.setTitle(\"Spoon Game\");\n stage.show();\n// System.out.println(\"rootPane width and height: \" + rootPane.getWidth() + \" \" + rootPane.getHeight());\n// System.out.println(\"home width and height: \" + home.getWidth() + \" \" + home.getHeight());\n// System.out.println(\"displayablelocation width and height: \" + displayedLocationPane.getWidth() + \" \" + displayedLocationPane.getHeight());\n\n //LocationHome home = new LocationHome(guiCharacters.get(1));\n\n\n //#TODO: How does the backend know its client's player?\n new Timer().schedule(\n new TimerTask() {\n\n @Override\n public void run() {\n guiWorld.timestep();\n }\n }, 0, 5);\n\n\n //worldManager.backendTimeStep(guiWorld);\n\n }",
"@FXML\n final void btnOnlineClick() {\n new Thread(() -> sceneHandler.setActiveScene(GameScene.MULTI_INTRO)).start();\n }",
"@FXML\n public void btnStartGame(Event e)\n {\n\n LobbyPlayer lobbyPlayer = PlayerSingleton.getPlayer().getLobbyPlayer();\n try {\n List<LobbyPlayer> lobbyPlayerList = LobbyServerConnection.getInstance().getPlayerList(lobbyPlayer);\n\n List<Player> pl = new ArrayList<>();\n\n for (LobbyPlayer lp :lobbyPlayerList) {\n Player p = new Player(lp.getUniqueId(), lp.getName());\n pl.add(p);\n }\n\n //game gets starter on server\n GameServerConnection.getInstance().startGame(pl);\n sleep();\n //tartGamevanuit lobby\n LobbyServerConnection.getInstance().startGame(lobbyPlayer);\n\n } catch (RemoteException e1) {\n log.warning(e1.toString());\n log.warning(\"couldn't create a game\");\n }\n }",
"public static void PVP(String name){ //for player vs player mode\r\n \r\n welcome.remove(p1first); \r\n welcome.remove(p2first);\r\n welcome.remove(hORt); //reformatting\r\n welcome.updateUI();\r\n \r\n if(name.equals(name1)&&numTurns==0){ //user 1 going first\r\n instructions.setText(\"<html>\" + name1 + \"<html> you are going first! <br><br> Please click the column number you wish to place your checker in. </html>\");\r\n whoseTurn = 1;\r\n welcome.remove(input);\r\n welcome.updateUI();\r\n canGo = true; //now, when the user clicks the column button, a checker may actually be placed\r\n }\r\n if(name.equals(name2)&&numTurns==0){ //user 2 going first\r\n instructions.setText(\"<html>\" + name2 + \"<html> you are going first! <br><br> Please click the column number you wish to place your checker in. </html>\");\r\n whoseTurn = 2;\r\n welcome.remove(input);\r\n welcome.updateUI();\r\n canGo = true;\r\n }\r\n }",
"public void repeatGui(String name){\r\n winCounter.setText(\"User Win Counter: \"+userWins);\r\n \r\n if(playAgain==false){ //if they don't want to play again\r\n if(name.equals(\"AI\")&&fullBoard()==false){\r\n instructions.setText(\"<html> The AI has won the game. \"+\"</br> Better luck next time. </br> Would you like to play again? </html>\");\r\n }\r\n else if(fullBoard()==true){\r\n instructions.setText(\"<html>Wow!, It's a tie! \"+\"</br> Would you like to play again?\");\r\n }\r\n else{\r\n instructions.setText(\"<html>Congratulations! \"+\"</br>\" +name+ \", you have won the game!</br> Would you like to play again? </html>\");\r\n }\r\n \r\n welcome.add(again);\r\n welcome.add(notAgain);\r\n again.setAlignmentX(Component.CENTER_ALIGNMENT);\r\n notAgain.setAlignmentX(Component.CENTER_ALIGNMENT); //adding the buttons that let the user decide whtehr to play again\r\n welcome.remove(input);\r\n }\r\n \r\n if(playAgain==true){ //if they want to play again\r\n super.dispose();\r\n name1=\"\"; \r\n name2 = \"AI\"; \r\n choice = 1; \r\n mode = 1; //resetting all necessary variables and restarting the GUI\r\n whoseTurn = 1; \r\n numTurns = 0; \r\n canGo = false; \r\n randomnum = -1;\r\n AINumber = 3; \r\n erase = 0; \r\n color2=Color.magenta;\r\n AIPlayed = false; \r\n GameWon = false;\r\n playAgain = false;\r\n canPlace = true;\r\n trapBlocked = false;\r\n mustPlace = -1;\r\n \r\n for(int i = 0; i<7; i++){ //resetting everything so that the next time the GUI runs, things are not messed up\r\n shouldNotPlace[i] = -1;\r\n }\r\n \r\n okButton.removeActionListener(this); //removing all the actionlisteners becauase i dont want to have two action listeners when the gui is run again\r\n pvp.removeActionListener(this);\r\n pvai.removeActionListener(this);\r\n black.removeActionListener(this);\r\n red.removeActionListener(this);\r\n yellow.removeActionListener(this);\r\n green.removeActionListener(this);\r\n okayButton.removeActionListener(this);\r\n easyAI.removeActionListener(this);\r\n hardAI.removeActionListener(this);\r\n again.removeActionListener(this);\r\n notAgain.removeActionListener(this);\r\n p1first.removeActionListener(this);\r\n p2first.removeActionListener(this);\r\n hORt.removeActionListener(this);\r\n \r\n instructions.setText(\"Please enter your name\"); //the original thing that it's supposed to say\r\n \r\n for(int i = 0; i<6; i++){\r\n for(int j = 0; j<7; j++){\r\n arrayCircles[i][j].setColor(Color.white);\r\n }\r\n }\r\n \r\n welcome.removeAll();\r\n board.removeAll(); //removing all components from the panels\r\n \r\n remove(board); //removing the panels\r\n remove(welcome);\r\n \r\n Connect4Final frame1 = new Connect4Final(); //restarting the Frame with a new instance\r\n }\r\n }",
"public ConnectFive()\n {\n setTitle(\"Connect Five\");\n setResizable(false);\n setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n getContentPane().setLayout(new BorderLayout());\n\n //adding buttons (top)\n JPanel boardSizePanel = new JPanel(new GridLayout(2, 3, 5 , 5));\n JButton largeBoard = new JButton(\"Board Size (15x15)\");\n JButton mediumBoard = new JButton(\"Board Size (12x12)\");\n JButton smallBoard = new JButton(\"Board Size (9x9)\");\n JButton playGame = new JButton(\"Play Game\");\n JButton change = new JButton(\"Change Color\");\n JButton muting = new JButton(\"Mute\");\n for (JButton button: new JButton[] { largeBoard, mediumBoard, smallBoard, change, playGame, muting })\n {\n button.setFocusPainted(true);\n boardSizePanel.add(button);\n }\n getContentPane().add(boardSizePanel, BorderLayout.NORTH);\n board = new Board(15);\n playing = false;\n mute = false;\n\n //create Board GUI instance (center)\n boardPanel = new BoardPanel(board); //initializing the panel for the model\n boardPanel.setPreferredSize(new Dimension(670, 670));\n getContentPane().add(boardPanel, BorderLayout.CENTER);\n\n //creating message label (bottom)\n JPanel statusPanel = new JPanel();\n statusPanel.setBackground(Color.DARK_GRAY);\n statusPanel.setPreferredSize(new Dimension(670, 50));\n message = new JLabel(\"Welcome to Connect Five\");\n message.setForeground(Color.WHITE);\n message.setFont(new Font(message.getName(), Font.BOLD, 28));\n statusPanel.add(message);\n getContentPane().add(statusPanel, BorderLayout.SOUTH);\n\n\n //Actions for the three different buttons.\n //Actions for (15x15) button\n largeBoard.addActionListener(e ->\n {\n buttonSound();\n gameButton(15);\n });\n\n //Actions for (12x12) button\n mediumBoard.addActionListener(e ->\n {\n buttonSound();\n gameButton(12);\n });\n\n //Actions for (9x9) button\n smallBoard.addActionListener(e ->\n {\n buttonSound();\n gameButton(9);\n });\n\n //Actions for play game button\n playGame.addActionListener(e ->\n {\n if(playing)\n {\n play();\n }\n else if(!playing)\n {\n playing = true;\n play();\n boardPanel.setPlaying(true);\n }\n });\n message.setText(\"Please choose your table mode.\");\n\n //Actions for change color button\n change.addActionListener(e ->\n {\n boolean foundColor = true;\n String [] colors = {\"Green\",\"Blue\",\"Yellow\",\"Red\",\"Black\",\"Gray\",\"Orange\",\"Purple\"};\n String[] possibilities = {\"hey\",\"no\"};//Simple initialization\n String colorPlayer1 = BoardPanel.getPlayer1ColorName();\n String colorPlayer2 = BoardPanel.getPlayer2ColorName();\n if(playing)\n {\n String inputColor = \"\";\n int r = 0, g = 0, b = 0;\n possibilities = new String[6];\n for(int i = 0, j= 0; i < 6 && j < colors.length; j++)\n {\n if(!(colorPlayer1.equals(colors[j])) && !(colorPlayer2.equals(colors[j])))//Adds the options to be displayed if they are not used.\n {\n possibilities[i] = colors[j];\n i += 1;\n }\n }\n if(board.getNumberOfDisks() % 2 == 0)\n {\n inputColor = (String) JOptionPane.showInputDialog(null, \"Color\",\"Player 1 please choose a color.\", JOptionPane.QUESTION_MESSAGE, null, possibilities,colorPlayer1); // Gets the color choosen by the user.\n }\n else if(board.getNumberOfDisks() % 2 == 1)\n {\n inputColor = (String) JOptionPane.showInputDialog(null, \"Color\",\"Player 2 please choose a color.\", JOptionPane.QUESTION_MESSAGE, null, possibilities,colorPlayer2); // Gets the color choosen by the user.\n }\n if(inputColor != null)\n {\n switch(inputColor)\n {\n case \"Green\":\n r = 140;\n g = 197;\n b = 141;\n break;\n\n case \"Blue\":\n r = 0;\n g = 0;\n b = 255;\n break;\n\n case \"Yellow\":\n r = 240;\n g = 226;\n b = 84;\n break;\n\n case \"Red\":\n r = 237;\n g = 90;\n b = 76;\n break;\n\n case \"Black\":\n r = 0;\n g = 0;\n b = 0;\n break;\n\n case \"Gray\":\n r = 128;\n g = 128;\n b = 128;\n break;\n\n case \"Orange\":\n r = 237;\n g = 166;\n b = 79;\n break;\n\n case \"Purple\":\n r = 125;\n g = 110;\n b = 246;\n break;\n\n case \"Oscar\":\n r = 55;\n g = 120;\n b = 117;\n break;\n }\n Color provisional = new Color(r,g,b);\n if(board.getNumberOfDisks() % 2 == 0 && !inputColor.equals(\"\") && boardPanel.getPlayer2Color().getRGB() != provisional.getRGB())\n {\n boardPanel.setPlayer1Color(r,g,b);\n boardPanel.setPlayer1ColorName(inputColor);\n }\n else if(board.getNumberOfDisks() % 2 == 1 && !inputColor.equals(\"\") && boardPanel.getPlayer1Color().getRGB() != provisional.getRGB())\n {\n boardPanel.setPlayer2Color(r,g,b);\n boardPanel.setPlayer2ColorName(inputColor);\n }\n playcolorMod();\n }\n }\n });\n\n //Actions when the mute button is pressed\n muting.addActionListener(e ->\n {\n if(mute)\n mute = false;\n\n else if(!mute)\n mute = true;\n });\n\n //Actions when the mousd is clicked\n boardPanel.addMouseListener(new MouseAdapter()\n {\n public void mousePressed(MouseEvent e)\n {\n if(playing)\n {\n board.addDisk(e.getX(), e.getY());\n play();\n boardPanel.drawBoard();\n getContentPane().repaint();\n }\n else if(!playing)\n {\n errorSound();\n message.setFont(new Font(message.getName(), Font.BOLD, 22));\n message.setText(\"Please choose a new game board and press 'play game'.\");\n }\n }//end mouse pressed\n });\n }",
"public SnakeUI() {\r\n setFrame(); \r\n setKeyListener();\r\n setTimer();\r\n startGame();\r\n this.setVisible(true);\r\n }",
"@Override\n\tpublic void start(Stage primaryStage) throws Exception {\n\t\t// TODO Auto-generated method stub\n\t\tprimaryStage.setTitle(\"(Client) Let's Play Morra!!!\");\n\t\t\n\t\tHashMap<String,Scene> sceneMap = new HashMap<String,Scene>();\n\t\t\n\t\tsceneMap.put(\"game\", gameScene());\t\t\n\t\t// Login button event handler from intro scene\n\t\ttoTheGame = new EventHandler<ActionEvent>() {\n\t\t\tpublic void handle(ActionEvent event) {\n\t\t\t\tip.setText(\"Your IP: \" + ipField.getText());\n\t\t\t\tport.setText(\"Your Port: \" + portNum.getText());\n\t\t\t\t\n\t\t\t\tprimaryStage.setScene(sceneMap.get(\"game\"));\n\t\t\t\tclientConnection = new Client(data->{\n\t\t\t\t\tPlatform.runLater(()->{\n\t\t\t\t\t\tlistView.getItems().add(data.toString());\n\t\t\t\t\t\t\n\t\t\t\t\t\t// checking if Game is over\n\t\t\t\t\t\tint temp = listView.getItems().size();\n\t\t\t\t\t\tlistView.scrollTo(temp);\n\t\t\t\t\t\tString temp1 = listView.getItems().get(temp-1);\n\t\t\t\t\t\tif(temp1.contains(\"GoodBye.\")) {\n\t\t\t\t\t\t\tplayAgain.setDisable(true);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t}, ipField.getText(), Integer.parseInt(portNum.getText()));\n\t\t\t\t\n\t\t\t\tclientConnection.start();\n\t\t\t}\n\t\t};\n\t\t\n\t\tsceneMap.put(\"instr\", instructionScene());\n\t\ttoTheInstr = new EventHandler<ActionEvent>() {\n\t\t\tpublic void handle(ActionEvent event) {\n\t\t\t\tif(isValidPort(portNum.getText()) && isValidIP(ipField.getText())) {\n\t\t\t\t\tprimaryStage.setScene(sceneMap.get(\"instr\"));\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tportNum.setText(\"Check Port Number\");\n\t\t\t\t\tipField.setText(\"Check IP number\");\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\t\n\t\tsceneMap.put(\"intro\", introScene());\n\t\tprimaryStage.setScene(sceneMap.get(\"intro\"));\n\t\tprimaryStage.show();\n\t}",
"public void connectStandard(View view) throws InterruptedException {\n Intent intent = new Intent(this, StandardControlActivity.class);\n myoBackgroundService = new Intent(this, MyoBackgroundService.class);\n stopService(myoBackgroundService);\n startActivity(intent);\n finish();\n }",
"private void joinGame() {\n\t\tgame.connect(list.getSelectedValue());\n\t\tdispose();\n\t}",
"public UmiClient() {\r\n\t\tButton b;\r\n\t\tf = new Frame();// to show the window of the entire client info\r\n\t\tp = new Panel();// to show the buttons and the sea\r\n\t\tp.setLayout(new BorderLayout());\r\n\r\n\t\t\r\n\t\tb = new Button(\"up\");\r\n\t\tb.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\r\n\t\t\t\tsendCommand(\"up\");\r\n\t\t\t}\r\n\t\t});\r\n\t\tp.add(b, BorderLayout.NORTH);\r\n\r\n\t\tb = new Button(\"left\");\r\n\t\tb.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\r\n\t\t\t\tsendCommand(\"left\");\r\n\t\t\t}\r\n\t\t});\r\n\t\tp.add(b, BorderLayout.WEST);\r\n\r\n\t\tb = new Button(\"right\");\r\n\t\tb.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\r\n\t\t\t\tsendCommand(\"right\");\r\n\t\t\t}\r\n\t\t});\r\n\t\tp.add(b, BorderLayout.EAST);\r\n\r\n\t\tb = new Button(\"down\");\r\n\t\tb.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\r\n\t\t\t\tsendCommand(\"down\");\r\n\t\t\t}\r\n\t\t});\r\n\t\tp.add(b, BorderLayout.SOUTH);\r\n\r\n\t\t// generate the Canvas to show the sea\r\n\t\tc = new Canvas();\r\n\t\tc.setSize(256, 256);// set the size of the sea\r\n\t\t// set the GUI widgets\r\n\t\tp.add(c);\r\n\t\tf.add(p);\r\n\r\n\t\t// add login button on frame f\r\n\t\tb = new Button(\"login\");\r\n\t\tb.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\r\n\t\t\t\t// press login button...then... \r\n\t\t\t\t// if the server hasn't been set up, then execute the handling part\r\n\t\t\t\tif (server == null)\r\n\t\t\t\t\tlogin();\r\n\t\t\t}\r\n\t\t});\r\n\t\tf.add(b, BorderLayout.NORTH);\r\n\r\n\t\tb = new Button(\"logout\");\r\n\t\tb.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\r\n\t\t\t\tlogout();\r\n\t\t\t}\r\n\t\t});\r\n\t\tf.add(b, BorderLayout.SOUTH);\r\n\r\n\t\t// to show frame f\r\n\t\tf.setSize(335, 345);\r\n\t\tf.show();\r\n\t}",
"public void program3Pressed() {\n // display\n TextLCD.print(PROGRAM3);\n }",
"public void ChatGUI() {\n try {\n\n DataOutputStream out = new DataOutputStream(socket.getOutputStream());\n DataInputStream in = new DataInputStream(socket.getInputStream());\n out.writeUTF(\"Connmain\");\n String message = in.readUTF();\n if (message.equals(\"Conf\")) {\n ObjectInputStream inOb = new ObjectInputStream(socket.getInputStream());\n ArrayList<String> chatlog = (ArrayList<String>) inOb.readObject();\n\n new ChatGUI().start(stage, this, socket, chatlog);\n }\n } catch (IOException | ClassNotFoundException e) {\n e.printStackTrace();\n }\n }",
"public void actionPerformed(ActionEvent e)\n {\n \tif(buttonActionFlag)\n \t{\n \t\tGraphics controlDisplay = new BasicControls();\n \t\tGraphics outwardDisplay = new OutwardDisplay();\n \t\tTimerImpl t = new TimerImpl();\n \t\tt.addObserver(controlDisplay);\n \t\tt.addObserver(outwardDisplay);\n \t\tScoreboardImpl s = new ScoreboardImpl();\n \t\ts.addObserver(controlDisplay);\n \t\ts.addObserver(outwardDisplay);\n \t\tTeamImpl t1 = new TeamImpl(teamName1.getText());\n \t\tt1.addObserver(controlDisplay);\n \t\tt1.addObserver(outwardDisplay);\n \t\tTeamImpl t2 = new TeamImpl(teamName2.getText());\n \t\tt2.addObserver(controlDisplay);\n \t\tt2.addObserver(outwardDisplay);\n \t\tcontrolDisplay.start(t, s, t1, t2);\n \t\toutwardDisplay.start(t, s, t1, t2);\n\t\t\tteamFrame.dispose();\n \t}\n \telse\n \t{\n \t\tArrayList<Player> team1players = new ArrayList<Player>();\n \t\tteam1players.add(new PlayerImpl(team1playerName1.getText(), Integer.valueOf(team1playerNumber1.getText())));\n \t\tteam1players.add(new PlayerImpl(team1playerName2.getText(), Integer.valueOf(team1playerNumber2.getText())));\n \t\tteam1players.add(new PlayerImpl(team1playerName3.getText(), Integer.valueOf(team1playerNumber3.getText())));\n \t\tteam1players.add(new PlayerImpl(team1playerName4.getText(), Integer.valueOf(team1playerNumber4.getText())));\n \t\tteam1players.add(new PlayerImpl(team1playerName5.getText(), Integer.valueOf(team1playerNumber5.getText())));\n \t\tteam1players.add(new PlayerImpl(team1playerName6.getText(), Integer.valueOf(team1playerNumber6.getText())));\n \t\tteam1players.add(new PlayerImpl(team1playerName7.getText(), Integer.valueOf(team1playerNumber7.getText())));\n \t\tArrayList<Player> team2players = new ArrayList<Player>();\n \t\tteam2players.add(new PlayerImpl(team2playerName1.getText(), Integer.valueOf(team2playerNumber1.getText())));\n \t\tteam2players.add(new PlayerImpl(team2playerName2.getText(), Integer.valueOf(team2playerNumber2.getText())));\n \t\tteam2players.add(new PlayerImpl(team2playerName3.getText(), Integer.valueOf(team2playerNumber3.getText())));\n \t\tteam2players.add(new PlayerImpl(team2playerName4.getText(), Integer.valueOf(team2playerNumber4.getText())));\n \t\tteam2players.add(new PlayerImpl(team2playerName5.getText(), Integer.valueOf(team2playerNumber5.getText())));\n \t\tteam2players.add(new PlayerImpl(team2playerName6.getText(), Integer.valueOf(team2playerNumber6.getText())));\n \t\tteam2players.add(new PlayerImpl(team2playerName7.getText(), Integer.valueOf(team2playerNumber7.getText())));\n \t\t\n \t\tGraphics controlDisplay = new AdvancedControls();\n \t\tGraphics outwardDisplay = new OutwardDisplay();\n \t\tTimerImpl t = new TimerImpl();\n \t\tt.addObserver(controlDisplay);\n \t\tt.addObserver(outwardDisplay);\n \t\tScoreboardImpl s = new ScoreboardImpl();\n \t\ts.addObserver(controlDisplay);\n \t\ts.addObserver(outwardDisplay);\n \t\tTeamImpl t1 = new TeamImpl(teamName1.getText());\n \t\tt1.addObserver(controlDisplay);\n \t\tt1.addObserver(outwardDisplay);\n \t\tt1.addPlayers(team1players);\n \t\tTeamImpl t2 = new TeamImpl(teamName2.getText());\n \t\tt2.addObserver(controlDisplay);\n \t\tt2.addObserver(outwardDisplay);\n \t\tt2.addPlayers(team2players);\n \t\tcontrolDisplay.start(t, s, t1, t2);\n \t\toutwardDisplay.start(t, s, t1, t2);\n\t\t\tteamFrame.dispose();\n \t}\n }",
"private void buildGui() {\n nifty = screen.getNifty();\n nifty.setIgnoreKeyboardEvents(true);\n nifty.loadStyleFile(\"nifty-default-styles.xml\");\n nifty.loadControlFile(\"nifty-default-controls.xml\");\n nifty.addScreen(\"Option_Screen\", new ScreenBuilder(\"Options_Screen\") {\n {\n controller((ScreenController) app);\n layer(new LayerBuilder(\"background\") {\n {\n childLayoutCenter();;\n font(\"Interface/Fonts/zombie.fnt\");\n backgroundImage(\"Backgrounds/ZOMBIE1.jpg\");\n visibleToMouse(true);\n }\n });\n layer(new LayerBuilder(\"foreground\") {\n {\n childLayoutOverlay();\n font(\"Interface/Fonts/zombie.fnt\");\n\n panel(new PanelBuilder(\"Switch_Options\") {\n {\n childLayoutVertical();\n control(new ButtonBuilder(\"\", \"Display Settings\") {\n {\n marginTop(\"42%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(Align.Left);\n interactOnClick(\"goTo(Display_Settings)\");\n font(\"Interface/Fonts/zombie.fnt\");\n }\n });\n /*control(new ButtonBuilder(\"\", \"Graphics Settings\") {\n {\n marginTop(\"2%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n interactOnClick(\"goTo(Graphics_Extension)\");\n }\n });*/\n control(new ButtonBuilder(\"\", \"Sound Settings\") {\n {\n marginTop(\"2%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n interactOnClick(\"goTo(#Sound_Settings)\");\n }\n });\n control(new ButtonBuilder(\"\", \"Leaderboard\") {\n {\n marginTop(\"2%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n interactOnClick(\"goTo(Leader_Board)\");\n }\n });\n control(new ButtonBuilder(\"\", \"Logout\") {\n {\n marginTop(\"2%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n interactOnClick(\"goTo(#Login_Screen)\");\n }\n });\n control(new ButtonBuilder(\"\", \"Quit Game\") {\n {\n marginTop(\"2%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n interactOnClick(\"quitGame()\");\n }\n });\n }\n });\n }\n });\n }\n }.build(nifty));\n nifty.addScreen(\"Graphics_Settings\", new ScreenBuilder(\"Graphics_Extension\") {\n {\n controller(settingsControl);\n layer(new LayerBuilder(\"background\") {\n {\n font(\"Interface/Fonts/zombie.fnt\");\n childLayoutCenter();\n backgroundImage(\"Backgrounds/ZOMBIE1.jpg\");\n visibleToMouse(true);\n }\n });\n layer(new LayerBuilder(\"foreground\") {\n {\n font(\"Interface/Fonts/zombie.fnt\");\n childLayoutOverlay();\n panel(new PanelBuilder(\"Settings\") {\n {\n childLayoutVertical();\n control(new ButtonBuilder(\"\", \"Display Settings\") {\n {\n marginTop(\"42%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n interactOnClick(\"goTo(Display_Settings)\");\n }\n });\n /*control(new ButtonBuilder(\"\", \"Graphics Settings\") {\n {\n marginTop(\"2%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n }\n });*/\n control(new ButtonBuilder(\"\", \"Sound Settings\") {\n {\n marginTop(\"2%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n interactOnClick(\"goTo(#Sound_Settings)\");\n }\n });\n control(new ButtonBuilder(\"\", \"Leaderboard\") {\n {\n marginTop(\"2%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n interactOnClick(\"goTo(Leader_Board)\");\n }\n });\n control(new ButtonBuilder(\"\", \"Logout\") {\n {\n marginTop(\"2%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n interactOnClick(\"goTo(#Login_Screen)\");\n }\n });\n control(new ButtonBuilder(\"\", \"Quit Game\") {\n {\n marginTop(\"2%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n interactOnClick(\"quitGame()\");\n }\n });\n }\n });\n }\n });\n layer(new LayerBuilder(\"Settings\") {\n {\n font(\"Interface/Fonts/zombie.fnt\");\n childLayoutVertical();\n panel(new PanelBuilder(\"Post_Water_Panel\") {\n {\n childLayoutHorizontal();\n marginLeft(\"40%\");\n marginTop(\"15%\");\n control(new LabelBuilder(\"\", \"Post Water\") {\n {\n font(\"Interface/Fonts/zombie.fnt\");\n color(\"#ff0000\");\n }\n });\n control(new CheckboxBuilder(\"Post_Water_Button\") {\n {\n marginLeft(\"110%\");\n }\n });\n }\n });\n panel(new PanelBuilder(\"Water_Reflections_Panel\") {\n {\n childLayoutHorizontal();\n marginLeft(\"40%\");\n marginTop(\"5%\");\n control(new LabelBuilder(\"\", \"Water Reflections\") {\n {\n font(\"Interface/Fonts/zombie.fnt\");\n color(\"#ff0000\");\n }\n });\n control(new CheckboxBuilder(\"Water_Reflections_Button\") {\n {\n marginLeft(\"45%\");\n }\n });\n }\n });\n panel(new PanelBuilder(\"Water_Ripples_Panel\") {\n {\n childLayoutHorizontal();\n marginLeft(\"40%\");\n marginTop(\"5%\");\n control(new LabelBuilder(\"\", \"Water Ripples\") {\n {\n font(\"Interface/Fonts/zombie.fnt\");\n color(\"#ff0000\");\n }\n });\n control(new CheckboxBuilder(\"Water_Ripples_Button\") {\n {\n marginLeft(\"75%\");\n }\n });\n }\n });\n panel(new PanelBuilder(\"Water_Specular_Panel\") {\n {\n childLayoutHorizontal();\n marginLeft(\"40%\");\n marginTop(\"5%\");\n control(new LabelBuilder(\"\", \"Water Specular\") {\n {\n font(\"Interface/Fonts/zombie.fnt\");\n color(\"#ff0000\");\n }\n });\n control(new CheckboxBuilder(\"Water_Specular_Button\") {\n {\n marginLeft(\"59%\");\n }\n });\n }\n });\n panel(new PanelBuilder(\"Water_Foam_Panel\") {\n {\n childLayoutHorizontal();\n marginLeft(\"40%\");\n marginTop(\"5%\");\n control(new LabelBuilder(\"\", \"Water Foam\") {\n {\n font(\"Interface/Fonts/zombie.fnt\");\n color(\"#ff0000\");\n }\n });\n control(new CheckboxBuilder(\"Water_Foam_Button\") {\n {\n marginLeft(\"93%\");\n }\n });\n }\n });\n panel(new PanelBuilder(\"Sky_Dome_Panel\") {\n {\n childLayoutHorizontal();\n marginLeft(\"40%\");\n marginTop(\"5%\");\n control(new LabelBuilder(\"\", \"Sky Dome\") {\n {\n font(\"Interface/Fonts/zombie.fnt\");\n color(\"#ff0000\");\n }\n });\n control(new CheckboxBuilder(\"Sky_Dome_Button\") {\n {\n marginLeft(\"128%\");\n }\n });\n }\n });\n panel(new PanelBuilder(\"Star_Motion_Panel\") {\n {\n childLayoutHorizontal();\n marginLeft(\"40%\");\n marginTop(\"5%\");\n control(new LabelBuilder(\"\", \"Star Motion\") {\n {\n font(\"Interface/Fonts/zombie.fnt\");\n color(\"#ff0000\");\n }\n });\n control(new CheckboxBuilder(\"Star_Motion_Button\") {\n {\n marginLeft(\"106%\");\n }\n });\n }\n });\n panel(new PanelBuilder(\"Cloud_Motion_Panel\") {\n {\n childLayoutHorizontal();\n marginLeft(\"40%\");\n marginTop(\"5%\");\n control(new LabelBuilder(\"\", \"Cloud Motion\") {\n {\n font(\"Interface/Fonts/zombie.fnt\");\n color(\"#ff0000\");\n }\n });\n control(new CheckboxBuilder(\"Cloud_Motion_Button\") {\n {\n marginLeft(\"87%\");\n }\n });\n }\n });\n panel(new PanelBuilder(\"Bloom_Light_Panel\") {\n {\n childLayoutHorizontal();\n marginLeft(\"40%\");\n marginTop(\"5%\");\n control(new LabelBuilder(\"\", \"Bloom Lighting\") {\n {\n color(\"#ff0000\");\n font(\"Interface/Fonts/zombie.fnt\");\n }\n });\n control(new CheckboxBuilder(\"Bloom_Light_Button\") {\n {\n marginLeft(\"70%\");\n }\n });\n }\n });\n panel(new PanelBuilder(\"Light_Scatter_Panel\") {\n {\n childLayoutHorizontal();\n marginLeft(\"40%\");\n marginTop(\"5%\");\n control(new LabelBuilder(\"\", \"Light Scatter\") {\n {\n color(\"#ff0000\");\n font(\"Interface/Fonts/zombie.fnt\");\n }\n });\n control(new CheckboxBuilder(\"Light_Scatter_Button\") {\n {\n marginLeft(\"90%\");\n }\n });\n }\n });\n panel(new PanelBuilder(\"Apply_Panel\") {\n {\n font(\"Interface/Fonts/zombie.fnt\");\n childLayoutHorizontal();\n marginLeft(\"43%\");\n marginTop(\"5%\");\n control(new ButtonBuilder(\"Apply_Button\", \"Apply Settings\") {\n {\n interactOnClick(\"applySettings()\");\n font(\"Interface/Fonts/zombie.fnt\");\n }\n });\n }\n });\n }\n });\n }\n }.build(nifty));\n nifty.addScreen(\"Display_Screen\", new ScreenBuilder(\"Display_Settings\") {\n {\n controller(settingsControl);\n layer(new LayerBuilder(\"background\") {\n {\n font(\"Interface/Fonts/zombie.fnt\");\n childLayoutCenter();;\n backgroundImage(\"Backgrounds/ZOMBIE1.jpg\");\n visibleToMouse(true);\n }\n });\n layer(new LayerBuilder(\"foreground\") {\n {\n font(\"Interface/Fonts/zombie.fnt\");\n childLayoutOverlay();\n panel(new PanelBuilder(\"Settings\") {\n {\n font(\"Interface/Fonts/zombie.fnt\");\n childLayoutVertical();\n control(new ButtonBuilder(\"\", \"Display Settings\") {\n {\n marginTop(\"42%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n }\n });\n /*control(new ButtonBuilder(\"\", \"Graphics Settings\") {\n {\n marginTop(\"2%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n interactOnClick(\"goTo(Graphics_Extension)\");\n }\n });*/\n control(new ButtonBuilder(\"\", \"Sound Settings\") {\n {\n marginTop(\"2%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n interactOnClick(\"goTo(#Sound_Settings)\");\n }\n });\n control(new ButtonBuilder(\"\", \"Leaderboard\") {\n {\n marginTop(\"2%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n interactOnClick(\"goTo(Leader_Board)\");\n }\n });\n control(new ButtonBuilder(\"\", \"Logout\") {\n {\n marginTop(\"2%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n interactOnClick(\"goTo(#Login_Screen)\");\n }\n });\n control(new ButtonBuilder(\"\", \"Quit Game\") {\n {\n marginTop(\"2%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n interactOnClick(\"quitGame()\");\n }\n });\n }\n });\n }\n });\n layer(new LayerBuilder(\"Settings\") {\n {\n childLayoutVertical();\n panel(new PanelBuilder(\"Resolution_Panel\") {\n {\n childLayoutHorizontal();\n marginLeft(\"40%\");\n marginTop(\"15%\");\n control(new LabelBuilder(\"\", \"Set Resolution\") {\n {\n color(\"#ff0000\");\n font(\"Interface/Fonts/zombie.fnt\");\n }\n });\n control(new ListBoxBuilder(\"Resolution_Opts\") {\n {\n marginLeft(\"4%\");\n marginBottom(\"10%\");\n displayItems(1);\n showVerticalScrollbar();\n hideHorizontalScrollbar();\n selectionModeSingle();\n width(\"10%\");\n font(\"Interface/Fonts/zombie.fnt\");\n }\n });\n }\n });\n panel(new PanelBuilder(\"Apply_Panel\") {\n {\n childLayoutHorizontal();\n marginLeft(\"45%\");\n marginTop(\"5%\");\n control(new ButtonBuilder(\"Apply_Button\", \"Apply Settings\") {\n {\n interactOnClick(\"displayApply()\");\n font(\"Interface/Fonts/zombie.fnt\");\n }\n });\n }\n });\n }\n });\n }\n }.build(nifty));\n nifty.addScreen(\"Sound Settings\", new ScreenBuilder(\"#Sound_Settings\") {\n {\n controller(settingsControl);\n layer(new LayerBuilder(\"background\") {\n {\n font(\"Interface/Fonts/zombie.fnt\");\n childLayoutCenter();;\n backgroundImage(\"Backgrounds/ZOMBIE1.jpg\");\n visibleToMouse(true);\n }\n });\n layer(new LayerBuilder(\"foreground\") {\n {\n font(\"Interface/Fonts/zombie.fnt\");\n childLayoutOverlay();\n panel(new PanelBuilder(\"Settings\") {\n {\n font(\"Interface/Fonts/zombie.fnt\");\n childLayoutVertical();\n control(new ButtonBuilder(\"\", \"Display Settings\") {\n {\n marginTop(\"42%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(ElementBuilder.Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n interactOnClick(\"goTo(Display_Settings)\");\n }\n });\n /*control(new ButtonBuilder(\"\", \"Graphics Settings\") {\n {\n marginTop(\"2%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(ElementBuilder.Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n interactOnClick(\"goTo(Graphics_Extension)\");\n }\n });*/\n control(new ButtonBuilder(\"\", \"Sound Settings\") {\n {\n marginTop(\"2%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(ElementBuilder.Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n }\n });\n control(new ButtonBuilder(\"\", \"Leaderboard\") {\n {\n marginTop(\"2%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(ElementBuilder.Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n interactOnClick(\"goTo(Leader_Board)\");\n }\n });\n control(new ButtonBuilder(\"\", \"Logout\") {\n {\n marginTop(\"2%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n interactOnClick(\"goTo(#Login_Screen)\");\n }\n });\n control(new ButtonBuilder(\"\", \"Quit Game\") {\n {\n marginTop(\"2%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(ElementBuilder.Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n interactOnClick(\"quitGame()\");\n }\n });\n }\n });\n }\n });\n layer(new LayerBuilder(\"Settings\") {\n {\n childLayoutVertical();\n panel(new PanelBuilder(\"#Master_Volume_Panel\") {\n {\n childLayoutHorizontal();\n marginLeft(\"30%\");\n marginTop(\"35%\");\n control(new LabelBuilder(\"\", \"Master Volume : \") {\n {\n color(\"#ff0000\");\n font(\"Interface/Fonts/zombie.fnt\");\n }\n });\n control(new SliderBuilder(\"#Master_Volume\", false) {\n {\n marginLeft(\"20px\");\n min(0);\n max(100);\n width(\"25%\");\n }\n });\n }\n });\n panel(new PanelBuilder(\"#Ambient_Volume_Panel\") {\n {\n childLayoutHorizontal();\n marginLeft(\"30%\");\n marginTop(\"8%\");\n control(new LabelBuilder(\"\", \"Ambient Volume : \") {\n {\n color(\"#ff0000\");\n font(\"Interface/Fonts/zombie.fnt\");\n }\n });\n control(new SliderBuilder(\"#Ambient_Volume\", false) {\n {\n marginLeft(\"20px\");\n min(0);\n max(100);\n width(\"25%\");\n }\n });\n }\n });\n panel(new PanelBuilder(\"#Combat_Volume_Panel\") {\n {\n childLayoutHorizontal();\n marginLeft(\"30%\");\n marginTop(\"8%\");\n control(new LabelBuilder(\"\", \"Combat Volume : \") {\n {\n color(\"#ff0000\");\n font(\"Interface/Fonts/zombie.fnt\");\n }\n });\n control(new SliderBuilder(\"#Combat_Volume\", false) {\n {\n marginLeft(\"20px\");\n min(0);\n max(100);\n width(\"25%\");\n }\n });\n }\n });\n panel(new PanelBuilder(\"#Dialog_Volume_Panel\") {\n {\n childLayoutHorizontal();\n marginLeft(\"30%\");\n marginTop(\"8%\");\n control(new LabelBuilder(\"\", \"Dialog Volume : \") {\n {\n color(\"#ff0000\");\n font(\"Interface/Fonts/zombie.fnt\");\n }\n });\n control(new SliderBuilder(\"#Dialog_Volume\", false) {\n {\n marginLeft(\"20px\");\n min(0);\n max(100);\n width(\"25%\");\n }\n });\n }\n });\n panel(new PanelBuilder(\"#Footsteps_Volume_Panel\") {\n {\n childLayoutHorizontal();\n marginLeft(\"30%\");\n marginTop(\"8%\");\n control(new LabelBuilder(\"\", \"Footsteps Volume : \") {\n {\n color(\"#ff0000\");\n font(\"Interface/Fonts/zombie.fnt\");\n }\n });\n control(new SliderBuilder(\"#Footsteps_Volume\", false) {\n {\n marginLeft(\"20px\");\n min(0);\n max(100);\n width(\"25%\");\n }\n });\n }\n });\n panel(new PanelBuilder(\"Apply_Panel\") {\n {\n childLayoutHorizontal();\n marginLeft(\"45%\");\n marginTop(\"5%\");\n control(new ButtonBuilder(\"#Apply_Button\", \"Apply Settings\") {\n {\n interactOnClick(\"soundApply()\");\n font(\"Interface/Fonts/zombie.fnt\");\n }\n });\n }\n });\n }\n });\n\n }\n }.build(nifty));\n }",
"public void startGame(View view){\n difficultView.setVisibility(View.VISIBLE);\n startGame.setVisibility(View.INVISIBLE);\n playAgainId.setVisibility(View.INVISIBLE);\n// difficulty(view);\n }",
"public void onPlayGame(View view)\n {\n boolean newMode = !tttGame.getAIMode();\n\n tttGame = new TicTacToeGameState(newMode);\n resetBoard();\n setDescriptionPlay();\n\n }",
"public GUI() {\n initComponents();\n model = new Model();\n playerTurn = 1;\n JTurnMessage.setText(\"Player X Turn\");\n }",
"private void getViewComponents() {\n _gameView = (GameView) findViewById(R.id.game_cv_gameview);\n _levelView = (TextView) findViewById(R.id.game_tv_curlevel);\n _scoreView = (TextView) findViewById(R.id.game_tv_curscore);\n _startBtn = (Button) findViewById(R.id.game_btn_start);\n _gestureOverlay = (GestureOverlayView) findViewById(R.id.game_gov_gestures);\n\n }",
"public void sendeLobby();",
"public static void MultiComponents() {\n\t\tInterface.rndMapMulti.setPreferredSize(Interface.dim);\n\t\tInterface.rndMapMulti.setIcon(new ImageIcon(Interface.Button));\n\t\tInterface.rndMapMulti.setHorizontalTextPosition(JButton.CENTER);\n\t\tInterface.rndMapMulti.setVerticalTextPosition(JButton.CENTER);\n\t\tInterface.rndMapMulti.setForeground(Color.white);\n\t\t\n\t\t\n\t\tInterface.startGame2.setPreferredSize(Interface.dim);\n\t\tInterface.startGame2.setIcon(new ImageIcon(Interface.Button));\n\t\tInterface.startGame2.setHorizontalTextPosition(JButton.CENTER);\n\t\tInterface.startGame2.setVerticalTextPosition(JButton.CENTER);\n\t\tInterface.startGame2.setForeground(Color.white);\n\t\t\n\t\tInterface.online.setPreferredSize(Interface.dim);\n\t\tInterface.online.setIcon(new ImageIcon(Interface.Button));\n\t\tInterface.online.setHorizontalTextPosition(JButton.CENTER);\n\t\tInterface.online.setVerticalTextPosition(JButton.CENTER);\n\t\tInterface.online.setForeground(Color.white);\n\t\t\n\t\t\n\t\tInterface.join.setPreferredSize(Interface.dim);\n\t\tInterface.join.setIcon(new ImageIcon(Interface.Button));\n\t\tInterface.join.setHorizontalTextPosition(JButton.CENTER);\n\t\tInterface.join.setVerticalTextPosition(JButton.CENTER);\n\t\tInterface.join.setForeground(Color.white);\n\t\t\n\n\t\tInterface.ipLabel.setForeground(Color.white);\n\t}",
"void run() {\n System.out.println(\"PC Visual application run\");\n data = new Data(this);\n window = new Window(this);\n window.setup();\n mote = new MoteIF(PrintStreamMessenger.err);\n mote.registerListener(new OscilloscopeMsg(), this);\n }",
"private void networkHost(java.awt.event.MouseEvent evt) {\n\t\tgameChoice = 'h';\n\t\twindowComplete = true;\n\t}",
"public void playCvC() {\n isAI[0] = true;\n isAI[1] = true;\n players[0] = new AI();\n players[1] = new AI();\n playerShips[0] = players[0].getShipList();\n playerShips[1] = players[1].getShipList();\n grids[0] = new Grid();\n grids[1] = new Grid();\n currentPlayer = 0;\n playGame();\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 }",
"private void broadcast() {\n for (int key : bootstrapMap.keySet()) {\n bootstrapMap.get(key).getBroadcastView().show(Colors.BLUE + gameService.getCurrentPlayer().getName() + Colors.NOCOLOR, lastAnswer);\n }\n gameService.upDateCurrentPlayer();\n }",
"protected void actionPerformed(GuiButton par1GuiButton)\n {\n if (par1GuiButton.id == 0)\n {\n this.mc.displayGuiScreen(new GuiOptions(this, this.mc.gameSettings));\n }\n\n if (par1GuiButton.id == 5)\n {\n this.mc.displayGuiScreen(new GuiLanguage(this, this.mc.gameSettings));\n }\n\n if (par1GuiButton.id == 1)\n {\n this.mc.displayGuiScreen(new GuiSelectWorld(this));\n }\n\n if (par1GuiButton.id == 2)\n {\n this.mc.displayGuiScreen(new GuiMultiplayer(this));\n }\n\n if (par1GuiButton.id == 3)\n {\n this.mc.displayGuiScreen(new GuiTexturePacks(this));\n }\n\n if (par1GuiButton.id == 4)\n {\n this.mc.shutdown();\n }\n }",
"private void control() {\n try {\n gameThread.sleep(17);\n } catch (InterruptedException e) { }\n }",
"public GameView(GameModel gameModel, GameController gameController) {\n \n // ADD YOU CODE HERE\n\n this.gameModel=gameModel;\n\n setTitle(\"MineSweeper it -- the ITI 1121 version\");\n\n // For minesweeper matrix\n JPanel p1 = new JPanel();\n p1.setLayout(new GridLayout(gameModel.getHeigth(),gameModel.getWidth(),0,0));\n\n board = new DotButton[gameModel.getHeigth()][gameModel.getWidth()];\n\n // Integer temp used to store the tile's setActionCommand number so we can identify which tile is being clicked\n int temp=0;\n\n // Adding buttons to board matrix\n for (int i=0; i<gameModel.getHeigth(); i++) {\n\n for (int j=0; j<gameModel.getWidth(); j++) {\n\n board[i][j] = new DotButton(j,i,11);\n\n board[i][j].setPreferredSize(new Dimension(28,28));\n \n board[i][j].addActionListener(gameController);\n board[i][j].setActionCommand(Integer.toString(temp));\n \n temp++;\n\n p1.add(board[i][j]);\n \n }\n \n }\n\n // For buttons and text field\n JPanel p2 = new JPanel();\n\n JButton reset = new JButton(\"Reset\");\n reset.addActionListener(gameController);\n \n JButton quit = new JButton(\"Quit\");\n quit.addActionListener(gameController);\n\n nbreOfStepsLabel = new JLabel(\"Number of steps: \" + Integer.toString(gameModel.getNumberOfSteps()));\n\n p2.add(nbreOfStepsLabel);\n p2.add(reset);\n p2.add(quit);\n \n // Frame related stuff\n add(p1, BorderLayout.NORTH);\n add(p2, BorderLayout.SOUTH);\n pack();\n setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n setResizable(false); // Window isn't resizable so it doesnt look bad when stretched out\n setVisible(true);\n }",
"public void singlePlayerSelected()\n {\n //call Client Controller's setState method with\n //a parameter of new ClientLobbyState()\n clientController.startSinglePlayerGame();\n }",
"public void showView(){\n this.addObserver(GameView.GameViewNewGame(this));\n }",
"public void showLobby() {\n \t\tgameMain.showScreen(lobby);\n \t}",
"public void gameSetupMultiplayer() {\r\n\t\t\r\n\t\tmultiplayerScreen = new MultiplayerScreen(this, playerNumber, playerIndex ); \r\n\t\t\r\n\t\t// creo giocatore\r\n\t\tfor (int i=0; i<playerNumber; i++) {\r\n\t\t\tplayers.add(new Player());\r\n\r\n\t\t}\t\r\n\t\tmultiplayerScreen.addPlayers(players); //creazione schermo di gioco multiplayer\r\n\t\t\r\n\t\tmultiplayerScreen.setMusic(music);\r\n\t\t\r\n\t\tmultiplayerScreen.setLevel(level);\r\n\t\t\r\n\t\tclient.startThread(multiplayerScreen);\r\n\t\t\r\n\t\tgameFrame.add(multiplayerScreen);\r\n\t\tgameFrame.requestFocusInWindow();\r\n\r\n\t\t// aggiungo controllo da tastiera\r\n\t\tgameFrame.addKeyListener(players.get(playerIndex).getInputHandler());\r\n\t\tgameFrame.pack();\r\n\t\tgameFrame.setVisible(true);\r\n\t\t\t\t\r\n\t\t// avvio ciclo di gioco\r\n\t\tnew Thread(multiplayerScreen).start();\r\n\t\tmultiplayerScreen.setVisible(true);\r\n\t}",
"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}"
] | [
"0.65164775",
"0.6232271",
"0.6056205",
"0.5984048",
"0.5977133",
"0.59624517",
"0.5937895",
"0.58915764",
"0.587139",
"0.5848913",
"0.58092785",
"0.5805222",
"0.57817733",
"0.5772513",
"0.5763018",
"0.5760503",
"0.5760263",
"0.57461816",
"0.57290375",
"0.5726367",
"0.57245415",
"0.5724075",
"0.57214373",
"0.5715911",
"0.5714482",
"0.57143044",
"0.5697309",
"0.56966835",
"0.56664735",
"0.56633097",
"0.56429064",
"0.56331336",
"0.5605706",
"0.5601971",
"0.5599133",
"0.5592649",
"0.55925274",
"0.55921125",
"0.55887496",
"0.55843174",
"0.55791795",
"0.5578306",
"0.5576907",
"0.5575959",
"0.5564141",
"0.5562013",
"0.55539554",
"0.5553639",
"0.55530024",
"0.55485183",
"0.5547005",
"0.5544305",
"0.5540235",
"0.5537802",
"0.5535873",
"0.5529666",
"0.55294585",
"0.5518937",
"0.55066925",
"0.5506481",
"0.54898006",
"0.548565",
"0.5483465",
"0.5477655",
"0.54772073",
"0.54718286",
"0.5465278",
"0.5464527",
"0.54640096",
"0.54619336",
"0.54611707",
"0.5459438",
"0.54529953",
"0.54483294",
"0.5443991",
"0.54410875",
"0.54375625",
"0.5436028",
"0.5434637",
"0.54292005",
"0.5428307",
"0.5427916",
"0.5422429",
"0.54156315",
"0.5410064",
"0.54087305",
"0.5407381",
"0.5405552",
"0.5401748",
"0.53985786",
"0.5396131",
"0.53949785",
"0.53930235",
"0.5390845",
"0.5390408",
"0.53868",
"0.5375729",
"0.53690124",
"0.53679085",
"0.5361734",
"0.5360613"
] | 0.0 | -1 |
This method is called when the order button is clicked. | public void submitOrder(View view) {
CheckBox whippedCreamCheckBox = (CheckBox) findViewById(R.id.whipped_cream_checkbox);
boolean hasWhippedCream = whippedCreamCheckBox.isChecked();
CheckBox chocolateCheckBox= (CheckBox) findViewById(R.id.chocolate_checkbox);
boolean hasChocolate = chocolateCheckBox.isChecked();
EditText nameField = (EditText)findViewById(R.id.name_field);
/**getting the name */
String name = nameField.getText().toString();
/**calculating price*/
int price=calculatePrice(hasWhippedCream,hasChocolate);
/**creating order summary*/
String priceMessage=createOrderSummary(price,hasWhippedCream,hasChocolate,name);
Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("*/*");
intent.putExtra(Intent.EXTRA_SUBJECT, getString(R.string.order_summary_email_subject,name));
intent.putExtra(Intent.EXTRA_TEXT,priceMessage);
if (intent.resolveActivity(getPackageManager()) != null) {
startActivity(intent);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void orderClicked(View view) {\n Log.d(\"Method\", \"orderClicked()\");\n orderPlace();\n }",
"@Override\n\tpublic void processViewOrderButtonClick(ProcessViewOrderObjectEvent e) {\n\t\t\n\t}",
"@Override\n public void onClick(View v) {\n switch (v.getId()) {\n case R.id.btnOrder:\n onBtnOrderClick();\n break;\n default:\n break;\n }\n }",
"public void myorders() {\r\n\t\t\tdriver.findElement(orders).click();\r\n\t\t\t\r\n\t\t\t}",
"@Override\r\n public void run() {\n\r\n setNewOrder();\r\n canClick(true);\r\n }",
"@Override\n\tpublic void mousePressed(MouseEvent e)\n\t{\n\t\tif (e.getComponent() == jLTill)\n\t\t{\n\t\t\tArrayList<Order> tempOL = globalFrame.getTill().getOrders();\n\t\t\tglobalFrame.setOrder(tempOL.get(jLTill.getSelectedIndex()));\n\t\t\tglobalFrame.updateOrderItemList();\n\t\t\tglobalFrame.updateOrderList();\n\t\t}\n\t}",
"@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tPageUtil.jumpTo(MyOrderActivity.this, MyOrderAll.class);\n\t\t\t}",
"@Override\n\tpublic void eventSelectOrder() {\n\t\t\n\t}",
"private void orderHomePage() {\n setLayout(new FlowLayout(FlowLayout.CENTER));\n\n JButton button = new JButton(\"New Order\");\n add(button);\n\n button.addActionListener(new ActionListener() {\n @Override\n public void actionPerformed(ActionEvent e) {\n if (e.getSource() instanceof JButton) {\n JButton button1 = (JButton)e.getSource();\n\n if (button1.getText().equals(button.getText())) {\n removeAll(); // Removes everything from the panel\n message();\n orderFood();\n }\n }\n }\n });\n }",
"@Override\n public void onClick(View v) {\n CommonUtils.sendMsg(\"订单备餐中\", DeliveryActivity.SHOW_LOADING_TEXT, handler);\n List<String> list = new ArrayList<String>();\n list.add(odi.order_id);\n setDeliveryOrderDoing(list, position);\n\n }",
"@Override\r\n\t\t\t\t\t\tpublic void onClick(DialogInterface dialog, int which) {\n\t\t\t\t\t\t\tnextOrder();\r\n\t\t\t\t\t\t}",
"@FXML\n\tpublic void newOrderButtonAction() {\n\t\t\n\t\tcurrentOrder = new NewOrder();\n\t\tVBox main = new VBox();\n\t\tVBox.setVgrow(main, Priority.ALWAYS);\n\t\tVBox.setMargin(main, new Insets(5));\n\t\tmain.setStyle(\"-fx-border-insets: 0; \"\n\t\t\t\t+ \"-fx-border-width: 2; \"\n\t\t\t\t+ \"-fx-border-color: black lightgray lightgray black\");\n\t\t/*\n\t\t * Create top and bottom part of the OrderBox and\n\t\t * update currentOrder with this Order's variables to \n\t\t * be referenced later.\n\t\t */\n\t\tHBox top = createTopOrderBox();\n\t\tVBox bot = createBottomOrderBox();\n\t\t\n\t\t//Combine the top and bottom part od the OrderBox\n\t\tmain.getChildren().addAll(top, bot);\n\t\t\n\t\t//Iterate the total number of orders for display on labels.\n\t\tnoOfOrders++;\n\t\t\n\t\tSeparator sep = new Separator();\n\t\t\n\t\t//Add the display pieces together and add to the Window\n\t\torderEntryBox.getChildren().addAll(main, sep);\n\t\t\n\t\t/*\n\t\t * Add the currentOrder now that it is complete.\n\t\t * These will be used to create ConfigOrders to\n\t\t * complete the ConfigFile.\n\t\t */\n\t\tnewOrders.add(currentOrder);\n\t}",
"@Override\n public void onClick(View v) {\n orderField = \"orderTime\";\n btn_single_time.setTextColor(getResources().getColor(R.color.colorff6c02));\n btn_array_time.setTextColor(getResources().getColor(R.color.color000000));\n submitInitOrRefreshOrSearch();\n }",
"@Override\n\tpublic void processNewOrderButtonClick(ProcessNewOrderObjectEvent e) {\n\t\n\t\tthis.currentAmount = 0.0;\t\t\n\t\tthis.currentItems.clear();\n\t\n\t}",
"@Override\n public void onClick(View v) {\n AddingToCartList();\n }",
"@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tif(!order.get(position).getKitchenStaus().contentEquals(\"Completed\"))\n\t\t\t\t{\n\t\t\t\t\tString description=order.get(position).getVchFoodDescription();\n\t\t\t\t\tif (description != null && !description.isEmpty() && !description.equals(\"null\"))\n\t\t\t\t\t{\n\t\t\t\t\t\tdescription=order.get(position).getVchFoodDescription();\n\t\t\t\t\t}else\n\t\t\t\t\t{\n\t\t\t\t\t\tdescription=\" \";\n\t\t\t\t\t}\n\t\t\t\t\tEditOrderDetailsActivity editOrderDetailsActivity = new EditOrderDetailsActivity();\n\t\t\t\t\tBundle args = new Bundle();\n\t\t\t\t\targs.putString(\"Id\", order.get(position).getId());\n\t\t\t\t\targs.putString(\"MenuName\", order.get(position).getMenu_Name());\n\t\t\t\t\targs.putString(\"Qty\", order.get(position).getQty());\n\t\t\t\t\targs.putString(\"Price\", order.get(position).getPrice());\n\t\t\t\t\targs.putString(\"OrderId\", order.get(position).getOrder_Id());\n\t\t\t\t\targs.putString(\"TableName\", order.get(position).getTable_Name());\n\t\t\t\t\targs.putString(\"pagename\",pagenamee);\n\t\t\t\t\targs.putString(\"FoodDescription\",description);\n\t\t\t\t\teditOrderDetailsActivity.setArguments(args);\n\t\t\t\t\tMainActivity.fragmentManager.beginTransaction().replace(R.id.content_main, editOrderDetailsActivity).commitAllowingStateLoss();\n\n\t\t\t\t}else\n\t\t\t\t{\n\t\t\t\t\tToast.makeText(context,\"You Cannot Edited Or Delete this Order\",Toast.LENGTH_SHORT);\n\t\t\t\t}\n\n\t\t\t}",
"@Override\n public void onClick(View view) {\n String location = \"\";\n boolean met = false;\n if(method == 0){\n location = spTableChoice.getSelectedItem().toString();\n met = true;\n }else if(method == 1 && !etPickupName.getText().toString().isEmpty()){\n met = true;\n location = etPickupName.getText().toString();\n }else{\n Toast.makeText(getApplicationContext(), \"Please enter a pickup name!\", Toast.LENGTH_SHORT).show();\n }\n\n if(met){\n // Finalise the order as an order object\n order.setDestination(location);\n order.setOrderItems(orderHeld);\n order.setTotalPrice(totalPrice);\n\n addOrderDB();\n Toast.makeText(getApplicationContext(), \"Placed!\", Toast.LENGTH_SHORT).show();\n\n // Move to payment now\n //PayPalPay(totalPrice);\n }\n\n }",
"@Override\r\n\tpublic void actionPerformed(ActionEvent e) {\n adaptee.btnOrderTicket_actionPerformed(e);\r\n\t}",
"@Override\n public void onClick(View v) {\n\n new DrinkDatabase(getBaseContext()).DrinkaddToCart(new DrinkOrder(\n// new Database(getBaseContext()).addToCart(new Order(\n drinkId,\n currentDrink.getDrinkName(),\n drink_numberButton.getNumber(), //null,//use null to check or to run the program\n currentDrink.getDrinkPrice(),\n currentDrink.getDrinkDiscount()\n\n\n ));\n\n Toast.makeText(DrinkDetail.this, \"Added to chart\", Toast.LENGTH_SHORT).show();\n }",
"public void actionPerformed(ActionEvent e)\n\t\t\t\t\t{\n\t\t\t\t\t\tBuyerUIItem thisUIItem = (BuyerUIItem)order.getParent();\n\t\t\t\t\t\tint amountDesired = (int)spinner.getValue();\n\t\t\t\t\t\tif(_item.getQuantity() >= amountDesired && _item.inStock()) {\n\t\t\t\t\t\t\titemHelper.orderItem(thisUIItem, _item, amountDesired);\n\t\t\t\t\t\t\tquantity.setText(String.valueOf(_item.getQuantity()));\n\t\t\t\t\t\t\tnumModel.setValue(1);\t\t\t\t\t\t\t\n\t\t\t\t\t\t} else if(_item.inStock()) {\n\t\t\t\t\t\t\titemHelper.underStock(_item);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\titemHelper.stockOut(_item);\n\t\t\t\t\t\t}\n\t\t\t\t\t}",
"private void requestOrderDetail() {\n\n ModelHandler.OrderRequestor.requestOrderDetail(client, mViewData.getOrder().getId(), (order) -> {\n mViewData.setOrder(order);\n onViewDataChanged();\n }, this::showErrorMessage);\n }",
"private void acceptOrder() {\n buttonAcceptOrder.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n order.setDriver(ParseUser.getCurrentUser());\n order.saveInBackground();\n Log.i(TAG, \"driver!!: \" + order.getDriver().getUsername());\n ParseUser.getCurrentUser().put(KEY_HAS_ORDER, true);\n ParseUser.getCurrentUser().saveInBackground();\n\n finish();\n }\n });\n }",
"public void submitOrder() {\n int price = quantity*5;\n displayPrice(price);\n }",
"@Override\n\t\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\tboolean allOK = true;//boolean allOk is set to true\n\t\t\t\t\tString order = orderTextField.getText();//get text within the textfield\n\t\t\t\t\tif (order.equals(\"\")) {//if the textfield is blank nothing happens...\n\t\t\t\t\t\tallOK=false;\n\t\t\t\t\t}\n\t\t\t\t\tif (allOK==true) {//if allOk is set to true then....\n\t\t\t\t\t\t//Order orders = new Order(order);//\n\t\t\t\t\t\tRestaurant.runMyRestaurant(order);//Restaurant class is called\n\t\t\t\t\t}\n\t\t\t\t\t}",
"public void ordersToDoControl()\n\t{\n\t\tviewOrdersToDo = new OrdersToDoView();\n\t\ttry\n\t\t{\n\t\t\tArrayList<BookInformation> allBooks = adminModel.loadOrdersToDo();\n\t\t\tviewOrdersToDo.showTable(allBooks);\n\t\t}\n\t\tcatch(NullPointerException e)\n\t\t{\n\t\t\tviewOrdersToDo.showMessage(\"Blad polaczenia z baza : \"+ e);\n\t\t}\n\t\tcatch(SQLException e)\n\t\t{\n\t\t\tviewOrdersToDo.showMessage(\"Blad polaczenia z baza : \"+ e);\n\t\t}\n\t\tviewOrdersToDo.showMe();\n\t \n\t\tviewOrdersToDo.setMainMenuActionListener(new ActionListener(){\n\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0)\n\t\t\t{\n\t\t\t\tAdminController con = new AdminController(adminModel);\n\t\t\t\tcon.adminMainMenuControl();\n\t\t\t\tviewOrdersToDo.closeFrame();\t\n\n\t\t\t}\n\t\t});\n\t\tviewOrdersToDo.setMakeOrderActionListener(new ActionListener(){\n\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0)\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tArrayList<Integer> ordersToDo = viewOrdersToDo.getSelectedOrders();\n\t\t\t\t\tfor(Integer id : ordersToDo)\n\t\t\t\t\t{\n\t\t\t\t\t\tadminModel.confirmOrder(id);\n\t\t\t\t\t}\t\n\t\t\t\t}\n\t\t\t\tcatch(NullPointerException e)\n\t\t\t\t{\n\t\t\t\t\tviewOrdersToDo.showMessage(\"Blad polaczenia z baza : \"+ e);\n\t\t\t\t}\n\t\t\t\tcatch(SQLException e)\n\t\t\t\t{\n\t\t\t\t\tviewOrdersToDo.showMessage(\"Blad polaczenia z baza : \"+ e);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\t\n\t}",
"public void onClickOrder(View view) {\n\n //The Functions bellow are converting intiger values into strings which can then be written to the arduino via a Serial Connection\n String VodkaOrder = Integer.toString(Vodka_Measure);\n String RumOrder = Integer.toString(Rum_Measure);\n String GinOrder = Integer.toString(Gin_Measure);\n String WhiskeyOrder = Integer.toString(Whiskey_Measure);\n String TonicWaterOrder = Integer.toString(TonicWater_Measure);\n String CranberryJuiceOrder = Integer.toString(CranberryJuice_Measure);\n String OrangeJuiceOrder = Integer.toString(OrangeJuice_Measure);\n String PineappleJuiceOrder = Integer.toString(Pineapple_Measure);\n String MintOrder = Integer.toString(Mint_Measure);\n String SugarOrder = Integer.toString(Sugar_Measure);\n String LimeJuiceOrder = Integer.toString(Lime_Measure);\n String LimeSliceOrder = Integer.toString(Lime_Slice);\n String StirOrder = Integer.toString(Stir);\n String MashOrder = Integer.toString(Mash);\n String ShakeOrder = Integer.toString(Shake);\n String IceOrder = Integer.toString(Ice_Measure);\n String KaluaOrder = Integer.toString(Kalua);\n String CointreauOrder = Integer.toString(Cointreau);\n String VermouthOrder = Integer.toString(Vermouth);\n String PeachSchnappsOrder = Integer.toString(Peach_Schnapps);\n String CreamDeCacoOrder = Integer.toString(Cream_De_Cacao);\n String DrinkSizeOrder = Integer.toString(DrinkSize);\n\n //Actually writing the data to the arduino using the new strings created above\n serialPort.write(VodkaOrder.getBytes());\n serialPort.write(RumOrder.getBytes());\n serialPort.write(GinOrder.getBytes());\n serialPort.write(WhiskeyOrder.getBytes());\n serialPort.write(TonicWaterOrder.getBytes());\n serialPort.write(CranberryJuiceOrder.getBytes());\n serialPort.write(OrangeJuiceOrder.getBytes());\n serialPort.write(PineappleJuiceOrder.getBytes());\n serialPort.write(MintOrder.getBytes());\n serialPort.write(SugarOrder.getBytes());\n serialPort.write(LimeJuiceOrder.getBytes());\n serialPort.write(LimeSliceOrder.getBytes());\n serialPort.write(StirOrder.getBytes());\n serialPort.write(MashOrder.getBytes());\n serialPort.write(ShakeOrder.getBytes());\n serialPort.write(IceOrder.getBytes());\n serialPort.write(KaluaOrder.getBytes());\n serialPort.write(CointreauOrder.getBytes());\n serialPort.write(VermouthOrder.getBytes());\n serialPort.write(PeachSchnappsOrder.getBytes());\n serialPort.write(CreamDeCacoOrder.getBytes());\n serialPort.write(DrinkSizeOrder.getBytes());\n\n //A small text so the user knows what he/she ordered!\n\n tvAppend(textView, \"\\nYour Drink Order is one \" + DrinkSizeText + \" \" + DrinkName + \" (\" + DrinkType + \")\" + \"\\n\");\n\n\n\n\n myDialog.dismiss(); //Closes the popup after the order button is pressed, and order data is sent\n\n\n\n }",
"public void viewOrderDetails(){\n\t\tlibManhattanCommonFunctions.clickAnyElement(getPageElement(\"StatisticsTab\"), \"StatisticsTab\");\n\t\tlibManhattanCommonFunctions.clickAnyElement(getPageElement(\"OrdersTab\"), \"OrdersTab\");\n\t\tlibManhattanCommonFunctions.clickAnyElement(getPageElement(\"BtnOrderDetails\"), \"Order Details Button\");\t\n\t}",
"public void setOrder(Order order){\n this.order = order;\n }",
"@Override\r\n\tpublic void onButtonClicked() {\n\t\tclientFactory.getPlaceController().goTo(\r\n\t\t\t\tnew CellTableSortingPlace(\"sortingtable\"));\r\n\t}",
"void navigateToOrderingDonut() {\n Intent gotoOrderDonut = new Intent(this, OrderingDonutActivity.class);\n startActivity(gotoOrderDonut);\n }",
"@Override\n\tpublic void processFinishOrderButtonClick(ProcessFinishOrderObjectEvent e) {\n\t\t\n\t}",
"@Override\r\n\t\t\t\t\tpublic void onClick(DialogInterface dialog, int which) {\n\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\tbizOrder.SaveOrder(order);\r\n\t\t\t\t\t\t\tbizOrder.PrintOrder(order);\r\n\t\t\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t\t\tAlertDialog.Builder builder = new AlertDialog.Builder(\r\n\t\t\t\t\t\t\t\t\tUITable.this);\r\n\t\t\t\t\t\t\tbuilder.setMessage(\"Connect error\").show();\r\n\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}",
"public void EditOrderTest() {\n wait.until(ExpectedConditions.visibilityOfElementLocated(editOrderQuantityLocator));\n WebElement editOrderQuantity = driver.findElement(editOrderQuantityLocator);\n editOrderQuantity.click();\n // Click on the checkout button\n By goToCheckOutBtnLocator = By.xpath(\"//div[@class='Basket-bf28b64c20927ec7']//button[contains(@class,'ccl-d0484b0360a2b432')]\");\n wait.until(ExpectedConditions.visibilityOfElementLocated(goToCheckOutBtnLocator));\n WebElement goToCheckOutBtn = driver.findElement(goToCheckOutBtnLocator);\n goToCheckOutBtn.click();\n // Check that the order added to the basket\n By basketSectionSummaryLocator = By.className(\"ccl-9aab795066526b4d ccl-24c197eb36c1c3d3\");\n wait.until(ExpectedConditions.visibilityOfElementLocated(basketSectionSummaryLocator));\n\n }",
"public void clickOrders() throws InterruptedException{\n\t\tThread.sleep(1000);\n\t\tlibManhattanCommonFunctions.clickAnyElement(getPageElement(\"OrdersLnk\"), \"Orders\"); \n\t\tThread.sleep(1000);\n\t}",
"@Override\n\tpublic void confirmOrders() {\n\t\t\n\t}",
"@Override\n\tpublic void confirmOrders() {\n\t\t\n\t}",
"@Override\n\tpublic void confirmOrders() {\n\t\t\n\t}",
"public void onClickDelivery(View view) {\n savePreferences();\n Intent intent = new Intent(this, ActDelivery.class);\n\n // Passing order information using Intent.putString();\n intent.putExtra(\"items\", new String[]{(String) spEntree.getSelectedItem(),\n (String) spDrink.getSelectedItem(), (String) spDessert.getSelectedItem()});\n intent.putExtra(\"subtotal\", subtotal);\n\n startActivity(intent);\n }",
"@Override\n\t\t\t\t\tpublic void onClick(DialogInterface dialog, int which) {\n\t\t\t\t\t\tcommmitAllOrders(orderList);\n\t\t\t\t\t}",
"@Override\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\tIntent intent=new Intent();\n\t\t\t\tintent.setClass(WxcOrderActivity.this, WxcMainActivity.class);\n\t\t\t\tstartActivity(intent);\n\t\t\t}",
"void navigateToCurrentOrder() {\n Intent gotoCurrentOrder = new Intent(this, CurrentOrderActivity.class);\n startActivity(gotoCurrentOrder);\n }",
"public void submitOrder(View view) {\n //int price = calculatePrice();\n String priceMessage = createOrderSummary();\n\n displayMessage(priceMessage);\n\n }",
"public void actionPerformed(ActionEvent event) {\n\t\t\t//Finds the source of the ActionEvent\n\t Object source = event.getSource();\n\t\t\t\n\t //If the add random order button was clicked it calls a method to add a random order\n\t\t\tif(source == addO)\n\t\t\t{\n\t\t\t\taddOrder();\n\t\t\t}\n\t\t\t//If the add random order button was clicked it calls a method to add a random order\n\t\t\telse if(source == serveO)\n\t\t\t{\n\t\t\t\tserveOrder();\n\t\t\t}\n\t\t\t//Updates view\n\t\t\tconeList.validate();\n\t\t\trepaint();\n\t\t\t\n\t\t}",
"public void addToOrder() {\n OrderLine orderLine = new OrderLine(order.lineNumber++, sandwhich, sandwhich.price());\n order.add(orderLine);\n ObservableList<Extra> selected = extraSelected.getItems();\n orderPrice.clear();\n String price = new DecimalFormat(\"#.##\").format(sandwhich.price());\n orderPrice.appendText(\"$\"+price);\n extraOptions.getItems().addAll(selected);\n extraSelected.getItems().removeAll(selected);\n pickSandwhich();\n\n\n\n }",
"public confirm_order() {\n initComponents();\n }",
"public void linktomyorderseditbuttonPressed(javafx.event.ActionEvent event) throws IOException {\r\n Parent myorderseditParent = FXMLLoader.load(getClass().getResource(\"myOrdersEdit.fxml\"));\r\n Scene myorderseditScene = new Scene(myorderseditParent);\r\n Stage window = (Stage)((Node)event.getSource()).getScene().getWindow();\r\n window.setScene(myorderseditScene);\r\n window.show();\r\n }",
"private void onPaymentButtonClicked() {\n if (cartList == null || cartList.size() < 1) {\n Toast.makeText(getContext(), \"Your cart is empty!\", Toast.LENGTH_SHORT).show();\n return;\n }\n\n if (studentDetails[0] == null) {\n Toast.makeText(getContext(), \"Enter Student ID first\", Toast.LENGTH_SHORT).show();\n studentIdText.requestFocus();\n return;\n }\n\n final PaymentDialog dialog = new PaymentDialog(getActivity(), total, studentDetails[0]);\n\n if (dialog.getWindow() != null) {\n dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));\n dialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);\n }\n\n dialog.setCancelable(false);\n dialog.show();\n dialog.setOnOrderCompleteListener(transactionList -> {\n showProgressDialog();\n orderCompleted(transactionList);\n\n dialog.dismiss();\n });\n Objects.requireNonNull(dialog.getWindow()).clearFlags(WindowManager.\n LayoutParams.FLAG_NOT_FOCUSABLE | WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM);\n dialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE);\n }",
"void showOrdersGui();",
"@Override\n public void onClick(View v) {\n CommonUtils.sendMsg(\"获取订单详情\", DeliveryActivity.SHOW_LOADING_TEXT, handler);\n\n ApisManager.getOrderDetailInfoByOrderId(odi.order_id, new ApiCallback() {\n @Override\n public void success(Object object) {\n CommonUtils.sendMsg(\"\", DeliveryActivity.HIDE_LOADING, handler);\n OrderDetailInfo odi = new OrderDetailInfo();\n JSONObject obj = (JSONObject) object;\n JSONObject objSO = obj.getJSONObject(\"store_order\");\n StoreOrder so = com.alibaba.fastjson.JSONObject.parseObject(CommonUtils.converBooleanToInt(objSO.toString()), StoreOrder.class);\n odi.store_order = so;\n odi.take_serial_number = so.take_serial_number;\n odi.list_charge_items_all = so.order_items;\n\n Message msg = new Message();\n msg.what = DeliveryActivity.SHOW_ORDER_DETAIL_INFO;\n msg.obj = odi;\n handler.sendMessage(msg);\n }\n\n @Override\n public void error(BaseApi.ApiResponse response) {\n CommonUtils.sendMsg(\"\", DeliveryActivity.HIDE_LOADING, handler);\n CommonUtils.sendMsg(response.error_message, DeliveryActivity.SHOW_ERROR_MESSAGE, handler);\n }\n });\n\n }",
"public void onClickOrderName(View view){\n Intent intent = new Intent(this, ViewOrderedCWListActivity.class); //create a new intent and point it at the ViewOrderedCWList activity\n intent.putExtra(EXTRA_MESSAGE, \"Name\"); //add the \"Name\" string as a message in the intent, used to differentiate the calls to ViewOrderedCWList\n startActivity(intent); //start the new activity\n\n }",
"@FXML\n private void updateOrganOrder(ActionEvent event) {\n\n if (sortOrder == Order.ORGAN_ASC) {\n\n sortOrder = Order.ORGAN_DESC;\n\n } else if (sortOrder == Order.ORGAN_DESC) {\n\n sortOrder = Order.DEFAULT;\n\n } else {\n\n sortOrder = Order.ORGAN_ASC;\n\n }\n\n updateOrderButtons();\n\n }",
"@Override\n\t\t\tpublic void buttonClick(ClickEvent event) {\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tUI.getCurrent().getNavigator().navigateTo(\"CliPantallaBusquedaExpedientes\");\t \n\t\t\t}",
"private void setOrderField() \n\t{\n\t\tString size = currentOrder.get(\"size\");\n\t\tString temperature = currentOrder.get(\"drinkTemperature\");\n\t\tString drinkName = currentOrder.get(\"name\");\n\t\t\n\t\torderField.setText(\"Order Status: \" + size + \" \" + temperature + \" \" + drinkName);\n\t}",
"private void receiveOrder() {\n Intent intent = getIntent();\n MyOrder order = (MyOrder) intent.getSerializableExtra(getResources().getString(R.string.intentMesOrder));\n String help;\n final ArrayList<String> listing = new ArrayList<String>();\n ArrayAdapter<String> adap = new ArrayAdapter<String>(this,\n android.R.layout.simple_list_item_1, listing);\n tableSauceString = order.findTableSauce();\n\n switch (intent.getExtras().getInt(getResources().getString(R.string.intentMesOrderType))) { // depending on the order type the received information are displayed\n case 1:\n txtOrderType.setText(getResources().getString(R.string.stringPartOption) +\" \" +\n getResources().getString(R.string.rdbtPizzeria).toString());\n firstInfo.setText(getResources().getString(R.string.stringPartTable) + \" \" +\n String.valueOf(intent.getExtras().getInt(getResources()\n .getString(R.string.intentMesTable))));\n break;\n case 2:\n txtOrderType.setText(getResources().getString(R.string.stringPartOption)+ \" \" +\n getResources().getString(R.string.rdbtTakeaway).toString());\n firstInfo.setText(intent.getExtras().getString(getResources().getString(R.string.intentMesPacking)));\n secondInfo.setText(intent.getExtras().getString(getResources().getString(R.string.intentMesTime)));\n break;\n case 3:\n txtOrderType.setText(getResources().getString(R.string.stringPartOption)+ \" \" +\n getResources().getString(R.string.rdbtDelivery).toString());\n firstInfo.setText(intent.getExtras().getString(getResources().getString(R.string.intentMesAddress)));\n secondInfo.setText(intent.getExtras().getString(getResources().getString(R.string.intentMesPhone)));\n break;\n }\n help = String.format(\"%.2f\", order.getTotal());\n txtMoney.setText(help + getResources()\n .getString(R.string.currency));\n\n if(!(tableSauceString.equals(getResources().getString(R.string.stringNone)))){\n help = String.format(\"%.2f\", order.getTableSaucePrice());\n txtTableSauce.setText(getResources().getString(R.string.stringPartSauce)+\" \"\n + tableSauceString + \"(\" + help+ getResources().getString(R.string.currency) +\" )\");\n }\n\n helpTitle = order.writeOrder();\n helpInfo = order.getMoreOrder();\n for (int i = 0; i < helpTitle.length; i++) {\n if (helpTitle[i] != null) {\n listing.add(helpTitle[i]);\n }\n }\n list.setAdapter(adap);\n list.setOnItemLongClickListener(this);\n }",
"public void orderPlace() {\n Log.d(\"Method\", \"orderPlaced()\");\n\n if (coffeeCount < getResources().getInteger(R.integer.min_coffee)) {\n Log.e(\"\", \"coffeeCount < minimum coffee order\");\n displayMessage(String.format(Locale.getDefault(), getString(R.string.min_order_message), getResources().getInteger(R.integer.min_coffee)));\n } else if (coffeeCount > getResources().getInteger(R.integer.max_coffee)) {\n Log.e(\"\", \"coffeeCount > maximum coffee order\");\n displayMessage(String.format(Locale.getDefault(), getString(R.string.max_order_message), getResources().getInteger(R.integer.max_coffee)));\n } else {\n Log.i(\"\", \"Order placed: \" + coffeeCount + \" coffee.\");\n displayMessage(String.format(Locale.getDefault(), getString(R.string.order_thanks), 176));\n }\n resetQuantity();\n }",
"public static void viewOrder() {\n\t\tSystem.out.print(\"\\t\\t\");\n\t\tSystem.out.println(\"************Viewing existing orders************\");\n\t\t// TODO - implement RRPSS.viewOrder\n\t\tOrderManager orderManager = new OrderManager();\n\t\tList listOfOrders = orderManager.viewOrder();\n\n\t\tOrderedItemManager orderedItemManager = new OrderedItemManager();\n\t\tList listOfOrderedItems = null;\n\t\tOrderedPackageManager orderedPackageManager = new OrderedPackageManager();\n\t\tList listOfOrderedPromotionalPackage = null;\n\n\t\tint i = 0;\n\t\tint choice = 0;\n\t\tOrder order = null;\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tif (listOfOrders.size() == 0) {\n\t\t\tSystem.out.print(\"\\t\\t\");\n\t\t\tSystem.out.format(\"%-25s:\", \"TASK STATUS\");\n\t\t\tSystem.out.println(\"There is no orders!\");\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\t// print the list of orders for the user to select from.\n\t\t\tfor (i = 0; i < listOfOrders.size(); i++) {\n\t\t\t\torder = (Order) listOfOrders.get(i);\n\t\t\t\tSystem.out.print(\"\\t\\t\");\n\n\t\t\t\tSystem.out.println((i + 1) + \") Order: \" + order.getId()\n\t\t\t\t\t\t+ \" | Table: \" + order.getTable().getId());\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t\tSystem.out.print(\"\\t\\t\");\n\n\t\t\tSystem.out.print(\"Select an order to view the item ordered: \");\n\t\t\tchoice = Integer.parseInt(sc.nextLine());\n\n\t\t\torder = (Order) listOfOrders.get(choice - 1);\n\n\t\t\tlistOfOrderedItems = orderedItemManager\n\t\t\t\t\t.retrieveOrderedItemsByOrderID(order.getId());\n\t\t\tlistOfOrderedPromotionalPackage = orderedPackageManager\n\t\t\t\t\t.retrieveOrderedPackageByOrderID(order.getId());\n\n\t\t\tif (listOfOrderedItems.size() == 0\n\t\t\t\t\t&& listOfOrderedPromotionalPackage.size() == 0) {\n\t\t\t\tSystem.out.print(\"\\t\\t\");\n\t\t\t\tSystem.out.format(\"%-25s:\", \"TASK STATUS\");\n\t\t\t\tSystem.out.println(\"Order is empty!\");\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tSystem.out.println();\n\t\t\tif (listOfOrderedItems.size() > 0) {\n\t\t\t\tSystem.out.print(\"\\t\\t\");\n\n\t\t\t\tSystem.out.println(\"All Cart Items Ordered:\");\n\n\t\t\t\tfor (int j = 0; j < listOfOrderedItems.size(); j++) {\n\t\t\t\t\tOrderedItem orderedItem = (OrderedItem) listOfOrderedItems\n\t\t\t\t\t\t\t.get(j);\n\t\t\t\t\tSystem.out.print(\"\\t\\t\");\n\n\t\t\t\t\tSystem.out.println((j + 1) + \") ID: \"\n\t\t\t\t\t\t\t+ orderedItem.getItem().getId() + \" | Name: \"\n\t\t\t\t\t\t\t+ orderedItem.getItem().getName() + \" | $\"\n\t\t\t\t\t\t\t+ orderedItem.getPrice());\n\t\t\t\t}\n\n\t\t\t\tSystem.out.println();\n\t\t\t}\n\n\t\t\tif (listOfOrderedPromotionalPackage.size() > 0) {\n\t\t\t\tSystem.out.print(\"\\t\\t\");\n\n\t\t\t\tSystem.out.println(\"Promotional Packages Ordered:\");\n\n\t\t\t\tfor (int j = 0; j < listOfOrderedPromotionalPackage.size(); j++) {\n\t\t\t\t\tOrderedPackage orderedPackage = (OrderedPackage) listOfOrderedPromotionalPackage\n\t\t\t\t\t\t\t.get(j);\n\t\t\t\t\tSystem.out.print(\"\\t\\t\");\n\n\t\t\t\t\tSystem.out.println((j + 1) + \") ID: \"\n\t\t\t\t\t\t\t+ orderedPackage.getPackage().getId() + \" | Name: \"\n\t\t\t\t\t\t\t+ orderedPackage.getPackage().getName() + \" | $\"\n\t\t\t\t\t\t\t+ orderedPackage.getPrice());\n\t\t\t\t}\n\n\t\t\t\tSystem.out.println();\n\t\t\t}\n\t\t}\n\n\t\tcatch (Exception e) {\n\t\t\tSystem.out.print(\"\\t\\t\");\n\t\t\tSystem.out.format(\"%-25s:\", \"TASK STATUS\");\n\t\t\tSystem.out.println(\"Invalid Input!\");\n\t\t}\n\t\tSystem.out.print(\"\\t\\t\");\n\t\tSystem.out.println(\"************End of viewing orders************\");\n\t}",
"public void onAction(IClientContext context, IGuiElement button) throws Exception\n\t{\n IDataTableRecord activeCampaign = TC.getActiveCampagne(context);\n \n // check whether the given object already has an order in the future\n //\n IDataTableRecord objectRecord = context.getSelectedRecord();\n IDataAccessor accessor = context.getDataAccessor();\n accessor.qbeClearAll();\n \n IDataTable orderTable = accessor.getTable(\"tc_order\");\n orderTable.qbeSetKeyValue(\"tc_object_key\", objectRecord.getValue(\"pkey\"));\n \n IDataTable capacityTable = accessor.getTable(\"tc_capacity\");\n capacityTable.qbeSetKeyValue(\"tc_campaign_key\", activeCampaign.getValue(\"pkey\"));\n capacityTable.qbeSetValue(\"slot\", \">now\");\n \n IDataBrowser orderBrowser = accessor.getBrowser(\"tc_orderBrowser\");\n orderBrowser.search(\"r_tc_order\", Filldirection.BACKWARD);\n if (orderBrowser.recordCount() > 0)\n {\n IOkCancelDialog dialog = context.createOkCancelDialog(\"Für das Fahrzeug wurde bereits eine Buchung angelegt.\\\\n Buchung des Fahrzeuges anzeigen?\", new ObjectOrderExistsCallback(orderBrowser));\n dialog.show();\n return;\n }\n\n // check whether a customer has been selected\n //\n IDataTableRecord customerRecord = context.getDataTable(\"tc_customer\").getSelectedRecord();\n if (customerRecord == null)\n {\n throw new BusinessException(\"Es wurde bisher kein Kunde ausgewählt!\");\n }\n \n // check whether the given customer already has an order in the future\n //\n accessor.qbeClearAll();\n orderTable.qbeSetKeyValue(\"tc_customer_key\", customerRecord.getValue(\"pkey\"));\n capacityTable.qbeSetKeyValue(\"tc_campaign_key\", activeCampaign.getValue(\"pkey\"));\n capacityTable.qbeSetValue(\"slot\", \">now\");\n \n orderBrowser.search(\"r_tc_order\", Filldirection.BACKWARD);\n if (orderBrowser.recordCount() > 0)\n {\n FormLayout layout = new FormLayout(\"10dlu,p,10dlu\", \"20dlu,p,20dlu\");\n\n IFormDialog dialog = context.createFormDialog(\"Buchung vorhanden\", layout, new CustomerOrderExistsCallback(orderBrowser));\n CellConstraints c = new CellConstraints();\n if (orderBrowser.recordCount() == 1)\n dialog.addLabel(\"Der Kunde hat bereits eine Buchung beauftragt. Mit der Terminberechnung fortfahren oder Buchung anzeigen?\", c.xy(1, 1));\n else\n dialog.addLabel(\"Der Kunde hat bereits mehrere Buchungen beauftragt. Mit der Terminberechnung fortfahren oder Buchungen anzeigen?\", c.xy(1, 1));\n\n dialog.addSubmitButton(PROCEED_BUTTON_ID, \"Fortfahren\");\n if (orderBrowser.recordCount() == 1)\n dialog.addSubmitButton(SHOW_ORDER_BUTTON_ID, \"Buchung anzeigen\");\n else\n dialog.addSubmitButton(SHOW_ORDER_BUTTON_ID, \"Buchungen anzeigen\");\n dialog.setCancelButton(\"Abbrechen\");\n\n dialog.show(350, 120);\n return;\n }\n\n // everything already -> proceed\n doit(context);\n\t}",
"public void payForOrder(){\n\t\tcurrentOrder.setDate(new Date()); // setting date to current\n\t\t\n\t\t//Checking if tendered money is enough to pay for the order.\n\t\tfor(;;){\n\t\t\tJOptionPane.showMessageDialog(this.getParent(), new CheckoutPanel(currentOrder), \"\", JOptionPane.PLAIN_MESSAGE);\n\t\t\tif(currentOrder.getTendered().compareTo(currentOrder.getSubtotal())==-1){\n\t\t\t\tJOptionPane.showMessageDialog(this.getParent(), \"Not enough money tendered\", \"Error\", JOptionPane.ERROR_MESSAGE);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\t//Setting order number.\n\t\tSimpleDateFormat df = new SimpleDateFormat(\"yyyyMMdd\");\n\t\tString str = df.format(currentOrder.getDate());\n\t\tString number = Integer.toString(till.getOrders().size()+1) +\"/\"+str;\n\t\tcurrentOrder.setNumber(number);\n\t\t\n\t\t//Setting customer name.\n\t\tcurrentOrder.setCustomerName(custNameField.getText());\n\t\t\n\t\t//Adding current order to orders list.\n\t\ttill.getOrders().add(currentOrder); \n\t\t\n\t\t//Displays the receipt.\n\t\tJOptionPane.showMessageDialog(this.getParent(), new ReceiptPanel(currentOrder), \"Receipt\", \n\t\t\t\tJOptionPane.PLAIN_MESSAGE);\n\t\t\n\t\t//Resets OrderPanel.\n\t\tthis.resetOrder();\n\t}",
"public void submitOrder(BeverageOrder order);",
"public void submitOrder(View view) {\n\n String order = gatherOrder(view);\n\n Uri uri = Uri.parse(\"mailto:\" + \"[email protected]\")\n .buildUpon()\n .appendQueryParameter(\"to\", \"[email protected]\")\n .appendQueryParameter(\"subject\", \"Your pizza order\")\n .appendQueryParameter(\"body\", order)\n .build();\n\n sendEmail(uri, \"Select Email\");\n }",
"private void checkToMyOrder() {\n toolbar.setTitle(R.string.my_order);\n MyOrderFragment myOrderFragment = new MyOrderFragment();\n displaySelectedFragment(myOrderFragment);\n }",
"@Override\n public void OnOkButtonPressed(OrderDetail detail) {\n orderListAdpater.addOrderDetail(detail);\n orderListAdpater.setSelectedIndex(orderListAdpater.getCount() - 1);\n orderList.setSelection(orderListAdpater.getCount());\n\n// if (orderListAdpater.orderDetailList.size() == 1) {\n orderListAdpater.notifyDataSetChanged();\n// }\n onOrderUpdate();\n\n }",
"public void actionPerformed(ActionEvent event) {\n\t\t\n\t\tint order = drawing.getOrder();\n\t\tif (event.getSource() == increase) {\n\t\t\tif (order < MAX)\n\t\t\t\torder++;\n\t\t}\n\t\telse {\n\t\t\tif (order > MIN)\n\t\t\t\torder--;\n\t\t}\n\t\torderLabel.setText(\"Order: \" + order);\n\t\tdrawing.setOrder(order);\n\t\trepaint();\n\t}",
"public void submitOrder(View view) {\n EditText getName = (EditText)findViewById(R.id.name_field);\n String nameValue = getName.getText().toString();\n\n CheckBox whippedCreamCheckBox = (CheckBox) findViewById(R.id.Whipped_cream_checkbox);\n boolean hasWhippedCream = whippedCreamCheckBox.isChecked();\n\n CheckBox chocolateCheckBox = (CheckBox) findViewById(R.id.Chocolate_checkbox);\n boolean hasChocolate = chocolateCheckBox.isChecked();\n\n CheckBox CinnamonCheckBox = (CheckBox) findViewById(R.id.Cinnamon_checkbox);\n boolean hasCinnamon = CinnamonCheckBox.isChecked();\n\n CheckBox MarshmallowsCheckBox = (CheckBox) findViewById(R.id.Marshmallows_checkbox);\n boolean hasMarshmallows = MarshmallowsCheckBox.isChecked();\n\n int price = calculatePrice(hasWhippedCream, hasChocolate, hasMarshmallows, hasCinnamon);\n String priceMessage = createOrderSummary(nameValue, price, hasWhippedCream,hasChocolate, hasCinnamon, hasMarshmallows);\n /*displayMessage(priceMessage);*/\n // Use an intent to launch an email app.\n // Send the order summary in the email body.\n Intent intent = new Intent(Intent.ACTION_SENDTO);\n intent.setData(Uri.parse(\"mailto:\")); // only email apps should handle this\n intent.putExtra(Intent.EXTRA_SUBJECT, \"JustJava order for \" + nameValue);\n intent.putExtra(Intent.EXTRA_TEXT, priceMessage);\n\n if (intent.resolveActivity(getPackageManager()) != null) {\n startActivity(intent);\n }\n }",
"public orderView() {\n initComponents();\n }",
"@Override\n public void onClick(View view) {\n String enteredQuantity = etEditQuantity.getText().toString().trim();\n\n // Check to see if quantity has been entered and set it as the quantity if it has.\n if (!enteredQuantity.equals(\"\")) {\n quantity = Integer.parseInt(enteredQuantity);\n }\n\n // Set the quantity to zero if quantity has been entered and then removed,\n // so that the buttons work properly.\n if (enteredQuantity.equals(\"\")) {\n quantity = 0;\n }\n\n // Perform action on click.\n switch (view.getId()) {\n // Action to perform when the decrease button is clicked.\n case R.id.btn_decrease:\n // Don't allow quantity to go below zero.\n if (quantity == 0) {\n Toast.makeText(this, R.string.minimum_quantity,\n Toast.LENGTH_SHORT).show();\n return;\n }\n\n // Decrease the quantity and set the value in the quantity TextView.\n quantity--;\n etEditQuantity.setText(String.valueOf(quantity));\n break;\n\n // Action to perform when the increase button is clicked.\n case R.id.btn_increase:\n // Increase the quantity and set the value in the quantity TextView.\n quantity++;\n etEditQuantity.setText(String.valueOf(quantity));\n break;\n\n // Action to perform when the order button is clicked.\n case R.id.btn_order:\n // Create an intent to call the supplier.\n Intent callSupplier = new Intent(Intent.ACTION_DIAL);\n callSupplier.setData(Uri.parse(\"tel:\" + supplierPhoneNumber));\n // Make sure an app is installed to complete this action.\n if (callSupplier.resolveActivity(getPackageManager()) != null) {\n // Start the intent if there is an app installed to handle the intent.\n startActivity(callSupplier);\n } else {\n // Show a toast if there isn't an app installed to handle the intent.\n Toast.makeText(getApplication(), R.string.install_phone_app,\n Toast.LENGTH_SHORT).show();\n }\n }\n }",
"public SMplace_order() {\n initComponents();\n table();\n }",
"@Override\n public void onClick(View view) {\n switch (view.getId()) {\n\n // If the addWeight FAB is clicked\n case R.id.weightTableAddButton:\n if (mSelectedWeightPosition != RecyclerView.NO_POSITION) {\n mActionMode.finish();\n }\n Navigation.findNavController(getView()).navigate(R.id.navigation_add_weight);\n break;\n default:\n if (mActionMode != null) {\n mActionMode.finish();\n }\n break;\n }\n }",
"public void onClickOrderWeight(View view){\n Intent intent = new Intent(this, ViewOrderedCWListActivity.class); //create a new intent and point it at the ViewOrderedCWList activity\n intent.putExtra(EXTRA_MESSAGE, \"Weight\"); //add the \"Weight\" string as a message in the intent, used to differentiate the calls to ViewOrderedCWList\n startActivity(intent); //start the new activity\n\n }",
"public void onOrderAdded(OrderEntry orderEntry);",
"@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 }",
"public void submitOrder(View view) {\n /* invoke email app and include order summary in the mail body */\n final Intent emailIntent = new Intent(Intent.ACTION_SENDTO);\n emailIntent.setData(Uri.parse(\"mailto:\"));\n emailIntent.putExtra(Intent.EXTRA_SUBJECT, Constants.NEW_ORDER_SUBJECT);\n emailIntent.putExtra(Intent.EXTRA_TEXT, getOrderSummary());\n if (emailIntent.resolveActivity(getPackageManager()) != null) {\n startActivity(emailIntent);\n }\n }",
"public void Cart() {\r\n\t\tthis.cart.click();\r\n\t}",
"@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n\n initiateOrder(request, response);\n }",
"@Override\n public void actionPerformed(ActionEvent e) {\n if(e.getSource()==autopay){\n model.getCustomer().getOrder().orderStatus=OrderStatus.paid;\n dispose();\n }\n\n if(e.getSource()==Paywithanothercard){\n if(model.getCustomer().getOrder().orderStatus.name().equals(\"unpaid\")){\n //String orNUm=model.getCustomer().or.orderNumber;\n new Payment(model.getCustomer().getOrder(),model.getCustomer().getOrder().orderType);\n // System.out.println(model.getCustomer().or.orderNumber+\" \"+model.getCustomer().or.orderStatus);\n }else{\n JOptionPane.showMessageDialog(this,\n \"Your order has paied\", \"Error Message\",\n JOptionPane.ERROR_MESSAGE);\n }\n dispose();\n }\n\n\n if(e.getSource()==cancel){\n dispose();\n }\n\n }",
"@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tgetDeliveryList(true, solverMan);\n\t\t\t}",
"public void submitOrder(View view) {\n EditText nameText = (EditText) findViewById(R.id.edt_Name);\n String name = nameText.getText().toString();\n\n CheckBox whippedCream = (CheckBox) findViewById(R.id.chx_WhippedCream);\n boolean cream = whippedCream.isChecked();\n\n CheckBox hasChocolate = (CheckBox) findViewById(R.id.chx_Chocolate);\n boolean chocolate = hasChocolate.isChecked();\n\n int price = calculatePrice(cream, chocolate);\n displayMessage(createOrderSummary(price, cream, chocolate, name));\n sendReceipt(name, createOrderSummary(price,cream,chocolate,name));\n }",
"public void view() {\n\t\t\t\n\t\t\tSystem.out.println(\"Poping up window to show each order of customer @ AdminSaleController\");\n\t\t\tCustomerOrderMain vo = new CustomerOrderMain();\n\t\t vo.start(ps);\n\t\t\t\n\t\t}",
"@Override\n public void onClick(View v) {\n \tTextView text1 = (TextView) findViewById(R.id.quantity);\n \tItem.setQuantity(Integer.parseInt(text1.getText().toString()));\n EditText instr = (EditText) findViewById(R.id.instr);\n Item.setInstr(instr.getText().toString());\n // call fragment order\n Intent callIntent = new Intent(Intent.ACTION_CALL); \n callIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n callIntent.setClass(c, HomeActivity.class);\n Home.setOrder(true);\n startActivity(callIntent);\n }",
"public void submitOrder(View view) {\n\n String priceMesage = \"Amount due R\" + price;\n displayMessage(priceMesage);\n }",
"void setOrder(int order){\r\n\t\t\tthis.order = order;\r\n\t\t}",
"@FXML\n\tpublic void createNewOrder(ActionEvent event) {\n\t\t// TODO Autogenerated\n\t}",
"public void clickOnAddToCartButton()\n \t{\n \t\tproductRequirementsPageLocators.clickAddToCartButton.click();\n\n \t}",
"public void setOrder(int order) {\n this.order = order;\n }",
"public void setOrder(int order) {\n this.order = order;\n }",
"public void submitOrder(View view) {\n\n EditText nameField = (EditText) findViewById(R.id.name_field);\n String name = nameField.getText().toString();\n //Figure out if you want to add whipped cream\n CheckBox whippedCream = (CheckBox) findViewById(R.id.whipped_cream_checkbox);\n Boolean hasWhippedCream = whippedCream.isChecked();\n //Figure out if you want to add chocolate\n CheckBox chocolate = (CheckBox) findViewById(R.id.chocolate_checkbox);\n Boolean hasChocolate = chocolate.isChecked();\n\n int price = calculatePrice(hasWhippedCream, hasChocolate);\n\n// // Log.v(\"MainActivity\", \"This price is \" + price);\n\n String priceMessage = createOrderSummary(name, price, hasWhippedCream, hasChocolate);\n\n\n// composeEmail(\"[email protected]\", name, priceMessage);\n displayText(priceMessage);\n }",
"public void showOrderGui(int ID) throws OrderNotFoundException;",
"private void newOrderbutton(String txt) {\n Button btn = new Button(txt);\n newBtnStyle(btn);\n\n boolean containsbtn = false;\n btn.setId(txt);\n for (Node node : activeOrders.getChildren()) {\n String button = ((Button) node).getText();\n if (txt.equals(button))\n containsbtn = true;\n\n }\n if (!containsbtn) {\n activeOrders.getChildren().add(btn);\n\n changeActive(btn);\n } else {\n //Alert clerc about the amount to pay back.\n Alert alert = new Alert(Alert.AlertType.INFORMATION);\n alert.setTitle(\"Nyt bord\");\n alert.setHeaderText(\"Bord: \" + txt + \" eksistere allerede\");\n alert.showAndWait();\n }\n }",
"@Override\n\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\tIntent intent = new Intent(context, CustomerDueDetails.class);\n\t\t\t\t\tintent.putExtra(\"shopper_id\", \"\"+list.get(position).get_shopper_id());\n\t\t\t\t\tintent.putExtra(\"name\", \"\"+list.get(position).get_shopper_name());\n\t\t\t\t\tintent.putExtra(\"amount\", \"\"+list.get(position).get_outstanding_amount());\n\t\t\t\t\tintent.putExtra(\"order_id\", \"\"+list.get(position).getOrder_id());\n\t\t\t\t\tintent.putExtra(\"strdt\", txt_str_date.getText().toString());\n\n\t\t\t\t\tintent.putExtra(\"enddt\", txt_str_end.getText().toString());\n\n\t\t\t\t\tintent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n\t\t\t\t\tcontext.startActivity(intent);\n\t\t\t\t}",
"public AddOrderFrame() throws Exception {\n initComponents();\n this.orderService = new OrderService();\n this.loadProducts(new ProductService());\n this.getSelectedProducts(); \n }",
"public void buttonClick(ClickEvent event) {\n\t\t\t\tif (!isProcessing) {\n\t\t\t\t\tisProcessing = saveOperacion(oItem, operacionConfirmForm);\n\t\t\t\t}\n\t\t\t}",
"public void orderNow() throws Exception {\n\t\tQTiumAutomation.sleep(10);\n\t\tint item = 0;\n\t\tint range = 10;\n\t\tString clientName = Constants.CLIENT_NAME;\n\t\tString clientPhone = Constants.CLIENT_PHONE;\n\t\tSystem.out.println(\"click Order Now button & fill client info at RankingPage...\");\n\t\tdo {\n\t\t\titem = QTiumAutomation.randomIntNumber(range);\n\t\t\tString xpath = String.format(RankingPageEntity.ORDER_NOW_BUTTON, item);\n\t\t\tSystem.out.println(\">>>>> trying to click item: \" + xpath);\n\t\t\tBy element = By.xpath(xpath);\n\t\t\tif (QTiumAutomation.waitForElement(element)) {\n\t\t\t\tQTiumAutomation.scrollPageToElementAndClick(element);\n\t\t\t\tbreak;\n\t\t\t} else {\n\t\t\t\tSystem.err.println(\"NoSuchElement: \" + xpath);\n\t\t\t\trange = range / 2;\n\t\t\t}\n\t\t} while (range > 1);\n\t\tQTiumAutomation.sleep(5);\n\t\tdo {\n\t\t\tQTiumAutomation.enter(RankingPageEntity.CLIENT_NAME_TEXTBOX, clientName);\n\t\t\tQTiumAutomation.enter(RankingPageEntity.CLIENT_PHONE_TEXTBOX, clientPhone);\n\t\t\tQTiumAutomation.click(RankingPageEntity.SUBMIT_BUTTON);\n\t\t} while (QTiumAutomation.waitForElement(RankingPageEntity.NAME_ERROR)||\n\t\t\t\tQTiumAutomation.waitForElement(RankingPageEntity.PHONE_ERROR));\n\t}",
"@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tnew sell().execute(CartActivity.sendObject.toString());\n\t\t\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\n\t\tif (e.getSource() == logoutButton) {\n\t\t\tdispose();\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif (e.getSource() == itemModificationButton) {\n\t\t\tdispose();\n\t\t\tMain.openItemModification(User.EMPLOYEE_POSITION, itemBank);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tfor (int i = 0; i < ordersOnPage(); i++) {\n\t\t\t\n\t\t\tif (e.getSource() == deleteOrderButtons[i]) {\n\t\t\t\tremoveOrders();\n\t\t\t\tPostgresConnection db = new PostgresConnection();\n\t\t\t\tdb.deleteOrder(orderBank.get(i));\n\t\t\t\tdb.close();\n\t\t\t\torderBank.remove(i);\n\t\t\t\tif (orderBank.size() > 3) {\n\t\t\t\t\torderList.add(orderBank.get(4));\n\t\t\t\t}\n\t\t\t\trepaintContainer();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\tif (e.getSource() == approveOrderButtons[i]) {\n\t\t\t\tremoveOrders();\n\t\t\t\tPostgresConnection db = new PostgresConnection();\n\t\t\t\tdb.deleteOrder(orderBank.get(i));\n\t\t\t\tdb.close();\n\t\t\t\torderBank.remove(i);\n\t\t\t\tif (orderBank.size() > 3) {\n\t\t\t\t\torderList.add(orderBank.get(4));\n\t\t\t\t}\n\t\t\t\trepaintContainer();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t}",
"public void submitOrder(){\t\n\t\tSharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(this);\n\t\tint tableNumber = Integer.parseInt(sharedPref.getString(\"table_num\", \"\"));\n\t\t\n\t\tif(menu != null){\n\t\t\tParseUser user = ParseUser.getCurrentUser();\n\t\t\tParseObject order = new ParseObject(\"Order\");\n\t\t\torder.put(\"user\", user);\n\t\t\torder.put(\"paid\", false);\n\t\t\torder.put(\"tableNumber\", tableNumber); // Fix this -- currently hard coding table number\n\t\t\t\n\t\t\tParseRelation<ParseObject> items = order.getRelation(\"items\");\n\t\t\t\n\t\t\tfor(ParseObject item : selectedItems) {\n\t\t\t\titems.add(item);\n\t\t\t}\n\t\t\t\n\t\t\torder.saveInBackground(new SaveCallback(){\n\n\t\t\t\t@Override\n\t\t\t\tpublic void done(ParseException e) {\n\t\t\t\t\tif(e == null){\n\t\t\t\t\t\tToast.makeText(getApplicationContext(), \"Order Submitted!\", 5).show();\n\t\t\t\t\t\tfinish();\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tToast.makeText(getApplicationContext(), \"Submitting Order Failed!\", 5).show();\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});\n\t\t}\n\t}",
"@Override\n\t\t\tpublic void onClick(ClickEvent event) {\n\t\t\t}",
"public PlaceOrder() {\n initComponents();\n this.setSize(1090, 750);\n \n System.out.println(\"new Order().getAllOrders() = \" + new Order().getAllOrders());\n \n this.products = new ArrayList<>();\n \n this.productsList = new ItemList(ProductOrderPanel.WIDTH);\n this.getAllCustomers();\n \n pnlAddProducts.add(productsList, new org.netbeans.lib.awtextra.AbsoluteConstraints(55, 260, ProductOrderPanel.WIDTH, 250));\n \n UIUtils.setIcon(this.jbPlaceOrder, \"save\");\n UIUtils.setIcon(this.jbAdd, \"add\");\n \n \n \n }",
"@Override\n public void onClick(View view) {\n addCredit();\n }",
"@FXML\r\n void submitNewOrder(MouseEvent event) {\r\n\t\t\t//everything is ok, now we will add casual traveler order.\r\n\t\t\tif ( order != null && WorkerControllerClient.createNewOrder(order) ) {\r\n\t\t\t\torderSucceed = true;\r\n\t\t\t\tAlert alert = new Alert(AlertType.INFORMATION);\r\n\t\t\t\talert.setHeaderText(\"succeed!\");\r\n\t\t\t\talert.setContentText(\"order created successfully\");\r\n\t\t\t\talert.showAndWait();\r\n\t\t\t\tsubmitButton.getScene().getWindow().hide();\r\n\t\t\t} else {\r\n\t\t\t\tAlert alert = new Alert(AlertType.ERROR);\r\n\t\t\t\talert.setHeaderText(\"Failed!\");\r\n\t\t\t\talert.setContentText(\"Order Failed\");\r\n\t\t\t\talert.showAndWait();\r\n\t\t\t\tsubmitButton.getScene().getWindow().hide();\r\n\t\t\t}\r\n\t\t\r\n }",
"public void submitOrder(View view) {\n\n displayQuantity(myQuantity);\n int total = calculatePrice(myPrice,myQuantity);\n String orderMessage = displayOrder(total);\n Context context = getApplicationContext();\n Toast myToast = Toast.makeText(context,\"Thanks:\" + myName,Toast.LENGTH_SHORT);\n myToast.show();\n // intent to maps\n //Intent myIntent = new Intent(Intent.ACTION_VIEW);\n //myIntent.setData(Uri.parse(\"geo:47.6, -122.3\"));\n Intent myIntent = new Intent(Intent.ACTION_SENDTO);\n myIntent.setData(Uri.parse(\"mailto:\"));\n myIntent.putExtra(Intent.EXTRA_EMAIL, \"[email protected]\");\n myIntent.putExtra(Intent.EXTRA_SUBJECT,\"Java Order\");\n myIntent.putExtra(Intent.EXTRA_TEXT,orderMessage);\n if(myIntent.resolveActivity(getPackageManager())!= null) {startActivity(myIntent);}\n\n }",
"@Override\n\tpublic void openOrderEnd() {\n\t}"
] | [
"0.7512184",
"0.737486",
"0.7362862",
"0.7091616",
"0.69533724",
"0.69117",
"0.68465847",
"0.68266517",
"0.6773915",
"0.6769986",
"0.67150253",
"0.6704984",
"0.66957325",
"0.6653095",
"0.6641884",
"0.6599688",
"0.65948117",
"0.6591403",
"0.658026",
"0.6554097",
"0.65529776",
"0.65400636",
"0.6529118",
"0.6522291",
"0.6503852",
"0.6483824",
"0.64776516",
"0.6465518",
"0.6454121",
"0.64514977",
"0.6422476",
"0.6417226",
"0.64119166",
"0.64032084",
"0.6401228",
"0.6401228",
"0.6401228",
"0.63988835",
"0.6391347",
"0.63824016",
"0.63748556",
"0.6351257",
"0.6343465",
"0.6328782",
"0.63096315",
"0.63015693",
"0.62927693",
"0.62917036",
"0.6291651",
"0.62632006",
"0.62625015",
"0.625585",
"0.6255595",
"0.625401",
"0.622943",
"0.6223745",
"0.62181175",
"0.6208783",
"0.6194713",
"0.6191241",
"0.61817336",
"0.6179564",
"0.616803",
"0.6167929",
"0.61643034",
"0.6161974",
"0.61589414",
"0.6151648",
"0.61513686",
"0.6150398",
"0.6144328",
"0.61145514",
"0.6113297",
"0.61106455",
"0.6109039",
"0.6107899",
"0.61067706",
"0.6104328",
"0.6098531",
"0.60952413",
"0.6091431",
"0.6090906",
"0.6083857",
"0.6083704",
"0.6083704",
"0.6074309",
"0.60703176",
"0.6061687",
"0.60607904",
"0.60601413",
"0.60569566",
"0.60546863",
"0.60515225",
"0.6050598",
"0.6042354",
"0.6038039",
"0.60333985",
"0.6027229",
"0.6023393",
"0.60219544",
"0.6020337"
] | 0.0 | -1 |
This method displays the given quantity value on the screen. | private void display(int number) {
TextView quantityTextView = (TextView) findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void displayQuantity(int quantity) {\n final TextView quantityTextView = findViewById(R.id.quantity_text_view);\n quantityTextView.setText(String.valueOf(quantity));\n }",
"private void displayQuantity() {\n Log.d(\"Method\", \"displayQuantity()\");\n TextView quantityTextView = (TextView) findViewById(\n R.id.quantity_text_view);\n\n quantityTextView.setText(String.format(Locale.getDefault(), \"%d\", coffeeCount));\n displayTotal();\n }",
"private void displayQuantity(int quantityNumber) {\n TextView quantityTextView = findViewById(R.id.quantity_text_view);\n quantityTextView.setText(\"\" + quantityNumber);\n }",
"private void displayQuantity(int number) {\n TextView ob = findViewById(R.id.quantity_text_view);\n ob.setText(\"\"+number);\n }",
"private void displayQuantity(int number) {\n TextView quantityTextView = findViewById(R.id.quantity_text_view);\n quantityTextView.setText(\"\" + number);\n }",
"private void displayQuantity(int number) {\n TextView quantityTextView = (TextView) findViewById(R.id.quantity_text_view);\n quantityTextView.setText(String.valueOf(number));\n //quantityTextView.setText(new Integer(number).toString());\n }",
"private void displayQuantity(int number) {\n TextView quantityTextView = (TextView) findViewById(R.id.quantity_text_view);\n quantityTextView.setText(number);\n }",
"private void displayQuantity(int number) {\n TextView quantityTextView = (TextView) findViewById(\n R.id.quantity_text_view);\n quantityTextView.setText(\"\" + number);\n }",
"private void displayQuantity(int number) {\n TextView quantityTextView = (TextView) findViewById(R.id.quantity_text_view);\n quantityTextView.setText(\"\" + number);\n }",
"private void displayQuantity(int number) {\n TextView quantityTextView = (TextView) findViewById(R.id.quantity_text_view);\n quantityTextView.setText(\"\"+ number);\n }",
"private void display(int number) {\n TextView quantityTextView = (TextView) findViewById(R.id.quantity_text_view);\n quantityTextView.setText(String.format(\"%d\", number));\n }",
"private void display(int number) {\n TextView quantityTextView = (TextView) findViewById(\n R.id.quantity_text_view);\n quantityTextView.setText(\"\" + number);\n }",
"private void display(int number)\n {\n TextView quantityTextView = (TextView) findViewById(R.id.quantity_text_view);\n quantityTextView.setText(\"\" + number);\n }",
"private void display(int number) {\n TextView quantityTextView = (TextView)\n findViewById(R.id.quantity_text_view);\n quantityTextView.setText(\"\" + number);\n\n }",
"void printTotalQuantity();",
"private void display(int number) {\n TextView quantityTextView = (TextView) findViewById(R.id.quantity_text_view);\n quantityTextView.setText(\"\" + number);\n\n }",
"private void display(int number) {\r\n TextView quantity_txt = (TextView) findViewById(R.id.quantity_textview);\r\n quantity_txt.setText(\"\" + number);\r\n }",
"void printQuantity(Quantity iQuantity)\n {\n System.out.println(iQuantity.getElementValue());\n }",
"private void display(int number) {\n TextView quantityText = findViewById(R.id.textCups);\n quantityText.setText(\"\" + number);\n }",
"private void displayQuantity(int numOfCoffeee) {\n TextView quantityTextView = (TextView) findViewById(R.id.quantity_text_view);\n quantityTextView.setText(\"\" + numOfCoffeee);\n }",
"BigDecimal getDisplayQuantity();",
"public void display() {\n \t\tSystem.out.printf(\"|%6s \", String.valueOf(idNumber));\n\t\tSystem.out.printf(\"|%13s |\", name);\n\t\tSystem.out.printf(\"%10s |\", quantity);\n\t\tSystem.out.printf(\"%8.2f |\", price);\n\t\tSystem.out.printf(\"%16s |\", \" \");\n\t\tSystem.out.printf(\"%16s |\", \" \");\n\t\tSystem.out.println();\n }",
"private void display(int number){\n TextView quantTV = (TextView) findViewById(R.id.quant_tv);\n quantTV.setText(\"\"+ number);\n }",
"void setQuantity(int quantity) {\n mQuantityTextView.setText(String.valueOf(quantity));\n }",
"public void setQuantity(int value) {\n this.quantity = value;\n }",
"public void setQuantity(int value) {\n this.quantity = value;\n }",
"public void setQuantity(int value) {\n this.quantity = value;\n }",
"private void displayquintity(int numberOFCoffee){\n TextView quintityText= findViewById(R.id.quantity_text_view);\n quintityText.setText(\"\"+numberOFCoffee);\n\n }",
"public void setQuantity(float value) {\n this.quantity = value;\n }",
"@Override\n public String toString() {\n String output = quantity + \" x \" + product;\n\n return output;\n }",
"private void display(int number) {\n TextView quantityTextView = (TextView) findViewById(R.id.minute_text_view);\n quantityTextView.setText(\"\" + number);\n\n }",
"String getQuantity() {\n return Integer.toString(quantity);\n }",
"private void displayQuantity(int numberOfCoffees) {\n TextView quantityTextView = (TextView) findViewById(\n R.id.quantity_text_view);\n quantityTextView.setText(\"\" + numberOfCoffees);\n }",
"public void setQuantity(int quantity) {\r\n this.quantity = quantity;\r\n }",
"void setDisplayQuantity(BigDecimal inDisplayQuantity);",
"public void setQuantity(int quantity) {\n this.quantity = quantity;\n }",
"public void setQuantity(int quantity) {\n this.quantity = quantity;\n }",
"public void printOrderItem(){\r\n\t\tSystem.out.print(this.quantity+\" x \"+this.menuItem.getName()+\" ---- \");\r\n\t\tSystem.out.printf(\"$%.2f\\n\",this.calculatePrice());\r\n\t}",
"public void setQuantity(Integer quantity) {\n this.quantity = quantity;\n }",
"public void setQuantity(String quantity) {\n this.quantity = quantity;\n }",
"public void setQuantity(Integer quantity) {\r\n this.quantity = quantity;\r\n }",
"public void setQuantity(Integer quantity) {\n this.quantity = quantity;\n }",
"public void setQuantity(Integer quantity) {\n this.quantity = quantity;\n }",
"public String getQuantity() {\n return quantity;\n }",
"public void setQuantity(int quantity) {\r\n\t\tthis.quantity = quantity;\r\n\t}",
"public void setQuantity(Float quantity) {\n this.quantity = quantity;\n }",
"public void setQuantity(int quantity)\n\t{\n\t\tthis.quantity = quantity;\n\t}",
"public void submitOrder(int quantity) {\n display(quantity);\n displayPrice(quantity * pintPrice);\n }",
"public static String formatQuantity(int quantity) {\n return formatQuantity((double) quantity);\n }",
"private void displayPrice(int number) {\n }",
"public void setQuantity(int quantity) {\n\t\tthis.quantity = quantity;\n\t}",
"public String asText() {\n String quantityStr;\n\n // we don't want to display decimal digits for int values (6.0 TBSP)\n // so check if quantity is int (check rounded-down value of quantity is the same as quantity)\n if (Math.floor(quantity) == quantity) {\n // quantity can be display as int\n quantityStr = String.valueOf(Math.round(quantity));\n } else {\n // quantity should be double\n quantityStr = String.valueOf(quantity);\n }\n\n return name + \" (\" + quantityStr + \" \" + measureUnit + \")\";\n }",
"private void printCheckItemQuantityMenu(Shop shop) {\n System.out.println(\"What is the ID of the tool you would like to look up?\");\n int itemId = receiveNumberInput();\n if (shop.searchInventory(itemId)) {\n System.out.println(\"Quantity: \" + shop.checkToolStock(itemId));\n } else {\n System.out.println(\"Tool does not exist or invalid input, please check spelling and try again.\");\n }\n }",
"public void submitOrder() {\n int price = quantity*5;\n displayPrice(price);\n }",
"public void incQty() {\n b.qty.setText(\"\" + ++qty);\n\n }",
"public void addQuantity()\n {\n int quantity = Integer.parseInt(quantityTextField.getText());\n quantity++;\n quantityTextField.setText(\"\" + quantity);\n\n changeSubtotalTextField();\n }",
"public void display()\r\n\t{\r\n\t\tSystem.out.println(\"Dollar: $\"+getAmount());\r\n\t\tSystem.out.println(\"Rupiah: Rp.\"+dollarTorp());\r\n\t}",
"public void increaseQuantity (View view){\n if(quantity == 100){\n Toast.makeText(this, \"You cannot order more than 100 coffee\", Toast.LENGTH_SHORT).show();\n return;\n }\n quantity = quantity + 1;\n displayQuantity(quantity);\n }",
"public float getQuantity() {\n return quantity;\n }",
"@Override\n public String toString() {\n return product.toString() + \", Quantity: \" + quantity;\n }",
"@Override\r\n public void ItemQuantity(int quantity) {\n this.quantity = quantity;\r\n }",
"public void setQuantity(int qty) {\r\n\t\tthis.quantity = qty;\r\n\t}",
"public void printCost() {\r\n double cost;\r\n cost = quantity * price;\r\n System.out.printf(\"Total cost = $%.2f\", cost);\r\n }",
"public void showProducts() {\n\t\t\tfor(int i = 0; i < products.size(); i++) {\n\t\t\t\tif(products.get(i).quantity > 0) {\n\t\t\t\t\tSystem.out.println(alphabet.substring(i, i+1).toUpperCase() + \") \" + products.get(i).toString());\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tproducts.remove(i);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"@Override\r\n\t\tpublic void onClick(View v) {\n\t\t\tquantity++;\r\n\t\t\tquantityText.setText(\"\" + quantity);\r\n\t\t\t}",
"@Override\r\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tif (quantity > 0) {\r\n\t\t\t\t\tquantity--;\r\n\t\t\t\t\tquantityText.setText(\"\" + quantity);\r\n\t\t\t\t\t}\r\n\t\t\t\t}",
"public void display() {\r\n System.out.println(\" Cart Information \" + System.lineSeparator() +\r\n \"=========================\" + System.lineSeparator() +\r\n \"Customer ID: \" + getCustID() + System.lineSeparator() + \r\n \"Cart Total: \" + getTotal()+ System.lineSeparator());\r\n items.display();\r\n }",
"@Override\n public void actionPerformed(ActionEvent actionEvent) {\n total = total * amount3;\n String.valueOf(total);\n //displaying what user chose\n JOptionPane.showMessageDialog(null, total + \" seconds \" + nameItem +\" \"+ amount3 );\n }",
"public static String formatQuantity(Integer quantity) {\n if (quantity == null)\n return \"\";\n else\n return formatQuantity(quantity.doubleValue());\n }",
"public void setQuantity(int quantity) {\r\n if (quantity >= 0) {\r\n this.quantity = quantity;\r\n }\r\n else {\r\n System.out.print(\"Sorry no negative quantities -- setting to 1\");\r\n this.quantity = 1;\r\n }\r\n }",
"@Override\n\tpublic String toString()\n\t{\n\t\tint qty = quantity;\n\n\t\tif ( qty > 999 )\n\t\t\tqty = 999;\n\n\t\treturn Utility.pad(title, TITLE_LENGTH) + ' ' + Utility.pad(qty, QUANTITY_LENGTH) + ' ' + status.getCode() + ' ' + Utility.pad(price, PRICE_LENGTH);\n\t}",
"public void increment(View view) {\n quantity = quantity + 1;\n display(quantity);\n\n }",
"public void increment(View view) {\n quantity = quantity + 1;\n display(quantity);\n\n }",
"public int getQuantity() {\r\n return quantity;\r\n }",
"public double getQuantity() {\n return quantity;\n }",
"public void increament(View view) {\n if(!(quantity>=100)) {\n quantity++;\n display(quantity);\n }\n }",
"public Float getQuantity() {\n return quantity;\n }",
"public void show() {\n super.show(color, value.toString());\n }",
"private void quantityActionPerformed(java.awt.event.ActionEvent evt) {\n }",
"public int getQuantity() {\r\n return quantity;\r\n }",
"public void setQuantity(int quantity) {\n this.quantity = quantity;\n this.updateTotalPrice();\n }",
"@Override\r\n\tpublic void display() {\n\t\tSystem.out.println(\"Discount Code: \" + discode);\r\n\t\tSystem.out.println(\"Group Size: \" + groupsize);\r\n\t\t\r\n\t}",
"public void setQuantity(Long quantity) {\r\n this.quantity = quantity;\r\n }",
"public void showValor() {\n String out = new String();\n this.setText(Integer.toString(valor));\n }",
"public int getQuantity()\n {\n return quantity;\n }",
"public int getQuantity() {\r\n return quantity;\r\n }",
"public void setQuantity(Long quantity) {\n this.quantity = quantity;\n }",
"public Integer getQuantity() {\n return this.quantity;\n }",
"public Integer getQuantity() {\n return quantity;\n }",
"public Integer getQuantity() {\n return quantity;\n }",
"public void submitOrder(View view){\n int price = quant*5;\n String priceMsg = \"Total: $\" + price +\"\\nThank you!\";\n displayMessage(priceMsg);\n }",
"protected void increment(View view){\r\n\r\n if (quantity==99){\r\n return;\r\n }\r\n quantity++;\r\n display(quantity);\r\n }",
"private void display(int key, String value)\n {\n System.out.println(\"Value for id \" + key + \": \" + value);\n }",
"public int getQuantity() {\n return quantity;\n }"
] | [
"0.8213166",
"0.77711684",
"0.76877743",
"0.7662449",
"0.76077026",
"0.75838345",
"0.75393534",
"0.7531525",
"0.75173247",
"0.74963754",
"0.73660475",
"0.73062533",
"0.72967106",
"0.72941256",
"0.72941005",
"0.7285573",
"0.7280236",
"0.72365487",
"0.71914005",
"0.71198004",
"0.6994267",
"0.6964959",
"0.6940356",
"0.6913364",
"0.6900461",
"0.6900461",
"0.6900461",
"0.68776",
"0.6803052",
"0.6776666",
"0.6770069",
"0.6751116",
"0.66636825",
"0.66288346",
"0.66266364",
"0.6593947",
"0.6593947",
"0.65885377",
"0.65845084",
"0.6577237",
"0.65548205",
"0.654062",
"0.654062",
"0.65260404",
"0.65236574",
"0.6517852",
"0.6502968",
"0.6492926",
"0.64799434",
"0.6442976",
"0.64194083",
"0.64132017",
"0.63776505",
"0.6376244",
"0.63532203",
"0.6329494",
"0.63237375",
"0.63159907",
"0.62881327",
"0.6274794",
"0.6273292",
"0.62716436",
"0.6259078",
"0.6252833",
"0.6252445",
"0.62384564",
"0.6211893",
"0.61871225",
"0.61860365",
"0.61714715",
"0.616654",
"0.6143621",
"0.6143621",
"0.6136463",
"0.6123222",
"0.61214507",
"0.6117343",
"0.6108407",
"0.61006755",
"0.6093419",
"0.6075175",
"0.6068499",
"0.6067223",
"0.6063247",
"0.60616606",
"0.6060377",
"0.6056178",
"0.60553265",
"0.60542536",
"0.60542536",
"0.6052427",
"0.6047752",
"0.60392255",
"0.6025482"
] | 0.730518 | 17 |
normalize and split the line | @Override
public void flatMap(String value, Collector<Tuple2<String, Integer>> out) {
String[] tokens = value.toLowerCase().split("\\W+");
// emit the pairs
for (String token : tokens) {
if (token.length() > 0) {
out.collect(new Tuple2<>(token, 1));
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected String[] splitMVSLine(String raw) {\n if (raw == null) {\n return new String[] {};\n }\n StringTokenizer st = new StringTokenizer(raw);\n String[] rtn = new String[st.countTokens()];\n int i = 0;\n while (st.hasMoreTokens()) {\n String nextToken = st.nextToken();\n rtn[i] = nextToken.trim();\n i++;\n }\n return rtn;\n }",
"private String[] splitLine(String line)\n\t{\n\t\treturn line.split(CSV_SEPARATOR);\n\t}",
"protected String[] splitLine(String line) {\n return StringUtils.splitPreserveAllTokens(line, TabbedLineReader.this.delim);\n }",
"private void parseNormal(String line) {\n\n String first_float = line.substring(2);\n int second_space_index = first_float.indexOf(' ') + 1;\n String second_float = first_float.substring(second_space_index);\n int third_space_index = second_float.indexOf(' ') + 1;\n\n float vx = parseFloat(first_float.substring(0, second_space_index - 1));\n float vy = parseFloat(second_float.substring(0, third_space_index - 1));\n float vz = parseFloat(second_float.substring(third_space_index));\n\n mNormals.add(vx);\n mNormals.add(vy);\n mNormals.add(vz);\n }",
"protected String[] parseLine() {\n ArrayList<String> lines = new ArrayList<String>();\n StringBuffer line = new StringBuffer(current);\n while (line.length() > style.lineWidth) {\n int index = split(line);\n lines.add(line.substring(0, index));\n line = new StringBuffer(line.substring(index));\n if (line.length() != 0)\n line.insert(0, continueIndentString());\n }\n if (line.length() != 0)\n lines.add(line.toString());\n return lines.toArray(new String[0]);\n }",
"private static ArrayList<String> splitString(String line) {\n String[] splits = line.split(DELIMITER);\n return new ArrayList<>(Arrays.asList(splits));\n }",
"private String[] splitLine (String fileLine){\n String[] ans = new String[5];\n ans[0] = fileLine.substring(0, fileLine.indexOf(\"!\"));\n ans[1] = fileLine.substring(fileLine.indexOf(\"[\") + 1, fileLine.indexOf(\"]\"));\n String dfTf = fileLine.substring(fileLine.indexOf(\"]!\") + 2);\n ans[3] = dfTf;\n ans[2] = dfTf.substring(0, dfTf.indexOf(\"!\"));\n if (dfTf.contains(\"^\")) {\n ans[4] = dfTf.substring(dfTf.length() - 1);\n ans[3] = ans[3].substring(ans[3].indexOf(\"!\") + 1, ans[3].length() - 2);\n } else\n ans[3] = ans[3].substring(dfTf.indexOf(\"!\") + 1);\n\n return ans;\n }",
"@Override\n public String postProcess(final String line) {\n var lineSeparatorIndex = line.lastIndexOf(RECORD_SEPARATOR_CHARACTER);\n return lineSeparatorIndex >= 0 ? line.substring(0, lineSeparatorIndex) : line;\n }",
"public void processLine(String line){\n\t\tString[] splitted = line.split(\"(\\\\s+|\\\\t+)\");\n\t\tif(splitted.length < FIELDS){\n\t\t\tSystem.err.println(\"DataRow: Cannot process line : \" + line);\n\t\t\tSystem.exit(1);\n\t\t}\n\t\tindex \t\t= Integer.parseInt(splitted[0]);\n\t\tparentIndex = Integer.parseInt(splitted[1]);\n\t\tword \t\t= splitted[2].trim();\n\t\tpos\t\t\t= splitted[3].trim();\n\t\tpredicateLabel = splitted[4].trim();\n\t\tintervenes = splitted[5];\n\t\t\n\t\tidentificationLabel = splitted[6];\n\t\tclassificationLabel = splitted[7];\n\t\t\n\t\thmmState = Integer.parseInt(splitted[8]);\n\t\tnaiveState = Integer.parseInt(splitted[9]);\n\t\tchunk = splitted[10];\n\t\tne = splitted[11];\n\t\tif(splitted.length > FIELDS){\n\t\t\tSystem.err.println(\"WARNING: data row has more than required columns: \" + line);\n\t\t}\n\t}",
"@Override\n protected void processLine(String line) {\n String[] lines = line.split(\",\");\n for (String l : lines) {\n data.add(l);\n }\n }",
"private static String[] lineSplit(String input) {\r\n String[] tokens = input.split(delimiter);\r\n return tokens;\r\n }",
"protected abstract DataTypes[] processLine(MutableCharArrayString line);",
"private String parseLine(String line){\n String escaped = StringEscapeUtils.unescapeHtml4(line);\n escaped = escaped.replaceAll(\"[><*:]\", \"\");\n\n // get rid of ellipses\n escaped = escaped.replaceAll(\"[.]{2,}\", \".\");\n\n // Finally remove line-greaks\n escaped = escaped.replaceAll(\"[\\n]\", \"\");\n\n return escaped.trim();\n }",
"private void processLine(String line, String fileName) {\n splitedLine = textProcess.lemmatize(line);\n indexer.addLineToDoc(fileName, splitedLine);\n }",
"private void prepareLine(int line){\n int length = mText.getColumnCount(line);\n if(length >= mChars.length){\n mChars = new char[length + 100];\n }\n for(int i = 0;i < length;i++){\n mChars[i] = mText.charAt(line, i);\n }\n }",
"private void SplitString(String line) {\n String[] splittedLine = line.split(\"-\");\n AddLineToDictionary(Integer.parseInt(splittedLine[0]), splittedLine[1]);\n }",
"protected void processLine(String line){}",
"private Line(String inLine) {\n // Save the input line.\n this.lineText = inLine;\n // Get the number of fields in the line.\n int nFields = labels.length;\n // Normally, this will work.\n this.fields = TabbedLineReader.this.splitLine(inLine);\n // If the number of fields is wrong, we have to adjust.\n if (this.fields.length != nFields) {\n // Copy the old array and create a new one of the proper length.\n String[] buffer = this.fields;\n this.fields = new String[nFields];\n // Transfer the strings one by one, padding if necessary.\n for (int i = 0; i < nFields; i++) {\n if (i < buffer.length) {\n this.fields[i] = buffer[i];\n } else {\n this.fields[i] = \"\";\n }\n }\n }\n }",
"public String[] split(String line, String delimit) {\r\n\t\tlog.debug(\"line = \" + line);\r\n\t\tString[] a = null;\r\n\t\tVector<String> lines = new Vector<String>();\r\n\t\tline = line.replaceAll(\"\\\\\\\\\" + delimit, \"\\\\e\");\r\n\t\ta = line.split(delimit);\r\n\t\tfor (int i = 0; i < a.length; i++) {\r\n\t\t\tString thisLine = a[i];\r\n\t\t\tlog.debug(\"thisLine[\" + i + \"] = \" + thisLine);\r\n\t\t\tif (quoteText && thisLine.startsWith(\"\\\"\")) {\r\n\t\t\t\twhile (!thisLine.endsWith(\"\\\"\") && i < a.length) {\r\n\t\t\t\t\tthisLine += \",\" + a[++i];\r\n\t\t\t\t}\r\n\t\t\t\tif (i == line.length()) {\r\n\t\t\t\t\tthrow new RuntimeException(\"unterminated string quote\");\r\n\t\t\t\t}\r\n\t\t\t\tthisLine = thisLine.substring(1, thisLine.length()-2);\r\n\t\t\t\tthisLine.replaceAll(\"\\\\e\", delimit);\r\n\t\t\t}\r\n\t\t\tlines.add(thisLine);\r\n\t\t}\r\n\t\ta = new String[1];\r\n\t\treturn lines.toArray(a);\r\n\t}",
"private Vector<String> separateLineup(){\n Vector<String> lineup = new Vector<String>();\n StringTokenizer st = new StringTokenizer(masterLineup, \",\");\n\n while(st.hasMoreTokens()){\n lineup.add(st.nextToken().toLowerCase());\n }\n\n return lineup;\n\t\t\n\t}",
"private String[] readLine( String line ) throws IOException {\n if ( StringUtils.isBlank( line ) ) {\n return null;\n }\n if ( line.startsWith( \"#\" ) ) {\n return null;\n }\n\n String[] fields = StringUtils.splitPreserveAllTokens( line, '\\t' );\n if ( fields.length < 2 ) {\n throw new IOException( \"Illegal format, expected at least 2 columns, got \" + fields.length );\n }\n return fields;\n\n }",
"List<CountryEntity> parseLines(List<String> line);",
"public static Vector<String> parseLine(String line, String separator)\n\t{\n\t\tVector<String> partes=new Vector<>();\n\t\tint index = 0,offset = 0;\n\t\tint indexComillas;\n\t\tboolean startingComillas = true;\n\t\tif(line==null)return partes;\n\t\tif(!line.endsWith(separator))line+=separator;\n\t\tif((indexComillas = line.indexOf('\\\"')) == -1)indexComillas = Integer.MAX_VALUE;\n\t\twhile((index=line.indexOf(separator,startingComillas ? offset : indexComillas))!=-1)\n\t\t{\n\t\t\tif(index > indexComillas)\n\t\t\t{\n\t\t\t\tif((indexComillas = line.indexOf('\\\"', index)) == -1)indexComillas = Integer.MAX_VALUE;\n\t\t\t\tif(startingComillas)\n\t\t\t\t{\n\t\t\t\t\tstartingComillas = false;\n\t\t\t\t\toffset++;\n\t\t\t\t\tif(indexComillas == Integer.MAX_VALUE)break;\n\t\t\t\t\telse continue;\n\t\t\t\t}\n\t\t\t\telse startingComillas = true;\n\t\t\t\tindex--;\n\t\t\t}\n\t\t\tpartes.addElement(line.substring(offset,index));\n\t\t\toffset=index;\n\t\t\twhile(line.startsWith(separator,++offset)&&offset<line.length()); // Elimino separadores seguidos\n\t\t}\n\t\tif(!startingComillas) // Si faltan las comillas de cierre, igual pongo esa parte\n\t\t\tpartes.addElement(line.substring(offset, line.length() - separator.length()));\n\t\treturn partes;\n\t}",
"static Map.Entry<String, String> splitLine(String line) {\n // TODO: Make this method less gross!\n int count = 0;\n int cur = 0;\n do {\n cur = line.indexOf(' ', cur+1); // Move cursor to next space character.\n count++;\n } while (0 <= cur && count < 4);\n\n String key, value;\n if (0 <= cur && cur < line.length()) {\n // Don't include the separating space in either `key` or `value`:\n key = line.substring(0, cur); //\n value = line.substring(cur+1, line.length());\n } else {\n key = line;\n value = \"\";\n }\n\n return new Map.Entry<String, String>() {\n @Override public String getKey() {\n return key;\n }\n @Override public String getValue() {\n return value;\n }\n @Override public String setValue(String value) {\n throw new UnsupportedOperationException();\n }\n };\n }",
"public String[] obtener_nombres_de_torres(String line) {\n\t\tString tipo_enunciado = this.obtener_tipo_instruccion(line);\n\t\tString nombres[];\n\t\tline = line.replaceAll(\"\\\\.|\\\\?|\\\\s\", \"\");\n\t\t\n \tif( tipo_enunciado.equals(\"EnunciadoCrearEnlace\")){\n \t\tint index_creacion= line.indexOf('>');\n \t\tif(index_creacion > 0 ){\n \t\t\tnombres = line.split(\"->\");\n \t\t} else {\n \t\t\tnombres = line.split(\"<-\");\n \t\t}\n \t} else if( tipo_enunciado.equals(\"EnunciadoRemoverEnlace\") ){\n \t\t\tnombres = line.split(\"-\");\n \t} else {\n \t\tint index_question = line.indexOf(\"=>\");\n \t\tif( index_question > 0 ) {\n \t\t\tnombres = line.split(\"=>\");\n \t\t} else {\n \t\t\tnombres = line.split(\"<=\");\n \t\t}\n \t}\n \treturn nombres;\n }",
"private static ArrayList<String> sanatizeDataInstr(String lineInput){\n\t\tString line = lineInput;\n\t\tline = line.trim();\n\t\t//System.out.println(\"Line starts out as:(\"+line+\")\");\n\t\tArrayList<String> toReturn = new ArrayList<String>();\n\t\t\n\t\twhile(line.length()>0){\n\t\t\tif(line.indexOf(\" \") != -1){\n\t\t\t\ttoReturn.add(line.trim().substring(0, line.indexOf(\" \")).trim().toLowerCase());\n\t\t\t\tline = line.substring(line.indexOf(\" \"), line.length()).trim();\n\t\t\t} else {\n\t\t\t\ttoReturn.add(line.trim().toLowerCase());\n\t\t\t\tline = \"\";\n\t\t\t}\n\t\t\t//System.out.println(\"Line now equals:(\" + line +\")\");\n\t\t}\n\t\t\n\t\treturn toReturn;\n\t}",
"T transform(String line);",
"public static void reformat(BufferedReader input) throws IOException {\n String line = input.readLine();\n\n while (line != null) {\n String[] parts = line.split(\";\", 2);\n for (String part : parts) {\n System.out.println(part);\n }\n line = input.readLine();\n }\n }",
"public List<ConvertedLine> convert(final String line) {\n if (line.length() > 400) {\n return null;\n }\n\n Matcher match = linePattern.matcher(line);\n\n if (match.matches()) {\n String file = null;\n int lineno = -1;\n\n if (fileGroup >= 0) {\n file = match.group(fileGroup);\n // Make some adjustments - easier to do here than in the regular expression\n // (See 109721 and 109724 for example)\n if (file.startsWith(\"\\\"\")) { // NOI18N\n file = file.substring(1);\n }\n if (file.startsWith(\"./\")) { // NOI18N\n file = file.substring(2);\n }\n if (filePattern != null && !filePattern.matcher(file).matches()) {\n return null;\n }\n }\n\n if (lineGroup >= 0) {\n String linenoStr = match.group(lineGroup);\n\n try {\n lineno = Integer.parseInt(linenoStr);\n } catch (NumberFormatException nfe) {\n LOGGER.log(Level.INFO, null, nfe);\n lineno = 0;\n }\n }\n\n return Collections.<ConvertedLine>singletonList(\n ConvertedLine.forText(line,\n new FileListener(file, lineno, locator, handler)));\n }\n\n return null;\n }",
"public String[] split(String lineWithoutCmd) {\n String[] fields = new String[2];\n // position of the first space\n int pos = lineWithoutCmd.indexOf(\" \");\n\n // The name of the hashTable\n String tableName = lineWithoutCmd.substring(0, pos);\n // The name of the movie or reviewer\n String name = lineWithoutCmd.substring(pos, lineWithoutCmd.length());\n\n fields[0] = tableName.trim();\n\n fields[1] = name.trim();\n\n return fields;\n }",
"public String fixline(String line, float by);",
"protected abstract void parse(String line);",
"private String splitAndGetField(String line, String key) {\r\n\t\tString[] tmps = line.substring(line.indexOf(key) + key.length()).split(\r\n\t\t\t\t\" \");\r\n\t\treturn (tmps[0]);\r\n\t}",
"private static double[] extractRainfallInformation(String[] line){\n int index = line.length - 2;\n double[] out = new double[ index ]; // Without the first two elements(City & Country)\n\n for(int i = 0; i < index ;i++){\n out[i] = Double.parseDouble(line[i + 2]);// \"3.55\" => 3.55\n }\n\n return out;\n }",
"private List<String> normalizeCsv(String text) {\n logger.info (\"Text = \" + text);\n List<String> rr = new ArrayList<> ();\n\n StringBuilder line = new StringBuilder ();\n for (int i = 0; i < text.length (); i++) {\n\n String curr = \"\" + text.charAt (i);\n line.append (curr);\n try {\n\n if (text.charAt (i - 1) == ',' && (curr + \" \").equals (\"1 \") && (text.charAt (i + 1) == ' ' || Character.isAlphabetic (text.charAt (i + 1)))) {\n rr.add (line.toString ());\n line = new StringBuilder ();\n } else if (text.charAt (i - 1) == ',' && (curr + \" \").equals (\"2 \") && (text.charAt (i + 1) == ' ' || Character.isAlphabetic (text.charAt (i + 1)))) {\n rr.add (line.toString ());\n line = new StringBuilder ();\n } else if (text.charAt (i - 1) == ',' && (curr + \" \").equals (\"3 \") && (text.charAt (i + 1) == ' ' || Character.isAlphabetic (text.charAt (i + 1)))) {\n rr.add (line.toString ());\n line = new StringBuilder ();\n } else if (text.charAt (i - 1) == ',' && (curr + \" \").equals (\"4 \") && (text.charAt (i + 1) == ' ' || Character.isAlphabetic (text.charAt (i + 1)))) {\n rr.add (line.toString ());\n line = new StringBuilder ();\n } else if (text.charAt (i - 1) == ',' && (curr + \" \").equals (\"5 \") && (text.charAt (i + 1) == ' ' || Character.isAlphabetic (text.charAt (i + 1)))) {\n rr.add (line.toString ());\n line = new StringBuilder ();\n } else if (text.charAt (i - 1) == ',' && (curr + \" \").equals (\"6 \") && (text.charAt (i + 1) == ' ' || Character.isAlphabetic (text.charAt (i + 1)))) {\n rr.add (line.toString ());\n line = new StringBuilder ();\n } else if (text.charAt (i - 1) == ',' && (curr + \" \").equals (\"7 \") && (text.charAt (i + 1) == ' ' || Character.isAlphabetic (text.charAt (i + 1)))) {\n rr.add (line.toString ());\n line = new StringBuilder ();\n }\n\n } catch (Exception ex) {\n //System.out.println(ex.getMessage());\n }\n\n }\n return rr;\n }",
"@Override\n\tpublic ArrayList<BigDecimal> input(String line) {\n\t\tArrayList<BigDecimal> list = new ArrayList<BigDecimal>();\n\t\tfor (String s : line.split(\"\\\\s+\")) {\n\t\t\tBigDecimal num = new BigDecimal(Double.parseDouble(s));\n\t\t\tlist.add(num);\n\t\t}\n\n\t\treturn list;\n\t}",
"List<ThingPackage> parseLines(List<String> line);",
"@Override\r\n\tprotected String processLine(String line) {\n\t\treturn null;\r\n\t}",
"public void getOutData(String line) {\n\t\tMatcher myMatcher = myPattern.matcher(line);\n\t\tmyMatcher.find();\n\t\tmyMatcher.matches();\n\t\tmyMatcher.matches();\n\t\t// *--- GROUP 3(X) 4(Y) 5(Z) --*//\n\t\tif (myMatcher.group(3) != null)\n\t\t\txAxis = Double.parseDouble(myMatcher.group(3));\n\t\telse {\n\t\t\txAxis = Double.NaN;\n\t\t}\n\t\tif (myMatcher.group(4) != null)\n\t\t\tyAxis = Double.parseDouble(myMatcher.group(4));\n\t\telse {\n\t\t\tyAxis = Double.NaN;\n\t\t}\n\t\tif (myMatcher.group(5) != null)\n\t\t\tzAxis = Double.parseDouble(myMatcher.group(5));\n\t\telse {\n\t\t\tzAxis = Double.NaN;\n\t\t}\n\t}",
"private void processCalculation(String line) {\n\t\t//TODO: fill\n\t}",
"protected void processLine(String aLine){\n\t\t \t\t String temp=aLine.substring(0, 7);\n\t\t \t\t temp=temp.replaceAll(\"[^\\\\d.]\", \"\");\n\t\t \t\t int ID=Integer.parseInt(temp);\n\t \t\t String name=aLine.substring(7, 12);\n\t \t\t //int forget=;//epoch\n\t \t\t temp=aLine.substring(31, 42);\n\t \t\t temp=temp.replaceAll(\"[^\\\\d.]\", \"\");\n\t \t\t double a=Double.parseDouble(temp);//TODO determine what the scale of simulation should be\n\t \t\t temp=aLine.substring(42, 53);\n\t \t\t temp=temp.replaceAll(\"[^\\\\d.]\", \"\");\n\t \t\t double e=Double.parseDouble(temp);\n\t \t\t \n\t \t\t asteriod newBody=new asteriod(a,e);//TODO find asteriodal angular shit\n\t \t\t \n\t \t\t double temp2;\n\t \t\t //54 to 63 for inclination\n\t \t\t temp=aLine.substring(54,63);\n\t \t\t temp=temp.replaceAll(\"[^\\\\d.]\", \"\");\n\t \t\t temp2=Double.parseDouble(temp);\n\t \t\t newBody.Inclination=Math.toRadians(temp2);\n\t \t\t //64 for argument of periapsis\n\t \t\t temp=aLine.substring(63, 74);\n\t \t\t temp=temp.replaceAll(\"[^\\\\d.]\", \"\");\n\t \t\t temp2=Double.parseDouble(temp);\n\t \t\t newBody.ArgPeriapsis=Math.toRadians(temp2);\n\t \t\t //Longitude of ascending node\n\t \t\t temp=aLine.substring(73, 84);\n\t \t\t temp=temp.replaceAll(\"[^\\\\d.]\", \"\");\n\t \t\t temp2=Double.parseDouble(temp);\n\t \t\t newBody.LongAscenNode=Math.toRadians(temp2);\n\t \t\t //Mean Anommally/PHI\n\t \t\t temp=aLine.substring(83,96);\n\t \t\t temp=temp.replaceAll(\"[^\\\\d.]\", \"\");\n\t \t\t temp2=Double.parseDouble(temp);\n\t \t\t temp2=Math.toRadians(temp2);\n\t \t\t newBody.meanAnomaly0=temp2;\n\t \t\t \n\t \t\t temp=aLine.substring(95,100);\n\t \t\t temp=temp.replaceAll(\"[^\\\\d.]\", \"\");\n\t \t\t temp2=Double.parseDouble(temp);\n\t \t\t newBody.H=temp2;\n\t \t\t \n\t \t\t newBody.ID=ID;\n\t \t\t newBody.name=name;\n\t \t\t newBody.setType();\n\t \t\t runnerMain.bodies.add(newBody);\n\t \t\t System.out.println(\"e:\"+newBody.eccentricity+\" ID:\"+ID+\" name: \"+name+\" LongAsnNd: \"+newBody.LongAscenNode+\" Peri: \"+newBody.ArgPeriapsis+\" MeanAn0: \"+newBody.meanAnomaly0);\n\t\t }",
"private void resolveInlined(ArrayList<String> order_content) {\n for (int i = 0; i < order_content.size(); i++) {\n String line = order_content.get(i);\n if (ColesReceiptItem.Contain_Price(line)) {\n if (!ColesReceiptItem.Is_Per_Unit_Price_Line(line) && (!ColesReceiptItem.Is_Price(line))) {\n String[] items = line.split(\" \");\n order_content.remove(i);\n for (int j = 0; j < items.length; j++)\n order_content.add(i + j, items[j]);\n }\n }\n }\n }",
"private final List<PLineSegment> getLineSegmentsForSplitLine(SplitLine splitLine) {\n int lineIndex = splitLine.getLineIndex();\n List<PLineSegment> segments = getLineSegments(lineIndex);\n int index = 0;\n ArrayList<PLineSegment> result = new ArrayList<PLineSegment>();\n int start = splitLine.getOffset();\n int end = start + splitLine.getLength();\n \n for (int i = 0; index < end && i < segments.size(); ++i) {\n PLineSegment segment = segments.get(i);\n if (start >= index + segment.getModelTextLength()) {\n index += segment.getModelTextLength();\n continue;\n }\n if (start > index) {\n int skip = start - index;\n segment = segment.subSegment(skip);\n index += skip;\n }\n if (end < index + segment.getModelTextLength()) {\n segment = segment.subSegment(0, end - index);\n }\n result.add(segment);\n index += segment.getModelTextLength();\n }\n return result;\n }",
"@Override\n\tprotected String processLine(String line) {\n\t\treturn null;\n\t}",
"private void makeLines(LayoutContext lc) {\n //String s = new String(text);\n boolean isLastLine = false;\n int tries = 0;\n int curWidth, wordWidth, lineStart, wordEnd, wordStart, newWidth, textLen, beg, maxM2, spaceW;\n curWidth = lineStart = wordEnd = beg = 0;\n char[] text = this.text;\n textLen = text.length;\n maxM2 = textLen - 2;\n spaceW = fm.charWidth(' ');\n boolean glue = false;\n\n do {\n beg = wordEnd;\n\n // find next word\n for (wordStart = beg;; wordStart++) {\n if (wordStart >= textLen) // trailing blanks?\n {\n if (tries > 0) // guich@tc114_81\n {\n lc.disjoin();\n addLine(lineStart, wordEnd, false, lc, false);\n tries = 0;\n }\n wordEnd = wordStart;\n isLastLine = true;\n break;\n }\n if (text[wordStart] != ' ') // is this the first non-space char?\n {\n wordEnd = wordStart;\n do {\n if (++wordEnd >= textLen) {\n isLastLine = true;\n break;\n }\n } while (text[wordEnd] != ' ' && text[wordEnd] != '/'); // loop until the next space/slash char\n // use slashes as word delimiters (useful for URL addresses).\n if (maxM2 > wordEnd && text[wordEnd] == '/' && text[wordEnd + 1] != '/') {\n wordEnd++;\n }\n break;\n }\n }\n if (!lc.atStart() && wordStart > 0 && text[wordStart - 1] == ' ') {\n wordStart--;\n }\n wordWidth = fm.stringWidth(text, wordStart, wordEnd - wordStart);\n if (curWidth == 0) {\n lineStart = beg = wordStart; // no spaces at start of a line\n newWidth = wordWidth;\n } else {\n newWidth = curWidth + wordWidth;\n }\n\n if (lc.x + newWidth <= lc.maxWidth) {\n curWidth = newWidth + spaceW;\n } else // split: line length now exceeds the maximum allowed\n {\n //if (text[wordStart] == ' ') {wordStart++; wordWidth -= spaceW;}\n if (curWidth > 0) {\n // At here, wordStart and wordEnd refer to the word that overflows. So, we have to stop at the previous word\n wordEnd = wordStart;\n if (text[wordEnd - 1] == ' ') {\n wordEnd--;\n }\n if (DEBUG) {\n Vm.debug(\"1. \\\"\" + new String(text, lineStart, wordEnd - lineStart) + \"\\\": \" + curWidth + \" \" + isLastLine);\n }\n addLine(lineStart, wordEnd, true, lc, glue);\n curWidth = 0;\n isLastLine = false; // must recompute the last line, since there's at least a word left.\n } else if (!lc.atStart()) // case of \"this is a text at the end <b>oftheline</b>\" -> oftheline will overflow the screen\n {\n if (++tries == 2) {\n break;\n }\n if (DEBUG) {\n Vm.debug(\"2 \" + isLastLine);\n }\n // Nothing was gathered in, but the current line has characters left by a previous TextSpan. This occurs only once.\n addLine(0, 0, false, lc, glue);\n curWidth = 0;\n isLastLine = false; // must recompute the last line, since there's at least a word left.\n } else {\n // Rare case where we both have nothing gathered in, and the physical line is empty. Had this not been made, then we\n // woud have generated an extra-line at the top of the block.\n if (DEBUG) {\n Vm.debug(\"3. \\\"\" + new String(text, lineStart, wordEnd - lineStart) + '\"');\n }\n if (lineStart != wordEnd) {\n addLine(lineStart, wordEnd, true, lc, glue);\n }\n }\n glue = true;\n }\n } while (!isLastLine);\n\n if (wordEnd != lineStart) {\n //curWidth = fm.stringWidth(text, lineStart, wordEnd-lineStart);\n boolean split = lc.x + curWidth > lc.maxWidth && style.hasInitialValues() && style.isDisjoint;\n if (DEBUG) {\n Vm.debug(\"4. \\\"\" + new String(text, lineStart, wordEnd - lineStart) + \"\\\" \" + split);\n }\n addLine(lineStart, wordEnd, split, lc, glue);\n }\n }",
"public String[] parse() {\n String line = input.nextLine();\n line = line.trim();\n if (StringUtils.isNotEmpty(line)) {\n return StringUtils.split(line, \" \");\n }\n return null;\n }",
"private void populateListFromLine(String line, List<String> wordList) {\n\t\tif (line != null && line.length() > 0) {\n\t\t\tString[] words = line.split(\"\\\\s|\\\\?|\\\\.|\\\\!|\\\\:|\\\\;|\\\\-\");\n\t\t\tfor (String word : words) {\n\t\t\t\twordList.add(word);\n\t\t\t}\n\t\t}\n\t}",
"private List<String> ListTransform(Object value) {\n\n if (value.toString().contains(lineDelimiter))\n return Arrays.asList(value.toString().split(lineDelimiter));\n\n List<String> lines = new ArrayList<>();\n if (!value.toString().equals(\"\"))\n lines.add(value.toString());\n\n return lines;\n }",
"private static String[] parseCSVLine(String line, boolean convertToLowerCase ) {\r\n\t\t\r\n\t\t//split the line om commas, but only if that comma is not between quotes (0 or even nr of quotes ahead)\r\n\t\tString[] tokens = line.split(\",(?=([^\\\"]*\\\"[^\\\"]*\\\")*[^\\\"]*$)\");\r\n\t\t\r\n\t\tString[] result = new String[tokens.length];\r\n\t\t\r\n\t\t//get rid of spaces and enclosing double quotes\r\n\t\tfor (int i=0; i<tokens.length; i++) {\r\n\t\t\t\r\n\t\t\tString t = tokens[i].trim().replaceAll(\"^\\\"|\\\"$\", \"\");\r\n\t\t\t\r\n\t\t\tif (convertToLowerCase) {\r\n\t\t\t\tt = t.toLowerCase();\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t\tresult[i] = t;\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\treturn result;\r\n\t}",
"private static List<Double> parse_line_double(String line, int d) throws Exception {\n\t List<Double> ans = new ArrayList<Double>();\n\t StringTokenizer st = new StringTokenizer(line, \" \");\n\t if (st.countTokens() != d) {\n\t throw new Exception(\"Bad line: [\" + line + \"]\");\n\t }\n\t while (st.hasMoreElements()) {\n\t String s = st.nextToken();\n\t try {\n\t ans.add(Double.parseDouble(s));\n\t } catch (Exception ex) {\n\t throw new Exception(\"Bad Integer in \" + \"[\" + line + \"]. \" + ex.getMessage());\n\t }\n\t }\n\t return ans;\n\t }",
"public Iterable<String> call(String line) throws Exception {\n\t\t\t\treturn Arrays.asList(line.split(\",\"));\n\t\t\t}",
"private boolean LineHandler(String line, Out out) \n throws SQLException, IOException\n {\n if(line == null) \n {\n return false;\n }\n // Get Norm result by going through flow:t:g:o:l:B:w\n // get the term from appropriate field\n String inTerm = In.GetField(line, separator_, termFieldNum_);\n LexItem in = new LexItem(inTerm);\n Vector<LexItem> result = ToNormalize.Mutate(in, maxTerm_, stopWords_, \n conn_, trie_, symbolMap_, unicodeMap_, ligatureMap_, diacriticMap_, \n nonStripMap_, removeSTree_, detailsFlag_, false);\n \n // print results\n // check no output flag\n if((noOutputFlag_ == true) // no output flag\n && ((result.size() == 0) // no output LexItem\n || ((result.size() == 1) // one output lexItem with empty string\n && (result.elementAt(0).GetTargetTerm().length() == 0))))\n {\n String outStr = line;\n if(filterInputFlag_ == true)\n {\n outStr = in.GetOriginalTerm();\n }\n out.Println(outWriter_, (outStr + separator_ + noOutputStr_), \n fileOutput_, false);\n }\n else\n {\n for(int i = 0; i < result.size(); i++)\n {\n LexItem temp = result.elementAt(i);\n String outStr = line;\n if(filterInputFlag_ == true)\n {\n outStr = temp.GetOriginalTerm();\n }\n out.Println(outWriter_, (outStr + separator_ \n + temp.GetTargetTerm()), fileOutput_, false);\n // print details\n if(detailsFlag_ == true)\n {\n out.Println(outWriter_, temp.GetDetailInformation(), \n fileOutput_, false);\n }\n }\n }\n return true;\n }",
"private static List<String> parseLine(String csvLine) {\n List<String> result = new ArrayList<>();\n if (Objects.isNull(csvLine) || csvLine.isEmpty()) {\n return result;\n }\n StringBuilder charSet = new StringBuilder();\n char[] chars = csvLine.toCharArray();\n for (char character : chars) {\n if (character == DEFAULT_SEPARATOR) {\n result.add(charSet.toString().trim());\n charSet = new StringBuilder();\n } else {\n charSet.append(character);\n }\n }\n result.add(charSet.toString().trim());\n return result;\n }",
"private void splitLevelDetails() {\n final int zero = 0;\n final int one = 1;\n // goes over all of the levels\n for (int i = 0; i < level.size(); i++) {\n // if the level.get(i) contains \":\"\n if (level.get(i).contains(\":\")) {\n // split the line\n String[] keyAndVal = level.get(i).trim().split(\":\");\n // put the key and the value in the map\n this.map.put(keyAndVal[zero], keyAndVal[one].trim());\n } else {\n break;\n }\n }\n }",
"private static String[] rms(BufferedReader br) throws IOException {\n return br.readLine().split(SPLIT_CHAR);\n }",
"public void split(String line) {\r\n \r\n String temp[]=line.split(\";\");\r\n String dayno=temp[0];\r\n String itemval=temp[3];\r\n String dayvalues[]=dayno.split(\":\");\r\n String itemvalues[]=itemval.split(\":\");\r\n int dayno1=Integer.parseInt(dayvalues[1]);\r\n \r\n String itemno = itemvalues[1];\r\n \r\n \r\n tcount++;\r\n if(dayno1>dcount)\r\n {\r\n dcount++; \r\n }\r\n \r\n if(itemno.equals(\"Gun\"))\r\n icount++;\r\n else if(itemno.equals(\"NailCutter\"))\r\n icount++;\r\n else if(itemno.equals(\"Blade\"))\r\n icount++;\r\n else if(itemno.equals(\"Knife\"))\r\n icount++;\r\n \r\n \r\n apstate.settravellers(tcount);\r\n apstate.setprohibiteditems(icount);\r\n apstate.setdays(dcount);\r\n \r\n \r\n }",
"public static String[] splitString(String str) {\r\n String line = str.trim();\r\n String info = \"\";\r\n String areas = \"\";\r\n for (int i = 0; i < line.length(); i ++) {\r\n if (i <= 6)\r\n info += line.charAt(i);\r\n else\r\n areas += line.charAt(i);\r\n }\r\n info = info.trim();\r\n areas = areas.trim();\r\n String[] splitString = new String[]{info, areas};\r\n return splitString;\r\n }",
"private void processFirstLine(String line) {\r\n\t\tString[] numsAsStr = line.split(\" \");\r\n\t\tnumRows = Integer.parseInt(numsAsStr[0]);\r\n\t\tnumCols = Integer.parseInt(numsAsStr[1]);\r\n\t\t/**\r\n\t\t * Taken out for time testing\r\n\t\t */\r\n//\t\tSystem.out.println(\"Rows: \" + numRows + \" Cols: \" + numCols);\r\n\t}",
"private String parseGroupNameD2K(String line) {\n\t\tStringBuilder sb = new StringBuilder(\"\");\n\t\tString[] tokens = line.split(\"\\\\s+\");\n\t\tsb.append(tokens[0] + \".\");\n\t\tsb.append(tokens[1].replace(';', '_'));\n\t\ttry{\n\t\t\tsb.append(tokens[4].replace('#', '.'));\n\t\t} catch (ArrayIndexOutOfBoundsException e){\n\t\t\t// do nothing\n\t\t}\n\t\treturn sb.toString();\n\t}",
"public String[] processData(String raw_data, int type){\n String[] values;\n Pattern pattern = null;\n raw_data = raw_data.trim();\n // Use \"|\" to separate data\n if (type == 1){\n pattern = Pattern.compile(\"\\\\|\");\n }else if (type == 0){\n // Use whitespace to separate data\n pattern = Pattern.compile(\"\\\\s+\");\n }else {\n System.out.println(\"Please use correct type\");\n System.exit(1);\n }\n values = pattern.split(raw_data);\n // Delete whitespace\n if (values != null) {\n for (int i = 0 ; i < values.length ; i++){\n values[i] = values[i].trim();\n if (values[i].equals(\"\")){\n System.out.println(\"File is missing data\");\n System.exit(1);\n }\n }\n }\n return values;\n }",
"private void getEachElementOfTheLine() {\n int nbOfComa = 0;\n String idItemCraft = \"\";\n ArrayList<String> idItemNeeded = new ArrayList<>();\n ArrayList<String> quantityItemNeeded = new ArrayList<>();\n boolean isFinished = false;\n for (int c = 0; c < line.length() && !isFinished; c++) {\n switch (nbOfComa) {\n\n case 2:\n quantityItemNeeded.add(new String(\"\" + line.charAt(c)));\n if (line.charAt(c + 1) == '.') {\n isFinished = true;\n } else if (line.charAt(c + 1) == ';') {\n nbOfComa = 1;\n c++;\n }\n break;\n\n case 1:\n idItemNeeded.add(new String(\"\" + line.charAt(c)));\n if (line.charAt(c + 1) == ',') {\n nbOfComa++;\n c++;\n }\n break;\n\n case 0:\n idItemCraft = idItemCraft + line.charAt(c);\n if (line.charAt(c + 1) == ';') {\n nbOfComa++;\n c++;\n }\n break;\n\n default:\n break;\n }\n }\n this.idItemCraft = idItemCraft;\n this.idItemNeeded = idItemNeeded;\n this.quantityItemNeeded = quantityItemNeeded;\n }",
"public abstract void split(Space s);",
"String[] getLegalLineDelimiters();",
"public UBA<Line> _toLineSegments()\n {\n UBA<Line> output = new UBA<Line>();\n\n int len = _points.size();\n for(int i = 0; i < len - 1; i++)\n {\n Line line = new Line(i, i + 1, _points);\n output.push(line);\n }\n\n // Add the last point.\n if(_isClosed)\n {\n Line line = new Line(len - 1, 0, _points);\n output.push(line);\n }\n\n return output;\n }",
"public String[] parseLine() throws IOException, FHIRException {\n\t\tList<String> res = new ArrayList<String>();\n\t\tStringBuilder b = new StringBuilder();\n\t\tboolean inQuote = false;\n\n\t\twhile (more() && !finished(inQuote, res.size())) {\n\t\t\tchar c = peek();\n\t\t\tnext();\n\t\t\tif (c == '\"' && doingQuotes) {\n\t\t\t\tif (ready() && peek() == '\"') {\n\t b.append(c);\n next();\n\t\t\t\t} else {\n\t\t\t inQuote = !inQuote;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (!inQuote && c == delimiter ) {\n\t\t\t\tres.add(b.toString().trim());\n\t\t\t\tb = new StringBuilder();\n\t\t\t}\n\t\t\telse \n\t\t\t\tb.append(c);\n\t\t}\n\t\tres.add(b.toString().trim());\n\t\twhile (ready() && (peek() == '\\r' || peek() == '\\n')) {\n\t\t\tnext();\n\t\t}\n\t\t\n\t\tString[] r = new String[] {};\n\t\tr = res.toArray(r);\n\t\treturn r;\n\t}",
"public String bndProcess(String line) {\n\t\treturn bnd.process(line);\n\t}",
"public void stdOutputLine(String line) { \n debug(\"output:\"+line);\n if (line.equals(FINAL_SPLIT)) {\n if (addingDescription) {\n addingDescription = false;\n logInfo.setDescription(tempBuffer.toString());\n }\n if (addingLogMessage) {\n addingLogMessage = false;\n revision.setMessage(findUniqueString(tempBuffer.toString(), messageList));\n }\n if (revision != null) {\n logInfo.addRevision(revision);\n revision = null;\n }\n \n if (logInfo != null) { \n resultList.add(logInfo);\n // logInfo = null;\n tempBuffer = null;\n }\n return;\n }\n if (addingLogMessage) {\n // first check for the branches tag\n if (line.startsWith(BRANCHES)) {\n processBranches(line.substring(BRANCHES.length()));\n }\n else {\n processLogMessage(line);\n return;\n }\n }\n if (addingSymNames) { \n processSymbolicNames(line);\n }\n if (addingDescription) {\n processDescription(line);\n }\n // revision stuff first -> will be the most common to parse\n if (line.startsWith(REVISION)) {\n processRevisionStart(line);\n }\n if (line.startsWith(DATE)) {\n processRevisionDate(line);\n }\n\n if (line.startsWith(KEYWORD_SUBST)) {\n logInfo.setKeywordSubstitution(line.substring(KEYWORD_SUBST.length()).trim().intern());\n addingSymNames = false;\n return;\n }\n\n if (line.startsWith(DESCRIPTION)) {\n tempBuffer = new StringBuffer(line.substring(DESCRIPTION.length()));\n addingDescription = true;\n }\n\n if (line.indexOf(LOGGING_DIR) >= 0) {\n fileDirectory = line.substring(line.indexOf(LOGGING_DIR) + LOGGING_DIR.length()).trim();\n debug(\"fileDirectory: \"+fileDirectory);\n return;\n }\n if (line.startsWith(RCS_FILE)) {\n processRcsFile(line.substring(RCS_FILE.length()));\n return;\n }\n if (line.startsWith(WORK_FILE)) {\n processWorkingFile(line.substring(WORK_FILE.length()));\n return;\n }\n if (line.startsWith(REV_HEAD)) {\n logInfo.setHeadRevision(line.substring(REV_HEAD.length()).trim().intern());\n return;\n }\n if (line.startsWith(BRANCH)) {\n logInfo.setBranch(line.substring(BRANCH.length()).trim().intern());\n }\n if (line.startsWith(LOCKS)) {\n logInfo.setLocks(line.substring(LOCKS.length()).trim().intern());\n }\n if (line.startsWith(ACCESS_LIST)) {\n logInfo.setAccessList(line.substring(ACCESS_LIST.length()).trim().intern());\n }\n if (line.startsWith(SYM_NAME)) {\n addingSymNames = true;\n }\n if (line.startsWith(TOTAL_REV)) {\n int ind = line.indexOf(';');\n if (ind < 0) {\n // no selected revisions here..\n logInfo.setTotalRevisions(line.substring(TOTAL_REV.length()).trim().intern());\n logInfo.setSelectedRevisions(\"0\"); //NOI18N\n }\n else {\n String total = line.substring(0, ind);\n String select = line.substring(ind, line.length());\n logInfo.setTotalRevisions(total.substring(TOTAL_REV.length()).trim().intern());\n logInfo.setSelectedRevisions(select.substring(SEL_REV.length()).trim().intern());\n }\n }\n }",
"private static CharSequence[] splitOnSpaceRuns(CharSequence read) {\n int lastStart = 0;\n ArrayList<CharSequence> segs = new ArrayList<CharSequence>(5);\n int i;\n for(i=0;i<read.length();i++) {\n if (read.charAt(i)==' ') {\n segs.add(read.subSequence(lastStart,i));\n i++;\n while(i < read.length() && read.charAt(i)==' ') {\n // skip any space runs\n i++;\n }\n lastStart = i;\n }\n }\n if(lastStart<read.length()) {\n segs.add(read.subSequence(lastStart,i));\n }\n return (CharSequence[]) segs.toArray(new CharSequence[segs.size()]); \n }",
"public static String[] parseBlankSeparatedList(String line) {\n \tArrayList myList = new ArrayList();\n \t\n \tString myLine = new String(line);\n \t\n \twhile(myLine.contains(\" \")) {\n \t\tString item = myLine.substring(0, myLine.indexOf(\" \"));\n \t\tmyList.add(item);\n \t\tmyLine = myLine.substring((myLine.indexOf(\" \") + 1));\n \t\tmyLine = StringUtilities.removeEdgeWhitespace(myLine);\n \t}\n \tmyLine = StringUtilities.removeEdgeWhitespace(myLine);\n \tmyList.add(myLine);\n\n \tString[] list = new String[myList.size()];\n \tfor(int i = 0; i < myList.size(); i++) {\n \t\tlist[i] = new String((String)myList.get(i));\n \t}\n \t\n \treturn list;\n }",
"private String[] parseLine(final String nextLine, final boolean readLine)\n throws IOException {\n String line = nextLine;\n if (line.length() == 0) {\n return new String[0];\n } else {\n\n final List<String> fields = new ArrayList<String>();\n StringBuilder sb = new StringBuilder();\n boolean inQuotes = false;\n boolean hadQuotes = false;\n do {\n if (inQuotes && readLine) {\n sb.append(\"\\n\");\n line = getNextLine();\n if (line == null) {\n break;\n }\n }\n for (int i = 0; i < line.length(); i++) {\n final char c = line.charAt(i);\n if (c == CsvConstants.QUOTE_CHARACTER) {\n hadQuotes = true;\n if (inQuotes && line.length() > i + 1\n && line.charAt(i + 1) == CsvConstants.QUOTE_CHARACTER) {\n sb.append(line.charAt(i + 1));\n i++;\n } else {\n inQuotes = !inQuotes;\n if (i > 2 && line.charAt(i - 1) != this.fieldSeparator\n && line.length() > i + 1\n && line.charAt(i + 1) != this.fieldSeparator) {\n sb.append(c);\n }\n }\n } else if (c == this.fieldSeparator && !inQuotes) {\n hadQuotes = false;\n if (hadQuotes || sb.length() > 0) {\n fields.add(sb.toString());\n } else {\n fields.add(null);\n }\n sb = new StringBuilder();\n } else {\n sb.append(c);\n }\n }\n } while (inQuotes);\n if (sb.length() > 0 || fields.size() > 0) {\n if (hadQuotes || sb.length() > 0) {\n fields.add(sb.toString());\n } else {\n fields.add(null);\n }\n }\n return fields.toArray(new String[0]);\n }\n }",
"private java.util.ArrayList<String> textSplit(String splitted) {\n java.util.ArrayList<String> returned = new java.util.ArrayList<String>();\n String relatedSeparator = this.getLineSeparator(splitted);\n String[] pieces = splitted.split(relatedSeparator + relatedSeparator);\n String rstr = \"\";\n for (int cpiece = 0; cpiece < pieces.length; cpiece++) {\n String cstr = pieces[cpiece];\n if (rstr.length() + cstr.length() > maxLength) {\n if (!rstr.isEmpty()) {\n returned.add(rstr);\n rstr = cstr;\n }\n else {\n returned.add(cstr);\n }\n }\n else {\n if (rstr.equals(\"\")) {\n rstr = cstr;\n }\n else {\n rstr = rstr + lineSeparator + lineSeparator + cstr;\n }\n }\n if (cpiece == pieces.length - 1) {\n returned.add(rstr);\n }\n }\n return returned;\n }",
"public static String process(String line) {\r\n LinkedList<Character> list = new LinkedList<>();\r\n String lineR = \"\";\r\n boolean start = false;\r\n int contAux = 0;\r\n\r\n for (int i = 0; i < line.length() - 1; i++) {\r\n do {\r\n if (line.charAt(i) == '[') {\r\n start = true;\r\n i++;\r\n contAux = 0;\r\n }\r\n if (line.charAt(i) == ']') {\r\n start = false;\r\n contAux = 0;\r\n i++;\r\n }\r\n } while (line.charAt(i) == '[' || line.charAt(i) == ']');\r\n\r\n if (start) {\r\n list.add(contAux, line.charAt(i));\r\n contAux++;\r\n } else {\r\n list.add(line.charAt(i));\r\n }\r\n }\r\n\r\n for (int i = 0; i < list.size(); i++) {\r\n lineR += list.get(i);\r\n }\r\n return lineR;\r\n }",
"private static List<StudentRecord> convert(List<String> lines) {\n\t\tObjects.requireNonNull(lines);\n\t\t\n\t\tArrayList<StudentRecord> result = new ArrayList<>(lines.size());\n\t\t\n\t\tfor(String data : lines) {\n\t\t\tif(data.length() == 0) continue; //preskoci prazne linije\n\t\t\tScanner sc = new Scanner(data);\n\t\t\tsc.useDelimiter(\"\\t\");\n\t\t\t\n\t\t\ttry {\n\t\t\t\tresult.add(new StudentRecord(sc.next(), sc.next(), sc.next(), sc.next(), sc.next(), sc.next(), sc.next()));\n\t\t\t}catch(NoSuchElementException e) {\n\t\t\t\tsc.close();\n\t\t\t\tthrow new NoSuchElementException(\"Data not formatted correctly.\");\n\t\t\t}\n\t\t\tsc.close();\n\t\t}\n\t\t\n\t\treturn result;\n\t}",
"private String eliminar_contenido_innecesario(String line) {\n \n \tint index_question = line.indexOf('?');\n\t\tint index_point = line.indexOf('.');\n\t\t\n\t\tline = ( index_question > 0 ) ? line.substring(0, index_question+1) : line;\n\t\tline = ( index_point > 0 ) ? line.substring(0, index_point+1) : line;\n\t\t\n \treturn line;\n }",
"private static List<Integer> parse_line(String line, int d) throws Exception {\n\t List<Integer> ans = new ArrayList<Integer>();\n\t StringTokenizer st = new StringTokenizer(line, \" \");\n\t if (st.countTokens() != d) {\n\t throw new Exception(\"Bad line: [\" + line + \"]\");\n\t }\n\t while (st.hasMoreElements()) {\n\t String s = st.nextToken();\n\t try {\n\t ans.add(Integer.parseInt(s));\n\t } catch (Exception ex) {\n\t throw new Exception(\"Bad Integer in \" + \"[\" + line + \"]. \" + ex.getMessage());\n\t }\n\t }\n\t return ans;\n\t }",
"private static List<Pair<String, Integer>> splitWords(String line) {\n // This is kinda silly: we read and parse the stop words file once for each chunk, but this is the way the book\n // does it, so better stay in line with that.\n Set<String> stopWords = Arrays.stream(readFile(\"../stop_words.txt\").split(\",\")).\n collect(Collectors.toCollection(HashSet::new));\n return Arrays.stream(line.replaceAll(\"[^a-zA-Z\\\\d\\\\s]\", \" \").toLowerCase().split(\" \")).\n filter(w -> w.length() >= 2 && !stopWords.contains(w)).\n map(w -> new Pair<>(w, 1)).\n collect(Collectors.toList());\n }",
"private String[] readLine(BufferedReader r) throws IOException\r\n\t{\r\n\t\tSystem.out.print(\"> \");\r\n\t\tfinal String line = r.readLine();\r\n\t\treturn line != null ? split(line) : null;\r\n\t}",
"List<Vehicle> getLineVehicles(String line);",
"public static String[] splitLine(String line) {\n\t\t\n\t\tStringBuffer buffer = new StringBuffer();\n\t\tArrayList<String> stockStrs = new ArrayList<String>();\n\t\t\n\t\tchar[] chars = line.toCharArray();\n\t\tboolean inQuotes = false;\n\t\tfor (char ch: chars) {\n\t\t\tif (inQuotes) {\n\t\t\t\tif (ch == '\"') {\n\t\t\t\t\tinQuotes = false;\n\t\t\t\t} else {\n\t\t\t\t\tbuffer.append(ch);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (ch == '\"') {\n\t\t\t\t\tinQuotes = true;\n\t\t\t\t} else if (ch == ',') {\n\t\t\t\t\tstockStrs.add(buffer.toString());\n\t\t\t\t\tbuffer.delete(0, buffer.length());\n\t\t\t\t} else {\n\t\t\t\t\tbuffer.append(ch);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tstockStrs.add(buffer.toString());\n\t\n\t\tString[] stockStrsArray = stockStrs.toArray(new String[stockStrs.size()]);\n\t\treturn stockStrsArray;\n\t}",
"private void parseUnitLengthDegreeScaler(String line) throws IllegalArgumentException {\n\t\tString[] tokens = line.split(\"\\\\s+\");\n\t\tif(tokens.length == 2) {\n\t\t\tthis.setUnitLengthDegreeScaler(Double.parseDouble(tokens[1]));\n\t\t}\n\t\telse if(tokens.length == 3) {\n\t\t\tdouble firstNumber = Double.parseDouble(tokens[1].replace(\"/\", \"\"));\n\t\t\tdouble secondNumber = Double.parseDouble(tokens[2].replace(\"/\", \"\"));\n\t\t\tdouble degreeScaler = firstNumber / secondNumber;\n\t\t\tthis.setUnitLengthDegreeScaler(degreeScaler);\n\t\t}\n\t\telse if(tokens.length == 4 && tokens[2].equals(\"/\")) {\n\t\t\tdouble degreeScaler = Double.parseDouble(tokens[1]) / Double.parseDouble(tokens[3]);\n\t\t\tthis.setUnitLengthDegreeScaler(degreeScaler);\n\t\t}\n\t\telse {\n\t\t\tthrow new IllegalArgumentException(\"Invalid unitLengthDegreeScaler\");\n\t\t}\n\t}",
"private void processLine(String line1) {\n StringTokenizer tVal = new StringTokenizer(line1);\n int yearOf = Integer.parseInt((tVal.nextToken()));\n List chosenYear = yearOf == 2014 ? employeeSalary_2014:\n employeeSalary_2015;\n String employeeTypeE = tVal.nextToken();\n String employeeName = tVal.nextToken();\n Integer employeeMonthlySalary =\n Integer.parseInt(tVal.nextToken());\n Employee newEmployee = null;\n if (employeeTypeE.equals(\"Salesman\")) {\n Integer salesmanCommission=\n Integer.parseInt(tVal.nextToken());\n\n newEmployee = new Salesman(employeeName, employeeMonthlySalary, salesmanCommission);\n\n }\n else if (employeeTypeE.equals(\"Executive\")) {\n Integer stockPrice= Integer.parseInt(tVal.nextToken());\n newEmployee = new Executive(employeeName, employeeMonthlySalary, stockPrice);\n }\n else {\n newEmployee = new Employee(employeeName, employeeMonthlySalary);\n }\n chosenYear.add(newEmployee);\n }",
"private void separateAttributes() {\n\n String gfuncStr = gridRscData.getGdpfun().replaceAll(\"\\\\s+\", \"\").trim();\n if (gfuncStr != null && gfuncStr.endsWith(\"!\")) {\n gfuncStr = gfuncStr.substring(0, gfuncStr.length() - 1);\n }\n String[] gfuncArray = gfuncStr.split(\"!\", -1);\n\n String[] glevelArray = gridRscData.getGlevel().replaceAll(\"\\\\s+\", \"\")\n .split(\"!\", -1);\n String[] gvcordArray = gridRscData.getGvcord().replaceAll(\"\\\\s+\", \"\")\n .split(\"!\", -1);\n String[] skipArray = gridRscData.getSkip().replaceAll(\"\\\\s+\", \"\")\n .split(\"!\", -1);\n String[] filterArray = gridRscData.getFilter().replaceAll(\"\\\\s+\", \"\")\n .split(\"!\", -1);\n String[] scaleArray = gridRscData.getScale().replaceAll(\"\\\\s+\", \"\")\n .split(\"!\", -1);\n String[] typeArray = gridRscData.getType().replaceAll(\"\\\\s+\", \"\")\n .split(\"!\", -1);\n String[] cintArray = gridRscData.getCint().replaceAll(\"\\\\s+\", \"\")\n .split(\"!\", -1);\n String[] lineArray = gridRscData.getLineAttributes()\n .replaceAll(\"\\\\s+\", \"\").split(\"!\", -1);\n String[] fintArray = gridRscData.getFint().replaceAll(\"\\\\s+\", \"\")\n .split(\"!\", -1);\n String[] flineArray = gridRscData.getFline().replaceAll(\"\\\\s+\", \"\")\n .split(\"!\", -1);\n String[] hiloArray = gridRscData.getHilo().replaceAll(\"\\\\s+\", \"\")\n .split(\"!\", -1);\n String[] hlsymArray = gridRscData.getHlsym().replaceAll(\"\\\\s+\", \"\")\n .split(\"!\", -1);\n String[] windArray = gridRscData.getWind().replaceAll(\"\\\\s+\", \"\")\n .split(\"!\", -1);\n String[] markerArray = gridRscData.getMarker().replaceAll(\"\\\\s+\", \"\")\n .split(\"!\", -1);\n String[] clrbarArray = gridRscData.getClrbar().replaceAll(\"\\\\s+\", \"\")\n .split(\"!\", -1);\n String[] textArray = gridRscData.getText().replaceAll(\"\\\\s+\", \"\")\n .split(\"!\", -1);\n String[] colorArray = gridRscData.getColors().replaceAll(\"\\\\s+\", \"\")\n .split(\"!\", -1);\n /* Clean up cint -- max 5 zoom level */\n if (cintArray != null && cintArray.length > 0) {\n for (int i = 0; i < cintArray.length; i++) {\n String[] tmp = cintArray[i].split(\">\");\n if (tmp.length > 5) {\n cintArray[i] = tmp[0] + \">\" + tmp[1] + \">\" + tmp[2] + \">\"\n + tmp[3] + \">\" + tmp[4];\n }\n }\n }\n\n for (int i = 0; i < gfuncArray.length; i++) {\n if (gfuncArray[i].contains(\"//\")) {\n String[] tmpstr = gfuncArray[i].split(\"//\", 2);\n gfuncArray[i] = tmpstr[0];\n String referencedAlias = tmpstr[1];\n String referencedFunc = tmpstr[0];\n /*\n * Need to substitute all occurrences of referencedAlias with\n * referencedFunc\n */\n for (int j = i + 1; j < gfuncArray.length; j++) {\n /*\n * First need to find out if the gfuncArray[i] is a derived\n * quantity\n */\n gfuncArray[j] = substituteAlias(referencedAlias,\n referencedFunc, gfuncArray[j]);\n }\n } else {\n\n /*\n * Handle blank GDPFUN\n */\n if (gfuncArray[i].isEmpty()) {\n if (i > 0) {\n gfuncArray[i] = gfuncArray[i - 1];\n }\n }\n\n }\n }\n\n contourAttributes = new ContourAttributes[gfuncArray.length];\n\n for (int i = 0; i < gfuncArray.length; i++) {\n contourAttributes[i] = new ContourAttributes();\n contourAttributes[i].setGdpfun(gfuncArray[i]);\n\n if (i == 0) {\n contourAttributes[i].setGlevel(glevelArray[0]);\n contourAttributes[i].setGvcord(gvcordArray[0]);\n contourAttributes[i].setSkip(skipArray[0]);\n contourAttributes[i].setFilter(filterArray[0]);\n contourAttributes[i].setScale(scaleArray[0]);\n contourAttributes[i].setType(typeArray[0]);\n contourAttributes[i].setCint(cintArray[0]);\n contourAttributes[i].setLine(lineArray[0]);\n contourAttributes[i].setFint(fintArray[0]);\n contourAttributes[i].setFline(flineArray[0]);\n contourAttributes[i].setHilo(hiloArray[0]);\n contourAttributes[i].setHlsym(hlsymArray[0]);\n contourAttributes[i].setWind(windArray[0]);\n contourAttributes[i].setMarker(markerArray[0]);\n contourAttributes[i].setClrbar(clrbarArray[0]);\n contourAttributes[i].setText(textArray[0]);\n contourAttributes[i].setColors(colorArray[0]);\n } else {\n int idx = (glevelArray.length > i) ? i\n : (glevelArray.length - 1);\n if (glevelArray[idx].isEmpty() && idx > 0) {\n glevelArray[idx] = glevelArray[idx - 1];\n }\n contourAttributes[i].setGlevel(glevelArray[idx]);\n\n idx = (gvcordArray.length > i) ? i : gvcordArray.length - 1;\n if (gvcordArray[idx].isEmpty() && idx > 0) {\n gvcordArray[idx] = gvcordArray[idx - 1];\n }\n contourAttributes[i].setGvcord(gvcordArray[idx]);\n\n idx = (skipArray.length > i) ? i : skipArray.length - 1;\n if (skipArray[idx].isEmpty() && idx > 0) {\n skipArray[idx] = skipArray[idx - 1];\n }\n contourAttributes[i].setSkip(skipArray[idx]);\n\n idx = (filterArray.length > i) ? i : filterArray.length - 1;\n if (filterArray[idx].isEmpty() && idx > 0) {\n filterArray[idx] = filterArray[idx - 1];\n }\n contourAttributes[i].setFilter(filterArray[idx]);\n\n idx = (scaleArray.length > i) ? i : scaleArray.length - 1;\n if (scaleArray[idx].isEmpty() && idx > 0) {\n scaleArray[idx] = scaleArray[idx - 1];\n }\n contourAttributes[i].setScale(scaleArray[idx]);\n\n idx = (typeArray.length > i) ? i : typeArray.length - 1;\n if (typeArray[idx].isEmpty() && idx > 0) {\n typeArray[idx] = typeArray[idx - 1];\n }\n contourAttributes[i].setType(typeArray[idx]);\n\n idx = (cintArray.length > i) ? i : cintArray.length - 1;\n if (cintArray[idx].isEmpty() && idx > 0) {\n cintArray[idx] = cintArray[idx - 1];\n }\n contourAttributes[i].setCint(cintArray[idx]);\n\n idx = (lineArray.length > i) ? i : lineArray.length - 1;\n if (lineArray[idx].isEmpty() && idx > 0) {\n lineArray[idx] = lineArray[idx - 1];\n }\n contourAttributes[i].setLine(lineArray[idx]);\n\n idx = (fintArray.length > i) ? i : fintArray.length - 1;\n if (fintArray[idx].isEmpty() && idx > 0) {\n fintArray[idx] = fintArray[idx - 1];\n }\n contourAttributes[i].setFint(fintArray[idx]);\n\n idx = (flineArray.length > i) ? i : flineArray.length - 1;\n if (flineArray[idx].isEmpty() && idx > 0) {\n flineArray[idx] = flineArray[idx - 1];\n }\n contourAttributes[i].setFline(flineArray[idx]);\n\n idx = (hiloArray.length > i) ? i : hiloArray.length - 1;\n if (hiloArray[idx].isEmpty() && idx > 0) {\n hiloArray[idx] = hiloArray[idx - 1];\n }\n contourAttributes[i].setHilo(hiloArray[idx]);\n\n idx = (hlsymArray.length > i) ? i : hlsymArray.length - 1;\n if (hlsymArray[idx].isEmpty() && idx > 0) {\n hlsymArray[idx] = hlsymArray[idx - 1];\n }\n contourAttributes[i].setHlsym(hlsymArray[idx]);\n\n idx = (windArray.length > i) ? i : windArray.length - 1;\n if (windArray[idx].isEmpty() && idx > 0) {\n windArray[idx] = windArray[idx - 1];\n }\n contourAttributes[i].setWind(windArray[idx]);\n\n idx = (markerArray.length > i) ? i : markerArray.length - 1;\n if (markerArray[idx].isEmpty() && idx > 0) {\n markerArray[idx] = markerArray[idx - 1];\n }\n contourAttributes[i].setMarker(markerArray[idx]);\n\n idx = (clrbarArray.length > i) ? i : clrbarArray.length - 1;\n if (clrbarArray[idx].isEmpty() && idx > 0) {\n clrbarArray[idx] = clrbarArray[idx - 1];\n }\n contourAttributes[i].setClrbar(clrbarArray[idx]);\n\n idx = (textArray.length > i) ? i : textArray.length - 1;\n if (textArray[idx].isEmpty() && idx > 0) {\n textArray[idx] = textArray[idx - 1];\n }\n contourAttributes[i].setText(textArray[idx]);\n\n idx = (colorArray.length > i) ? i : colorArray.length - 1;\n if (colorArray[idx].isEmpty() && idx > 0) {\n colorArray[idx] = colorArray[idx - 1];\n }\n contourAttributes[i].setColors(colorArray[idx]);\n\n }\n }\n }",
"public String[] parseLine() {\n String[] tokens = null;\n try {\n tokens = csvReader.readNext();\n } catch (IOException e) {\n e.printStackTrace();\n } catch (Exception e) {\n e.printStackTrace();\n }\n return tokens;\n }",
"String getBeginSplited();",
"void format13(String line, int lineCount) {\n\n // is this the first record in the file?\n checkFirstRecord(code, lineCount);\n\n // there can only be one code 13 record per substation\n code13Count++;\n if (code13Count > 1) {\n outputError(lineCount + \" - Fatal - \" +\n \"More than 1 code 13 record in substation\");\n } // if (code13Count > 1)\n\n // get the data off the line\n java.util.StringTokenizer t = new java.util.StringTokenizer(line, \" \");\n String dummy = t.nextToken(); // get 'rid' of the code\n\n if (dataType == SEDIMENT) {\n\n //01 a2 format code always \"13\" n/a\n //02 a12 stnid station id: composed as for format 03 sedphy\n //03 i5 aluminium µgm / gram sedpol2\n //04 f8.3 antimony µgm / gram sedpol2\n //05 f4.1 bismuth µgm / gram sedpol2\n //06 f4.1 molybdenum µgm / gram sedpol2\n //07 f8.3 silver µgm / gram sedpol2\n //08 i4 titanium µgm / gram sedpol2\n //09 f5.2 vanadium µgm / gram sedpol2\n\n if (t.hasMoreTokens()) sedphy.setStationId(toString(t.nextToken()));\n if (t.hasMoreTokens()) sedpol2.setAluminium(toInteger(t.nextToken()));\n if (t.hasMoreTokens()) sedpol2.setAntimony(toFloat(t.nextToken(), 1f));\n if (t.hasMoreTokens()) sedpol2.setBismuth(toFloat(t.nextToken(), 1f));\n if (t.hasMoreTokens()) sedpol2.setMolybdenum(toFloat(t.nextToken(), 1f));\n if (t.hasMoreTokens()) sedpol2.setSilver(toFloat(t.nextToken(), 1f));\n if (t.hasMoreTokens()) sedpol2.setTitanium(toInteger(t.nextToken()));\n if (t.hasMoreTokens()) sedpol2.setVanadium(toFloat(t.nextToken(), 1f));\n\n // station Id must match that of previous station record\n checkStationId(lineCount, sedphy.getStationId(\"\"));\n\n if (dbg) System.out.println(\"format13: sedpol2 = \" + sedpol2);\n\n } else if (dataType == WATER) {\n\n //01 a2 format code always \"13\" n/a\n //02 a12 stnid station id: composed as for format 03 watphy\n //03 i5 aluminium µgm / litre watpol2\n //04 f8.3 antimony µgm / litre watpol2\n //05 f4.1 bismuth µgm / litre watpol2\n //06 f4.1 molybdenum µgm / litre watpol2\n //07 f8.3 silver µgm / litre watpol2\n //08 i4 titanium µgm / litre watpol2\n //08 f5.2 vanadium µgm / litre watpol2\n\n if (t.hasMoreTokens()) watphy.setStationId(toString(t.nextToken()));\n if (t.hasMoreTokens()) watpol2.setAluminium(toInteger(t.nextToken()));\n if (t.hasMoreTokens()) watpol2.setAntimony(toFloat(t.nextToken(), 1f));\n if (t.hasMoreTokens()) watpol2.setBismuth(toFloat(t.nextToken(), 1f));\n if (t.hasMoreTokens()) watpol2.setMolybdenum(toFloat(t.nextToken(), 1f));\n if (t.hasMoreTokens()) watpol2.setSilver(toFloat(t.nextToken(), 1f));\n if (t.hasMoreTokens()) watpol2.setTitanium(toInteger(t.nextToken()));\n if (t.hasMoreTokens()) watpol2.setVanadium(toFloat(t.nextToken(), 1f));\n\n // station Id must match that of previous station record\n checkStationId(lineCount, watphy.getStationId(\"\"));\n\n if (dbg) System.out.println(\"format13: watpol2 = \" + watpol2);\n\n } // if (dataType == SEDIMENT)\n\n }",
"public ExpenseEntity parse(String line);",
"public abstract T parseLine(String inputLine);",
"private ArrayList limpiar() {//quita espacios en blanco y saltos de linea\n String codigoFuente = ta_source.getText();\n ArrayList retorno = new ArrayList();\n try {\n codigoFuente = codigoFuente.replaceAll(\" \", \"\");\n String aux = \"\";\n byte guardaLinea = 1, guardaBloque = 1;\n for (int i = 0; i < codigoFuente.length(); i++) {\n if (codigoFuente.length() > (i + 1) && codigoFuente.charAt(i) == '/' && codigoFuente.charAt(i + 1) == '/' && guardaBloque == 1) {\n guardaLinea = 0;//0: no guarda\n }\n if (codigoFuente.length() > (i + 1) && codigoFuente.charAt(i) == '/' && codigoFuente.charAt(i + 1) == '*' && guardaLinea == 1) {\n guardaBloque = 0;//0: no guarda\n }\n if (i > 0 && codigoFuente.charAt(i) == '/' && codigoFuente.charAt(i - 1) == '*') {\n guardaBloque = 2;//1: si guarda\n }\n if (codigoFuente.charAt(i) == '\\n' && guardaBloque == 1) {\n guardaLinea = 1;//1: si guarda\n if (aux.length() > 0) {\n retorno.add(aux);\n aux = \"\";\n }\n } else {\n if (i == codigoFuente.length() - 1) {\n aux += codigoFuente.charAt(i);\n retorno.add(aux);\n }\n }\n if (guardaBloque == 1 && guardaLinea == 1 && codigoFuente.charAt(i) != '\\n') {\n aux += codigoFuente.charAt(i);\n }\n if (guardaBloque == 2) {\n guardaBloque--;\n }\n }\n } catch (Exception e) {\n System.out.println(\"errror \" + e.getClass());\n } finally {\n return retorno;\n }\n }",
"private void parseTriangle(String line) {\n String first_integer = line.substring(2);\n first_integer = first_integer.trim();\n int second_space_index = first_integer.indexOf(' ') + 1;\n String second_integer = first_integer.substring(second_space_index);\n second_integer = second_integer.trim();\n int third_space_index = second_integer.indexOf(' ') + 1;\n String third_integer = second_integer.substring(third_space_index);\n third_integer = third_integer.trim();\n\n parseTriplet(first_integer.substring(0, second_space_index - 1));\n parseTriplet(second_integer.substring(0, third_space_index - 1));\n parseTriplet(third_integer);\n }",
"protected abstract Operation parseLine(File baseDir, String line, int lineNum) throws IOException;",
"public void splitData(String fullData){\n\t\t\n\t\tDictionary<String> strings = new Dictionary<>();\n\t\tDictionary<Float> floats = new Dictionary<>();\n\t\tDictionary<Boolean> booleans = new Dictionary<>();\n\t\t\n\t\tList<String> lines = new ArrayList<>(Arrays.asList(fullData.split(\"\\n\")));\n\t\t\n\t\tString[] labels = lines.get(0).split(\",\");\n\t\tlines.remove(0);\n\t\t\n\t\tfor(String line: lines){\n\t\t\tString[] data = line.split(\",\");\n\t\t\t\n\t\t\tfor(int i=0;i<data.length;i++){\n\t\t\t\t\n\t\t\t\t//placeholder since current data has no actual booleans\n\t\t\t\tif(labels[i].equals(\"autoBaselineGroup\") || labels[i].equals(\"autoGear\") || labels[i].equals(\"Did Climb\") || labels[i].equals(\"died\") || labels[i].equals(\"defense\")){\n\t\t\t\t\tif(data[i].equals(\"1\")){\n\t\t\t\t\t\tbooleans.add(labels[i], true);\n\t\t\t\t\t} else{\n\t\t\t\t\t\tbooleans.add(labels[i], false);\n\t\t\t\t\t}\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//check what type it is\n\t\t\t\tSystem.out.println(number);\n\t\t\t\ttry{\n\t\t\t\t\tswitch(labels[i]){\n\t\t\t\t\tcase \"Round\":\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tcase \"Date and Time Of Match\":\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tcase \"UUID\":\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tcase \"end\":\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tfloats.add(labels[i], Float.parseFloat(data[i]));\n\t\t\t\t\tcontinue;\n\t\t\t\t} catch(NumberFormatException e){\n\t\t\t\t\t//not an int, check for bool\n\t\t\t\t\t\n\t\t\t\t\tif(data[i].toLowerCase().contains(\"true\")){\n\t\t\t\t\t\tbooleans.add(labels[i], true);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif(data[i].toLowerCase().contains(\"false\")){\n\t\t\t\t\t\tbooleans.add(labels[i], false);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//must be string\n\t\t\t\t\tdata[i] = \"\\n\\t\"+data[i];\n\t\t\t\t\tdata[i] = data[i].replace(\"|c\", \",\").replace(\"|n\", \"\\n\\t\").replace(\"||\", \"|\").replace(\"|q\", \"\\\"\").replace(\"|;\", \":\");\n\t\t\t\t\tstrings.add(labels[i], data[i]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tint matchNum = getMatchNum(line, labels);\n\t\t\t\n\t\t\tMatch r = new Match(number, matchNum, \"TIME\");\n\t\t\tr.setData(strings, floats, booleans);\n\t\t\tmatches.add(r);\n\t\t\t\n\t\t\tstrings = new Dictionary<>();\n\t\t\tfloats = new Dictionary<>();\n\t\t\tbooleans = new Dictionary<>();\n\t\t}\n\t}",
"public void tokenizeLines()\n {\n tokenizeLines(0, getDefaultRootElement().getElementCount());\n }",
"@Override\n public boolean processLine(String line) throws IOException {\n if (line == null || line.length() == 0) return true;\n String[] values = line.split(\"\\t\");\n // If there is an entry which is improperly sized, there is a problem so bail\n if (values.length != segment.getOutputParameters().size()) return false;\n ParameterMap.Builder builder = new ParameterMap.Builder();\n for (int i=0; i<parameters.size();i++)\n {\n builder.with(parameters.get(i), values[i]);\n }\n entries.add(builder.build());\n return true;\n }",
"public Vector2d getLineNormal(Line2d line)\n\t{\n\n\t\tthis.color = Color.BLACK;\n\t\t\n\n//\t\tDraw2DApplet da = new Draw2DApplet(this);\n//\t\tthis.display();\n\n\t\tVector2d dir = new Vector2d(line.getDirection());\n\t\tVector2d nDir = new Vector2d(-dir.y, dir.x);\n\t\tVector2d negDir = new Vector2d();\n\t\tnegDir.negate(nDir);\n\t\tVector2d sc = new Vector2d(nDir);\n\t\tsc.scale(20. * GeometryConstants.EPSILON);\n\t\tfinal Point2d mp = line.pointOnLine(line.getLength()/2);\n\t\tmp.add(sc);\n\t\tList points = getPoints();\n\t\tfinal int n = points.size();\n\t\tfinal double[] xp = new double[n];\n\t\tfinal double[] yp = new double[n];\n//\t\tSystem.out.println(\">>>>>>>>>> mpoint is: \" + mp);\n\t\tfor(int i = 0; i < n; i++) \n\t\t{\n\t\t\tPoint2d point = (Point2d) points.get(i);\n\t\t\txp[i] = point.x;\n\t\t\typ[i] = point.y;\n//\t\t\tSystem.out.println(\"-------------- point\" + i + \" is: \" + xp[i] + \", \" + yp[i]);\n\t\t}\n/*\t\tViewObject vo = new ViewObject () {\n\t\t\tpublic LinkedList getDrawList () {\n\t\t\t\tLinkedList list = new LinkedList(); \n\t\t\t\tfor (int i = 0; i <n-1; i++) {\n\t\t\t\t\tlist.add(new Line2D.Double (xp[i], yp[i], xp[i+1], yp[i+1]));\n\t\t\t\t}\n\t\t\t\tlist.add (new Ellipse2D.Double(mp.x, mp.y, mp.x+0.2, mp.y+0.2));\n\t\t\t\treturn list;\n\t\t\t}\n\t\t};\n\t\tvo.setApplet (new Draw2DApplet(vo));\n\t\tvo.display();*/\n\t\t try {\n\t\t\treturn Polygon2d.isPointInside(xp, yp, mp.x, mp.y)? negDir: nDir;\n\t\t} catch (Exception e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t} \n\t}",
"protected int[] parserLine(String source, int Line) {\n\t\tint[] Offset = new int[2];\n\t\tString[] Source = source.split(\"\\n\");\n\t\tint actualLine = 1;\n\t\tint counterChar = 0;\n\t\tfor(String src:Source){\n\t\t\tif(actualLine == Line){ // desired line\n\t\t\t\tOffset[0] = counterChar; //first char\n\t\t\t\tOffset[1] = counterChar+src.length()+1; //last char\n\t\t\t\treturn Offset;\n\t\t\t}\n\t\t\tcounterChar+=src.length()+1;\n\t\t\tactualLine++;\n\t\t}\n\t\treturn null;\n\t}",
"private void synsetParse(String line) {\n String[] tokens = line.split(\",\");\n Integer key = Integer.parseInt(tokens[0]);\n ArrayList<String> al = new ArrayList<String>();\n String[] words = tokens[1].split(\" \");\n for (String w : words) {\n al.add(w);\n nounSet.add(w); // build nounSet at the same time\n }\n synsetMap.put(key, al);\n }",
"public void normalization(){\n normalization = processControlBlock[0].getArrivalTime();\n }",
"abstract Node split();",
"abstract Node split();",
"public static String[] breakInput(String input){\n\t\t//Split the thing up on spaces,\n\t\tString[] inputSplit = (input.split(\"\\\\s\"));\n\t\treturn inputSplit;\n\t}",
"public Line voToLine() {\n Line line = new Line();\n if (this.getLineId() != null) {\n line.setLineId(this.getLineId());\n }\n line.setAppmodelId(this.getAppmodelId());\n line.setDriverName(this.getDriverName());\n line.setDriverPhone(this.getDriverPhone());\n line.setLineName(this.getLineName());\n line.setProvinceId(this.provinceId);\n line.setCityId(this.cityId);\n line.setAreaId(this.areaId);\n return line;\n }"
] | [
"0.6533829",
"0.6370605",
"0.62501514",
"0.6248125",
"0.6224249",
"0.61208814",
"0.60954285",
"0.60354406",
"0.59879774",
"0.5934873",
"0.5917446",
"0.5850977",
"0.58324426",
"0.58200365",
"0.5782829",
"0.5719349",
"0.5698696",
"0.5683159",
"0.56819624",
"0.5676527",
"0.565472",
"0.5643601",
"0.5606422",
"0.56037724",
"0.56026024",
"0.5594108",
"0.5579155",
"0.55621004",
"0.5544857",
"0.5543139",
"0.5533581",
"0.5530902",
"0.5528208",
"0.55165035",
"0.549102",
"0.54894316",
"0.54575145",
"0.54460883",
"0.5408955",
"0.540162",
"0.53911006",
"0.5379289",
"0.53668636",
"0.5353829",
"0.5348226",
"0.53277683",
"0.5307323",
"0.53037375",
"0.5299107",
"0.5293574",
"0.5283955",
"0.52805156",
"0.5254044",
"0.525062",
"0.52336067",
"0.5201668",
"0.51983166",
"0.5194843",
"0.51896995",
"0.51832",
"0.5179729",
"0.5178045",
"0.51512796",
"0.5147861",
"0.5138459",
"0.5124452",
"0.5121552",
"0.51082975",
"0.51081216",
"0.50964564",
"0.50914425",
"0.5087355",
"0.5086522",
"0.5072521",
"0.5072479",
"0.50684065",
"0.5067503",
"0.5052863",
"0.50501126",
"0.5039678",
"0.5027423",
"0.5022075",
"0.50206065",
"0.5020074",
"0.5006865",
"0.50026566",
"0.49882507",
"0.49864414",
"0.498181",
"0.4979624",
"0.49777666",
"0.4970127",
"0.49632207",
"0.49334657",
"0.4929118",
"0.4926142",
"0.49234036",
"0.49138397",
"0.49138397",
"0.49042195",
"0.4898922"
] | 0.0 | -1 |
Based on using the "Inverse Formula" (section 4) | private static void computeDistanceAndBearing(double lat1, double lon1,
double lat2, double lon2, double[] results) {
int MAXITERS = 20;
// Convert lat/long to radians
lat1 *= Math.PI / 180.0;
lat2 *= Math.PI / 180.0;
lon1 *= Math.PI / 180.0;
lon2 *= Math.PI / 180.0;
double a = 6378137.0; // WGS84 major axis
double b = 6356752.3142; // WGS84 semi-major axis
double f = (a - b) / a;
double aSqMinusBSqOverBSq = (a * a - b * b) / (b * b);
double L = lon2 - lon1;
double A = 0.0;
double U1 = Math.atan((1.0 - f) * Math.tan(lat1));
double U2 = Math.atan((1.0 - f) * Math.tan(lat2));
double cosU1 = Math.cos(U1);
double cosU2 = Math.cos(U2);
double sinU1 = Math.sin(U1);
double sinU2 = Math.sin(U2);
double cosU1cosU2 = cosU1 * cosU2;
double sinU1sinU2 = sinU1 * sinU2;
double sigma = 0.0;
double deltaSigma = 0.0;
double cosSqAlpha = 0.0;
double cos2SM = 0.0;
double cosSigma = 0.0;
double sinSigma = 0.0;
double cosLambda = 0.0;
double sinLambda = 0.0;
double lambda = L; // initial guess
for (int iter = 0; iter < MAXITERS; iter++) {
double lambdaOrig = lambda;
cosLambda = Math.cos(lambda);
sinLambda = Math.sin(lambda);
double t1 = cosU2 * sinLambda;
double t2 = cosU1 * sinU2 - sinU1 * cosU2 * cosLambda;
double sinSqSigma = t1 * t1 + t2 * t2; // (14)
sinSigma = Math.sqrt(sinSqSigma);
cosSigma = sinU1sinU2 + cosU1cosU2 * cosLambda; // (15)
sigma = Math.atan2(sinSigma, cosSigma); // (16)
double sinAlpha = (sinSigma == 0) ? 0.0 :
cosU1cosU2 * sinLambda / sinSigma; // (17)
cosSqAlpha = 1.0 - sinAlpha * sinAlpha;
cos2SM = (cosSqAlpha == 0) ? 0.0 :
cosSigma - 2.0 * sinU1sinU2 / cosSqAlpha; // (18)
double uSquared = cosSqAlpha * aSqMinusBSqOverBSq; // defn
A = 1 + (uSquared / 16384.0) * // (3)
(4096.0 + uSquared *
(-768 + uSquared * (320.0 - 175.0 * uSquared)));
double B = (uSquared / 1024.0) * // (4)
(256.0 + uSquared *
(-128.0 + uSquared * (74.0 - 47.0 * uSquared)));
double C = (f / 16.0) *
cosSqAlpha *
(4.0 + f * (4.0 - 3.0 * cosSqAlpha)); // (10)
double cos2SMSq = cos2SM * cos2SM;
deltaSigma = B * sinSigma * // (6)
(cos2SM + (B / 4.0) *
(cosSigma * (-1.0 + 2.0 * cos2SMSq) -
(B / 6.0) * cos2SM *
(-3.0 + 4.0 * sinSigma * sinSigma) *
(-3.0 + 4.0 * cos2SMSq)));
lambda = L +
(1.0 - C) * f * sinAlpha *
(sigma + C * sinSigma *
(cos2SM + C * cosSigma *
(-1.0 + 2.0 * cos2SM * cos2SM))); // (11)
double delta = (lambda - lambdaOrig) / lambda;
if (Math.abs(delta) < 1.0e-12) {
break;
}
}
float distance = (float) (b * A * (sigma - deltaSigma));
results[0] = distance;
float initialBearing = (float) Math.atan2(cosU2 * sinLambda,
cosU1 * sinU2 - sinU1 * cosU2 * cosLambda);
initialBearing *= 180.0 / Math.PI;
float finalBearing = (float) Math.atan2(cosU1 * sinLambda,
-sinU1 * cosU2 + cosU1 * sinU2 * cosLambda);
finalBearing *= 180.0 / Math.PI;
results[1] = finalBearing;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"int ainverse(int z)\n {\n return (65536-z);\n }",
"public final void invert() {\r\n\t\tRadical1 s = determinant();\r\n\t\tif (s.equals(Radical1.ZERO))\r\n\t\t\treturn;\r\n\r\n\t\tif (!s.equals(Radical1.ONE))\r\n\t\t\tthrow new ArithmeticException(\"can't invert radical expressions that have non-1 determinant (i.e. that rescale)\");\r\n\r\n\t\t// see Matrix4f.invert for an explination\r\n\r\n\t\tl1.setZero();\r\n\t\tl2.setZero();\r\n\t\tl3.setZero();\r\n\t\tl4.setZero();\r\n\t\tl5.setZero();\r\n\t\tl6.setZero();\r\n\t\tl7.setZero();\r\n\t\tl8.setZero();\r\n\t\tl9.setZero();\r\n\t\tl10.setZero();\r\n\t\tl11.setZero();\r\n\t\tl12.setZero();\r\n\t\tl13.setZero();\r\n\t\tl14.setZero();\r\n\t\tl15.setZero();\r\n\t\tl16.setZero();\r\n\r\n\t\tcalcPartInverse(5, 10, 15, 11, 14, op1, op2, op3, op4, l1);\r\n\t\tcalcPartInverse(6, 11, 13, 9, 15, op1, op2, op3, op4, l1);\r\n\t\tcalcPartInverse(7, 9, 14, 10, 13, op1, op2, op3, op4, l1);\r\n\r\n\t\tcalcPartInverse(9, 2, 15, 3, 14, op1, op2, op3, op4, l2);\r\n\t\tcalcPartInverse(10, 3, 13, 1, 15, op1, op2, op3, op4, l2);\r\n\t\tcalcPartInverse(11, 1, 14, 2, 13, op1, op2, op3, op4, l2);\r\n\r\n\t\tcalcPartInverse(13, 2, 7, 3, 6, op1, op2, op3, op4, l3);\r\n\t\tcalcPartInverse(14, 3, 5, 1, 7, op1, op2, op3, op4, l3);\r\n\t\tcalcPartInverse(15, 1, 6, 2, 5, op1, op2, op3, op4, l3);\r\n\r\n\t\tcalcPartInverse(1, 7, 10, 6, 11, op1, op2, op3, op4, l4);\r\n\t\tcalcPartInverse(2, 5, 11, 7, 9, op1, op2, op3, op4, l4);\r\n\t\tcalcPartInverse(3, 6, 9, 5, 10, op1, op2, op3, op4, l4);\r\n\r\n\t\tcalcPartInverse(6, 8, 15, 11, 12, op1, op2, op3, op4, l5);\r\n\t\tcalcPartInverse(7, 10, 12, 8, 14, op1, op2, op3, op4, l5);\r\n\t\tcalcPartInverse(4, 11, 14, 10, 15, op1, op2, op3, op4, l5);\r\n\r\n\t\tcalcPartInverse(10, 0, 15, 3, 12, op1, op2, op3, op4, l6);\r\n\t\tcalcPartInverse(11, 2, 12, 0, 14, op1, op2, op3, op4, l6);\r\n\t\tcalcPartInverse(8, 3, 14, 2, 15, op1, op2, op3, op4, l6);\r\n\r\n\t\tcalcPartInverse(14, 0, 7, 3, 4, op1, op2, op3, op4, l7);\r\n\t\tcalcPartInverse(15, 2, 4, 0, 6, op1, op2, op3, op4, l7);\r\n\t\tcalcPartInverse(12, 3, 6, 2, 7, op1, op2, op3, op4, l7);\r\n\r\n\t\tcalcPartInverse(2, 7, 8, 4, 11, op1, op2, op3, op4, l8);\r\n\t\tcalcPartInverse(3, 4, 10, 6, 8, op1, op2, op3, op4, l8);\r\n\t\tcalcPartInverse(0, 6, 11, 7, 10, op1, op2, op3, op4, l8);\r\n\r\n\t\tcalcPartInverse(7, 8, 13, 9, 12, op1, op2, op3, op4, l9);\r\n\t\tcalcPartInverse(4, 9, 15, 11, 13, op1, op2, op3, op4, l9);\r\n\t\tcalcPartInverse(5, 11, 12, 8, 15, op1, op2, op3, op4, l9);\r\n\r\n\t\tcalcPartInverse(11, 0, 13, 1, 12, op1, op2, op3, op4, l10);\r\n\t\tcalcPartInverse(8, 1, 15, 3, 13, op1, op2, op3, op4, l10);\r\n\t\tcalcPartInverse(9, 3, 12, 0, 15, op1, op2, op3, op4, l10);\r\n\r\n\t\tcalcPartInverse(15, 0, 5, 1, 4, op1, op2, op3, op4, l11);\r\n\t\tcalcPartInverse(12, 1, 7, 3, 5, op1, op2, op3, op4, l11);\r\n\t\tcalcPartInverse(13, 3, 4, 0, 7, op1, op2, op3, op4, l11);\r\n\r\n\t\tcalcPartInverse(3, 5, 8, 4, 9, op1, op2, op3, op4, l12);\r\n\t\tcalcPartInverse(0, 7, 9, 5, 11, op1, op2, op3, op4, l12);\r\n\t\tcalcPartInverse(1, 4, 11, 7, 8, op1, op2, op3, op4, l12);\r\n\r\n\t\tcalcPartInverse(4, 10, 13, 9, 14, op1, op2, op3, op4, l13);\r\n\t\tcalcPartInverse(5, 8, 14, 10, 12, op1, op2, op3, op4, l13);\r\n\t\tcalcPartInverse(6, 9, 12, 8, 13, op1, op2, op3, op4, l13);\r\n\r\n\t\tcalcPartInverse(8, 2, 13, 1, 14, op1, op2, op3, op4, l14);\r\n\t\tcalcPartInverse(9, 0, 14, 2, 12, op1, op2, op3, op4, l14);\r\n\t\tcalcPartInverse(10, 1, 12, 0, 13, op1, op2, op3, op4, l14);\r\n\r\n\t\tcalcPartInverse(12, 2, 5, 1, 6, op1, op2, op3, op4, l15);\r\n\t\tcalcPartInverse(13, 0, 6, 2, 4, op1, op2, op3, op4, l15);\r\n\t\tcalcPartInverse(14, 1, 4, 0, 5, op1, op2, op3, op4, l15);\r\n\r\n\t\tcalcPartInverse(0, 5, 10, 6, 9, op1, op2, op3, op4, l16);\r\n\t\tcalcPartInverse(1, 6, 8, 4, 10, op1, op2, op3, op4, l16);\r\n\t\tcalcPartInverse(2, 4, 9, 5, 8, op1, op2, op3, op4, l16);\r\n\r\n\t\tvalues[0].set(l1);\r\n\t\tvalues[1].set(l2);\r\n\t\tvalues[2].set(l3);\r\n\t\tvalues[3].set(l4);\r\n\t\tvalues[4].set(l5);\r\n\t\tvalues[5].set(l6);\r\n\t\tvalues[6].set(l7);\r\n\t\tvalues[7].set(l8);\r\n\t\tvalues[8].set(l9);\r\n\t\tvalues[9].set(l10);\r\n\t\tvalues[10].set(l11);\r\n\t\tvalues[11].set(l12);\r\n\t\tvalues[12].set(l13);\r\n\t\tvalues[13].set(l14);\r\n\t\tvalues[14].set(l15);\r\n\t\tvalues[15].set(l16);\r\n\r\n\t\tif (s.equals(Radical1.MINUS_ONE))\r\n\t\t\tnegate();\r\n\t}",
"public final void invert() {\n\tdouble s = determinant();\n\tif (s == 0.0)\n\t return;\n\ts = 1/s;\n\t// alias-safe way.\n\tset(\n\t m11*m22 - m12*m21, m02*m21 - m01*m22, m01*m12 - m02*m11,\n\t m12*m20 - m10*m22, m00*m22 - m02*m20, m02*m10 - m00*m12,\n\t m10*m21 - m11*m20, m01*m20 - m00*m21, m00*m11 - m01*m10\n\t );\n\tmul((float)s);\n }",
"@Override\n\tpublic void visit(InverseExpression arg0) {\n\n\t}",
"static void pregenInverse() \n\t{ \n\t\tinvfact[0] = invfact[1] = 1; \n\n\t\t// calculates the modInverse of \n\t\t// the last factorial \n\t\tinvfact[1000000] = modInverse(fact[1000000], mod); \n\n\t\t// precalculates the modInverse of \n\t\t// all factorials by formulae \n\t\tfor (int i = 999999; i > 1; --i) \n\t\t{ \n\t\t\tinvfact[i] = (int) (((long) invfact[i + 1] \n\t\t\t\t\t* (long) (i + 1)) % mod); \n\t\t} \n\t}",
"public Matrix inverse(){\r\n \tint n = this.nrow;\r\n \tif(n!=this.ncol)throw new IllegalArgumentException(\"Matrix is not square\");\r\n \tdouble[] col = new double[n];\r\n \tdouble[] xvec = new double[n];\r\n \tMatrix invmat = new Matrix(n, n);\r\n \tdouble[][] invarray = invmat.getArrayReference();\r\n \tMatrix ludmat;\r\n\r\n\t \tludmat = this.luDecomp();\r\n \tfor(int j=0; j<n; j++){\r\n \t\tfor(int i=0; i<n; i++)col[i]=0.0D;\r\n \t\tcol[j]=1.0;\r\n \t\txvec=ludmat.luBackSub(col);\r\n \t\tfor(int i=0; i<n; i++)invarray[i][j]=xvec[i];\r\n \t}\r\n \t\treturn invmat;\r\n \t}",
"public RMTransform getTransformInverse() { return getTransform().invert(); }",
"static int[][] inverse(int A[][]) \n { \n int inverse[][] = new int[4][4];\n // Find determinant of A[][] \n int det = determinant(A, N)%26; \n System.out.println(det);\n if (det == 0) \n { \n System.out.print(\"Singular matrix, can't find its inverse\"); \n return null; \n } \n \n // Find adjoint \n int [][]adj = new int[N][N]; \n adjoint(A, adj); \n \n // Find Inverse using formula \"inverse(A) = adj(A)/det(A)\" \n for (int i = 0; i < N; i++) \n for (int j = 0; j < N; j++) {\n inverse[i][j] = adj[i][j]/det; \n inverse[i][j] = inverse[i][j]%26;\n System.out.print(inverse[i][j]);\n }\n return inverse; \n }",
"Matrix InverseT()\n {\n Matrix ad = new Matrix( y.cross(z), z.cross(x), x.cross(y) );\n float inv_det = 1.0f / ( x.dot( ad.x ) );\n ad.timesEqual( inv_det );\n return ad;\n }",
"@Override\n public void Invert() {\n\t \n }",
"public Matrix inverse() {\n\t\tMatrix a = copy();\n\t\tif (a.M != a.N) {\n\t\t\tthrow new RuntimeException(\"This matrix is not square!\");\n\t\t}\n\t\tMatrix i = identity(a.N);\n\t\tMatrix ai = a.augment(i);\n\t\tai = ai.specialrref();\n\t\tMatrix[] split = ai.split(a.N);\n\t\tif (split[0].equals(i)) {\n\t\t\treturn split[1];\n\t\t} else {\n\t\t\tthrow new RuntimeException(\"This matrix is not invertible!\");\n\t\t}\n\t}",
"public void invert() {\n\t\tthis.vector.setXYZ(-this.vector.x(), -this.vector.y(), -this.vector.z());\n\t\tthis.energy = -this.energy;\n\t}",
"public void invert() {\n \n float[] result = new float[16];\n System.arraycopy(IDENTITY, 0, result, 0, 16);\n \n for(int i = 0; i < 4; i++){\n int i4 = i*4;\n \n // make sure[i,i] is != 0\n \n for(int j = 0; matrix[i4+i] == 0 && j < 4; j++){\n if(j != i && matrix[j*4+i] != 0){\n transform(i, 1, j, matrix, result);\n }\n }\n \n // ensure tailing 0s\n \n for(int j = 0; j < i; j++){\n if(matrix[i4+j] != 0){\n transform(i, -matrix[i4+j]/matrix[j*4+j], j, matrix, result);\n }\n }\n\n if(matrix[i4+i] == 0){\n throw new IllegalArgumentException(\"Not invertable\");\n }\n\n // dump(\"row \"+i+\" leading zeros\", matrix, result);\n }\n \n for(int i = 3; i >= 0; i--){\n int i4 = i*4;\n if(matrix[i4+i] != 1){\n float f = matrix[i4+i];\n matrix[i4+i] = 1;\n for(int j = 0; j < 4; j++){\n result[i4+j] /= f;\n if(j > i){\n matrix[i4+j] /= f;\n }\n }\n }\n\n// dump(\"row \"+i+\" leading 1\", matrix, result);\n \n for(int j = i+1; j < 4; j++){\n if(matrix[i*4+j] != 0){\n transform(i, -matrix[i*4+j], j, matrix, result);\n }\n }\n\n// dump(\"row \"+i+\" tailing 0\", matrix, result);\n\n }\n\n matrix = result;\n }",
"private void makeInverse() {\n if (_map != null) {\n for (Map.Entry<Integer, Integer> e : _map.entrySet()) {\n _inverse.put(e.getValue(), e.getKey());\n }\n }\n }",
"public Matrix inverseMatrix(Matrix L, Matrix U, Matrix P, int n)\n {\n\tMatrix Uinv = new Matrix(n,n);\n\tMatrix Linv = new Matrix(n,n);\n\tfor (int k = 0; k < n; k++)\n\t{\n\t\tVector temp = new Vector(n);\n\t\tfor (int i = 0; i < n; i++)\n\t\t{\n\t\t\tif (i == k)\n\t\t\t\ttemp.vector[i] = 1;\n\t\t\telse\n\t\t\t\ttemp.vector[i] = 0;\n\t\t}\n\t\t// forward substitution for L y = b.\n\t\tfor (int i = 1; i < n; i++)\n\t\t\tfor (int j = 0; j < i; j++)\n\t\t\t\ttemp.vector[i] -= L.matrix[i][j] * temp.vector[j];\n\n\t\tfor (int i = 0; i < n; i++)\n\t\t{\n\t\t\tLinv.matrix[i][k] = temp.vector[i];\n\t\t}\n\n\t}\n\n\tfor (int k = 0; k < n; k++)\n\t{\n\t\tVector temp = new Vector(n);\n\t\tfor (int i = 0; i < n; i++)\n\t\t{\n\t\t\tif (i == k)\n\t\t\t\ttemp.vector[i] = 1;\n\t\t\telse\n\t\t\t\ttemp.vector[i] = 0;\n\t\t}\n\t\t// back substitution for U x = y. \n\t\tfor (int i = n - 1; i >= 0; i--) {\n\t\t\tfor (int j = i + 1; j < n; j++) \n temp.vector[i] -= U.matrix[i][j] * temp.vector[j];\n\t\t\ttemp.vector[i] /= U.matrix[i][i];\n\t\t}\n\n\t\tfor (int i = 0; i < n; i++)\n\t\t{\n\t\t\tUinv.matrix[i][k] = temp.vector[i];\n\t\t}\n\n\t}\n Matrix LinP = new Matrix();\n\tLinP = LinP.multiplication(Linv, P);\n Matrix results = new Matrix();\n results = results.multiplication(Uinv, LinP);\n\treturn results;\n\n }",
"public Double inverse(Double advNum1){\n answer = 1 / advNum1;\n return answer;\n }",
"public Matrix inverse() throws JPARSECException {\n return solve(identity(m,m));\n }",
"Edge inverse() {\n return bond.inverse().edge(u, v);\n }",
"private void performInverseExpression(Map<ColumnIdentifier, byte[]> dbValues,\n \t\t\tTermMap tm, String effectiveSQLQuery) throws SQLException,\n \t\t\tR2RMLDataError, UnsupportedEncodingException {\n \t\t// Every column reference in the inverse expression MUST\n \t\t// be an existing column in t\n \t\tString inverseExpression = tm.getInverseExpression();\n \t\tif (inverseExpression == null)\n \t\t\treturn;\n \t\tSet<ColumnIdentifier> columnReferences = R2RMLToolkit\n \t\t\t\t.extractColumnNamesFromInverseExpression(inverseExpression);\n \t\tSet<ColumnIdentifier> existingColumns = getExistingColumnNames();\n \t\tfor (ColumnIdentifier referencedColumns : columnReferences) {\n \t\t boolean found = false;\n \t\t for (ColumnIdentifier existingColumn : existingColumns) {\n \t\t\tif(existingColumn.equals(referencedColumns)) {\n \t\t\t found = true;\n \t\t\t break;\n \t\t\t}\n \t\t }\n \t\t if (!found)\n \t\t\tthrow new R2RMLDataError(\"[R2RMLEngine:checkInverseExpression] Every column\"\n \t\t\t\t\t\t\t\t+ \" reference in the inverse expression must be an existing column : \"\n \t\t\t\t\t\t\t\t+ referencedColumns + \" does not exist.\");\n \t\t}\n \t\t// Let instantiation(r)\n \t\tString instantiation = R2RMLToolkit\n \t\t\t\t.extractColumnValueFromInverseExpression(inverseExpression,\n \t\t\t\t\t\tdbValues, columnReferences);\n \t\t// let same-term(r) be the set of logical table rows in t that are\n \t\t// the result of executing the following SQL query over the SQL\n \t\t// connection\n \t\tResultSet sameTerm = constructInversionTable(instantiation,\n \t\t\t\teffectiveSQLQuery);\n \t\t// For every logical table row r in t whose generated RDF term g is not\n \t\t// NULL, same-term(r)\n \t\t// MUST be exactly the set of logical table rows in t whose generated\n \t\t// RDF term is also g\n \t\t// => Save similar rows\n \t\tif (sameRows.containsKey(tm)) {\n \t\t\tsameRows.get(tm).put(rows.getRow(), sameTerm);\n \t\t} else {\n \t\t\tMap<Integer, ResultSet> sameRowsMap = new HashMap<Integer, ResultSet>();\n \t\t\tsameRowsMap.put(rows.getRow(), sameTerm);\n \t\t\tsameRows.put(tm, sameRowsMap);\n \t\t}\n \n \t}",
"public Matrix inverse() {\n int n = L.getNrows();\n Matrix inv = Matrix.identity(n);\n solve(inv);\n return inv;\n }",
"public FImage inverse() {\n\t\tfinal int cs = real.getCols();\n\t\tfinal int rs = real.getRows();\n\n\t\tfinal FloatFFT_2D fft = new FloatFFT_2D(rs, cs);\n\t\tfinal float[][] prepared = new float[rs][cs * 2];\n\t\tfor (int y = 0; y < rs; y++) {\n\t\t\tfor (int x = 0; x < cs; x++) {\n\t\t\t\tprepared[y][x * 2] = real.pixels[y][x];\n\t\t\t\tprepared[y][1 + x * 2] = imaginary.pixels[y][x];\n\t\t\t}\n\t\t}\n\n\t\tfft.complexInverse(prepared, true);\n\n\t\tfinal FImage image = new FImage(cs, rs);\n\t\tFourierTransform.unprepareData(prepared, image, centre);\n\n\t\treturn image;\n\t}",
"public static native void Inverse(long lpjFbxDualQuaternion);",
"private static float[] qinv(float[] d, float[] s) {\n \td[0] = s[0];\n \td[1] = -s[1];\n \td[2] = -s[2];\n \td[3] = -s[3];\n \treturn(d);\n }",
"public static void main(String[] args) {\n\t\tint n=scn.nextInt();\r\n\t\tint[] arr=takeinput(n);\r\nint[] ans=Inverse(arr);\r\nfor(int val:ans)\r\n\tSystem.out.println(val);\r\n\t}",
"private void calcPartInverse(int i, int i1, int i2, int i3, int i4, Radical1 op1, Radical1 op2, Radical1 op3, Radical1 op4, Radical1 l1) {\r\n\t\taddR(l1, mulR(values[i], subR(mulR(values[i1], values[i2], op3), mulR(values[i3], values[i4], op4), op2), op1), l1);\r\n\t}",
"public Fp12_2Over3Over2 inverse() {\n final Fp6_3Over2 t0 = c0.square();\n final Fp6_3Over2 t1 = c1.square();\n final Fp6_3Over2 t2 = t0.sub(mulByNonResidue(t1));\n final Fp6_3Over2 t3 = t2.inverse();\n\n return new Fp12_2Over3Over2(c0.mul(t3), c1.mul(t3).negate(), Fp12Parameters);\n }",
"@Test\n public void testInversePrime() {\n final GaloisPrimeField field = new GaloisPrimeField(13);\n final GaloisElement element = field.element(9);\n final GaloisElement inverse = galoisInverse.invert(element);\n Assertions.assertEquals(BigInteger.valueOf(3), inverse.value());\n }",
"public static Matrix inverse(Matrix amat){\r\n \tint n = amat.nrow;\r\n \tif(n!=amat.ncol)throw new IllegalArgumentException(\"Matrix is not square\");\r\n \tdouble[] col = new double[n];\r\n \tdouble[] xvec = new double[n];\r\n \tMatrix invmat = new Matrix(n, n);\r\n \tdouble[][] invarray = invmat.getArrayReference();\r\n \tMatrix ludmat;\r\n\r\n\t \tludmat = amat.luDecomp();\r\n \tfor(int j=0; j<n; j++){\r\n \t\tfor(int i=0; i<n; i++)col[i]=0.0D;\r\n \t\tcol[j]=1.0;\r\n \t\txvec=ludmat.luBackSub(col);\r\n \t\tfor(int i=0; i<n; i++)invarray[i][j]=xvec[i];\r\n \t}\r\n \treturn invmat;\r\n \t}",
"public static double [][] inv(double [][] a) {\n int N = a.length;\n double [] col = new double[N];\n int [] indx = new int[N];\n double [][] y = new double[N][N];\n \n double d = ludcmp(a, indx);\n for (int j=0; j<N; j++ ) {\n for (int i=0; i<N; i++) \n col[i] = 0.0;\n col[j] = 1.0;\n lubksb(a, indx, col);\n for (int i=0; i<N; i++)\n y[i][j] = col[i];\n }\n return y; \n }",
"public static Transform rigidInverse(Transform t) {\n\t\treturn transpose(t.d, -t.c, (t.c * t.ty - t.tx * t.d), -t.b, t.a, (t.tx * t.b - t.a * t.ty));\n\t}",
"public Fraction inverse() {\n return new Fraction (denominator, numerator).reduce();\n }",
"public static Transform inverse(Transform t) {\n\t\tfloat inv_det = 1.0f / (t.a * t.d - t.c * t.b);\n\t\treturn transpose(t.d * inv_det, -t.c * inv_det, (t.c * t.ty - t.tx * t.d) * inv_det, -t.b * inv_det,\n\t\t\t\t\t\t t.a * inv_det, (t.tx * t.b - t.a * t.ty) * inv_det);\n\t}",
"public T pseudoInverse() {\n T ret = createLike();\n ops.pseudoInverse(mat, ret.mat);\n return ret;\n }",
"public double[][] inverse(double[][] X, int n) {\n\t\tdouble[][] adj = adjoint(X, n);\n\t\tdouble[][] inv = new double[n][n];\n\t\tdouble det = determinant(X, n);\n\t\tfor (int i = 0; i < n; i++)\n\t\t\tfor (int j = 0; j < n; j++)\n\t\t\t\tinv[i][j] = adj[i][j] / det;\n\t\treturn inv;\n\t}",
"static int modInverse(int a, int m) \n\t{ \n\t\tint m0 = m; \n\t\tint y = 0, x = 1; \n\t\tif (m == 1) \n\t\t{ \n\t\t\treturn 0; \n\t\t} \n\n\t\twhile (a > 1) \n\t\t{ \n\n\t\t\t// q is quotient \n\t\t\tint q = a / m; \n\t\t\tint t = m; \n\n\t\t\t// m is remainder now, process \n\t\t\t// same as Euclid's algo \n\t\t\tm = a % m; \n\t\t\ta = t; \n\t\t\tt = y; \n\n\t\t\t// Update y and x \n\t\t\ty = x - q * y; \n\t\t\tx = t; \n\t\t} \n\n\t\t// Make x positive \n\t\tif (x < 0) \n\t\t{ \n\t\t\tx += m0; \n\t\t} \n\n\t\treturn x; \n\t}",
"public JamMatrix invert() {\n RealMatrix apacheUT = decomposition.getUT();\n RealMatrix apacheV = decomposition.getV();\n RealMatrix apacheDinv = getApacheDinv();\n\n return JamMatrix.wrap(apacheV.multiply(apacheDinv.multiply(apacheUT)).getData());\n }",
"public void invert()\n {\n assert isComplete;\n \n isInverted = !isInverted;\n }",
"long modInverse(long a, long m) \r\n { \r\n\t\t long m0 = m; \r\n long y = 0, x = 1; \r\n \r\n if (m == 1) \r\n return 0; \r\n \r\n while (a > 1) \r\n { \r\n // q is quotient \r\n \tlong q = a / m; \r\n \r\n \tlong t = m; \r\n \r\n // m is remainder now, process \r\n // same as Euclid's algo \r\n m = a % m; \r\n a = t; \r\n t = y; \r\n \r\n // Update x and y \r\n y = x - q * y; \r\n x = t; \r\n } \r\n \r\n // Make x positive \r\n if (x < 0) \r\n x += m0; \r\n \r\n return x; \r\n }",
"@Override\n public void invert() {\n getInvertibles().parallelStream().forEach(Invertible::invert);\n }",
"public static void main(String[] args) {\n System.out.println(inverseNumber(1595));\n System.out.println(inverseNumber(353));\n System.out.println(inverseNumber(-121));\n System.out.println(inverseNumber(125));\n }",
"@Override\n\t// For extra credit\n\tpublic long analyzeInverse(double[][] m1, double[][] m2) \n\t{\n\t\t// TODO Auto-generated method stub\n\t\treturn 0;\n\t}",
"public static double inverseSquare(double z){ //TODO: This needs a little love. Should probably use the repel method instead.\n boolean positive = z >= 0;\n z += positive? 1:(-1);\n double square = Math.pow(z,2);\n return positive? 1/square:square;\n }",
"public final native Mat4 inverse() /*-{\n return $wnd.mat4.inverse(this, $wnd.mat4.create());\n }-*/;",
"public static double inverseFunction(Double num) {\n// try {\n// return 1 / num;\n// } catch (Exception e) {\n// Console.println(\"Err\");\n// }\n return 1 / num;\n }",
"Matrix inverse(Matrix m){\r\n Matrix mtemp = new Matrix(m.M);\r\n Matrix miden = new Matrix(m.rows,m.cols);\r\n miden = miden.identity();\r\n for(int i=0;i<mtemp.rows-1;i++){\r\n for(int j=i+1; j<mtemp.rows; j++){\r\n if(mtemp.M[i][i]<mtemp.M[j][i]){\r\n swapRow(mtemp,i,j);\r\n swapRow(miden,i,j);\r\n }\r\n }\r\n for(int k=i+1; k<mtemp.rows; k++){\r\n double ratio = mtemp.M[k][i]/mtemp.M[i][i];\r\n for(int j=0;j<mtemp.cols;j++){\r\n mtemp.M[k][j] -= ratio*mtemp.M[i][j];\r\n miden.M[k][j] -= ratio*miden.M[i][j];\r\n }\r\n\r\n }\r\n\r\n }\r\n for(int i=mtemp.rows-1;i>0;i--){\r\n for(int k=i-1; k>-1; k--){\r\n double ratio = mtemp.M[k][i]/mtemp.M[i][i];\r\n for(int j=mtemp.cols-1;j>-1;j--){\r\n mtemp.M[k][j] -= ratio*mtemp.M[i][j];\r\n miden.M[k][j] -= ratio*miden.M[i][j];\r\n }\r\n\r\n }\r\n\r\n }\r\n \r\n\r\n for(int i=0; i<mtemp.rows; i++){\r\n for(int j=0; j<mtemp.cols; j++){\r\n miden.M[i][j] /= mtemp.M[i][i];\r\n }\r\n }\r\n return miden;\r\n\r\n }",
"@Test\n public void testInverseStressPrime() {\n final GaloisPrimeField field = new GaloisPrimeField(15_485_863);\n final GaloisElement element = field.element(1_000_000);\n final GaloisElement inverse = galoisInverse.invert(element);\n Assertions.assertEquals(BigInteger.valueOf(2_540_812), inverse.value());\n }",
"public Matrix getInversematrixS()\n {\n // Build alpha * I\n double [][] alphainvmatrix;\n alphainvmatrix = new double[x + 1][x + 1];\n for(int i = 0; i < x + 1; i++)\n {\n alphainvmatrix[i][i] = alpha;\n\n }\n Matrix alphamatrixnew = new Matrix(alphainvmatrix);\n\n // calculate summation\n Matrix sum = new Matrix(x + 1, 1);\n int i = 1;\n while (i <= arraylistofprices.size() - 1) {\n phimatrix(i);\n\n sum.plusEquals(phi);\n\n i++;\n }\n Matrix summation = sum.times(phiT);\n summation.timesEquals(beta); \n\n // alpha * I + beta * sum\n Matrix sInv = alphamatrixnew.plus(summation);\n return sInv;\n }",
"public void inverse(Projection projection);",
"public ImmutableBiMap<V, K> inverse() {\n/* 246 */ ImmutableBiMap<V, K> result = this.inverse;\n/* 247 */ return (result == null) ? (this.inverse = new Inverse()) : result;\n/* */ }",
"<T> void inverse(final T[] array);",
"public void invert() {\n \n for(T first : getFirstDimension()) {\n \n for(T second : getMatches(first)) {\n \n Double sim = get(first, second);\n \n if(sim!=null && sim > 0.0) {\n set(first, second, 1.0/sim);\n }\n \n }\n \n }\n }",
"public Inverse(int m, int n) \n { \n super(m, n); \n }",
"public Index invert() {\n \t\tint n=length();\n \t\tIndex ni=new Index(n);\n \t\tfor (int i=0; i<n; i++) {\n \t\t\tni.set(this.get(i), i);\n \t\t}\n \t\treturn ni;\n \t}",
"public static void InverseA(double pos_x1, double pos_x2, double pos_x3, double pos_y1, double pos_y2, double pos_y3, double fX, double fY, double fZ,\n double tX, double tY, double tZ, double h11, double h21, double k1, double h12, double h22, double k2, double h13, double h23,\n double k3, YoDouble fx1, YoDouble fz1, YoDouble fx2, YoDouble fy2, YoDouble fz2, YoDouble fz3)\n\n {\n double s42, s44, s45, s46, s51, s52;\n double s53, s55, s56, s61, s63, s64;\n\n double t11, t12, t16;\n double t21, t22, t23, t24, t25, t26;\n double t31, t32, t36;\n double t42;\n double t51, t52, t53, t54, t55, t56;\n double t61, t62, t63, t64, t65, t66;\n\n double cd;\n\n s42 = (pos_y1 + AgileHexapodRobot.LEN * Math.cos(h21) * (Math.sin(h11 + k1) + Math.sin(h11)));\n s44 = (-2.0 * AgileHexapodRobot.LEN * Math.sin(h11) * Math.sin(k1) - AgileHexapodRobot.LEN * Math.sin(h12) * Math.sin(k2)\n - AgileHexapodRobot.LEN * Math.sin(h13) * Math.sin(k3) + AgileHexapodRobot.LEN * Math.cos(h12) * (Math.cos(k2) + 1)\n + AgileHexapodRobot.LEN * Math.cos(h13) * (Math.cos(k3) + 1) + 2.0 * AgileHexapodRobot.LEN * Math.cos(h11) * (Math.cos(k1) + 1));\n s45 = (pos_y2 + AgileHexapodRobot.LEN * Math.cos(h22) * (Math.sin(h12 + k2) + Math.sin(h12)));\n s46 = (pos_y3 + AgileHexapodRobot.LEN * Math.cos(h23) * (Math.sin(h13 + k3) + Math.sin(h13)));\n s51 = (-AgileHexapodRobot.LEN * Math.cos(h11 + k1) - AgileHexapodRobot.LEN * Math.cos(h11));\n s52 = (-pos_x1 + AgileHexapodRobot.LEN * Math.sin(h21) * (Math.sin(h11 + k1) + Math.sin(h11)));\n s53 = (AgileHexapodRobot.LEN * Math.cos(h12) * (-Math.cos(k2) - 1) + AgileHexapodRobot.LEN * Math.cos(h13) * (-Math.cos(k3) - 1)\n + AgileHexapodRobot.LEN * Math.sin(h12) * Math.sin(k2) + AgileHexapodRobot.LEN * Math.sin(h13) * Math.sin(k3));\n s55 = (-pos_x2 + AgileHexapodRobot.LEN * Math.sin(h22) * (Math.sin(h12) * (Math.cos(k2) + 1) + Math.cos(h12) * Math.sin(k2)));\n s56 = (-pos_x3 + AgileHexapodRobot.LEN * Math.sin(h23) * (Math.sin(h13 + k3) + Math.sin(h13)));\n s61 = (-pos_y1 - AgileHexapodRobot.LEN * Math.cos(h21) * (Math.sin(h11 + k1) + Math.sin(h11)));\n s63 = (-pos_y2 - pos_y3 - AgileHexapodRobot.LEN * Math.cos(h22) * (Math.sin(h12 + k2) + Math.sin(h12))\n - AgileHexapodRobot.LEN * Math.cos(h23) * (Math.sin(h13 + k3) + Math.sin(h13)));\n s64 = (2.0 * pos_x1 + pos_x2 + pos_x3 - 2.0 * AgileHexapodRobot.LEN * Math.sin(h21) * (Math.sin(h11 + k1) + Math.sin(h11))\n - AgileHexapodRobot.LEN * Math.sin(h22) * (Math.sin(h12 + k2) + Math.sin(h12))\n - AgileHexapodRobot.LEN * Math.sin(h23) * (Math.sin(h13 + k3) + Math.sin(h13)));\n\n DET.set((4.0 * s63 - 8.0 * s61) * (s42 * (s55 - s56) + s45 * (-s52 + s56) + s46 * (s52 - s55)));\n\n if ((DET.getDoubleValue() > -0.001) && (DET.getDoubleValue() < 0.0))\n DET.set(-0.001);\n if ((DET.getDoubleValue() < 0.001) && (DET.getDoubleValue() > 0.0))\n DET.set(0.001);\n\n cd = 4.0 * s63 - 8.0 * s61;\n\n t11 = (4.0 * s63 * DET.getDoubleValue()) / (cd);\n t12 = (2.0 * s64 * DET.getDoubleValue()) / (cd);\n t16 = (-8.0 * DET.getDoubleValue()) / (cd);\n\n t21 = 4.0 * (s53 * s61 - s51 * s63) * (s46 - s45);\n t22 = s51 * s64 * (-2.0 * s46 + 2.0 * s45) + s53 * s64 * (-s45 + s46) + s55 * s44 * (-s63 + 2.0 * s61) + s56 * s44 * (-2.0 * s61 + s63);\n t23 = cd * (s45 * s56 - s46 * s55);\n t24 = cd * (s55 - s56);\n t25 = cd * (-s45 + s46);\n t26 = (4.0 * s53 - 8.0 * s51) * (s45 - s46);\n\n t31 = (-4.0 * s61 * DET.getDoubleValue()) / (cd);\n t32 = (-s64 * DET.getDoubleValue()) / (cd);\n t36 = (4.0 * DET.getDoubleValue()) / (cd);\n\n t42 = DET.getDoubleValue() / 4.0;\n\n t51 = 4.0 * (s46 - s42) * (s51 * s63 - s61 * s53);\n t52 = (2.0 * s51 - s53) * (-s42 * s64 + s46 * s64) + (2.0 * s61 - s63) * (s56 * s44 - s52 * s44);\n t53 = cd * (-s42 * s56 + s46 * s52);\n t54 = cd * (s56 - s52);\n t55 = cd * (-s46 + s42);\n t56 = (4.0 * s53 - 8.0 * s51) * (s46 - s42);\n\n t61 = 4.0 * (s63 * s51 - s61 * s53) * (s42 - s45);\n t62 = (2.0 * s51 - s53) * (-s45 * s64 + s42 * s64) + (2.0 * s61 - s63) * (s52 * s44 - s55 * s44);\n t63 = cd * (s42 * s55 - s45 * s52);\n t64 = cd * (s52 - s55);\n t65 = cd * (s45 - s42);\n t66 = (8.0 * s51 - 4.0 * s53) * (s45 - s42);\n\n\n fx1.set((1.0 / DET.getDoubleValue()) * (t11 * fX + t12 * fY + t16 * tZ));\n fz1.set((1.0 / DET.getDoubleValue()) * (t21 * fX + t22 * fY + t23 * fZ + t24 * tX + t25 * tY + t26 * tZ));\n fx2.set((1.0 / DET.getDoubleValue()) * (t31 * fX + t32 * fY + t36 * tZ));\n fy2.set((1.0 / DET.getDoubleValue()) * (t42 * fY));\n fz2.set((1.0 / DET.getDoubleValue()) * (t51 * fX + t52 * fY + t53 * fZ + t54 * tX + t55 * tY + t56 * tZ));\n fz3.set((1.0 / DET.getDoubleValue()) * (t61 * fX + t62 * fY + t63 * fZ + t64 * tX + t65 * tY + t66 * tZ));\n\n\n /* test it */\n\n /*\n * ls.sminv_err_1 = (*fx1) + 2.0* (*fx2) - fX;\n * ls.sminv_err_2 = 4.0 * (*fy2) - fY;\n * ls.sminv_err_3 = (*fz1) + (*fz2) + (*fz3) - fZ;\n *\n * ls.sminv_err_4 = s42*(*fz1) + s44*(*fy2) + s45*(*fz2) + s46*(*fz3) - tX;\n * ls.sminv_err_5 = s51*(*fx1) + s52*(*fz1) + s53*(*fx2) + s55*(*fz2) + s56*(*fz3) - tY;\n * ls.sminv_err_6 = s61*(*fx1) + s63*(*fx2) + s64*(*fy2) - tZ;\n */\n\n }",
"public Matrix opposite(){\r\n \tMatrix opp = Matrix.copy(this);\r\n \tfor(int i=0; i<this.nrow; i++){\r\n \t\tfor(int j=0; j<this.ncol; j++){\r\n \t\topp.matrix[i][j]=-this.matrix[i][j];\r\n \t\t}\r\n \t}\r\n \treturn opp;\r\n \t}",
"public void invert() throws NoninvertibleTransform3DException {\r\n\t\tthis.set(getInverse());\r\n\t}",
"public void cinv_() {\n TH.THTensor_(cinv)(this, this);\n }",
"public NumberType inverse(\n final double probability );",
"public final void invert(Matrix4rad toInvert) {\r\n\t\tthis.set(toInvert);\r\n\t\tinvert();\r\n\t}",
"public void invert() {\n int len= currentIm.getRows() * currentIm.getCols();\n \n // invert all pixels (leave alpha/transparency value alone)\n \n // invariant: pixels 0..p-1 have been complemented.\n for (int p= 0; p < len; p= p+1) {\n int rgb= currentIm.getPixel(p);\n int red= 255 - DM.getRed(rgb);\n int blue= 255 - DM.getBlue(rgb);\n int green= 255 - DM.getGreen(rgb);\n int alpha= DM.getAlpha(rgb);\n currentIm.setPixel(p,\n (alpha << 24) | (red << 16) | (green << 8) | blue);\n }\n }",
"public static long modInverse(long a, long m) {\n a = mod(a, m);\n return a == 0 ? 0 : mod((1 - modInverse(m % a, a) * m) / a, m);\n }",
"Vec inverseFilter(DMatrixRMaj H, double V, DMatrixRMaj Cnew) {\n CommonOps_DDRM.mult(helix.C, H, tempV);\n double denom = -V + CommonOps_DDRM.dot(H, tempV);\n CommonOps_DDRM.scale(1.0/denom, helix.C, tempM);\n DMatrixRMaj Kstar = new DMatrixRMaj(5,1);\n CommonOps_DDRM.mult(tempM, H, Kstar); // Kalman gain matrix\n\n CommonOps_DDRM.scale(r, Kstar, tempV);\n Vec aNew = helix.a.sum(mToVec(tempV));\n directProd(Kstar, H, tempM);\n CommonOps_DDRM.scale(-1.0, tempM);\n CommonOps_DDRM.addEquals(tempM, U);\n CommonOps_DDRM.mult(tempM, helix.C, Cnew);\n if (debug) {\n System.out.format(\"StateVector.inverseFilter: V=%12.4e, denom=%12.4e\\n\", V, denom);\n helix.a.print(\"old helix\");\n aNew.print(\" new helix in StateVector.inverseFilter\");\n }\n return aNew;\n }",
"@Override\n public void visit(P_Inverse inversePath) {\n engine.flipDirection() ;\n engine.eval(inversePath.getSubPath(), node, output) ;\n engine.flipDirection() ;\n }",
"public CubieCube inverseCube() {\n\n CubieCube clone = this.clone();\n for (int i = 0; i < edgesValues.length; i++) {\n clone.eo[i] = this.eo[clone.ep[i]];\n }\n for (int i = 0; i < cornerValues.length; i++) {\n char ori = this.co[clone.cp[i]];\n if (ori >= 3)\n clone.co[i] = ori;\n else {\n clone.co[i] = (char) -ori;\n if (clone.co[i] < 0)\n clone.co[i] += 3;\n }\n }\n return clone;\n }",
"public Matrix getInverse() throws InvalidMoveException {\r\n Matrix temp = null;\r\n double determinant = this.getDeterminant();\r\n\r\n if (determinant == 0) {\r\n throw new InvalidMoveException(\"The matrix are singular, and doesn't have any inverse.\");\r\n }\r\n\r\n // getting the cofactor matrix\r\n try {\r\n temp = this.getCofactor();\r\n\r\n } catch (IndexOutOfBoundsException e) {\r\n // actually this will never happened when we're the one who\r\n // handles the code.\r\n }\r\n // transpose it.\r\n temp.transpose();\r\n\r\n // multiply it with the determinant.\r\n temp.multiply(1 / determinant);\r\n return temp;\r\n }",
"public void setInverted(boolean inv) {\n/* 69 */ int dat = getData() & 0x7;\n/* 70 */ if (inv) {\n/* 71 */ dat |= 0x8;\n/* */ }\n/* 73 */ setData((byte)dat);\n/* */ }",
"@Test\n public void testBuildInverse() {\n System.out.println(\"buildInverse\");\n int xIndex = 2;\n int yIndex = 5;\n String input1 = \"6 3 1 6 5 -2 4\";\n String input2 = \"6 3 1 6 5 -2 4\";\n CCGeneticDrift instance = new CCGeneticDrift();\n List<Integer> permutation = instance.inputStringToIntegerList(input1);\n String expResult = \"[6, 3, 1, 2, -5, -6, 4]\";\n List result = instance.buildInverse(permutation, xIndex, yIndex);\n assertEquals(result.toString(), expResult);\n }",
"@Override\n\tpublic void vInv() {\n\t\t\n\t}",
"public final void invert(Matrix3f m1) {\n\tset(m1);\n\tinvert();\n }",
"public final void negate() {\n \n \tthis.m00 = -this.m00;\n \tthis.m01 = -this.m01;\n \tthis.m02 = -this.m02;\n this.m10 = -this.m10;\n this.m11 = -this.m11;\n this.m12 = -this.m12;\n this.m20 = -this.m20;\n this.m21 = -this.m21;\n this.m22 = -this.m22;\n }",
"void invertAllBits();",
"public int inverse(int x ) {\n\t\treturn exp[max_value - log[x]];\n\t}",
"public AffineTransform3D getInverse()\r\n\t\t\tthrows NoninvertibleTransform3DException {\r\n\t\tAffineTransform3D inverseMat = new AffineTransform3D();\r\n\t\tdouble Det = getDeterminant();\r\n\r\n\t\tif (Det == 0) {\r\n\t\t\tthrow new NoninvertibleTransform3DException();\r\n\t\t}\r\n\t\tAffineTransform3D rv = new AffineTransform3D();\r\n\t\trv.M11 = (M23 * M34 * M42) - (M24 * M33 * M42) + (M24 * M32 * M43)\r\n\t\t\t\t- (M22 * M34 * M43) - (M23 * M32 * M44) + (M22 * M33 * M44);\r\n\t\trv.M12 = (M14 * M33 * M42) - (M13 * M34 * M42) - (M14 * M32 * M43)\r\n\t\t\t\t+ (M12 * M34 * M43) + (M13 * M32 * M44) - (M12 * M33 * M44);\r\n\t\trv.M13 = (M13 * M24 * M42) - (M14 * M23 * M42) + (M14 * M22 * M43)\r\n\t\t\t\t- (M12 * M24 * M43) - (M13 * M22 * M44) + (M12 * M23 * M44);\r\n\t\trv.M14 = (M14 * M23 * M32) - (M13 * M24 * M32) - (M14 * M22 * M33)\r\n\t\t\t\t+ (M12 * M24 * M33) + (M13 * M22 * M34) - (M12 * M23 * M34);\r\n\t\trv.M21 = (M24 * M33 * M41) - (M23 * M34 * M41) - (M24 * M31 * M43)\r\n\t\t\t\t+ (M21 * M34 * M43) + (M23 * M31 * M44) - (M21 * M33 * M44);\r\n\t\trv.M22 = (M13 * M34 * M41) - (M14 * M33 * M41) + (M14 * M31 * M43)\r\n\t\t\t\t- (M11 * M34 * M43) - (M13 * M31 * M44) + (M11 * M33 * M44);\r\n\t\trv.M23 = (M14 * M23 * M41) - (M13 * M24 * M41) - (M14 * M21 * M43)\r\n\t\t\t\t+ (M11 * M24 * M43) + (M13 * M21 * M44) - (M11 * M23 * M44);\r\n\t\trv.M24 = (M13 * M24 * M31) - (M14 * M23 * M31) + (M14 * M21 * M33)\r\n\t\t\t\t- (M11 * M24 * M33) - (M13 * M21 * M34) + (M11 * M23 * M34);\r\n\t\trv.M31 = (M22 * M34 * M41) - (M24 * M32 * M41) + (M24 * M31 * M42)\r\n\t\t\t\t- (M21 * M34 * M42) - (M22 * M31 * M44) + (M21 * M32 * M44);\r\n\t\trv.M32 = (M14 * M32 * M41) - (M12 * M34 * M41) - (M14 * M31 * M42)\r\n\t\t\t\t+ (M11 * M34 * M42) + (M12 * M31 * M44) - (M11 * M32 * M44);\r\n\t\trv.M33 = (M12 * M24 * M41) - (M14 * M22 * M41) + (M14 * M21 * M42)\r\n\t\t\t\t- (M11 * M24 * M42) - (M12 * M21 * M44) + (M11 * M22 * M44);\r\n\t\trv.M34 = (M14 * M22 * M31) - (M12 * M24 * M31) - (M14 * M21 * M32)\r\n\t\t\t\t+ (M11 * M24 * M32) + (M12 * M21 * M34) - (M11 * M22 * M34);\r\n\t\trv.M41 = (M23 * M32 * M41) - (M22 * M33 * M41) - (M23 * M31 * M42)\r\n\t\t\t\t+ (M21 * M33 * M42) + (M22 * M31 * M43) - (M21 * M32 * M43);\r\n\t\trv.M42 = (M12 * M33 * M41) - (M13 * M32 * M41) + (M13 * M31 * M42)\r\n\t\t\t\t- (M11 * M33 * M42) - (M12 * M31 * M43) + (M11 * M32 * M43);\r\n\t\trv.M43 = (M13 * M22 * M41) - (M12 * M23 * M41) - (M13 * M21 * M42)\r\n\t\t\t\t+ (M11 * M23 * M42) + (M12 * M21 * M43) - (M11 * M22 * M43);\r\n\t\trv.M44 = (M12 * M23 * M31) - (M13 * M22 * M31) + (M13 * M21 * M32)\r\n\t\t\t\t- (M11 * M23 * M32) - (M12 * M21 * M33) + (M11 * M22 * M33);\r\n\r\n\t\tDet = (1 / getDeterminant());\r\n\t\tinverseMat = ScalarMult(new AffineTransform3D(), Det); // MatrixScaling4(VectorInput(Det,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Det, Det),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Det)\r\n\t\trv = MatrixMult(rv, inverseMat);\r\n\t\treturn rv;\r\n\t}",
"public static Direction inverse(Direction direction) {\n if (direction.isHorizontal()) {\n if (direction.equals(Direction.EAST))\n return Direction.WEST;\n else\n return Direction.EAST;\n } else {\n if (direction.equals(Direction.NORTH))\n return Direction.SOUTH;\n else\n return Direction.NORTH;\n }\n }",
"public Matriks Inverse(Matriks M){\r\n\t\tMatriks Minv = M.MatriksCofactor(M);\r\n\t\tMinv = Minv.Transpose();\r\n\t\tdouble det = M.DetCofactor(M);\r\n\t\tint sign = 1;\r\n\t\tfor(int i=0; i<BrsEff;i++){\r\n\t\t\tfor(int j=0; j<KolEff; j++){\r\n\t\t\t\tMinv.Elmt[i][j] = sign*(1/det)*Minv.Elmt[i][j];\r\n\t\t\t\tsign *= -1;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn Minv;\r\n\t}",
"public void setInverseOutput(boolean inverseOutput) {\r\n\t\tthis.inverseOutput = inverseOutput;\r\n\t}",
"@Override\n public Optional<Curve> inverse() {\n Optional<Curve> invF = f.inverse();\n Optional<Curve> invG = g.inverse();\n\n if (invF.isPresent() && invG.isPresent()) {\n return Optional.of(new ComposedCurve(invF.get(), invG.get()));\n } else {\n return Optional.empty();\n }\n }",
"public static void inverseTransform() {\n int first = BinaryStdIn.readInt();\n String st = BinaryStdIn.readString();\n char[] t1 = st.toCharArray();\n int length = t1.length;\n\n int[] count = new int[R + 1];\n int[] next = new int[length];\n\n for (int i = 0; i < length; i++)\n count[t1[i] + 1]++;\n for (int r = 0; r < R; r++)\n count[r + 1] += count[r];\n for (int i = 0; i < length; i++)\n next[count[t1[i]]++] = i;\n\n\n for (int i = 0; i < length; i++) {\n first = next[first];\n BinaryStdOut.write(t1[first]);\n\n }\n BinaryStdOut.close();\n }",
"public void setInvert (boolean invert) {\r\n\t\tthis.invert = invert;\r\n\t}",
"public T invert() {\n T ret = createLike();\n\n if (!ops.invert(mat, ret.mat))\n throw new SingularMatrixException();\n if (ops.hasUncountable(ret.mat))\n throw new SingularMatrixException(\"Solution contains uncountable numbers\");\n\n return ret;\n }",
"public boolean isInverted() {\n/* 59 */ return ((getData() & 0x8) != 0);\n/* */ }",
"int invert(int c) {\n int index = wrap(c);\n if (_inverse != null && _inverse.containsKey(index)) {\n return _inverse.get(index);\n } else {\n return index;\n }\n }",
"public static void invert(int[] a) {\r\n\t\tint n = a.length;\r\n\t\tint j = n - 1;\r\n\t\tfor (int i = 0; i < j; i++) {\r\n\t\t\tint tmp = a[i];\r\n\t\t\ta[i] = a[j];\r\n\t\t\ta[j] = tmp;\r\n\t\t\tj--;\r\n\t\t}\r\n\t}",
"public static Matrix opposite(Matrix amat){\r\n \tMatrix opp = Matrix.copy(amat);\r\n \tfor(int i=0; i<amat.nrow; i++){\r\n \t\tfor(int j=0; j<amat.ncol; j++){\r\n \t\topp.matrix[i][j]=-amat.matrix[i][j];\r\n \t\t}\r\n \t}\r\n \treturn opp;\r\n \t}",
"public static double invert(double x){\n\t\tif (x == 0)\n\t\t\treturn 1;\n\t\treturn 0;\n\t}",
"public double[] SPLInverse(Matriks A, Matriks B){\r\n\t\tMatriks temp = A.KaliMatriks(A.Inverse(A), B);\r\n\t\tdouble[] result = new double[temp.BrsEff];\r\n\r\n\t\tfor(int i=0; i<temp.BrsEff; i++){\r\n\t\t\tresult[i] = temp.Elmt[i][0];\r\n\t\t}\r\n\r\n\t\treturn result;\r\n\t}",
"@Deprecated\n public static EquationExpression inverse(EquationExpression x) {\n return x.getInverse();\n }",
"public static void ArrayInverso(int[] arr){\r\n\t\t\t\t\r\n\t\tint l=arr.length;\r\n\t\tint[] arr_inv = new int[l];\r\n\t\tfor (int i=0;i<l;i++){\r\n\t\tarr_inv[i]=arr[l-1-i];\r\n\t\tSystem.out.println(\"\\n array iniziale [\" + arr[i] + \"]\\n array invertito [\" + arr_inv[i] + \"]\");\r\n\t\t}\r\n\t\t\r\n\t\r\n\t}",
"private void invertStreets() {\n this.canCross = !this.canCross;\n String calleAux = this.calleVerde;\n this.calleVerde = this.calleRojo;\n this.calleRojo = this.calleVerde;\n }",
"public Vector3 invert()\n {\n this.scale(-1);\n return this;\n }",
"public Vector2f negateLocal ()\n {\n return negate(this);\n }",
"@Deprecated\n\tpublic static EquationExpression inverse(EquationExpression x) {\n\t\treturn x.getInverse();\n\t}",
"public Couleur obtenirCouleurInverse()\n\t{\n\t\tif (this == BLANC)\n\t\t\treturn NOIR;\n\t\treturn BLANC;\n\t}",
"public HashMap<Type, Double> getInversePossibilities() {\r\n\t\tHashMap<Type, Double> ret = new HashMap<Type, Double>();\r\n\t\tfor (Type t : Type.values()) ret.put(t, 0.0);\r\n\t\tfor (Type t : types) {\r\n\t\t\t//??? IS THIS CORRECT ??? --> Seems correct\r\n\t\t\t//get inverse of each relation that is 1.0 \r\n\t\t\tType inverseRelation = FuzzyAllenIntervalConstraint.getInverseRelation(t);\r\n\t\t\t\r\n\t\t\tHashMap<FuzzyAllenIntervalConstraint.Type, Double> possibilities = this.getPossibilities();\r\n\t\t\t\r\n\t\t\t//set poss of each inverse relation to 1.0\r\n\t\t\tret.put(inverseRelation, possibilities.get(t));\r\n\t\t\t\r\n\t\t\t//calculate the Freksa N of each inverse relation\r\n\t\t\tHashMap<FuzzyAllenIntervalConstraint.Type, Double> fr = new HashMap<FuzzyAllenIntervalConstraint.Type, Double>();\r\n\t\t\tfor(int i = 0; i < FuzzyAllenIntervalConstraint.freksa_neighbor[inverseRelation.ordinal()].length; i++)\r\n\t\t\t\tfr.put(FuzzyAllenIntervalConstraint.lookupTypeByInt(i), FuzzyAllenIntervalConstraint.getPossibilityDegree(FuzzyAllenIntervalConstraint.freksa_neighbor[inverseRelation.ordinal()][i]));\r\n\t\t\t\r\n\t\t\t//take the maximum between calculated Freksa N and previously added possibilities\r\n\t\t\t//(because this is an OR)\r\n\t\t\tfor(FuzzyAllenIntervalConstraint.Type t1: fr.keySet())\r\n\t\t\t\tret.put(t1, Math.max(ret.get(t1), fr.get(t1)));\r\n\t\t}\r\n\t\t\r\n\t\t/*\r\n\t\tSystem.out.println(\"=====================================\");\r\n\t\tSystem.out.println(\"DIRECT \" + this + \":\\n\" + this.possibilities);\r\n\t\tSystem.out.println(\"INVERSE:\\n\" + ret);\r\n\t\tSystem.out.println(\"=====================================\");\r\n\t\t*/\r\n\t\t\r\n\t\treturn ret;\r\n\t}",
"public abstract O reciprocal();",
"static int[] getInverseOrder(int[] values) {\n if (values == null) {\n return null;\n }\n\n int[] result = new int[values.length];\n for (int i = 0; i < values.length; i++) {\n result[values[i]] = i;\n }\n\n return result;\n }",
"protected double[] negate(ColumnVector vector) {\r\n double[] v = vector.getVector();\r\n for(int i = 0; i < v.length; i++) {\r\n v[i] *= -1.0;\r\n }\r\n return v;\r\n }",
"public Squarelotron inverseDiagonalFlip(int ring);",
"public static short[][] inverseModQ(short[][] entries, short q) {\n\n if (Arithmetic.isPrime(q)) {\n int dimension = entries.length;\n\n /*\n if (dimension == 0) {\n return null;\n }\n if (entries[0].length != dimension) {\n return null;\n }\n*/\n short[][] entriesCopy = new short[dimension][dimension];\n for (int i = 0; i < dimension; i++) {\n System.arraycopy(entries[i], 0, entriesCopy[i], 0, dimension);\n }\n\n short[][] inv = new short[dimension][dimension];\n for (int i = 0; i < dimension; i++) {\n for (int j = 0; j < dimension; j++) {\n if (i == j) {\n inv[i][j] = 1;\n } else {\n inv[i][j] = 0;\n }\n }\n }\n\n\n for (int k = 0; k < dimension; k++) {\n\n if (entriesCopy[k][k] == 0) { //switch rows; return 0 if not possible\n boolean notFound = true;\n for (int j = k + 1; j < dimension && notFound; j++) {\n if (entriesCopy[j][k] != 0) {\n notFound = false;\n short[] temp = new short[dimension];\n System.arraycopy(entriesCopy[j], 0, temp, 0, dimension);\n System.arraycopy(entriesCopy[k], 0, entriesCopy[j], 0, dimension);\n System.arraycopy(temp, 0, entriesCopy[k], 0, dimension);\n temp = new short[dimension];\n System.arraycopy(inv[j], 0, temp, 0, dimension);\n System.arraycopy(inv[k], 0, inv[j], 0, dimension);\n System.arraycopy(temp, 0, inv[k], 0, dimension);\n }\n }\n if (notFound) {\n return null;\n }\n }\n\n short dInv = Arithmetic.findInverse(entriesCopy[k][k], q);\n for (int l = 0; l < dimension; l++) {\n entriesCopy[k][l] = Arithmetic.reducedProduct(dInv, entriesCopy[k][l], q);\n inv[k][l] = Arithmetic.reducedProduct(dInv, inv[k][l], q);\n }\n\n for (int j = 0; j < dimension; j++) { //add - a[j][k] * a[k][k]^(-1) times kth row to the jth row\n if (j != k) {\n short factor = Arithmetic.reduce(-entriesCopy[j][k], q);// * dInv;\n for (int l = 0; l < dimension; l++) {\n entriesCopy[j][l] = Arithmetic.reducedSum(entriesCopy[j][l], Arithmetic.reducedProduct(factor, entriesCopy[k][l], q), q);\n inv[j][l] = Arithmetic.reducedSum(inv[j][l], Arithmetic.reducedProduct(factor, inv[k][l], q), q);\n //System.out.print(\"inv[\" + j + \"][\" +l + \"] = \" + inv[j][l] + \" \");\n }\n }\n }\n }\n return inv;\n }\n return null;\n }",
"public boolean isInversed() {\n return isinv != null && isinv.booleanValue();\n }",
"public JTensor cinv() {\n JTensor r = new JTensor();\n TH.THTensor_(cinv)(r, this);\n return r;\n }"
] | [
"0.7458774",
"0.7228451",
"0.71970034",
"0.7145124",
"0.70881134",
"0.7022031",
"0.6991155",
"0.69871885",
"0.698636",
"0.6964465",
"0.69350886",
"0.69276834",
"0.691758",
"0.6877991",
"0.68166804",
"0.67834973",
"0.6755819",
"0.6730349",
"0.66992104",
"0.6621614",
"0.6610418",
"0.65679",
"0.6562399",
"0.6558438",
"0.65570194",
"0.6544331",
"0.6528258",
"0.65279543",
"0.65173537",
"0.6469209",
"0.6452427",
"0.64515924",
"0.64513767",
"0.6399655",
"0.6380978",
"0.63430315",
"0.63332146",
"0.63231975",
"0.6320841",
"0.63191724",
"0.6300346",
"0.6298152",
"0.6285292",
"0.62848157",
"0.6274259",
"0.6268319",
"0.62595135",
"0.62561023",
"0.623177",
"0.6216975",
"0.6214256",
"0.6201069",
"0.618104",
"0.6120272",
"0.6104559",
"0.61029744",
"0.6095907",
"0.6087012",
"0.60826916",
"0.6062451",
"0.6023661",
"0.6014642",
"0.5985257",
"0.5984594",
"0.5958619",
"0.59508777",
"0.5949533",
"0.59284157",
"0.5911883",
"0.59113437",
"0.5910161",
"0.5907608",
"0.58878225",
"0.5858377",
"0.5853569",
"0.5849675",
"0.5829167",
"0.5822301",
"0.58197",
"0.58133936",
"0.5803892",
"0.5799345",
"0.5764365",
"0.57604104",
"0.5749295",
"0.5747397",
"0.57406",
"0.57226497",
"0.5719073",
"0.5710271",
"0.57061905",
"0.57061315",
"0.5705647",
"0.56869173",
"0.5659564",
"0.56562525",
"0.5636544",
"0.56214577",
"0.5604215",
"0.5601926",
"0.5582242"
] | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public void prepare() {
System.out.println("i am in ShanTou,i like the pork,so i add the pork");
} | {
"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 |
To fight color banding. | private void init(int color) {
getWindow().setFormat(PixelFormat.RGBA_8888);
setUp(color);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void initColors() {\n\n int i;\n float j;\n\n int start;\n int numShades = 5;\n float shadeInc = 1 / (float) numShades;\n\n\n aColors = new Color[glb.MAXCOLORS]; /* set array size */\n\n\n /* White to Black */\n start = 0;\n for (i = start, j = 1; i < start + 6; j -= shadeInc, i++) {\n aColors[i] = new Color(j, j, j);\n }\n\n start = 6;\n /* Red to almost Magenta */\n for (i = start, j = 0; i < start + 5; j += shadeInc, i++) {\n aColors[i] = new Color((float) 1, (float) 0, j);\n }\n\n\n /* Magenta to almost Blue */\n start += 5;\n for (i = start, j = 1; i < start + 5; j -= shadeInc, i++) {\n aColors[i] = new Color(j, (float) 0, (float) 1);\n }\n\n\n /* Blue to almost Cyan */\n start += 5;\n for (i = start, j = 0; i < start + 5; j += shadeInc, i++) {\n aColors[i] = new Color((float) 0, j, (float) 1);\n }\n\n /* Cyan to almost Green */\n start += 5;\n for (i = start, j = 1; i < start + 5; j -= shadeInc, i++) {\n aColors[i] = new Color((float) 0, (float) 1, j);\n }\n\n\n\n /* Green to almost Yellow */\n start += 5;\n for (i = start, j = 0; i < start + 5; j += shadeInc, i++) {\n aColors[i] = new Color(j, (float) 1, (float) 0);\n }\n\n /* Yellow to almost Red */\n start += 5;\n for (i = start, j = 1; i < start + 5; j -= shadeInc, i++) {\n aColors[i] = new Color((float) 1, j, (float) 0);\n }\n\n }",
"public void speckle() {\n\t\tint r = (height / res) - 1;\n\t\tint c = (width / res);\n\t\tfor (int i = 0; i < c; i++)\t\t{\n\t\t\tint x = rng.nextInt(25);\t\t\t\n\t\t\tif (x == 0) { // 1/25 chance of changing bottom row pixel to black\t \n\t\t\t\tvalues[r][i] = color1;\t\t\t\t\n\t\t\t}\n\t\t\telse if (x == 1) { // 1/25 chance of changing bottom row pixel to white\n\t\t\t\tvalues[r][i] = color2;\n\t\t\t}\n\t\t\t// 23/25 chance of leaving bottom pixel alone\n\t\t}\n\t}",
"private void green(){\n\t\tthis.arretes_fG();\n\t\tthis.coins_fG();\n\t\tthis.coins_a1G();\n\t\tthis.coins_a2G();\n\t\tthis.aretes_aG();\n\t\tthis.cube[31] = \"G\";\n\t}",
"private void blue(){\n\t\tthis.arretes_fB();\n\t\tthis.coins_fB();\n\t\tthis.coins_a1B();\n\t\tthis.coins_a2B();\n\t\tthis.aretes_aB();\n\t\tthis.cube[22] = \"B\";\n\t}",
"public void k() {\n float f2 = BitmapDescriptorFactory.HUE_RED;\n for (float f3 : this.i) {\n if (f3 > BitmapDescriptorFactory.HUE_RED) {\n f2 += f3;\n }\n }\n if (f2 != BitmapDescriptorFactory.HUE_RED) {\n int length = this.i.length;\n for (int i2 = 0; i2 < length; i2++) {\n float[] fArr = this.i;\n if (fArr[i2] > BitmapDescriptorFactory.HUE_RED) {\n fArr[i2] = fArr[i2] / f2;\n }\n }\n }\n }",
"void dither();",
"void dither();",
"private void white(){\n\t\tthis.arretes_fW();\n\t\tthis.coins_fW();\n\t\tthis.coins_a1W();\n\t\tthis.coins_a2W();\n\t\tthis.aretes_aW();\n\t\tthis.cube[4] = \"W\";\n\t}",
"public void fade2black() {\n int var3 = this.field_723 * this.field_724;\n int var2 = 0;\n if(field_759 || var2 < var3) {\n do {\n int var1 = this.pixels[var2] & 16777215;\n this.pixels[var2] = (var1 >>> 1 & 8355711) + (var1 >>> 2 & 4144959) + (var1 >>> 3 & 2039583) + (var1 >>> 4 & 986895);\n ++var2;\n } while(var2 < var3);\n\n }\n }",
"void fill(int rgb);",
"public abstract void collectorHelp(FloodItWorld w, Color c);",
"@Override\n\t\t\tpublic void setColorFilter(ColorFilter cf) {\n\t\t\t\t\n\t\t\t}",
"private void colorDetermine(PGraphics pg) {\r\n\t\tfloat depth = getDepth();\r\n\t\t\r\n\t\tif (depth < THRESHOLD_INTERMEDIATE) {\r\n\t\t\tpg.fill(255, 255, 0);\r\n\t\t}\r\n\t\telse if (depth < THRESHOLD_DEEP) {\r\n\t\t\tpg.fill(0, 0, 255);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tpg.fill(255, 0, 0);\r\n\t\t}\r\n\t}",
"public void Color() {\n\t\t\r\n\t}",
"@Override\n public void periodic() {\n\n if (lastcolor != sColor())\n {\n lastcolor = sColor();\n colorcount++;\n }\n\n DriverStation.reportError(sColor() + /*\",\" + sRGB() +*/ \", \" + sIsClose() + \",\" + String.valueOf(colorcount), false);\n\n\n \n }",
"@Override\n public void update(int n, int n2) {\n void mouseY;\n void mouseX;\n super.update((int)mouseX, (int)mouseY);\n float[] hsb = Color.RGBtoHSB(this.setting.getValue().getRed(), this.setting.getValue().getGreen(), this.setting.getValue().getBlue(), null);\n double difference = Math.min(95, Math.max(0, (int)(mouseX - this.getX())));\n this.hueWidth = Float.intBitsToFloat(Float.floatToIntBits(0.012939732f) ^ 0x7EEB012B) * (hsb[0] * Float.intBitsToFloat(Float.floatToIntBits(0.22324012f) ^ 0x7DD0990F) / Float.intBitsToFloat(Float.floatToIntBits(0.07544195f) ^ 0x7E2E814F));\n this.satWidth = Float.intBitsToFloat(Float.floatToIntBits(0.009555363f) ^ 0x7EA18E19) * (hsb[1] * Float.intBitsToFloat(Float.floatToIntBits(0.021556562f) ^ 0x7F049763) / Float.intBitsToFloat(Float.floatToIntBits(0.026331188f) ^ 0x7F63B481));\n this.briWidth = Float.intBitsToFloat(Float.floatToIntBits(0.02392782f) ^ 0x7E790447) * (hsb[2] * Float.intBitsToFloat(Float.floatToIntBits(0.09763377f) ^ 0x7E73F437) / Float.intBitsToFloat(Float.floatToIntBits(0.019418718f) ^ 0x7F2B1401));\n this.alphaWidth = Float.intBitsToFloat(Float.floatToIntBits(0.010174015f) ^ 0x7E9BB0E9) * ((float)this.setting.getValue().getAlpha() / Float.intBitsToFloat(Float.floatToIntBits(0.0089911735f) ^ 0x7F6C4FB7));\n this.changeColor(difference, new Color(Color.HSBtoRGB((float)(difference / Double.longBitsToDouble(Double.doubleToLongBits(0.15404371830294214) ^ 0x7F9477B45E21F7BFL) * Double.longBitsToDouble(Double.doubleToLongBits(0.050973544293479105) ^ 0x7FDC99345367453FL) / Double.longBitsToDouble(Double.doubleToLongBits(0.03014217321508198) ^ 0x7FE85D9700C1AF0AL)), hsb[1], hsb[2])), new Color(Color.HSBtoRGB(Float.intBitsToFloat(Float.floatToIntBits(1.8279414E38f) ^ 0x7F0984DF), hsb[1], hsb[2])), this.hueDragging);\n this.changeColor(difference, new Color(Color.HSBtoRGB(hsb[0], (float)(difference / Double.longBitsToDouble(Double.doubleToLongBits(0.1223112785883676) ^ 0x7FE88FCABD780F54L) * Double.longBitsToDouble(Double.doubleToLongBits(0.026943886254004668) ^ 0x7FED172D9927021DL) / Double.longBitsToDouble(Double.doubleToLongBits(0.05427001644334754) ^ 0x7FDD4947938E1C55L)), hsb[2])), new Color(Color.HSBtoRGB(hsb[0], Float.intBitsToFloat(Float.floatToIntBits(1.1082437E38f) ^ 0x7EA6BFFF), hsb[2])), this.saturationDragging);\n this.changeColor(difference, new Color(Color.HSBtoRGB(hsb[0], hsb[1], (float)(difference / Double.longBitsToDouble(Double.doubleToLongBits(0.12328622126775308) ^ 0x7FE84FAF90647595L) * Double.longBitsToDouble(Double.doubleToLongBits(0.09854681448488288) ^ 0x7FCFBA5D315669BFL) / Double.longBitsToDouble(Double.doubleToLongBits(0.029067112480345214) ^ 0x7FEB43C4E5F80CC0L)))), new Color(Color.HSBtoRGB(hsb[0], hsb[1], Float.intBitsToFloat(Float.floatToIntBits(3.3573391E38f) ^ 0x7F7C9400))), this.brightnessDragging);\n this.changeAlpha(difference, (float)(difference / Double.longBitsToDouble(Double.doubleToLongBits(0.014823398455503097) ^ 0x7FD99BBADCA7DC11L) * Double.longBitsToDouble(Double.doubleToLongBits(0.013271171619186513) ^ 0x7FE4CDEA80AC0D24L) / Double.longBitsToDouble(Double.doubleToLongBits(0.08218747250746601) ^ 0x7FDAEA3CFA8F7AADL)), this.alphaDragging);\n }",
"private void renderLights() {\n\t\t\n\t}",
"public void generateColor() {\n if (army < 0)\n color = Color.getHSBColor(0f, 1 - (float) Math.random() * 0.2f, 0.5f + (float) Math.random() * 0.5f);\n else if (army > 0)\n color = Color.getHSBColor(0.7f - (float) Math.random() * 0.2f, 1 - (float) Math.random() * 0.2f, 0.4f + (float) Math.random() * 0.25f);\n else color = Color.getHSBColor(0f, 0, 0.55f + (float) Math.random() * 0.25f);\n }",
"private void m23260f() {\n Shimmer aVar;\n Shader shader;\n Rect bounds = getBounds();\n int width = bounds.width();\n int height = bounds.height();\n if (width != 0 && height != 0 && (aVar = this.f19138f) != null) {\n int a = aVar.mo28981a(width);\n int b = this.f19138f.mo28983b(height);\n boolean z = true;\n if (this.f19138f.f19117g != 1) {\n if (!(this.f19138f.f19114d == 1 || this.f19138f.f19114d == 3)) {\n z = false;\n }\n if (z) {\n a = 0;\n }\n if (!z) {\n b = 0;\n }\n shader = new LinearGradient(0.0f, 0.0f, (float) a, (float) b, this.f19138f.f19112b, this.f19138f.f19111a, Shader.TileMode.CLAMP);\n } else {\n shader = new RadialGradient(((float) a) / 2.0f, ((float) b) / 2.0f, (float) (((double) Math.max(a, b)) / Math.sqrt(2.0d)), this.f19138f.f19112b, this.f19138f.f19111a, Shader.TileMode.CLAMP);\n }\n this.f19134b.setShader(shader);\n }\n }",
"@Test\n @Tag(\"bm1000\")\n public void testBLEND() {\n CuteNetlibCase.doTest(\"BLEND.SIF\", \"-3.0812149846E+01\", null, NumberContext.of(7, 4));\n }",
"@Override\n public void setColorFilter(ColorFilter colorFilter) {}",
"private void colorDetermine(PGraphics pg) {\n\t\tif(this.getDepth() < 70){\n\t\t\tpg.fill(255,255,0);\n\t\t}else if(this.getDepth() >= 70 && this.getDepth() < 300){\n\t\t\tpg.fill(0, 0, 255);\n\t\t}else if(this.getDepth() >= 300){\n\t\t\tpg.fill(255, 0, 0);\n\t\t}\n\t}",
"public abstract BossColor getColor();",
"private static int[] initFloydSteinberg24To8(ColorCube colorCube) {\n // Allocate memory for the dither table.\n int[] ditherTable = new int[NBANDS * TOTALGRAYS];\n\n float[] thresh = new float[NGRAYS];\n\n //\n // Get the colorcube parameters\n //\n int[] multipliers = colorCube.getMultipliers();\n int[] dimsLessOne = colorCube.getDimsLessOne();\n int offset = colorCube.getAdjustedOffset();\n\n //\n // Construct tables for each band\n //\n for (int band = 0; band < NBANDS; band++) {\n int pTab = band * TOTALGRAYS;\n\n //\n // Calculate the binwidth for this band, i.e. the gray level step\n // from one quantization level to the next. Do this in scaled\n // integer to maintain precision.\n //\n float binWidth = 255.0F / dimsLessOne[band];\n\n //\n // Pre-calculate the thresholds, so we don't have to do\n // it in the inner loops. The threshold is always the\n // midpoint of each bin, since, in error diffusion, the dithering\n // is done by the error distribution process, not by varying\n // the dither threshold as in ordered dither.\n //\n for (int i = 0; i < dimsLessOne[band]; i++) {\n thresh[i] = (i + 0.5F) * binWidth;\n }\n thresh[dimsLessOne[band]] = 256.0F;\n\n //\n // Populate the range below gray level zero with the same entry\n // as that for zero. The error distribution can cause undershoots\n // of as much as 255.\n //\n int tableInc = 1 << ERR_SHIFT;\n int tableValue = (-UNDERSHOOT) << ERR_SHIFT;\n for (int gray = -UNDERSHOOT; gray < 0; gray++) {\n ditherTable[pTab++] = tableValue;\n tableValue += tableInc;\n }\n\n //\n // Populate the main range of 0...255.\n //\n int indexContrib = 0;\n float frepValue = 0.0F;\n int repValue;\n int binNum = 0;\n float threshold = thresh[0];\n int gray = 0;\n while (gray < 256) {\n //\n // Populate all the table values up to the next threshold.\n // Since the only thing which changes is the error,\n // and it changes by one scaled gray level, we can\n // just add the increment at each iteration.\n //\n int tableBase = indexContrib;\n repValue = (int) (frepValue + 0.5F);\n while ((float) gray < threshold) {\n ditherTable[pTab++] = ((gray - repValue) << ERR_SHIFT) + tableBase;\n gray++;\n }\n\n //\n // Once the gray level crosses a threshold,\n // move to the next bin threshold. Also update\n // the color contribution index step and the\n // representative value, needed to compute the error.\n //\n threshold = thresh[++binNum];\n indexContrib += multipliers[band];\n frepValue += binWidth;\n }\n\n //\n // Populate the range above gray level 255 with the same entry\n // as that for 255. As in the under-range case, the error\n // distribution can cause overshoots as high as 255 over max.\n //\n indexContrib -= multipliers[band];\n repValue = 255;\n tableValue = ((256 - repValue) << ERR_SHIFT) | indexContrib;\n\n for (gray = 256; gray < (256 + OVERSHOOT); gray++) {\n ditherTable[pTab++] = tableValue;\n tableValue += tableInc;\n }\n\n } // End band loop\n\n //\n // Add in the colormap offset value to the index contribution\n // for the first band. This eliminates the need to add it in\n // when we do the error diffusion.\n //\n int pTab = 0;\n for (int count = TOTALGRAYS; count != 0; count--) {\n ditherTable[pTab] += offset;\n pTab++;\n }\n\n return ditherTable;\n }",
"private void bufferWorld() {\r\n\t\t//Draws to a PGraphics object must be surrounded with this...\r\n\t\tthis.backgroundBuffer.beginDraw();\r\n\t\t//Set a dark grey background\r\n\t\tthis.backgroundBuffer.background(50, 50, 50);\r\n\t\t//Iterate for each hexgon in the grid\r\n\t\tfor (int row = 0; row < this.numHexRow; row++) {\r\n\t\t\tfor (int col = 0; col < this.numHexCol; col++) {\r\n\t\t\tif (this.gridCells[row][col].getAnthill() == 1) {\r\n\t\t\t\t//If it is black anthill\r\n\t\t\t\tdrawImage(this.blackAnthillTile, row, col, 1);\r\n\t\t\t} else if (this.gridCells[row][col].getAnthill() == 2) { \r\n\t\t\t\t\t//If the cell is a red ant hill\r\n\t\t\t\t\tdrawImage(this.redAnthillTile, row, col, 1);\r\n\t\t\t\t} else if (this.gridCells[row][col].isRocky()) {\r\n\t\t\t\t\t//If it's rocky, randomly pick shade of grey\r\n\t\t\t\t\tint shade = this.random.nextInt(2);\r\n\t\t\t\t\tswitch (shade) {\r\n\t\t\t\t\t\tcase 0: this.backgroundBuffer.tint(LIGHT_ROCK_TINT);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase 1: this.backgroundBuffer.tint(NEUTRAL_ROCK_TINT);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase 2: this.backgroundBuffer.tint (DARK_ROCK_TINT);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tdrawImage(this.rockTile, row, col, 1);\r\n\t\t\t\t\tthis.backgroundBuffer.tint(255); //Restore default no tint\r\n\t\t\t\t} else {\r\n\t\t\t\t\t//Otherwise it is a grass tile\r\n\t\t\t\t\tdrawImage(this.grassTile, row, col, 1); \r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tthis.backgroundBuffer.endDraw();\r\n\t}",
"int getHighLightColor();",
"int canon_600_color (int ratio[], int mar)\n{\n int clipped=0, target, miss;\n\n if (flash_used != 0.0) {\n if (ratio[1] < -104)\n { ratio[1] = -104; clipped = 1; }\n if (ratio[1] > 12)\n { ratio[1] = 12; clipped = 1; }\n } else {\n if (ratio[1] < -264 || ratio[1] > 461) return 2;\n if (ratio[1] < -50)\n { ratio[1] = -50; clipped = 1; }\n if (ratio[1] > 307)\n { ratio[1] = 307; clipped = 1; }\n }\n target = flash_used != 0.0 || ratio[1] < 197\n\t? -38 - (398 * ratio[1] >> 10)\n\t: -123 + (48 * ratio[1] >> 10);\n if (target - mar <= ratio[0] &&\n target + 20 >= ratio[0] && clipped == 0) return 0;\n miss = target - ratio[0];\n if ( Math.abs(miss) >= mar*4) return 2;\n if (miss < -20) miss = -20;\n if (miss > mar) miss = mar;\n ratio[0] = target - miss;\n return 1;\n}",
"public void run() {\n HwNormalizedRampAnimator hwNormalizedRampAnimator = HwNormalizedRampAnimator.this;\n hwNormalizedRampAnimator.mAnimatedValue = hwNormalizedRampAnimator.mHwGradualBrightnessAlgo.getAnimatedValue();\n HwNormalizedRampAnimator hwNormalizedRampAnimator2 = HwNormalizedRampAnimator.this;\n hwNormalizedRampAnimator2.updateHBMData(hwNormalizedRampAnimator2.mTargetValue, HwNormalizedRampAnimator.this.mRate, HwNormalizedRampAnimator.this.mHwGradualBrightnessAlgo.getDuration());\n HwNormalizedRampAnimator.this.mHwGradualBrightnessAlgo.updateCurrentBrightnessValue(HwNormalizedRampAnimator.this.mAnimatedValue);\n int oldCurrentValue = HwNormalizedRampAnimator.this.mCurrentValue;\n HwNormalizedRampAnimator hwNormalizedRampAnimator3 = HwNormalizedRampAnimator.this;\n hwNormalizedRampAnimator3.mCurrentValue = Math.round(hwNormalizedRampAnimator3.mAnimatedValue);\n if (HwNormalizedRampAnimator.this.mData.animatingForRGBWEnable && HwNormalizedRampAnimator.this.mModeOffForRGBW && (HwNormalizedRampAnimator.this.mTargetValueChange != HwNormalizedRampAnimator.this.mTargetValue || (HwNormalizedRampAnimator.this.mProximityStateRecovery && HwNormalizedRampAnimator.this.mTargetValue != HwNormalizedRampAnimator.this.mCurrentValue))) {\n boolean unused = HwNormalizedRampAnimator.this.mModeOffForRGBW = false;\n HwNormalizedRampAnimator.this.mDisplayEngineManager.setScene(21, 16);\n if (HwNormalizedRampAnimator.DEBUG) {\n Slog.i(HwNormalizedRampAnimator.TAG, \"send DE_ACTION_MODE_ON For RGBW\");\n }\n HwNormalizedRampAnimator hwNormalizedRampAnimator4 = HwNormalizedRampAnimator.this;\n int unused2 = hwNormalizedRampAnimator4.mTargetValueChange = hwNormalizedRampAnimator4.mTargetValue;\n boolean unused3 = HwNormalizedRampAnimator.this.mProximityStateRecovery = false;\n }\n if (oldCurrentValue != HwNormalizedRampAnimator.this.mCurrentValue) {\n HwNormalizedRampAnimator hwNormalizedRampAnimator5 = HwNormalizedRampAnimator.this;\n hwNormalizedRampAnimator5.updateBrightnessViewAlpha(hwNormalizedRampAnimator5.mCurrentValue);\n HwNormalizedRampAnimator.this.mProperty.setValue(HwNormalizedRampAnimator.this.mObject, HwNormalizedRampAnimator.this.mCurrentValue);\n boolean unused4 = HwNormalizedRampAnimator.DEBUG;\n }\n if (HwNormalizedRampAnimator.this.mTargetValue != HwNormalizedRampAnimator.this.mCurrentValue) {\n HwNormalizedRampAnimator.this.postAnimationCallback();\n return;\n }\n HwNormalizedRampAnimator hwNormalizedRampAnimator6 = HwNormalizedRampAnimator.this;\n hwNormalizedRampAnimator6.mAnimating = false;\n hwNormalizedRampAnimator6.mHwGradualBrightnessAlgo.clearAnimatedValuePara();\n if (HwNormalizedRampAnimator.this.mListener != null) {\n HwNormalizedRampAnimator.this.mListener.onAnimationEnd();\n }\n if (HwNormalizedRampAnimator.this.mData.animatingForRGBWEnable) {\n boolean unused5 = HwNormalizedRampAnimator.this.mModeOffForRGBW = true;\n HwNormalizedRampAnimator.this.mDisplayEngineManager.setScene(21, 17);\n if (HwNormalizedRampAnimator.DEBUG) {\n Slog.i(HwNormalizedRampAnimator.TAG, \"send DE_ACTION_MODE_Off For RGBW\");\n }\n }\n }",
"public void setBgColours(weatherData tmp) {\n\t\t\t\t\tswitch(tmp.getCondit()) {\n\t\t\t\t\t\tcase \"sky is clear \":\n\t\t\t\t\t\tcase \"clear sky \":\n\t\t\t\t\t\tcase \"Sky is Clear \":\n\t\t\t\t\t\t\t\t\tcolor1 = new Color(255, 215,0);\n\t\t\t\t\t\t\t\t\tcolor2 = new Color(255, 111, 0);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"few clouds \":\n\t\t\t\t\t\t\t\t\tcolor1 = new Color(160, 255, 0);\n\t\t\t\t\t\t\t\t\tcolor2 = new Color(9, 173, 33);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"scattered clouds \":\n\t\t\t\t\t\t\t\t\tcolor1 = new Color(30, 255, 90);\n\t\t\t\t\t\t\t\t\tcolor2 = new Color(45, 110, 35);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"broken clouds \":\n\t\t\t\t\t\tcase \"overcast clouds \":\n\t\t\t\t\t\t\t\t\tcolor1 = new Color(30, 255, 150);\n\t\t\t\t\t\t\t\t\tcolor2 = new Color(40, 150, 130);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"shower rain \":\n\t\t\t\t\t\tcase \"light intensity drizzle \":\n\t\t\t\t\t\tcase \"drizzle \":\n\t\t\t\t\t\tcase \"heavy intensity drizzle \":\n\t\t\t\t\t\tcase \"light intensity drizzle rain \":\n\t\t\t\t\t\tcase \"drizzle rain \":\n\t\t\t\t\t\tcase \"heavy intensity drizzle rain \":\n\t\t\t\t\t\tcase \"shower rain and drizzle \":\n\t\t\t\t\t\tcase \"heavy shower rain and drizzle \":\n\t\t\t\t\t\tcase \"shower drizzle \":\n\t\t\t\t\t\tcase \"light intensity shower rain \":\n\t\t\t\t\t\tcase \"heavy intensity shower rain \":\n\t\t\t\t\t\tcase \"ragged shower rain \":\n\t\t\t\t\t\t\t\t\tcolor1 = new Color(0,255,255);\n\t\t\t\t\t\t\t\t\tcolor2 = new Color(30, 130, 160);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"rain \":\n\t\t\t\t\t\tcase \"light rain \":\n\t\t\t\t\t\tcase \"moderate rain \":\n\t\t\t\t\t\tcase \"heavy intensity rain \":\n\t\t\t\t\t\tcase \"very heavy rain \":\n\t\t\t\t\t\tcase \"extreme rain \":\n\t\t\t\t\t\t\t\t\tcolor1 = new Color(0, 166, 255);\n\t\t\t\t\t\t\t\t\tcolor2 = new Color(30, 50, 160);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"thunderstorm \":\n\t\t\t\t\t\tcase \"thunderstorm with light rain \":\n\t\t\t\t\t\tcase \"thunderstorm with rain \":\n\t\t\t\t\t\tcase \"thunderstorm with heavy rain \":\n\t\t\t\t\t\tcase \"light thunderstorm \":\n\t\t\t\t\t\tcase \"heavy thunderstorm \":\n\t\t\t\t\t\tcase \"ragged thunderstorm \":\n\t\t\t\t\t\tcase \"thunderstorm with light drizzle \":\n\t\t\t\t\t\tcase \"thunderstorm with drizzle \":\n\t\t\t\t\t\tcase \"thunderstorm with heavy drizzle \":\n\t\t\t\t\t\t\t\t\tcolor1 = new Color(0, 95, 255);\n\t\t\t\t\t\t\t\t\tcolor2 = new Color(60, 30, 160);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"snow \":\n\t\t\t\t\t\tcase \"freezing rain \":\n\t\t\t\t\t\tcase \"light snow \":\n\t\t\t\t\t\tcase \"heavy snow \":\n\t\t\t\t\t\tcase \"sleet \":\n\t\t\t\t\t\tcase \"shower sleet \":\n\t\t\t\t\t\tcase \"light rain and snow \":\n\t\t\t\t\t\tcase \"rain and snow \":\n\t\t\t\t\t\tcase \"light shower snow \":\n\t\t\t\t\t\tcase \"shower snow \":\n\t\t\t\t\t\tcase \"heavy shower snow \":\n\t\t\t\t\t\t\t\t\tcolor1 = new Color(145, 245, 245);\n\t\t\t\t\t\t\t\t\tcolor2 = new Color(75, 150, 160);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"mist \":\n\t\t\t\t\t\tcase \"smoke \":\n\t\t\t\t\t\tcase \"haze \":\n\t\t\t\t\t\tcase \"sand, dust whirls \":\n\t\t\t\t\t\tcase \"fog \":\n\t\t\t\t\t\tcase \"sand \":\n\t\t\t\t\t\tcase \"dust \":\n\t\t\t\t\t\tcase \"volcanic ash \":\n\t\t\t\t\t\tcase \"squalls \":\n\t\t\t\t\t\tcase \"tornado \":\n\t\t\t\t\t\t\t\t\tcolor1 = new Color(200, 210, 210);\n\t\t\t\t\t\t\t\t\tcolor2 = new Color(85, 110, 100);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\tcolor1 = new Color(160, 120, 240);\n\t\t\t\t\t\t\t\t\tcolor2 = new Color(40, 10, 90);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}",
"@Override\r\n\tpublic void howToColor() {\n\t\t\r\n\t}",
"public void setColorAccordingToAge() {\n float brightness = (float) Math.max(0f, Math.min(1f, getLifetime() / fullbrightnessLifetime));\n Color color = Color.getHSBColor(.5f, 1f, brightness);\n setColor(color);\n }",
"private void yellow(){\n\t\tthis.arretes_fY();\n\t\tthis.coins_fY();\n\t\tthis.coins_a1Y();\n\t\tthis.coins_a2Y();\n\t\tthis.aretes_aY();\n\t\tthis.cube[49] = \"Y\";\n\t}",
"private void red(){\n\t\tthis.arretes_fR();\n\t\tthis.coins_fR();\n\t\tthis.coins_a1R();\n\t\tthis.coins_a2R();\n\t\tthis.aretes_aR();\n\t\tthis.cube[13] = \"R\";\n\t}",
"@Override\n\tpublic void setColorFilter(ColorFilter cf) {\n\n\t}",
"private static void normalizeColor(BufferedImage image) {\n\t\tHashMap<Integer, Integer> counts = colorHistogram(image);\r\n\t\tInteger[] a=sortmap(counts); // sorting the map\r\n\t\tInteger minFreq = 1000;\r\n\t\tfor (Integer i: counts.keySet()) {\r\n\t\t\tif (counts.get(i) < minFreq) {\r\n\t\t\t\tminFreq = counts.get(i);\r\n\t\t\t}\r\n\t\t}\r\n\t\t/*\r\n\t\t*\r\n\t\t*Main logic to normalise the code\r\n\t\t* Assumption: all the colors which start from edges are the noise to the captcha or background.\r\n\t\t*/\r\n\t\tArrayList<Integer> topValues = new ArrayList<>();\r\n\t\tfor (Integer i: counts.keySet()) {\r\n\t\t\ttopValues.add(i); // adding all the colors into the the array list topValues without any condition\r\n\t\t}\r\n\t\tInteger[] out=findEdgecolors(image); // findEdgecolors function returns the array of RGB values of colors which are at the edges of the picture\r\n\t\tfor(int i=0;i<out.length;i++)\r\n\t\t{\r\n\t\t\tif(out[i]!=null)\r\n\t\t\t\ttopValues.remove(out[i]); // remove the colours from topValues list if the color exist in the array returned by the findEdgecolors funciton (removing the colors which start from edges)\r\n\t\t}\r\n\t\t/*\r\n\t\t*Now topvalues consists of colors which are not in the edges of the clipped image\r\n\t\t*/\r\n\t\tint white_rgb = Color.YELLOW.getRGB();\r\n\t\tint black_rgb = Color.BLACK.getRGB();\r\n\r\n\t\tfor (int x=0; x<image.getWidth(); x++) {\r\n\t\t\tfor (int y=0; y<image.getHeight(); y++) {\r\n\t\t\t\tint pixelVal = image.getRGB(x, y);\r\n\r\n\t\t\t\tif (!topValues.contains(pixelVal)) {\r\n\t\t\t\t\timage.setRGB(x, y, white_rgb); //replacing the colors in topvalue with black\r\n\t\t\t\t} else {\r\n\t\t\t\t\timage.setRGB(x, y, black_rgb); // rest is colored with yellow (background)\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif (debug) {\r\n\t\t\ttry {\r\n\t\t\t\tImageIO.write(image, \"gif\", new File(\"colorNormalized.gif\"));\r\n\t\t\t} catch (Exception e) {e.printStackTrace();}\r\n\t\t}\r\n\t}",
"public Color colorByNeighbors() {\n float mod = maxVoltage /10f;\n float color = Math.max(0,Math.min(voltageAccumulator,mod))/mod;\n float colorNeighbors = (float)Math.max(0,Math.min(this.neighbors.size()/maxNeighbors,1.0));\n\n if(colorNeighbors<0.5f)return new Color(0.0f,0f,0f);\n\n return new Color(colorNeighbors/2f,color,color);//, 0.25f);\n }",
"public Color brighter()\n {\n return color.brighter();\n }",
"private void colorCalibration()\n {\n\n if(ntRedColorCalibration.getBoolean(false))\n {\n if(colorCalibrationEnabled)\n {\n /* NON-OPERATIONAL SENSOR\n kRedTargetRedValue = detectedColor.red;\n kRedTargetGreenValue = detectedColor.green;\n kRedTargetBlueValue = detectedColor.blue;\n */\n ntRedRValue.forceSetDouble(kRedTargetRedValue);\n ntRedGValue.forceSetDouble(kRedTargetGreenValue);\n ntRedBValue.forceSetDouble(kRedTargetBlueValue);\n kRedTarget = new Color(new Color8Bit((int) (kRedTargetRedValue * 255), \n (int) (kRedTargetGreenValue * 255), (int) (kRedTargetBlueValue * 255)));\n\n updateColorMatcher();\n }\n colorCalibrationEnabled = false;\n ntRedColorCalibration.setBoolean(false);\n }\n \n if(ntGreenColorCalibration.getBoolean(false))\n {\n if(colorCalibrationEnabled)\n {\n /* NON-OPERATIONAL SENSOR\n kGreenTargetRedValue = detectedColor.red;\n kGreenTargetGreenValue = detectedColor.green;\n kGreenTargetBlueValue = detectedColor.blue; \n */\n ntGreenRValue.forceSetDouble(kGreenTargetRedValue);\n ntGreenGValue.forceSetDouble(kGreenTargetGreenValue);\n ntGreenBValue.forceSetDouble(kGreenTargetBlueValue);\n kGreenTarget = new Color(new Color8Bit((int) (kGreenTargetRedValue * 255), \n (int) (kGreenTargetGreenValue * 255), (int) (kGreenTargetBlueValue * 255)));\n\n updateColorMatcher();\n }\n colorCalibrationEnabled = false;\n ntGreenColorCalibration.setBoolean(false);\n }\n\n if(ntBlueColorCalibration.getBoolean(false))\n {\n if(colorCalibrationEnabled)\n {\n /* NON-OPERATIONAL SENSOR\n kBlueTargetRedValue = detectedColor.red;\n kBlueTargetGreenValue = detectedColor.green;\n kBlueTargetBlueValue = detectedColor.blue;\n */\n ntBlueRValue.forceSetDouble(kBlueTargetRedValue);\n ntBlueGValue.forceSetDouble(kBlueTargetGreenValue);\n ntBlueBValue.forceSetDouble(kBlueTargetBlueValue);\n kBlueTarget = new Color(new Color8Bit((int) (kBlueTargetRedValue * 255), \n (int) (kBlueTargetGreenValue * 255), (int) (kBlueTargetBlueValue * 255)));\n\n updateColorMatcher();\n }\n colorCalibrationEnabled = false;\n ntBlueColorCalibration.setBoolean(false);\n }\n\n if(ntYellowColorCalibration.getBoolean(false))\n {\n if(colorCalibrationEnabled)\n {\n /* NON-OPERATIONAL SENSOR\n kYellowTargetRedValue = detectedColor.red;\n kYellowTargetGreenValue = detectedColor.green;\n kYellowTargetBlueValue = detectedColor.blue;\n */\n ntYellowRValue.forceSetDouble(kYellowTargetRedValue);\n ntYellowGValue.forceSetDouble(kYellowTargetGreenValue);\n ntYellowBValue.forceSetDouble(kYellowTargetBlueValue);\n kYellowTarget = new Color(new Color8Bit((int) (kYellowTargetRedValue * 255), \n (int) (kYellowTargetGreenValue * 255), (int) (kYellowTargetBlueValue * 255)));\n\n updateColorMatcher();\n }\n colorCalibrationEnabled = false;\n ntYellowColorCalibration.setBoolean(false);\n }\n ntColorCalibrationEnabled.setBoolean(colorCalibrationEnabled);\n }",
"private int getCloseColor(int[] prgb) {\n \t\t\tfloat[] phsv = { 0, 0, 0 };\n \t\t\trgbToHsv(prgb[0], prgb[1], prgb[2], phsv);\n \t\t\t\n \t\t\tfloat hue = phsv[0];\n \t\t\tfloat val = phsv[2] * 100 / 256;\n \n \t\t\tint closest = -1;\n \n \t\t\tfinal int white = 15;\n \t\t\tfinal int black = 1;\n \t\t\tfinal int grey = 14;\n \t\t\t\n \t\t\tif (phsv[1] < (hue >= 30 && hue < 75 ? 0.66f : 0.33f)) {\n \t\t\t\tif (val >= 70) {\n \t\t\t\t\tclosest = white;\n \t\t\t\t} else if (val >= 10) {\n \t\t\t\t\t// dithering will take care of the rest\n \t\t\t\t\tclosest = grey;\n \t\t\t\t} else {\n \t\t\t\t\tclosest = black;\n \t\t\t\t}\n \t\t\t}\n \t\t\telse {\n \t\t\t\tclosest = getClosestColorByDistance(palette, firstColor, 16, prgb, 12);\n \t\t\t\t\n \t\t\t\t// see how the color matches\n \t\t\t\tif (closest == black) {\n \t\t\t\t\tif (phsv[1] > 0.9f) {\n \t\t\t\t\t\tif ((hue >= 75 && hue < 140) && (val >= 5 && val <= 33)) {\n \t\t\t\t\t\t\tclosest = 12;\n \t\t\t\t\t\t}\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t\t/*else {\n \t\t\t\t\tint rigid = rigidMatch(phsv, hue, val);\n \t\t\t\t\tif (phsv[1] < 0.5f && (rigid == 1 || rigid == 14 || rigid == 15)) {\n \t\t\t\t\t\tclosest = rigid;\n \t\t\t\t\t}\n \t\t\t\t}*/\n \t\t\t}\n \t\t\t\n \t\t\t//closest = rigidMatch(phsv, hue, val);\n \t\t\t\n \t\t\treturn closest;\n \t\t}",
"private int getCloseColor(int[] prgb) {\n \t\t\t\n \t\t\treturn getClosestColorByDistance(palette, firstColor, numColors, prgb, -1);\n \t\t}",
"private primitives.Color AdaptiveDiffusedAndGlossy(Vector n, Point3D point, Vector Vto, int direction, double DiffusedAndGlossy, int level , double k, double ktr) throws Exception {\r\n\r\n if (direction != 1 && direction != -1)\r\n throw new IllegalArgumentException(\"direction must be 1 or -1\");\r\n double gridSize = DiffusedAndGlossy;\r\n int numOfRowCol = isZero(gridSize) ? 1 : (int) Math.floor(Math.sqrt(maxRaysForDiffusedAndGlossy));\r\n Vector Vup = Vto.findRandomOrthogonal();//vector in the grid\r\n Vector Vright = Vto.crossProduct(Vup);//vector in the grid\r\n Point3D centerOfGrid = point.add(Vto.scale(distanceForDiffusedAndGlossy)); // center point of the grid\r\n double sizeOfCube = gridSize / numOfRowCol;//size of each cube in the grid\r\n n = n.dotProduct(Vto) > 0 ? n.scale(-direction) : n.scale(direction);//fix the normal direction\r\n\r\n if(isZero(gridSize))\r\n {\r\n Ray tempRay = new Ray(point, centerOfGrid.subtract(point), n);\r\n GeoPoint gp = findClosestIntersection(tempRay);\r\n if (gp == null)\r\n return scene.background;\r\n else\r\n return calcColor(gp, tempRay, level - 1, k);\r\n }\r\n\r\n return AdaptiveDiffusedAndGlossyRec(centerOfGrid, gridSize, sizeOfCube, point, Vright, Vup, n, direction, level, k, ktr, null);\r\n }",
"public void run(double deltaMs) {\n //wave360.setPeriod(speedParam.getValuef() * speedMult);\n //wave100.setPeriod(speedParam.getValuef() * speedMult);\n total_ms1+=deltaMs;\n total_ms2+=deltaMs;\n // Use a for loop here to set the ube colors\n if (total_ms2>50) {\n\t for (int i=0; i<model.baseCubes.size(); i++ ) {\n\t\t BaseCube cube=model.baseCubes.get(i);\n\n\t\t if (hits_cube(i,current_cube_r)) {\n\t\t\t shadow[i][0]=(float)1;\n\t\t\t shadow[i][1]=(float)0;\n\t\t\t shadow[i][2]=(float)0;\n\t\t } else if (hits_cube(i,current_cube_g)) {\n\t\t\t shadow[i][0]=(float)0;\n\t\t\t shadow[i][1]=(float)1;\n\t\t\t shadow[i][2]=(float)0;\n\t\t } else if (hits_cube(i,current_cube_b)) {\n\t\t\t shadow[i][0]=(float)0;\n\t\t\t shadow[i][1]=(float)0;\n\t\t\t shadow[i][2]=(float)1;\n\t\t } else {\n\t\t\t shadow[i][0]=(float)Math.min(1,new_shadow(shadow[i][0],dmax(i,current_cube_r)));\n\t\t\t shadow[i][1]=(float)Math.min(1,new_shadow(shadow[i][1],dmax(i,current_cube_g)));\n\t\t\t shadow[i][2]=(float)Math.min(1,new_shadow(shadow[i][2],dmax(i,current_cube_b)));\n\t\t }\n\t\t float norm =shadow[i][0]*2+shadow[i][1]+shadow[i][2];\n\t\t float h = (360*shadow[i][0]*2+120*shadow[i][1]+240*shadow[i][2])/norm;\n\t\t float v = (shadow[i][0]+shadow[i][1]+shadow[i][2])*100;\n\t\t colors[cube.index] = lx.hsb( h , 100, Math.min(100,v));\n\t }\n\t\ttotal_ms2=0;\n }\n if (total_ms1>10*speedParam.getValuef()) {\n\n\t //transistion to new cube\n\n\t float new_p;\n\t for (int j=0; j<n; j++) {\n\t\t new_p = (float)Math.random();\n\t\t for (int i=0; i<model.baseCubes.size(); i++) {\n\t\t\t if (new_p>0.0) {\n\t\t\t\t new_p-=p[current_cube_r[j]][i];\n\t\t\t } else {\n\t\t\t\t current_cube_r[j]=i;\n\t\t\t\t break;\n\t\t\t }\n\t\t }\n\t\t new_p = (float)Math.random();\n\t\t for (int i=0; i<model.baseCubes.size(); i++) {\n\t\t\t if (new_p>0.0) {\n\t\t\t\t new_p-=p[current_cube_g[j]][i];\n\t\t\t } else {\n\t\t\t\t current_cube_g[j]=i;\n\t\t\t\t break;\n\t\t\t }\n\t\t }\n\t\t new_p = (float)Math.random();\n\t\t for (int i=0; i<model.baseCubes.size(); i++) {\n\t\t\t if (new_p>0.0) {\n\t\t\t\t new_p-=p[current_cube_b[j]][i];\n\t\t\t } else {\n\t\t\t\t current_cube_b[j]=i;\n\t\t\t\t break;\n\t\t\t }\n\t\t }\n\t }\n\t total_ms1=0;\n }\n }",
"private static int mixColors(float t, byte r1, byte g1, byte b1, byte a1, byte r2, byte g2, byte b2, byte a2) {\n final int r = lerp(t, r1, r2);\n final int g = lerp(t, g1, g2);\n final int b = lerp(t, b1, b2);\n final int a = lerp(t, a1, a2);\n return (r << 24) | (g << 16) | (b << 8) | a;\n }",
"public abstract void flood();",
"public static void main(String[] args)\n {\n \n //opens selfie picture \n /**/ \n //relative path\n //og pics\n Picture apic = new Picture(\"images/selfie.jpg\");\n Picture obama = new Picture(\"images/obama.jpg\");\n apic.explore();\n obama.explore();\n\n //change with selfie picture\n Picture me = new Picture(\"images/selfie.jpg\"); \n Picture me1 = new Picture(\"images/selfie.jpg\");\n Picture me2 = new Picture(\"images/selfie.jpg\");\n \n //initializes array pix\n Pixel[] pix;\n \n /**\n * method 1 change\n * divides colors into 4 equal groups\n */\n //initializes vars for rgb values\n int red;\n int blue;\n int green;\n pix = me.getPixels(); \n \n for (Pixel spot: pix) {\n //gets rgb values of colors\n red = spot.getRed();\n blue = spot.getBlue();\n green = spot.getGreen();\n \n //if pixel under a certain value then the color is changed\n if (red < 63 && blue < 63 && green < 63) {\n spot.setColor(new Color(2, 32, 62));\n }\n else if (red < 127 && blue < 127 && green < 127) {\n spot.setColor(new Color(198, 37, 8));\n }\n else if (red < 191 && blue < 191 && green < 191) {\n spot.setColor(new Color(102, 157, 160));\n }\n else {\n spot.setColor(new Color(250, 238, 192));\n }\n }\n me.explore();\n me.write(\"images/selfie1.jpg\");\n\n /**\n * method 2 change\n * changes color based on intensity using max and min grayscale values\n */\n pix = me1.getPixels(); \n int s = 0; //smallest pix value\n int b = 255; //largest pix value\n int ave;\n int quads; //size of four equal range of colors\n \n for (Pixel spot: pix) {\n red = spot.getRed();\n blue = spot.getBlue();\n green = spot.getGreen();\n \n ave = (red + blue + green)/3;\n if (ave > b) { //gets maximum grayscale\n b = ave;\n }\n if (ave < s) { //gets min grayscale\n s = ave;\n }\n quads = (b-s)/4; //divides range of pix values into 4\n \n //sees if pixel value is less than the factor of quad\n if (red < quads && blue < quads && green < quads) {\n spot.setColor(new Color(2, 32, 62));\n }\n else if (red < quads*2 && blue < quads*2 && green < quads*2 ) {\n spot.setColor(new Color(198, 37, 8));\n }\n else if (red < quads*3 && blue < quads*3 && green < quads*3) {\n spot.setColor(new Color(102, 157, 160));\n }\n else {\n spot.setColor(new Color(250, 238, 192));\n }\n }\n me1.explore();\n me1.write(\"images/selfie2.jpg\");\n \n /**\n * custom color palette\n */\n pix = me2.getPixels();\n \n for (Pixel spot: pix) {\n red = spot.getRed();\n blue = spot.getBlue();\n green = spot.getGreen();\n \n //sets color to new value if under a certain value\n if (red < 63 && blue < 63 && green < 63) {\n spot.setColor(new Color(77, 105, 170));\n }\n else if (red < 127 && blue < 127 && green < 127) {\n spot.setColor(new Color(71, 183, 116));\n }\n else if (red < 191 && blue < 191 && green < 191) {\n spot.setColor(new Color(254, 129, 99));\n }\n else {\n spot.setColor(new Color(254, 202, 99));\n }\n }\n me2.explore();\n me2.write(\"images/selfie3.jpg\");\n \n }",
"private int getCloseColor(int[] prgb) {\n \t\t\tfloat[] phsv = { 0, 0, 0 };\n \t\t\trgbToHsv(prgb[0], prgb[1], prgb[2], phsv);\n \t\t\treturn phsv[2] < 64 ? fg : bg;\n \t\t}",
"private void sepiaTone(){\n int len= currentIm.getRows() * currentIm.getCols();\n \n for (int p= 0; p < len; p= p+1) {\n int rgb= currentIm.getPixel(p);\n int red= DM.getRed(rgb);\n int blue= DM.getBlue(rgb);\n int green= DM.getGreen(rgb);\n int alpha= DM.getAlpha(rgb);\n \n double brightness = 0.3 * red + 0.6 * green + 0.1 * blue;\n \n currentIm.setPixel(p,\n (alpha << 24) | ((int)brightness << 16) | ((int)(brightness*0.6) << 8) | \n (int)(brightness*0.4));\n \n }\n }",
"public void chooseColor() {\r\n\t\t// TODO Auto-generated method stub\r\n\t\t\r\n\t}",
"private void traverseBayeredPatternFullSizeRGB() {\n\n for (int x = 0; x < originalImageHeight -1; x++){\n for (int y = 1; y < originalImageWidth -1; y++){\n Point position = new Point(x,y);\n int absolutePosition = getAbsolutPixelPosition(position);\n\n PixelType pixelType = null;\n\n if (x%2 == 0 && y%2 == 0) pixelType = PixelType.GREEN_TOPRED;\n if (x%2 == 0 && y%2 == 1) pixelType = PixelType.BLUE;\n if (x%2 == 1 && y%2 == 0) pixelType = PixelType.RED;\n if (x%2 == 1 && y%2 == 1) pixelType = PixelType.GREEN_TOPBLUE;\n\n fullSizePixRGB[absolutePosition] = getFullSizeRGB(new Point(x,y),pixelType);\n }\n }\n }",
"@Override\r\n\t\tpublic void setColorFilter(ColorFilter cf)\r\n\t\t{\n\t\t\t\r\n\t\t}",
"private void updateMainColors () {\n int mainColor = getCurrentMainColor();\n int index = 0;\n int[] topColors = new int[256];\n for ( int y = 0; y < 256; y++ ) {\n for ( int x = 0; x < 256; x++ ) {\n if ( y == 0 ) {\n mMainColors[index] = Color.rgb( 255 - ( 255 - Color.red( mainColor ) ) * x / 255, 255 - ( 255 - Color.green( mainColor ) ) * x / 255, 255 - ( 255 - Color.blue( mainColor ) ) * x / 255 );\n topColors[x] = mMainColors[index];\n } else\n mMainColors[index] = Color.rgb( ( 255 - y ) * Color.red( topColors[x] ) / 255, ( 255 - y ) * Color.green( topColors[x] ) / 255, ( 255 - y ) * Color.blue( topColors[x] ) / 255 );\n index++;\n }\n }\n }",
"@Override\n public void setup()\n { \n background(100);\n quadrate();\n }",
"public void battleMode() {\n\t\tif (!inBattle) {\n\t\t\tinBattle = true;\n\t\t\tJPanel thisPanel = this;\n\n\t\t\tnew Timer(3, new ActionListener() {\n\t\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\tred -= 1;\n\t\t\t\t\tgreen -= 1;\n\t\t\t\t\tblue -= 1;\n\n\t\t\t\t\tthisPanel.setBackground(new Color(red, green, blue));\n\n\t\t\t\t\tif (red == 0) {\n\t\t\t\t\t\t((Timer) e.getSource()).stop();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}).start();\n\n\t\t}\n\t}",
"protected void tickHue(){\r\n if(rUP){\r\n R++;\r\n if(R>=maxR) rUP = false;\r\n }else{\r\n R--;\r\n if(R<=minR) rUP = true;\r\n }\r\n if(gUP){\r\n G++;\r\n if(G>=maxG) gUP = false;\r\n }else{\r\n G--;\r\n if(G<=minG) gUP = true;\r\n }\r\n if(bUP){\r\n B++;\r\n if(B>=maxB) bUP = false;\r\n }else{\r\n B--;\r\n if(B<=minB) bUP = true;\r\n }\r\n \r\n }",
"public Color4 getEffectColorAdd();",
"void draw() {\n\n // SeamInfo lowestSeam = this.lowestSeamVert();\n // lowestSeam.changeColor();\n\n ComputedPixelImage seamRemovedImg = new ComputedPixelImage(this.newImg.width,\n this.newImg.height);\n int countRow = 0;\n int countCol = 0;\n\n Pixel current = this.curPixel;\n Pixel temp;\n\n while (current.down != null) {\n temp = current.down;\n while (current.right != null) {\n Color c = Color.MAGENTA;\n if (current.highlighted) {\n c = Color.RED;\n }\n else {\n c = current.color;\n }\n if (this.showType.equals(\"e\")) {\n int energy = (int) (current.energy * 100);\n if (energy > 255) {\n System.out.println(\"energy: \" + energy + \" to 255\");\n energy = 255;\n }\n c = new Color(energy, energy, energy);\n }\n else if (this.showType.equals(\"w\")) {\n int weight = (int) (current.seam.totalWeight);\n if (weight > 255) {\n System.out.println(\"weight: \" + weight + \" to 255\");\n weight = 255;\n }\n c = new Color(weight, weight, weight);\n }\n\n seamRemovedImg.setColorAt(countCol, countRow, c);\n countCol += 1;\n current = current.right;\n }\n countCol = 0;\n countRow += 1;\n current = temp;\n }\n countCol = 0;\n\n this.newImg = seamRemovedImg;\n\n }",
"void setColor(){\n this.objectColour = new Color(rValue,gValue,bValue,timeToLive).brighter();\n }",
"public void blackScreen() {\n boolean var5 = field_759;\n int var1 = this.field_723 * this.field_724;\n int var2;\n if(this.interlace) {\n var2 = 0;\n int var3 = -this.field_724;\n if(var5 || var3 < 0) {\n do {\n int var4 = -this.field_723;\n if(var5) {\n this.pixels[var2++] = 0;\n ++var4;\n }\n\n while(var4 < 0) {\n this.pixels[var2++] = 0;\n ++var4;\n }\n\n var2 += this.field_723;\n var3 += 2;\n } while(var3 < 0);\n\n }\n } else {\n var2 = 0;\n if(var5 || var2 < var1) {\n do {\n this.pixels[var2] = 0;\n ++var2;\n } while(var2 < var1);\n\n }\n }\n }",
"private boolean m(){\r\n int m = countColors - maxSat;\r\n if (m <= TH){\r\n return true;\r\n }else{\r\n return false;\r\n }\r\n }",
"private static int mixSigColor(int c1, int c2, int ratio) {//0~100\r\n return 0xff & (((c2 * ratio) + (c1 * (100 - ratio))) / 100);\r\n }",
"@Override\n\tpublic void setColour(float r, float g, float b) {\n\n\t}",
"public RGBImage makeRGBImage()\r\n {\r\n\tint rows = getHeight();\r\n\tint cols = getWidth();\r\n \r\n\tshort[][] red = new short[rows][cols]; \r\n\tshort[][] green = new short[rows][cols]; \r\n\tshort[][] blue = new short[getHeight()][getWidth()]; \r\n \r\n\t@SuppressWarnings(\"unused\")\r\n\tdouble H, S, I;\r\n\tshort v1, v2, v3, h, h0, sat, intens;\r\n\tint sector;\r\n\r\n\tfor (int row = 0; row < rows; row++)\r\n\t{\r\n\t for (int col = 0; col < cols; col++)\r\n\t {\r\n\r\n\t\tif (saturation[row][col] == 0)\r\n\t\t{\r\n\t\t red[row][col] = intensity[row][col];\r\n\t\t green[row][col] = intensity[row][col];\r\n\t\t blue[row][col] = intensity[row][col];\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t h0 = hue[row][col];\r\n\r\n\t\t if (h0 <= (L-1)/3)\r\n\t\t {\r\n\t\t\th = (short)h0;\r\n\t\t\tsector = 1;\r\n\t\t }\r\n\t\t else if (h0 <= 2*(L-1)/3)\r\n\t\t {\r\n\t\t\th = (short)(h0 - (L-1)/3);\r\n\t\t\tsector = 2;\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t\th = (short)(h0 - 2*(L-1)/3);\r\n\t\t\tsector = 3;\r\n\t\t }\r\n\r\n\t\t H = h * 2 * Math.PI / (L-1);\r\n\r\n\t\t sat = saturation[row][col];\r\n\t\t S = (double)sat / (L-1);\r\n\r\n\t\t intens = intensity[row][col]; \r\n\t\t I = (double)intens / (L-1);\r\n\r\n\t\t v1 = (short)Math.round(intens * (1 - S));\r\n\t\t v1 = checkInterval (v1);\r\n\r\n\t\t v2 = (short)Math.round(intens * (1 + S * Math.cos(H)/\r\n\t\t\t\t\t\t Math.cos(Math.PI/3 - H) ));\r\n\t\t v2 = checkInterval (v2);\r\n \r\n\t\t v3 = (short)Math.round(3 * intens - (v1 + v2));\r\n\t\t v3 = checkInterval (v3);\r\n \r\n\t\t if (sector == 1)\r\n\t\t {\r\n\t\t\tblue[row][col] = v1;\r\n\t\t\tred[row][col] = v2;\r\n\t\t\tgreen[row][col] = v3;\r\n\t\t }\r\n\t\t else if (sector == 2)\r\n\t\t {\r\n\t\t\tred[row][col] = v1;\r\n\t\t\tgreen[row][col] = v2;\r\n\t\t\tblue[row][col] = v3;\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t\tgreen[row][col] = v1;\r\n\t\t\tblue[row][col] = v2;\r\n\t\t\tred[row][col] = v3;\r\n\t\t }\r\n\t\t}\r\n\t }\r\n\t}\r\n \r\n\treturn new RGBImage (red, green, blue);\r\n }",
"public void setIntensities(float r0, float g0, float b0, float a0,\n float r1, float g1, float b1, float a1,\n float r2, float g2, float b2, float a2) {\n // Check if we need alpha or not?\n if ((a0 != 1.0f) || (a1 != 1.0f) || (a2 != 1.0f)) {\n INTERPOLATE_ALPHA = true;\n a_array[0] = (a0 * 253f + 1.0f) * 65536f;\n a_array[1] = (a1 * 253f + 1.0f) * 65536f;\n a_array[2] = (a2 * 253f + 1.0f) * 65536f;\n m_drawFlags|=R_ALPHA;\n } else {\n INTERPOLATE_ALPHA = false;\n m_drawFlags&=~R_ALPHA;\n }\n \n // Check if we need to interpolate the intensity values\n if ((r0 != r1) || (r1 != r2)) {\n INTERPOLATE_RGB = true;\n m_drawFlags |= R_GOURAUD;\n } else if ((g0 != g1) || (g1 != g2)) {\n INTERPOLATE_RGB = true;\n m_drawFlags |= R_GOURAUD;\n } else if ((b0 != b1) || (b1 != b2)) {\n INTERPOLATE_RGB = true;\n m_drawFlags |= R_GOURAUD;\n } else {\n //m_fill = parent.filli;\n m_drawFlags &=~ R_GOURAUD;\n }\n \n // push values to arrays.. some extra scaling is added\n // to prevent possible color \"overflood\" due to rounding errors\n r_array[0] = (r0 * 253f + 1.0f) * 65536f;\n r_array[1] = (r1 * 253f + 1.0f) * 65536f;\n r_array[2] = (r2 * 253f + 1.0f) * 65536f;\n \n g_array[0] = (g0 * 253f + 1.0f) * 65536f;\n g_array[1] = (g1 * 253f + 1.0f) * 65536f;\n g_array[2] = (g2 * 253f + 1.0f) * 65536f;\n \n b_array[0] = (b0 * 253f + 1.0f) * 65536f;\n b_array[1] = (b1 * 253f + 1.0f) * 65536f;\n b_array[2] = (b2 * 253f + 1.0f) * 65536f;\n \n // for plain triangles\n m_fill = 0xFF000000 | \n ((int)(255*r0) << 16) | ((int)(255*g0) << 8) | (int)(255*b0);\n }",
"private boolean m0(int[] r6, int[] r7) {\n /*\n r5 = this;\n boolean r0 = super.onStateChange(r6)\n android.content.res.ColorStateList r1 = r5.f10944b\n r2 = 0\n if (r1 == 0) goto L_0x0010\n int r3 = r5.O\n int r1 = r1.getColorForState(r6, r3)\n goto L_0x0011\n L_0x0010:\n r1 = 0\n L_0x0011:\n int r3 = r5.O\n r4 = 1\n if (r3 == r1) goto L_0x0019\n r5.O = r1\n r0 = 1\n L_0x0019:\n android.content.res.ColorStateList r1 = r5.f10947e\n if (r1 == 0) goto L_0x0024\n int r3 = r5.P\n int r1 = r1.getColorForState(r6, r3)\n goto L_0x0025\n L_0x0024:\n r1 = 0\n L_0x0025:\n int r3 = r5.P\n if (r3 == r1) goto L_0x002c\n r5.P = r1\n r0 = 1\n L_0x002c:\n android.content.res.ColorStateList r1 = r5.b0\n if (r1 == 0) goto L_0x0037\n int r3 = r5.Q\n int r1 = r1.getColorForState(r6, r3)\n goto L_0x0038\n L_0x0037:\n r1 = 0\n L_0x0038:\n int r3 = r5.Q\n if (r3 == r1) goto L_0x0043\n r5.Q = r1\n boolean r1 = r5.a0\n if (r1 == 0) goto L_0x0043\n r0 = 1\n L_0x0043:\n b.c.a.d.q.b r1 = r5.j\n if (r1 == 0) goto L_0x0052\n android.content.res.ColorStateList r1 = r1.f2389b\n if (r1 == 0) goto L_0x0052\n int r3 = r5.R\n int r1 = r1.getColorForState(r6, r3)\n goto L_0x0053\n L_0x0052:\n r1 = 0\n L_0x0053:\n int r3 = r5.R\n if (r3 == r1) goto L_0x005a\n r5.R = r1\n r0 = 1\n L_0x005a:\n int[] r1 = r5.getState()\n r3 = 16842912(0x10100a0, float:2.3694006E-38)\n boolean r1 = b0(r1, r3)\n if (r1 == 0) goto L_0x006d\n boolean r1 = r5.u\n if (r1 == 0) goto L_0x006d\n r1 = 1\n goto L_0x006e\n L_0x006d:\n r1 = 0\n L_0x006e:\n boolean r3 = r5.S\n if (r3 == r1) goto L_0x0088\n android.graphics.drawable.Drawable r3 = r5.w\n if (r3 == 0) goto L_0x0088\n float r0 = r5.d()\n r5.S = r1\n float r1 = r5.d()\n int r0 = (r0 > r1 ? 1 : (r0 == r1 ? 0 : -1))\n if (r0 == 0) goto L_0x0087\n r0 = 1\n r1 = 1\n goto L_0x0089\n L_0x0087:\n r0 = 1\n L_0x0088:\n r1 = 0\n L_0x0089:\n android.content.res.ColorStateList r3 = r5.X\n if (r3 == 0) goto L_0x0093\n int r2 = r5.T\n int r2 = r3.getColorForState(r6, r2)\n L_0x0093:\n int r3 = r5.T\n if (r3 == r2) goto L_0x00a4\n r5.T = r2\n android.content.res.ColorStateList r0 = r5.X\n android.graphics.PorterDuff$Mode r2 = r5.Y\n android.graphics.PorterDuffColorFilter r0 = b.c.a.d.n.a.a(r5, r0, r2)\n r5.W = r0\n goto L_0x00a5\n L_0x00a4:\n r4 = r0\n L_0x00a5:\n android.graphics.drawable.Drawable r0 = r5.m\n boolean r0 = i0(r0)\n if (r0 == 0) goto L_0x00b4\n android.graphics.drawable.Drawable r0 = r5.m\n boolean r0 = r0.setState(r6)\n r4 = r4 | r0\n L_0x00b4:\n android.graphics.drawable.Drawable r0 = r5.w\n boolean r0 = i0(r0)\n if (r0 == 0) goto L_0x00c3\n android.graphics.drawable.Drawable r0 = r5.w\n boolean r6 = r0.setState(r6)\n r4 = r4 | r6\n L_0x00c3:\n android.graphics.drawable.Drawable r6 = r5.q\n boolean r6 = i0(r6)\n if (r6 == 0) goto L_0x00d2\n android.graphics.drawable.Drawable r6 = r5.q\n boolean r6 = r6.setState(r7)\n r4 = r4 | r6\n L_0x00d2:\n if (r4 == 0) goto L_0x00d7\n r5.invalidateSelf()\n L_0x00d7:\n if (r1 == 0) goto L_0x00dc\n r5.l0()\n L_0x00dc:\n return r4\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.android.material.chip.a.m0(int[], int[]):boolean\");\n }",
"private void colorSetup(){\n Color color2 = Color.GRAY;\n Color color = Color.LIGHT_GRAY;\n this.setBackground(color);\n this.mainPanel.setBackground(color);\n this.leftPanel.setBackground(color);\n this.rightPanel.setBackground(color);\n this.rightCenPanel.setBackground(color);\n this.rightLowPanel.setBackground(color);\n this.rightTopPanel.setBackground(color);\n this.inputPanel.setBackground(color);\n this.controlPanel.setBackground(color);\n this.setupPanel.setBackground(color);\n this.cameraPanel.setBackground(color);\n this.jPanel4.setBackground(color);\n this.sensSlider.setBackground(color); \n }",
"public void disperse() {\t\t\n\t\tfor (int r = 0; r < rows; r++){\n\t\t\tfor (int c = 1; c < cols; c++){\n\t\t\t\tint sum = values[r+1][c-1] + values[r+1][c] + values[r+1][c+1];\n\t\t\t\tif(r < rows - fireLevel + 14){\n\t\t\t\t\tvalues[r][c] = (sum / 3) - 1;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tvalues[r][c] = (int)((sum / 3.0) - 0.0); \n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (values[r][c] < 0) values[r][c] = 0;\n\t\t\t\tg2.setColor(colors[values[r][c]]);\n\t\t\t\tif(values[r][c] > 5){\n\t\t\t\t\tg2.fillRect(c*res,r*res,res,res);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public void\nsetSpecularElt( SbColor color )\n//\n{\n this.coinstate.specular.copyFrom(color);\n}",
"public void black() {\n g2.setPaint(Color.black);\r\n }",
"private void traverseBayeredPatternHalfSizeRGB(){\n int originalPositionX = 0;\n int originalPositionY = 1;\n\n for (int newX = 0; originalPositionX < originalImageHeight -1; newX++){\n for (int newY = 0; originalPositionY < originalImageWidth -1; newY++){\n Point newPosition = new Point(newX,newY);\n int newAbsoultPosition = getAbsolutPixelPosition(newPosition, originalImageHeight / 2, originalImageWidth / 2);\n halfSizePixRGB[newAbsoultPosition] = getAverageRGB(new Point(originalPositionX,originalPositionY));\n originalPositionY += 2;\n }\n originalPositionY = 0;\n originalPositionX += 2;\n }\n }",
"private void assignColors() {\n soundQuickStatus.setBackground(drawables[noise]);\n comfortQuickStatus.setBackground(drawables[comfort]);\n lightQuickStatus.setBackground(drawables[light]);\n convenienceQuickStatus.setBackground(drawables[convenience]);\n }",
"public void drawMushroom(int x, int y, Color r) {\n\n\t\tPixelController px = PixelController.getInstance(Screen.MEDEA_3);\n\t\t\n\t\ttry {\n\t\t\tThread.sleep(3000);\n\t\t} catch (InterruptedException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\t/* Colors in the array */ \n\t\tColor b = Color.BLACK;\n\t\tColor w = Color.WHITE;\n\t\tColor n = null;\n\t\t\n\t\tColor[][] superMushroom = {\n\t\t\t\t{n,n,n,n,n,b,b,b,b,b,b,n,n,n,n,n},\n\t\t\t\t{n,n,n,b,b,r,r,r,r,w,w,b,b,n,n,n},\n\t\t\t\t{n,n,b,w,w,r,r,r,r,w,w,w,w,b,n,n},\n\t\t\t\t{n,b,w,w,r,r,r,r,r,r,w,w,w,w,b,n},\n\t\t\t\t{n,b,w,r,r,w,w,w,w,r,r,w,w,w,b,n},\n\t\t\t\t{b,r,r,r,w,w,w,w,w,w,r,r,r,r,r,b},\n\t\t\t\t{b,r,r,r,w,w,w,w,w,w,r,r,w,w,r,b},\n\t\t\t\t{b,w,r,r,w,w,w,w,w,w,r,w,w,w,w,b},\n\t\t\t\t{b,w,w,r,r,w,w,w,w,r,r,w,w,w,w,b},\n\t\t\t\t{b,w,w,r,r,r,r,r,r,r,r,r,w,w,r,b},\n\t\t\t\t{b,w,r,r,b,b,b,b,b,b,b,b,r,r,r,b},\n\t\t\t\t{n,b,b,b,w,w,b,w,w,b,w,w,b,b,b,n},\n\t\t\t\t{n,n,b,w,w,w,b,w,w,b,w,w,w,b,n,n},\n\t\t\t\t{n,n,b,w,w,w,w,w,w,w,w,w,w,b,n,n},\n\t\t\t\t{n,n,n,b,w,w,w,w,w,w,w,w,b,n,n,n},\n\t\t\t\t{n,n,n,n,b,b,b,b,b,b,b,b,n,n,n,n}\n\t\t}; \n\t\t/* loops out the color of the mushroom from the array */\n\t\tfor(int i = 15; i >= 0; i --) {\n\t\t\tfor(int j = 0; j < 16; j ++) {\n\t\t\t\tif(superMushroom[i][j] != null ){\n\t\t\t\t\tpx.setPixel(x + i, y + j, superMushroom[i][j]);\n\t\t\t\t\t//System.out.print(superMushroom[y][x].toString());\n\t\t\t\t}\n\t\t\t}\n\t\t} \n\t\t\n\t\t\n\t}",
"public GameColor getColor();",
"private DeadbandMath() {\n logger.setLevel(Constants.LOG_LEVEL_FINE);\n deadbandZone = DeadbandZone.RED;\n shotChance = ShotChance.MISS;\n }",
"void rainbow(int width);",
"public void doImageRendering( int frame )\n\t{\n\t\tArrayColormap cmap = new ArrayColormap();\n\t\tColor color1 = new Color((int)red1.get(frame), (int)green1.get(frame), (int)blue1.get(frame) );\n\t\tColor color2 = new Color((int)red2.get(frame), (int)green2.get(frame), (int)blue2.get(frame) );\n\t\tColor color3 = new Color((int)red3.get(frame), (int)green3.get(frame), (int)blue3.get(frame) );\n\n\t\tcmap.setColor( 0, color2.getRGB() );\n\t\tcmap.setColor( 255, color1.getRGB() );\n\t\tcmap.setColorInterpolated(middleValue.get(), 0, 255, color3.getRGB() );\n\n\t\tfor( int j = 0; j < 256; j++ )\n\t\t\trbgLook[ j ] = cmap.getColor( (float) j / 255.0f ) & alpha_mask;\n\n\t\t//--- Do color replacement.\n\t\tBufferedImage source = getFlowImage();\n\t\tint[] pix = getBank( source );\n\t\tint rbg;\n\t\tint lumaValue;\n\t\tint a;\n\t\tint r;\n\t\tint g;\n\t\tint b;\n\n\t\tfor( int i = 0; i < pix.length; i++ )\n\t\t{\n\t\t\ta = ( pix[ i ] >> alpha ) & 0xff;\n\t\t\tr = ( pix[ i ] >> red ) & 0xff;\n\t\t\tg = ( pix[ i ] >> green ) & 0xff;\n\t\t\tb = ( pix[ i ] & 0xff );\n\n\t\t\tlumaValue = (( r + g + b ) * 255 ) / MAX_RGB;\n\t\t\trbg = rbgLook[ lumaValue ];\n\n\t\t\tpix[ i ] = a << alpha | rbg;\n\t\t}\n\n\t\tsendFilteredImage( source, frame );\n\n\t}",
"public void testColorSensing()\n {\n // SmartDashboard.putData(\"Color Wheel Spinning\", new ControlPanelSpinFour());\n }",
"private void colorBricks(GRect block,int k) {\n\n\t\tif (k < 2) block.setFillColor(Color.RED);\n\t\telse if (k >= 2 && k < 4) block.setFillColor(Color.ORANGE);\n\t\telse if (k >= 4 && k < 6) block.setFillColor(Color.YELLOW);\n\t\telse if (k >= 6 && k < 8) block.setFillColor(Color.GREEN);\n\t\telse if (k >= 8 && k < 10) block.setFillColor(Color.CYAN);\n\t}",
"public TankBlue(){\n this.setTankColor(TANK_COLORS.blue);\n this.initializeSoundsFilesMap();\n }",
"@Override\n public void drawHeatFlux() {\n }",
"@Override\n protected Color getflameC ()\n {\n return null;\n }",
"public ColorRgb getColorRgbBiLinear(double x, double y)\n {\n //-----------------------------------------------------------------\n double u = x - Math.floor(x);\n double v = y - Math.floor(y);\n double U = u * ((double)(getXSize()-2));\n double V = v * ((double)(getYSize()-2));\n int i = (int)Math.floor(U);\n int j = (int)Math.floor(V);\n double du = U - (double)i;\n double dv = V - (double)j;\n RGBPixel p;\n\n //-----------------------------------------------------------------\n p = getPixelRgb(i, j);\n ColorRgb F00 = new ColorRgb();\n F00.r = ((double)VSDK.signedByte2unsignedInteger(p.r)) / 255.0;\n F00.g = ((double)VSDK.signedByte2unsignedInteger(p.g)) / 255.0;\n F00.b = ((double)VSDK.signedByte2unsignedInteger(p.b)) / 255.0;\n\n p = getPixelRgb(i+1, j);\n ColorRgb F10 = new ColorRgb();\n F10.r = ((double)VSDK.signedByte2unsignedInteger(p.r)) / 255.0;\n F10.g = ((double)VSDK.signedByte2unsignedInteger(p.g)) / 255.0;\n F10.b = ((double)VSDK.signedByte2unsignedInteger(p.b)) / 255.0;\n\n p = getPixelRgb(i, j+1);\n ColorRgb F01 = new ColorRgb();\n F01.r = ((double)VSDK.signedByte2unsignedInteger(p.r)) / 255.0;\n F01.g = ((double)VSDK.signedByte2unsignedInteger(p.g)) / 255.0;\n F01.b = ((double)VSDK.signedByte2unsignedInteger(p.b)) / 255.0;\n\n p = getPixelRgb(i+1, j+1);\n ColorRgb F11 = new ColorRgb();\n F11.r = ((double)VSDK.signedByte2unsignedInteger(p.r)) / 255.0;\n F11.g = ((double)VSDK.signedByte2unsignedInteger(p.g)) / 255.0;\n F11.b = ((double)VSDK.signedByte2unsignedInteger(p.b)) / 255.0;\n\n //-----------------------------------------------------------------\n ColorRgb FU0 = new ColorRgb();\n FU0.r = F00.r + du * (F10.r-F00.r);\n FU0.g = F00.g + du * (F10.g-F00.g);\n FU0.b = F00.b + du * (F10.b-F00.b);\n\n ColorRgb FU1 = new ColorRgb();\n FU1.r = F01.r + du * (F11.r-F01.r);\n FU1.g = F01.g + du * (F11.g-F01.g);\n FU1.b = F01.b + du * (F11.b-F01.b);\n\n ColorRgb FVAL = new ColorRgb();\n FVAL.r = FU0.r + dv * (FU1.r-FU0.r);\n FVAL.g = FU0.g + dv * (FU1.g-FU0.g);\n FVAL.b = FU0.b + dv * (FU1.b-FU0.b);\n\n return FVAL;\n }",
"protected int getShadeAlpha() {\n int a = currAlpha - 80;\n if (a < 0)\n a = 0;\n return a;\n }",
"void sendToGreen();",
"protected Image makeColorWheel() {\r\n int x, y;\r\n float[] hsb = new float[3];\r\n\r\n Image image = createImage(colorWheelWidth, colorWheelWidth);\r\n if (image == null)\r\n return null;\r\n\r\n Graphics g = image.getGraphics();\r\n\r\n g.setColor(getBackground());\r\n g.fillRect(0, 0, colorWheelWidth, colorWheelWidth);\r\n\r\n int offset = selectDiameter / 2;\r\n for (y = 0; y <= diameter; y++) {\r\n for (x = 0; x <= diameter; x++) {\r\n if (getColorAt(hsb, x, y, true)) {\r\n g.setColor(Color.getHSBColor(hsb[0], hsb[1], hsb[2]));\r\n g.drawLine(x + offset, y + offset, x + offset, y + offset);\r\n }\r\n }\r\n }\r\n g.dispose();\r\n return image;\r\n }",
"public static int countColorsAboveBrightnessThreshold(double bound) {\n int count = 0;\n\n if (bound >= luminanceOfRed255Green255Blue11()) {\n //If the bound is this high, no color value can be lower than 11, even if the other two are maxed.\n double maxRedBlueSumLuminance = 0.2126 + 0.0722; // Equals .2848, which is 1 - .7152\n double minGreenContrib = bound - maxRedBlueSumLuminance;\n double minGreenElementLuminance = minGreenContrib / .7152;\n // What is RsGreen when ((RsGreen + .055)/1.055)^2.4 == minGreenElementLuminance?\n double minRsGreen = RsRGBFromElementLuminanceWhereIntAbove10(minGreenElementLuminance);\n long minGreenInt = Math.round(Math.ceil(minRsGreen*255));\n Long i = minGreenInt;\n while (i <= 255) {\n //Evaluate what happens when the green value from 0 to 255 is equal to i\n double greenElementLuminance = .7152*ColorNamer.elementLuminance(i.intValue());\n double minRedContrib = bound - greenElementLuminance - .0722;\n // Red must contribute at least minRedContrib luminance for the luminance to be above the bound\n double minRedElementLuminance = minRedContrib / .2126;\n double minRsRed = RsRGBFromElementLuminanceWhereIntAbove10(minRedElementLuminance);\n long minRedInt = Math.round(Math.ceil(minRsRed*255));\n Long j = minRedInt;\n while (j <= 255) {\n double redElementLuminance = .2126*ColorNamer.elementLuminance(j.intValue());\n double minBlueContrib = bound - greenElementLuminance - redElementLuminance;\n double minBlueElementLuminance = minBlueContrib / .0722;\n double minRsBlue = RsRGBFromElementLuminanceWhereIntAbove10(minBlueElementLuminance);\n long minBlueInt = Math.round(Math.ceil(minRsBlue*255));\n count += (255 - minBlueInt + 1);\n j++;\n }\n\n i++;\n }\n }\n else {\n System.out.println(\"countColorsAboveBrightnessThreshold is not finished for bounds this low\");\n }\n\n return count;\n }",
"@Override\r\n public void onProgressChanged(SeekBar seekBar, int progress,\r\n boolean fromUser) {\n fade = seeker.getProgress();\r\n if(!getLucky) {\r\n Log.i(\"Poop\", \"getLucky == false\");\r\n hold = ColorFinder.kindFinder(color, gotColor1);\r\n test = ColorFinder.kindFinder(color2, gotColor2);\r\n token = new StringTokenizer(hold);\r\n smoken = new StringTokenizer(test);\r\n redTotal = (int) ColorFinder.colorFinder(Integer.parseInt(token.nextToken())\r\n , Integer.parseInt(smoken.nextToken()), fade);\r\n greenTotal = (int) ColorFinder.colorFinder(Integer.parseInt(token.nextToken()),\r\n Integer.parseInt(smoken.nextToken()), fade);\r\n blueTotal = (int) ColorFinder.colorFinder((Integer.parseInt(token.nextToken()))\r\n , Integer.parseInt(smoken.nextToken()), fade);\r\n hex = ColorFinder.changeColor(redTotal, greenTotal, blueTotal);\r\n colorBlend.setBackgroundColor(hex);\r\n } else if(getLucky && gotColor2){\r\n Log.i(\"Poop\", \"getLuck == true and gotColor2 ==true\");\r\n hold = ColorFinder.randomColorFinder(ran, dom, ness);\r\n test = ColorFinder.kindFinder(color2, gotColor2);\r\n token = new StringTokenizer(hold);\r\n smoken = new StringTokenizer(test);\r\n redTotal = (int) ColorFinder.colorFinder(Integer.parseInt(token.nextToken())\r\n , Integer.parseInt(smoken.nextToken()), fade);\r\n greenTotal = (int) ColorFinder.colorFinder(Integer.parseInt(token.nextToken()),\r\n Integer.parseInt(smoken.nextToken()), fade);\r\n blueTotal = (int) ColorFinder.colorFinder((Integer.parseInt(token.nextToken()))\r\n , Integer.parseInt(smoken.nextToken()), fade);\r\n hex = ColorFinder.changeColor(redTotal, greenTotal, blueTotal);\r\n colorBlend.setBackgroundColor(hex);\r\n } else if(getLucky && gotColor1) {\r\n Log.i(\"Poop\", \"getLucky == true and gotColor1 == true\");\r\n hold = ColorFinder.kindFinder(color, gotColor1);\r\n test = ColorFinder.randomColorFinder(fus, ro, dah);\r\n token = new StringTokenizer(hold);\r\n smoken = new StringTokenizer(test);\r\n redTotal = (int) ColorFinder.colorFinder(Integer.parseInt(token.nextToken())\r\n , Integer.parseInt(smoken.nextToken()), fade);\r\n greenTotal = (int) ColorFinder.colorFinder(Integer.parseInt(token.nextToken()),\r\n Integer.parseInt(smoken.nextToken()), fade);\r\n blueTotal = (int) ColorFinder.colorFinder((Integer.parseInt(token.nextToken()))\r\n , Integer.parseInt(smoken.nextToken()), fade);\r\n hex = ColorFinder.changeColor(redTotal, greenTotal, blueTotal);\r\n colorBlend.setBackgroundColor(hex);\r\n } else {\r\n Log.i(\"Poop\", \"getLucky == true and nothing else\");\r\n hold = ColorFinder.randomColorFinder(ran, dom, ness);\r\n test = ColorFinder.randomColorFinder(fus, ro, dah);\r\n token = new StringTokenizer(hold);\r\n smoken = new StringTokenizer(test);\r\n redTotal = (int) ColorFinder.colorFinder(Integer.parseInt(token.nextToken())\r\n , Integer.parseInt(smoken.nextToken()), fade);\r\n greenTotal = (int) ColorFinder.colorFinder(Integer.parseInt(token.nextToken()),\r\n Integer.parseInt(smoken.nextToken()), fade);\r\n blueTotal = (int) ColorFinder.colorFinder((Integer.parseInt(token.nextToken()))\r\n , Integer.parseInt(smoken.nextToken()), fade);\r\n hex = ColorFinder.changeColor(redTotal, greenTotal, blueTotal);\r\n colorBlend.setBackgroundColor(hex);\r\n }\r\n if(gotColor1&& gotColor2) {\r\n getLucky = false;\r\n }\r\n }",
"public void setBlackAndWhite()\n {\n if (wall != null) // only if it's painted already...\n {\n wall.changeColor(\"black\");\n window.changeColor(\"white\");\n roof.changeColor(\"black\");\n sun.changeColor(\"black\");\n }\n }",
"public void pixaveGreyscale(int x1, int y1, int x2, int y2) {\n //float sumr,sumg,sumb;\n float sumg;\n int pix;\n //int r,g,b;\n float g;\n int n;\n\n if(x1<0) x1=0;\n if(x2>=kWidth) x2=kWidth-1;\n if(y1<0) y1=0;\n if(y2>=kHeight) y2=kHeight-1;\n\n //sumr=sumg=sumb=0.0;\n sumg = 0.0f;\n for(int y=y1; y<=y2; y++) {\n for(int i=kWidth*y+x1; i<=kWidth*y+x2; i++) {\n \n // old method use depth image\n //pix= kinecter.depthImg.pixels[i];\n //g = pix & 0xFF; // grey\n //sumg += g;\n \n //b=pix & 0xFF; // blue\n // pix = pix >> 8;\n //g=pix & 0xFF; // green\n //pix = pix >> 8;\n //r=pix & 0xFF; // red\n //if( random(0, 150000) > 149000 && r > 0) println(\"r \" + r + \" b \" + b + \" g \" + g);\n // averaging the values\n //sumr += b;//r;//g;//r;\n //sumg += b;//r;//g;\n //sumb += b;//r;//g;//b;\n \n // WORK WITH RAW DEPTH INSTEAD\n sumg += kinecter.rawDepth[i];\n\n \n }\n }\n n = (x2-x1+1)*(y2-y1+1); // number of pixels\n // the results are stored in static variables\n //ar = sumr/n; \n //ag = sumg/n; \n //ab = sumb/n;\n\n ar = sumg/n; \n ag = ar; \n ab = ar;\n }",
"protected void doDark() {\r\n\t\talpha = 0.5f;\r\n\t\tsetAlphaOnTiles();\r\n\t\trepaint();\r\n\t}",
"private void blackwhiteEffect(float min, float max) {\n float val_min = min / 200f;\n float val_max = max / 200f;\n Log.i(\"kike\", \"valor min : \" + val_min + \" valor max : \" + val_max + \" barra: \" + min + \" \" + max);\n EffectFactory factory = effectContext.getFactory();\n effect = factory.createEffect(EffectFactory.EFFECT_BLACKWHITE);\n effect.setParameter(\"black\", val_min);\n effect.setParameter(\"white\", val_max);\n effect.apply(textures[0], photoWidth, photoHeight, textures[1]);\n }",
"void setColor(float r, float g, float b) {\n color c = color(r, g, b);\n for(int x = 0; x < _img.width; x++) {\n for(int y = 0; y < _img.height; y++) {\n _img.set(x, y, c);\n }\n }\n }",
"private void drawsegment_gouraud_alpha(float leftadd,\n float rghtadd,\n int ytop,\n int ybottom) {\n ytop *= SCREEN_WIDTH;\n ybottom *= SCREEN_WIDTH;\n // int p = m_index;\n \n float irf = iradd;\n float igf = igadd;\n float ibf = ibadd;\n float iaf = iaadd;\n \n while (ytop < ybottom) {\n int xstart = (int) (xleft + PIXEL_CENTER);\n if (xstart < 0)\n xstart = 0;\n int xend = (int) (xrght + PIXEL_CENTER);\n if (xend > SCREEN_WIDTH)\n xend = SCREEN_WIDTH;\n float xdiff = (xstart + PIXEL_CENTER) - xleft;\n \n int ir = (int) (irf * xdiff + rleft);\n int ig = (int) (igf * xdiff + gleft);\n int ib = (int) (ibf * xdiff + bleft);\n int ia = (int) (iaf * xdiff + aleft);\n float iz = izadd * xdiff + zleft;\n \n xstart+=ytop;\n xend+=ytop;\n \n for ( ; xstart < xend; xstart++ ) {\n if (noDepthTest || (iz <= m_zbuffer[xstart])) {\n //m_zbuffer[xstart] = iz;\n \n //\n int red = (ir & 0xFF0000);\n int grn = (ig >> 8) & 0xFF00;\n int blu = (ib >> 16);\n \n // get buffer pixels\n int bb = m_pixels[xstart];\n int br = (bb & 0xFF0000); // 0x00FF0000\n int bg = (bb & 0xFF00); // 0x0000FF00\n bb = (bb & 0xFF); // 0x000000FF\n \n // blend alpha\n int al = ia >> 16;\n \n //\n m_pixels[xstart] = 0xFF000000 | \n ((br + (((red - br) * al) >> 8)) & 0xFF0000) | \n ((bg + (((grn - bg) * al) >> 8)) & 0xFF00) | \n ((bb + (((blu - bb) * al) >> 8)) & 0xFF);\n // m_stencil[xstart] = p;\n }\n \n //\n ir+=iradd;\n ig+=igadd;\n ib+=ibadd;\n ia+=iaadd;\n iz+=izadd;\n }\n \n ytop+=SCREEN_WIDTH;\n xleft+=leftadd;\n xrght+=rghtadd;\n rleft+=rleftadd;\n gleft+=gleftadd;\n bleft+=bleftadd;\n aleft+=aleftadd;\n zleft+=zleftadd;\n }\n }",
"private static BufferedImage colorBird(final BufferedImage refImage,\n final Color color) {\n \n final BufferedImage image = new BufferedImage(BIRD_WIDTH,\n BIRD_HEIGHT, BufferedImage.TYPE_INT_ARGB);\n \n final Color bright = color.brighter().brighter();\n final Color dark = color.darker().darker();\n \n for (int y = 0; y < BIRD_HEIGHT; ++y){\n for (int x = 0; x < BIRD_WIDTH; ++x) {\n int argb = refImage.getRGB(x, y);\n if (argb == 0xffe0802c)\n argb = dark.getRGB();\n else if (argb == 0xfffad78c)\n argb = bright.getRGB();\n else if (argb == 0xfff8b733)\n argb = color.getRGB();\n image.setRGB(x, y, argb);\n }\n } \n return image;\n }",
"@Override\n public synchronized void render(DssContext dssContext, Graphics2D g2d, int width, int height) \n {\n audioChannels = dssContext.getAudioData();\n channelSamples = averageChannels(audioChannels);// channelSamples has length blockLength\n applyWindow(fftWindowLength, channelSamples); // fftWindowLength = blockLength\n binValues = computeFFT(channelSamples); // binValues has length fftWindowLength/2\n whitener.whiten ( binValues, meanValues, whiteBinValues); // binValues typically range from 0.0 dB to 96.0 dB\n whitener.pickPeaks ( whiteBinValues, peakBinValues);\n \n bandHeight = (float) height / (float) bandCount;\n \n // Rendering:\n float y = height;\n int widthm1 = width - 1;// width minus 1\n int binNum; // binNum = bin number\n int bandNum; // bandNum = band number\n int topBinNum; // topBinNum = bin number of top bin in band\n int bottomBinNum = 0; // bottomBinNum = bin number of bottom bin in band\n float binValue; // binValue = value of selected FFT bin\n float bandValue; // bandValue = value of selected band (the loudest bin in the band)\n \n // Group up available bands using band distribution table:\n for (bandNum = 0; bandNum < bandCount; bandNum++)\n {\n topBinNum = topBinNumArray[bandNum];\n float tempFloat = 0;\n \n // Find loudest bin in the band. (The band is from bins 'bottomBinNum' to 'topBinNum').\n for (binNum = bottomBinNum; binNum <= topBinNum; binNum++)\n { binValue = whiteBinValues[binNum]; // binValue = Value of bin number binNum\n if (binValue > tempFloat)\n { tempFloat = binValue;\n }\n }\n bottomBinNum = topBinNum;\n\n // Calculate gain using a static gain factor and slope.\n bandValue = tempFloat * ( gain + (slope * bandNum) );\n if (bandValue < 0.0F) { bandValue = 0.0F; } // Limit under-saturation.\n if (bandValue > 1.0F) { bandValue = 1.0F; } // Limit over-saturation.\n\n // Calculate spectrogram color shifting between foreground and background colors.\n float _bandValue = 1.0F - bandValue;\n backgroundColor.getColorComponents(brgb);\n foregroundColor.getColorComponents(frgb);\n Color color = new Color(frgb[0] * bandValue + brgb[0] * _bandValue,\n frgb[1] * bandValue + brgb[1] * _bandValue,\n frgb[2] * bandValue + brgb[2] * _bandValue);\n g2d.setColor(color);\n g2d.drawLine(widthm1, Math.round(y), widthm1, Math.round(y - bandHeight));\n\n // Optionally, draw the peaks spectrum:\n tempFloat = peakBinValues[binNum]; // peakBinValues are either 0.1 or 50.0\n if(tempFloat > 10.0F)\n { g2d.setColor(Color.red);\n g2d.drawLine(widthm1, Math.round(y), widthm1, Math.round(y - bandHeight));\n }\n \n y -= bandHeight;\n }\n\n g2d.drawImage(buffImage, -1, 0, null);\n \n }",
"protected void tourne() {\n\t\tint direction = ev3.getDirection();\n\t\twhile (seenColor != ev3.SUIVRE) {\n\t\t\tev3.tourne(direction);\n\t\t\tev3.setCourbe(ev3.getCourbe() + 1);\n\t\t\tseenColor = find.whatColor(ev3.lireColor());\n\t\t\tif (ev3.getCourbe() % 10 == 0) {\n\t\t\t\tgeorges = 0;\n\t\t\t}\n\t\t}\n\t}",
"public void setBlackAndWhite()\n {\n if(wall != null) // only if it's painted already...\n {\n wall.changeColor(\"black\");\n window.changeColor(\"white\");\n roof.changeColor(\"black\");\n sun.changeColor(\"black\");\n }\n }",
"public void setBlackAndWhite()\n {\n if(wall != null) // only if it's painted already...\n {\n wall.changeColor(\"black\");\n window.changeColor(\"white\");\n roof.changeColor(\"black\");\n sun.changeColor(\"black\");\n }\n }",
"public boolean smooth(EnumSkyBlock mode) {\r\n \t\t\tint x, y, z, typeid, light, factor;\r\n \t\t\tint loops = 0;\r\n \t\t\tboolean haserror = true;\r\n \t\t\tboolean haderror = false;\r\n \t\t\tint lasterrx, lasterry, lasterrz;\r\n \t\t\tlasterrx = lasterry = lasterrz = 0;\r\n \t\t\twhile (haserror) {\r\n \t\t\t\tif (loops > 100) {\r\n \t\t\t\t\tlasterrx += this.chunk.x << 4;\r\n \t\t\t\t\tlasterrz += this.chunk.z << 4;\r\n \t\t\t\t\tStringBuilder msg = new StringBuilder();\r\n \t\t\t\t\tmsg.append(\"Failed to fix all \" + mode.toString().toLowerCase() + \" lighting at [\");\r\n \t\t\t\t\tmsg.append(lasterrx).append('/').append(lasterry);\r\n \t\t\t\t\tmsg.append('/').append(lasterrz).append(']');\r\n \t\t\t\t\tNoLaggLighting.plugin.log(Level.WARNING, msg.toString());\r\n \t\t\t\t\tbreak;\r\n \t\t\t\t}\r\n \t\t\t\thaserror = false;\r\n \t\t\t\tloops++;\r\n \t\t\t\tint inity;\r\n \t\t\t\tfor (x = 0; x < 16; x++) {\r\n \t\t\t\t\tfor (z = 0; z < 16; z++) {\r\n \t\t\t\t\t\tif (mode == EnumSkyBlock.SKY) {\r\n \t\t\t\t\t\t\tinity = this.chunk.b(x, z);\r\n \t\t\t\t\t\t\tif (inity >= this.world.getHeight()) {\r\n \t\t\t\t\t\t\t\tinity = this.world.getHeight() - 1;\r\n \t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t} else {\r\n \t\t\t\t\t\t\tinity = this.world.getHeight() - 1;\r\n \t\t\t\t\t\t}\r\n \t\t\t\t\t\tfor (y = inity; y > 0; --y) {\r\n \t\t\t\t\t\t\tif (this.chunk.i()[y >> 4] == null) {\r\n \t\t\t\t\t\t\t\tcontinue;\r\n \t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t\ttypeid = this.chunk.getTypeId(x, y, z);\r\n \t\t\t\t\t\t\tif (!Block.n[typeid]) {\r\n \t\t\t\t\t\t\t\tfactor = Math.max(1, Block.lightBlock[typeid]);\r\n \t\t\t\t\t\t\t\tlight = this.chunk.getBrightness(mode, x, y, z);\r\n \t\t\t\t\t\t\t\t// actual editing here\r\n \t\t\t\t\t\t\t\tint newlight = light + factor;\r\n \t\t\t\t\t\t\t\t// obtain lighting from all sides\r\n \t\t\t\t\t\t\t\tnewlight = Math.max(newlight, getLightLevel(mode, x - 1, y, z));\r\n \t\t\t\t\t\t\t\tnewlight = Math.max(newlight, getLightLevel(mode, x + 1, y, z));\r\n \t\t\t\t\t\t\t\tnewlight = Math.max(newlight, getLightLevel(mode, x, y, z - 1));\r\n \t\t\t\t\t\t\t\tnewlight = Math.max(newlight, getLightLevel(mode, x, y, z + 1));\r\n \t\t\t\t\t\t\t\tnewlight = Math.max(newlight, getLightLevel(mode, x, y - 1, z));\r\n \t\t\t\t\t\t\t\tnewlight = Math.max(newlight, getLightLevel(mode, x, y + 1, z));\r\n \t\t\t\t\t\t\t\tnewlight -= factor;\r\n \t\t\t\t\t\t\t\t// pick the highest value\r\n \t\t\t\t\t\t\t\tif (newlight > light) {\r\n \t\t\t\t\t\t\t\t\tChunkSection chunksection = this.chunk.i()[y >> 4];\r\n \t\t\t\t\t\t\t\t\tif (chunksection != null) {\r\n \t\t\t\t\t\t\t\t\t\tif (mode == EnumSkyBlock.SKY) {\r\n \t\t\t\t\t\t\t\t\t\t\tchunksection.c(x, y & 0xf, z, newlight);\r\n \t\t\t\t\t\t\t\t\t\t} else {\r\n \t\t\t\t\t\t\t\t\t\t\tchunksection.d(x, y & 0xf, z, newlight);\r\n \t\t\t\t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t\t\t\t\tlasterrx = x;\r\n \t\t\t\t\t\t\t\t\t\tlasterry = y;\r\n \t\t\t\t\t\t\t\t\t\tlasterrz = z;\r\n \t\t\t\t\t\t\t\t\t\thaserror = true;\r\n \t\t\t\t\t\t\t\t\t\thaderror = true;\r\n \t\t\t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t}\r\n \t\t\t\t\t}\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t\treturn haderror;\r\n \t\t}",
"@Override\n public void process() {\n getTelemetry().addData(\" start move\", \"BaseColor %s relic side %s\", baseColor.name(), (relicSide)?\"true\" :\"false\" );\n getTelemetry().update();\n if (JewelSensorAutoArmProcessor.JewelColor.RED.equals(baseColor)){\n if (relicSide) {\n RedRelicCorner();\n } else{\n RedNonRelicCorner();\n }\n }else{\n if (relicSide) {\n BlueRelicCorner();\n } else{\n BlueNonRelicCorner();\n }\n }\n releaseGlyph();\n }",
"private void m76755g() {\n this.f61635e = new Paint();\n this.f61635e.setAntiAlias(true);\n this.f61635e.setColor(this.f61636f);\n this.f61635e.setStyle(Style.FILL);\n this.f61635e.setStrokeWidth(2.0f);\n }",
"private Color getColor( float value ) {\n float[] rgba = (float[]) baseRgba_.clone();\n shader_.adjustRgba( rgba, value );\n return new Color( rgba[ 0 ], rgba[ 1 ], rgba[ 2 ], rgba[ 3 ] );\n }"
] | [
"0.6607069",
"0.6485882",
"0.6231806",
"0.6158383",
"0.61263114",
"0.612025",
"0.612025",
"0.6031252",
"0.6024009",
"0.6000648",
"0.5958585",
"0.5922553",
"0.5887433",
"0.58793986",
"0.58562607",
"0.584344",
"0.5843148",
"0.58352643",
"0.58185595",
"0.5774817",
"0.5771673",
"0.5765903",
"0.57573235",
"0.5756381",
"0.5735305",
"0.5727408",
"0.5720615",
"0.5718436",
"0.57162774",
"0.571276",
"0.5706664",
"0.5704286",
"0.56968725",
"0.5696185",
"0.56954473",
"0.5687387",
"0.568732",
"0.5674826",
"0.5648604",
"0.56485903",
"0.56475455",
"0.56471246",
"0.5645924",
"0.5645079",
"0.56409615",
"0.5640459",
"0.56330436",
"0.5614459",
"0.56089056",
"0.5600544",
"0.55984575",
"0.55930555",
"0.55889213",
"0.5579397",
"0.5569416",
"0.55673903",
"0.556052",
"0.55573416",
"0.5548536",
"0.55443895",
"0.55383873",
"0.5537192",
"0.55323374",
"0.5532336",
"0.5529894",
"0.5527009",
"0.5526259",
"0.55198693",
"0.5509501",
"0.5508734",
"0.5506728",
"0.55030984",
"0.5501839",
"0.54949284",
"0.54905295",
"0.5486103",
"0.5485301",
"0.5468751",
"0.5465563",
"0.54610765",
"0.5458987",
"0.545873",
"0.54586893",
"0.545855",
"0.5456757",
"0.5456615",
"0.5449875",
"0.54490566",
"0.54490024",
"0.54482704",
"0.54449457",
"0.5444399",
"0.54341835",
"0.5434179",
"0.54317844",
"0.5428406",
"0.5428406",
"0.542668",
"0.54224694",
"0.5416301",
"0.54153186"
] | 0.0 | -1 |
Set a OnColorChangedListener to get notified when the color selected by the user has changed. | public void setOnColorChangedListener(OnColorChangedListener listener) {
mListener = listener;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void setOnColorChangedListener(@NonNull OnColorChangedListener listener);",
"interface ColorChangedListener {\n void colorChanged(Color newColor);\n }",
"public interface OnColorChangedListener {\n\t/**\n\t * color change call back\n\t * @param color 选择的颜色\n\t */\n void colorChanged(int color);\n}",
"public static interface OnColorSelectedListener {\n void onColorSelected(Color color);\n }",
"@Override\n public void onColorSelected(int selectedColor) {\n }",
"public interface OnColorPickedListener {\n\tvoid onColorPicked(int swatch, int color);\n}",
"public void setColor(Color color) {\n\t\tthis.color = color;\n\t\tfireListenerSignal();\n\t}",
"public interface OnColorSelectedListener {\n public void onColorSelected(int color);\n}",
"@Override\n public void onColorChanged(int selectedColor) {\n Log.d(\"ColorPicker\", \"onColorChanged: 0x\" + Integer.toHexString(selectedColor));\n }",
"private void registerObservers() {\n ColorChooser.addObserver(new GeneralObserver() {\n @Override\n public void update() {\n color = ColorChooser.getColor();\n }\n });\n }",
"void onColorChanged(SeekBar seekBar, int color, boolean b);",
"public TColorPickerDialog setOnColorPickerListener(final TDialogInterface.OnColorPickerListener colorPickerListener) {\n this.colorPickerListener = colorPickerListener;\n// colorPicker.setColorListener(colorListener);\n return this;\n }",
"public void setColor(Color c) { color.set(c); }",
"public interface OnColorSeekBarChangeListener {\n\n\t\t/**\n\t\t * Notification that the color has changed. Clients can use the fromUser\n\t\t * parameter to distinguish user-initiated changes from those that\n\t\t * occurred programmatically. Parameters:\n\t\t * \n\t\t * @param seekBar\n\t\t * The SeekBar whose progress has changed\n\t\t * @param color\n\t\t * The current color-int from alpha, red, green, blue\n\t\t * components.\n\t\t * @param b\n\t\t * True if the progress change was initiated by the user.\n\t\t */\n\t\tvoid onColorChanged(SeekBar seekBar, int color, boolean b);\n\n\t\t/**\n\t\t * Notification that the user has started a touch gesture. Clients may\n\t\t * want to use this to disable advancing the seekbar.\n\t\t * \n\t\t * @param seekBar\n\t\t * The SeekBar in which the touch gesture began\n\t\t */\n\t\tvoid onStartTrackingTouch(SeekBar seekBar);\n\n\t\t/**\n\t\t * Notification that the user has finished a touch gesture. Clients may\n\t\t * want to use this to re-enable advancing the seekbar.\n\t\t * \n\t\t * @param seekBar\n\t\t * The SeekBar in which the touch gesture finished\n\t\t */\n\t\tvoid onStopTrackingTouch(SeekBar seekBar);\n\t}",
"public void setColor(Color c) {\n color = c;\n }",
"private void onColorChoose(View view) {\n int intColor = ((ColorDrawable) view.getBackground()).getColor();\n setColorForDialog(intColor);\n }",
"@Override\n public void onColorChange(int color) {\n int r = Color.red(color);\n int g = Color.green(color);\n int b = Color.blue(color);\n Log.w(\"CameraEngineActivity\", \"R:\" + r + \" G:\" + g + \" B:\" + b);\n colorText.setBackgroundColor(color);\n }",
"public void setColor(Color c) {\n this.color = c;\n }",
"public void setColor(Color c);",
"@Override\n public void onColorSelected(String color) {\n Toast.makeText(MainActivity.this, \"Selected Color HeX:\" + color, Toast.LENGTH_SHORT).show();\n }",
"@Override\n public void changeColor(ColorEvent ce) {\n \n txtRed.setText(\"\"+ ce.getColor().getRed());\n txtGreen.setText(\"\"+ ce.getColor().getGreen());\n txtBlue.setText(\"\"+ ce.getColor().getBlue());\n \n \n }",
"public void setColor(Color newColor) ;",
"public void setColor(Color c) {\n\t\tthis.color = c;\n\t}",
"public void setColor(Color c)\n\t{\n\t\tthis.color = c;\n\t}",
"public void setColor(Color color) {\n\t\t_color = color;\n\t\tnotifyObs(this);\n\t}",
"public void addSetColorListener(ActionListener action) {\n greenButton.addActionListener(action);\n redButton.addActionListener(action);\n yellowButton.addActionListener(action);\n blueButton.addActionListener(action);\n }",
"public void setColor(Color color);",
"public void changeColor(Color color) {\n this.color = color;\n }",
"public void onUpdateColor() {\n getVertexBufferObject().onUpdateColor(this);\n }",
"public void setColor(Color newColor)\n {\n this.color = newColor;\n conditionallyRepaint();\n }",
"@Override\n public void setColor(Color color) {\n this.color = color;\n }",
"public void setSelectedColor(Color color) {\r\n mColor = color;\r\n }",
"public void setColor(NativeCallback colorCallback) {\n\t\t// resets callback\n\t\tsetColor((ColorCallback<DatasetContext>) null);\n\t\t// stores value\n\t\tsetValueAndAddToParent(CommonProperty.COLOR, colorCallback);\n\t}",
"public void setChangeListener();",
"public void setColor(Color color) {\n this.color = color;\r\n }",
"public void setColor(ColorCallback<DatasetContext> colorCallback) {\n\t\t// sets the callback\n\t\tthis.colorCallback = colorCallback;\n\t\t// checks if callback is consistent\n\t\tif (colorCallback != null) {\n\t\t\t// adds the callback proxy function to java script object\n\t\t\tsetValueAndAddToParent(CommonProperty.COLOR, colorCallbackProxy.getProxy());\n\t\t} else {\n\t\t\t// otherwise sets null which removes the properties from java script object\n\t\t\tremove(CommonProperty.COLOR);\n\t\t}\n\t}",
"public void setColor(Color color) {\n this.color = color;\n }",
"void changeColor(Color color) {\r\n currentColor = color;\r\n redInput.setText(String.valueOf(color.getRed()));\r\n greenInput.setText(String.valueOf(color.getGreen()));\r\n blueInput.setText(String.valueOf(color.getBlue()));\r\n newSwatch.setForeground(currentColor);\r\n }",
"public void setColor(Color color) {\n this.color = color;\n }",
"public void setColor(int color);",
"public void setColor(int color);",
"@Override\n public void onChooseColor(int position, int color) {\n int red = Color.red(color);\n int green = Color.green(color);\n int blue = Color.blue(color);\n Log.e(\"rgb\", \"\" + red + \" \" + green + \" \" + blue);\n }",
"public void setColor( GraphColor newVal ) {\n color = newVal;\n }",
"public void setColor(int value);",
"public void setTrackColor(@ColorInt int color){\n this.mTrackColor = color;\n refreshTheView();\n }",
"public void setColor(int color) {\n this.color = color;\n }",
"public void setColor(Color newColor) {\n color = newColor;\n Canvas.getInstance().repaint();\n }",
"public void setColorSelectedHandler(@Nonnull ColorSelectedHandler handler) {\n this.colorSelectedHandler = checkNotNull(handler);\n }",
"void setColor(final java.awt.Color color);",
"private void onColorClick() {\n Integer colorFrom = getResources().getColor(R.color.animated_color_from);\r\n Integer colorTo = getResources().getColor(R.color.animated_color_to);\r\n ValueAnimator colorAnimator = ValueAnimator.ofObject(new ArgbEvaluator(), colorFrom, colorTo);\r\n colorAnimator.setDuration(animationDuration);\r\n colorAnimator.setRepeatCount(1);\r\n colorAnimator.setRepeatMode(ValueAnimator.REVERSE);\r\n colorAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {\r\n\r\n @Override\r\n public void onAnimationUpdate(ValueAnimator animator) {\r\n animatedArea.setBackgroundColor((Integer)animator.getAnimatedValue());\r\n }\r\n\r\n });\r\n colorAnimator.start();\r\n }",
"public void setColor(int color){\n this.color = color;\n }",
"public boolean setColor(Color c)\n {\n color = c;\n return true;\n }",
"public void setColor(float[] color){\n GLES20.glUniform4fv(mColorHandle, 1, color, 0);\n }",
"public void setColor(Color color_) {\r\n\t\tcolor = color_;\r\n\t}",
"protected void setColor(Color color) {\r\n\t\tthis.color = color;\r\n\t}",
"public void setColor(Color newColor) {\n\tcolor = newColor;\n }",
"public void setColor(final Color theColor) {\n myColor = theColor;\n }",
"private void define_select_color(){\n\n TextView white_panel = (TextView) findViewById(R.id.palette_white);\n TextView black_panel = (TextView) findViewById(R.id.palette_black);\n TextView red_panel = (TextView) findViewById(R.id.palette_red);\n TextView blue_panel = (TextView) findViewById(R.id.palette_blue);\n\n white_panel.setOnClickListener(new View.OnClickListener(){\n @Override\n public void onClick(View v){\n selected_color=WHITE;\n canvasView.setPaintColor(getSelectedColor(selected_color));\n }\n });\n black_panel.setOnClickListener(new View.OnClickListener(){\n @Override\n public void onClick(View v){\n selected_color=BLACK;\n canvasView.setPaintColor(getSelectedColor(selected_color));\n }\n });\n red_panel.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n selected_color = RED;\n canvasView.setPaintColor(getSelectedColor(selected_color));\n }\n });\n blue_panel.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n selected_color = BLUE;\n canvasView.setPaintColor(getSelectedColor(selected_color));\n }\n });\n\n\n\n }",
"public void setOnColor(final ColorDef ON_COLOR) {\n onColor = ON_COLOR;\n init(getInnerBounds().width, getInnerBounds().height);\n repaint(getInnerBounds());\n }",
"public void setColor(Color color) \n\t{\n\t\tthis.color = color;\n\t}",
"void setColor(@ColorInt int color);",
"public interface ColorPickerDialogCallback {\n void colorPicked(int red, int green, int blue, int textColor);\n}",
"public void setColor(int color) {\r\n\t\tthis.color = color;\r\n\t}",
"@Override\n public void setColorFilter(ColorFilter colorFilter) {}",
"public void chooseColor() {\n Color c = JColorChooser.showDialog(_parent, \"Choose '\" + getLabelText() + \"'\", _color);\n if (c != null) {\n _color = c;\n notifyChangeListeners();\n _updateField(_color);\n } \n }",
"public void setColor(Color color) {\n\t\tthis.color = color;\n\t}",
"public void setColor(Color color) {\n\t\tthis.color = color;\n\t}",
"public void colorClicked(View view) {\n //Selecting a colour\n if(view != currColor) {\n handwritingView.setErase(false); // Selecting a color switches to write mode\n ImageButton btnView = (ImageButton)view;\n String selColor = view.getTag().toString();\n handwritingView.changeColor(selColor);\n\n //Visually change selected color\n btnView.setAlpha((float) 0.50);\n currColor.setAlpha((float) 1.00);\n currColor = (ImageButton)view;\n }\n }",
"public void colorButtonClicked(String tag){\n color.set(tag);\n }",
"@Override\r\n public void setColor(Llama.Color color) {\r\n this.color = color;\r\n }",
"public interface OnColorSelectedListener {\n void onColorSelected(int color);\n\n /*\n public static interface OnColorSelectedListener {\n void onColorSelected(int color);\n }\n public static OnColorSelectedListener SelectedListener;\n public void setOnColorSelectedListener(OnColorSelectedListener listener){\n SelectedListener = listener;\n }*/\n}",
"public interface CardColorListener {\n public void setColorCode(int textColor, int bgColor);\n}",
"public void onColorFetched(int[] colors, long albumId) {\n }",
"public void setColor(int color){\r\n\t\tthis.color=color;\r\n\t}",
"public void setColor(int color){\n\t\tthis.color = color;\n\t}",
"public void setColor (Color color)\n {\n this.color = color;\n repaint();\n }",
"public void bindColor(final ColorPicker colorPicker, final Edit value) {\n try {\n building = true;\n Color color = Color.BLACK;\n try {\n color = Color.valueOf(value.getAsText());\n } catch (final Exception failure) {\n notifications.println(failure, \"unable to parse color:\" + value.getAsText());\n }\n\n colorPicker.setValue(color);\n colorPicker.valueProperty().addListener((ChangeListener<Color>) (val, before, after) -> {\n value.setByText(after.toString());\n syncable.sync();\n });\n bindFocus(value.name(), colorPicker);\n } finally {\n building = false;\n }\n }",
"public void setValue(Color value) {\n _color = value;\n _updateField(value);\n }",
"public void setColor(int c) {\n paint.setColor(c);\n invalidate();\n }",
"public void changeColor(Color c){\n switch(identifier){\n case \"FillRec\":\n fillrec.setBackground(c);\n break;\n case \"FillOval\":\n filloval.setBackground(c);\n break;\n case \"EmptyRec\":\n emptyrec.setBackground(c);\n break;\n case \"EmptyOval\":\n emptyoval.setBackground(c);\n break;\n case \"LineDraw\":\n linedraw.setBackground(c);\n break;\n case \"ColorChooser\":\n opencolor.setBackground(c);\n break;\n }\n }",
"public void setCurrentColor(Color color) {\n super.setColor(color);\n }",
"public void setOnKnobValuesChangedListener (KnobValuesChangedListener l) {\r\n\t\tknobValuesChangedListener = l;\r\n\t}",
"public void setColor(Color newColor) {\n\t\tcolor = newColor;\n\t}",
"public void stateChanged(ChangeEvent e) {\n\t\tif (!_receive) {\r\n\t\t\t// jesli nastapila zmiana na suwaku nastepuej odczyt wart z\r\n\t\t\t// wszystkich suwakow, utworzenie koloru i umieszczenie go w kolejce\r\n\t\t\tColor col = new Color(canvas.getBackground().getRed(), canvas.getBackground().getGreen(),\r\n\t\t\t\t\tcanvas.getBackground().getBlue());\r\n\t\t\tColorQueue.getInstance().putColor(col);\r\n\t\t}\r\n\r\n\t}",
"private void onColourWheelInput(MouseEvent e)\n {\n int x = (int)e.getX(), y = (int)e.getY();\n try\n {\n setColour(pickerWheel.getImage().getPixelReader().getColor(x, y), true);\n syncSliderInput();\n syncHexInput();\n syncRgbInput();\n } catch (IndexOutOfBoundsException ex){}\n }",
"public void setColor(Color clr){\n color = clr;\n }",
"void setColorSelection() {\r\n for (int i = 0; i < chooser.length; i++) {\r\n\r\n if (mainclass.getGraphTyp()\r\n == AbstractGraph.GRAPHTYP_RESIDUAL) {\r\n\r\n switch (i) {\r\n case COLOR_EDGE_ONE:\r\n chooser[i].setColorSelected(colors[COLOR_EDGE_FLOW]);\r\n break;\r\n case COLOR_EDGE_TWO:\r\n chooser[i].setColorSelected(colors[COLOR_EDGE_CAP]);\r\n break;\r\n case COLOR_EDGE_TOP:\r\n chooser[i].setColorSelected(colors[COLOR_EDGE_RTOP]);\r\n break;\r\n default:\r\n chooser[i].setColorSelected(colors[i]);\r\n }\r\n } else {\r\n chooser[i].setColorSelected(colors[i]);\r\n }\r\n }\r\n }",
"public void stateChanged(ChangeEvent changeEvent) {\n Color newForegroundColor = colorChooser.getColor();\n label.setForeground(newForegroundColor);\n }",
"@NoProxy\n @NoWrap\n public void setColor(final String val) {\n color = val;\n }",
"@Override\n\tpublic void changeColor2(Color color) {\n\n\t}",
"public void setColor(Color another)\r\n {\r\n currentColor = another;\r\n }",
"public void setColor(RGBColor color){\r\n this._color = new RGBColor(color);\r\n }",
"public abstract void setColor(Color color);",
"public abstract void setColor(Color color);",
"public ColorFilter(Color color) {\r\n this.color = color;\r\n }",
"public void setColorTo(IsColor color) {\n\t\tsetColorTo(IsColor.checkAndGetValue(color));\n\t}",
"void setColorWithRedraw(@ColorInt int color) {\n/* 167 */ this.mPaint.setColor(color);\n/* 168 */ onRedrawIfInitialized();\n/* */ }",
"public void RGB_Change(View view) {\r\n int [] color= {0,0,0};\r\n\r\n adb= new AlertDialog.Builder(this);\r\n adb.setCancelable(false);\r\n adb.setTitle(\"Core Colors Change\");\r\n adb.setItems(colors, new DialogInterface.OnClickListener() {\r\n @Override\r\n public void onClick(DialogInterface dialog, int which) {\r\n color[which]=255;\r\n lL.setBackgroundColor(Color.rgb(color[0],color[1],color[2]));\r\n }\r\n });\r\n adb.setPositiveButton(\"Exit\", new DialogInterface.OnClickListener() {\r\n @Override\r\n public void onClick(DialogInterface dialog, int which) {\r\n\r\n }\r\n });\r\n AlertDialog ad=adb.create();\r\n ad.show();\r\n }",
"public void setColor(@ColorInt int color) {\n Color.colorToHSV(color, mColorHSV);\n mColorHSV[1] = 1F;\n mColorHSV[2] = 1F;\n invalidate();\n }",
"protected void onColorUpdated(int type){\n if(type == ColorScheme.AUTO_COMP_PANEL_BG || type == ColorScheme.AUTO_COMP_PANEL_CORNER) {\n if(mACPanel != null)\n mACPanel.applyColor();\n return;\n }\n invalidate();\n }"
] | [
"0.867271",
"0.8056842",
"0.75854987",
"0.7361858",
"0.69965386",
"0.6811801",
"0.679091",
"0.66799814",
"0.6672865",
"0.6661419",
"0.66561365",
"0.6640978",
"0.64697236",
"0.63618064",
"0.62760776",
"0.6253922",
"0.6231881",
"0.62123567",
"0.6155136",
"0.61294585",
"0.6119502",
"0.6110901",
"0.6074314",
"0.60670733",
"0.5997581",
"0.5992412",
"0.5989209",
"0.59888077",
"0.5988412",
"0.5981332",
"0.59728694",
"0.5967407",
"0.59629864",
"0.5961408",
"0.59480435",
"0.59070456",
"0.59054023",
"0.5863659",
"0.5857997",
"0.58559835",
"0.58559835",
"0.5850601",
"0.58436584",
"0.5816035",
"0.5782027",
"0.5771974",
"0.5769951",
"0.57611686",
"0.5758514",
"0.57574165",
"0.5756285",
"0.57467496",
"0.5741535",
"0.574053",
"0.5732218",
"0.5732158",
"0.5723955",
"0.5715155",
"0.57147616",
"0.5687829",
"0.5680007",
"0.56789255",
"0.5678192",
"0.5675585",
"0.5668099",
"0.5664077",
"0.5664077",
"0.56612813",
"0.5656164",
"0.5641512",
"0.56282294",
"0.5627206",
"0.56228113",
"0.5622793",
"0.56165075",
"0.56154937",
"0.5612483",
"0.5594811",
"0.55760795",
"0.55753773",
"0.5556589",
"0.5541724",
"0.5541391",
"0.5541208",
"0.5540624",
"0.5539485",
"0.5530802",
"0.5530539",
"0.55200905",
"0.5510628",
"0.55093104",
"0.550699",
"0.550621",
"0.550621",
"0.5504484",
"0.5500006",
"0.5499406",
"0.549811",
"0.5496249",
"0.5493953"
] | 0.834232 | 1 |
Save the new price to the data store for this currency and update the currentPrice accordingly. Returns true if any data was changed; | boolean applyPrice(int asOfDate, boolean makeCurrent) {
if (newPrice == null || newPrice.doubleValue() == 0) {
updateCurrentPrice();
return false;
}
security.setSnapshotInt(asOfDate, 1 / Util.safeRate(newPrice), relativeCurrency).syncItem();
if (makeCurrent) {
if(relativeCurrency!=null && !relativeCurrency.equals(currencyTable.getBaseType())) {
double viewRateMult = CurrencyUtil.getUserRate(relativeCurrency,
currencyTable.getBaseType());
newPrice *= viewRateMult;
}
security.setUserRate(1.0/newPrice);
security.setParameter("price_date", System.currentTimeMillis());
security.syncItem();
}
newPrice = null;
updateCurrentPrice();
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic boolean updateShopCartMoney(double price) {\n\t\treturn false;\n\t}",
"@Override\n public boolean updateItemModelPrice(ItemModelPrice itemModelPrice) {\n return itemModelPriceDao.update(itemModelPrice);\n }",
"public boolean updatePricingForId(int productId, Pricing pricing);",
"public void setPrice(double newPrice) {\r\n price = newPrice;\r\n }",
"public void updateCurrentPriceAndValue (Double newPrice) {\n\t\t\n\t\tcurrentPrice = newPrice;\n\t\tcurrentValue = currentPrice * quantity;\n\t\t\n\t\t\n\t}",
"public boolean setPrice(double price){\r\n\t\tif(price < 0) return false;\r\n\t\ttry {\r\n\t\t\tthis.workerobj.put(WorkerController.PRICE, price);\r\n\t\t\treturn true;\r\n\t\t} catch (JSONException e) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}",
"@Override\n public boolean updatePriceByProductId(ProductRequest productRequest) {\n\n boolean isUpdateSuccess = false;\n try {\n Product product = fetchProductById(productRequest.getProductId());\n\n if (product != null) {\n product.setPrice(productRequest.getPrice());\n productRepository.save(product);\n isUpdateSuccess = true;\n }\n } catch (MongoException ex) {\n LOGGER.debug(\"MongoException DB - \" + ex.getMessage());\n }\n return isUpdateSuccess;\n }",
"public synchronized void updateCurrentMarket() throws InvalidDataException {\n\t\tPrice topBuyPrice = (getBuySide().topOfBookPrice() == null) ? PriceFactory.makeLimitPrice(0) : getBuySide().topOfBookPrice();\n\t\tPrice topSellPrice = (getSellSide().topOfBookPrice() == null) ? PriceFactory.makeLimitPrice(0) : getSellSide().topOfBookPrice();\n\n\t\tString data = topBuyPrice.toString() + getBuySide().topOfBookVolume()\n\t\t\t\t\t+ topSellPrice.toString() + getSellSide().topOfBookVolume();\n\t\tif (!getLatestMarketData().equals(data)) {\n\t\t\tMarketDataDTO latestData = new MarketDataDTO(getStock(), topBuyPrice, \n\t\t\t\t\tgetBuySide().topOfBookVolume(), topSellPrice, getSellSide().topOfBookVolume());\n\t\t\tCurrentMarketPublisher.getInstance().publishCurrentMarket(latestData);\n\t\t\tsetLatestMarketData(data);\n\t\t}\n\t}",
"private boolean updateCoin()\r\n {\r\n\r\n MyLogger.log(Level.INFO, LOG_CLASS_NAME + \"Updating coin\");\r\n coinUpdateStatus.setText(\"\");\r\n coinUpdateStatus.setVisible(false);\r\n boolean updateCoinSuccess = false;\r\n\r\n if (isCoinValid())\r\n {\r\n //TODO\r\n StringBuilder coinNote = new StringBuilder(coinNoteTxtField.getText());\r\n int coinYear = Integer.parseInt(coinMintYearTxtField.getText());\r\n MyLogger.log(Level.INFO, LOG_CLASS_NAME + \"collectionComboBox.getValue(): {0}\", collectionComboBox.getValue());\r\n MyLogger.log(Level.INFO, LOG_CLASS_NAME + \"collection uuid is: {0}\", collectionUUID);\r\n coinUUID = UUID.fromString(coinProperty.getCoinUUID());\r\n Coin newCoin = new Coin(userUUID, coinNameTxtField.getText(), coinGradeComboBox.getValue(), coinFaceValueTxtField.getText(), coinCurrencyComboBox.getValue(), coinNote, coinYear, coinMintMarkTxtField.getText(), coinBuyPriceTxtField.getText(), coinValueTxtField.getText(), coinBuyDatePicker.getValue(), collectionUUID, coinUUID);\r\n MyLogger.log(Level.INFO, LOG_CLASS_NAME + \"Coin object with updated info created, coin uuid is {0}\", newCoin.getItemUUID().toString());\r\n\r\n if (DBCoinConnect.updateCoin(newCoin))\r\n {\r\n MyLogger.log(Level.INFO, LOG_CLASS_NAME + \"Coin updated in DB, user uuid is {0}\", userUUID.toString());\r\n MyLogger.log(Level.INFO, LOG_CLASS_NAME + \"Coin updated in DB, collection uuid is {0}\", collectionUUID.toString());\r\n MyLogger.log(Level.INFO, LOG_CLASS_NAME + \"Coin updated in DB, coin uuid is {0}\", newCoin.getItemUUID().toString());\r\n updateCoinSuccess = true;\r\n saveCoinImages();\r\n } else\r\n {\r\n MyLogger.log(Level.INFO, LOG_CLASS_NAME + \"Coin NOT updated in DB, user uuid is {0}\", userUUID.toString());\r\n MyLogger.log(Level.INFO, LOG_CLASS_NAME + \"Coin NOT updated in DB, coin uuid is {0}\", newCoin.getItemUUID().toString());\r\n updateCoinSuccess = false;\r\n }\r\n }\r\n return updateCoinSuccess;\r\n }",
"BigDecimal getDirtyPrice();",
"public void increasePrice() {\n //price doubled\n itemToSell.setBuyPrice(itemToSell.getBuyPrice() * 2);\n }",
"private void updatePriceStats(double newPrice) {\n this.currentPrice = newPrice;\n this.currentAvgPrice = Double.parseDouble(decimalFormat.format(computeSMA(newPrice, currentAvgPrice, priceHistory)));\n this.priceChangePCT = Double.parseDouble(decimalFormat.format(computeDifferentialPCT(newPrice, currentAvgPrice)));\n }",
"private void updatePriceAndSaving() {\n movieOrder = new MovieOrder(movie, Weekday.weekdayForValue(selectedDay), flagsApplied, numberOfTickets);\n\n tvTotalPriceNewTickets.setText(getResources().getString(\n R.string.total_price_new_tickets,\n movieOrder.getTotalPriceAfterDiscount(),\n movieOrder.getNumberOfTicketsAfterOfferIsApplied())\n );\n\n tvSavingsNewTickets.setText(getResources().getString(\n R.string.today_saving_new_tickets,\n movieOrder.getTotalSaving()\n ));\n }",
"private void changePrice() {\n\t\tint sic_idHolder; // declares sic_idHolder\n\t\tdouble priceHolder; // declares priceHolder\n\t\t\n\t\tSystem.out.println(\"Please enter the SIC-ID of the book you'd like to change the price of:\");\n\t\tsic_idHolder = scan.nextInt();\n\t\tscan.nextLine();\n\t\t\n\t\tif(inventoryObject.cardExists(sic_idHolder)) { // checks to see if card exists\n\t\t\tSystem.out.println(\"Please enter the new price of the book:\");\n\t\t\tpriceHolder = scan.nextDouble();\n\t\t\tscan.nextLine();\n\t\t\tif(priceHolder < 0) { // checks to see if priceHolder is negative\n\t\t\t\tSystem.out.println(\"The price cannot be below zero\\n\");\n\t\t\t\tgetUserInfo();\n\t\t\t}\n\t\t\tinventoryObject.changePrice(sic_idHolder, priceHolder);\n\t\t\tgetUserInfo();\n\t\t}\n\t\telse {\n\t\t\tSystem.out.println(\"The ID you entered does not exist\\n\");\n\t\t\tgetUserInfo();\n\t\t}\n\t}",
"private void insertItemPrice(final Price price) {\n try {\n boolean isItemExisting = false;\n ItemEntity knownItem = mDatabaseAccess.itemsDAO().selectItem(price.getId());\n // item is not known yet. Load the item via the REST API\n if (knownItem == null) {\n Item newItem = mItemAccess.getItemWithWifi(price.getId());\n if (newItem != null) {\n mDatabaseAccess.itemsDAO().insertItems(new ItemEntity(newItem));\n isItemExisting = true;\n }\n } else {\n isItemExisting = true;\n }\n\n // add the price only if the item reference is known and exists\n if (isItemExisting) {\n ItemPriceEntity newPrice = new ItemPriceEntity(\n price.getId(),\n price.getBuys().getUnitPrice(),\n price.getSells().getUnitPrice(),\n System.currentTimeMillis());\n mDatabaseAccess.itemsDAO().insertItemPrice(newPrice);\n } else {\n Log.w(TAG, String.format(\n \"The Item to the price id '%d' doesn't exist. the price will be skipped\",\n price.getId()));\n }\n } catch (Exception ex) {\n Log.e(TAG, \"Failed to process the item price with the ID: \" + price.getId(), ex);\n }\n }",
"public void UpdatePFStorePrices()\n {\n PlayFabClientModels.GetStoreItemsRequest req = new PlayFabClientModels.GetStoreItemsRequest();\n req.StoreId = cStoreId;\n\n PlayFabErrors.PlayFabResult<PlayFabClientModels.GetStoreItemsResult> result = PlayFabClientAPI.GetStoreItems(req);\n\n String errors = CompileErrorsFromResult(result);\n Log.d(TAG, \"GetStoreItems: \" + (errors == null? \"success\" : errors));\n\n if(result.Result != null)\n {\n for(PlayFabClientModels.StoreItem item : result.Result.Store)\n {\n Log.d(TAG, \"Store Item ID: \" + item.ItemId);\n\n if(item.VirtualCurrencyPrices.containsKey(cVC))\n {\n mStorePrices.put(item.ItemId, Objects.requireNonNull(item.VirtualCurrencyPrices.get(cVC)));\n }\n }\n }\n }",
"public void updateStockPrice(String ticker, double currentUnitValue) {\n\t\tStock stock = this.findStockByTicker(ticker);\n\t\tstock.setCurrentUnitValue(currentUnitValue);\n\t\tstockRepo.save(stock);\t\n\t}",
"public ProductWithStockItemTO changePrice(long storeID, StockItemTO stockItemTO) throws NotInDatabaseException, UpdateException;",
"public void putNewPrice(String symbol, double price);",
"public void setPriceEntered (BigDecimal PriceEntered);",
"public String updateProductPrice(PriceAndCurrency priceAndCurrency) {\n\t\t// TODO Auto-generated method stub\n\t\tString response = myRetailAppDao.updateProductPrice(priceAndCurrency);\n\t\treturn response;\n\t}",
"public void setPrice(BigDecimal price) {\r\n this.price = price;\r\n }",
"public void setPrice(BigDecimal price) {\r\n this.price = price;\r\n }",
"public void setPrice(BigDecimal price) {\n this.price = price;\n }",
"public void setPrice(BigDecimal price) {\n this.price = price;\n }",
"public void refreshData(float price) {\n if (price <= 0 || price == mLastPrice) {\n return;\n }\n mLastPrice = price;\n CombinedData data = mChartPrice.getData();\n if (data == null) return;\n LineData lineData = data.getLineData();\n if (lineData != null) {\n ILineDataSet set = lineData.getDataSetByIndex(0);\n if (set.removeLast()) {\n set.addEntry(new Entry(set.getEntryCount(), price));\n }\n }\n\n mChartPrice.notifyDataSetChanged();\n mChartPrice.invalidate();\n }",
"public void priceUpdate(String security, double price) {\n logger.debug(\"There is a price update for stock: \" + security + \" :: updated price: \" + price);\n stockMap.get(security).setPricePerUnit(price);\n for (Map.Entry<String, PersonalStock> entrySet : personalStockMap.entrySet()) {\n entrySet.getValue().priceUpdate(security, price);\n }\n }",
"void stockPriceChanged(Stock stock, double oldValue, double newValue);",
"public void setPrice(Money price) {\n this.price = price;\n }",
"public boolean saveDown() {\n if (\n cashFlow == null ||\n cashFlow.getDetail() == null ||\n cashFlow.getDetail().isEmpty()\n ) {\n System.out.println(\"invalid model store\");\n return false;\n }\n boolean cashFlowSaveResult = CashFlow.save(cashFlow);\n\n // save cash flow failure case\n if (!cashFlowSaveResult) {\n System.out.println(\"query false\");\n return false;\n }\n\n // get owe per provider\n boolean owe_log = true;\n int pointer = 0;\n final Map<String, Integer> providerIndex = new HashMap<>();\n final int nrow = cashFlow.getDetail().size();\n final int[] owe = new int[nrow];\n for (Payable p: cashFlow.getDetail()) {\n String prvId = p.getProviderId();\n if (providerIndex.containsKey(prvId)) {\n owe[ providerIndex.get(prvId) ] += p.getPrice();\n } else {\n providerIndex.put(prvId, pointer);\n owe[ pointer ] = p.getPrice();\n pointer++;\n }\n }\n for (String k: providerIndex.keySet()) {\n owe_log = owe_log &&\n db.send(\"UPDATE NhaCungCap SET NoPhaiTra = NoPhaiTra + \"\n + owe[ providerIndex.get(k) ]\n + \" WHERE MaNCC = \" + k);\n }\n if (!owe_log) {\n System.out.println(\"update own false\");\n }\n return owe_log;\n }",
"public boolean confirmPrice(String price) {\r\n String finalPrice = getPrice();\r\n info(\"Price of chosen ticket: \" + price + \" Price before paying: \" + finalPrice);\r\n return clearPrice(finalPrice).equals(price);\r\n }",
"public void setPrice(java.math.BigDecimal price) {\n this.price = price;\n }",
"public boolean hasPrice() {\n return ((bitField0_ & 0x00000020) == 0x00000020);\n }",
"public boolean hasPrice() {\n return ((bitField0_ & 0x00000020) == 0x00000020);\n }",
"@Subscribe\n public void receiveCurrentPrice(CurrentPriceResponse currentPriceResponse) {\n if (currentPriceResponse.getCurrency().equals(\"btc\")) {\n // we made a btc price request\n btcPrice = new BigDecimal(currentPriceResponse.getPrice());\n } else {\n // local currency price\n localCurrencyPrice = new BigDecimal(currentPriceResponse.getPrice());\n }\n if (currentPriceResponse.getBtc() != null) {\n btcPrice = new BigDecimal(currentPriceResponse.getBtc());\n }\n RxBus.get().post(new WalletPriceUpdate());\n }",
"public void setPriceListOld (BigDecimal PriceListOld);",
"public void setPrice(final BigDecimal price) {\n this.price = price;\n }",
"public void setPrice(double price) {\r\n this.price = price;\r\n }",
"public void setPrice(double price) {\r\n this.price = price;\r\n }",
"public void setPrice(double price) {\r\n this.price = price;\r\n }",
"@Override\r\n\tpublic int createPrice(ProductRaw_Price price) {\n\t\tprice.setStatus(0);\r\n\t\treturn productRaw_PriceDao.insert(price);\r\n\t}",
"public void setPrice(Double price) {\r\n this.price = price;\r\n }",
"public void setPrice(double price) {\n this.price = price;\n }",
"public void setPrice(double price) {\n this.price = price;\n }",
"public void setPrice(double price) {\n this.price = price;\n }",
"public void setPrice(double price) {\n this.price = price;\n }",
"public void setPrice(double price) {\n this.price = price;\n }",
"public void setPrice(double price) {\n this.price = price;\n }",
"public void setPrice(double price) {\n this.price = price;\n }",
"public void updateStockData() {\n\t\t\ttry {\n\t\t\t\tthis.dataURL = new URL(this.url);\n\t\t\t} catch (final MalformedURLException e) {\n\t\t\t\tSystem.out\n\t\t\t\t\t\t.println(\"CRITICAL ERROR: The impossible has happened! The hard-hoded URL was malformed.\");\n\t\t\t\tSystem.exit(1);\n\t\t\t}\n\t\t\tScanner scanner;\n\t\t\ttry {\n\t\t\t\tscanner = new Scanner(this.dataURL.openStream());\n\t\t\t\twhile (scanner.hasNextLine())\n\t\t\t\t\ttry {\n\t\t\t\t\t\tscanner\n\t\t\t\t\t\t\t\t.findInLine(Pattern\n\t\t\t\t\t\t\t\t\t\t.compile(\"([0-9.]*),\\\"([0-9a-zA-Z._-]*)\\\",\\\"([a-zA-Z._\\\\s-]*)\\\"\"));\n\t\t\t\t\t\tfinal MatchResult result = scanner.match();\n\t\t\t\t\t\tboolean found = false;\n\t\t\t\t\t\tfor (final StockCompany company : StockBrokerImpl.this.stockData)\n\t\t\t\t\t\t\tif (company.getCompanySymbol().equals(\n\t\t\t\t\t\t\t\t\tresult.group(2))) {\n\t\t\t\t\t\t\t\tfinal Double stockPrice = Double\n\t\t\t\t\t\t\t\t\t\t.parseDouble(result.group(1));\n\t\t\t\t\t\t\t\tcompany.setStockPrice(stockPrice);\n\t\t\t\t\t\t\t\tfound = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!found)\n\t\t\t\t\t\t\tStockBrokerImpl.this.stockData\n\t\t\t\t\t\t\t\t\t.add(new StockCompany(result.group(3),\n\t\t\t\t\t\t\t\t\t\t\tresult.group(2), Double\n\t\t\t\t\t\t\t\t\t\t\t\t\t.parseDouble(result\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.group(1))));\n\n\t\t\t\t\t\tscanner.nextLine();\n\n\t\t\t\t\t} catch (final NumberFormatException e) {\n\t\t\t\t\t\tSystem.out\n\t\t\t\t\t\t\t\t.println(\"CRITICAL ERROR: Update data corrupted. [Virtually impossible]\");\n\t\t\t\t\t\tSystem.exit(1);\n\t\t\t\t\t}\n\t\t\t\tscanner.close();\n\t\t\t} catch (final IOException e) {\n\t\t\t\tSystem.out\n\t\t\t\t\t\t.println(\"ERROR: Connection to stock price update feed could not be established.\");\n\t\t\t}\n\t\t}",
"public void setPrice(Double price) {\n this.price = price;\n }",
"public void setPrice(Double price) {\n this.price = price;\n }",
"public void setPrice(double price)\n {\n this.price = price;\n }",
"public void setPrice(double price)\n {\n this.price = price;\n }",
"private Boolean saveChanges() {\n int rowId = ticketGui.getSelectedRowId();\n\n // getting all the text fields for any possible changes\n String clientName = clientNameTextField.getText().strip();\n String starID = starIdTextField.getText().strip();\n String email = emailTextField.getText().strip();\n String phoneNumber = phoneNumberTextField.getText().strip();\n String machineModel = deviceModelTextField.getText().strip();\n String description = descriptionTextArea.getText().strip();\n String memberName = clubMemberNameTextField.getText().strip();\n String resolution = resolutionTextArea.getText().strip();\n\n // making sure all the required fields are still filled out\n boolean valid = ticketGui.fieldValidation(clientName,starID,email,phoneNumber,machineModel,description,\n memberName,resolution);\n\n if (valid){\n if (JOptionPane.showConfirmDialog(this, \"Are you sure you want to save these changes?\",\n \"Save\", JOptionPane.OK_CANCEL_OPTION) == JOptionPane.OK_OPTION) {\n\n // adding all of this to a new ticket and passing it to the tiketstore to update the ticket\n Ticket ticket = new Ticket(clientName, starID, email, phoneNumber, machineModel, description, memberName, resolution);\n ticket.setTicketId(rowId);\n\n controller.updateTicket(ticket);\n ticketGui.showAllTickets();\n return true;\n }\n }\n return false;\n }",
"public void setPrice(Date price) {\n this.price = price;\n }",
"public void setPrice(double price) {\r\n\t\tthis.price = price;\r\n\t}",
"public void setPrice(double price) {\r\n\t\tthis.price = price;\r\n\t}",
"@Test\n public void addPrice() throws Exception {\n final PriceDraft expectedPrice = PriceDraft.of(MoneyImpl.of(123, EUR));\n withUpdateableProduct(client(), product -> {\n final Product updatedProduct = client()\n .executeBlocking(ProductUpdateCommand.of(product, AddPrice.of(1, expectedPrice)));\n\n\n final List<Price> prices = updatedProduct.getMasterData().getStaged().getMasterVariant().getPrices();\n assertThat(prices).hasSize(1);\n final Price actualPrice = prices.get(0);\n\n assertThat(expectedPrice).isEqualTo(PriceDraft.of(actualPrice));\n\n return updatedProduct;\n });\n }",
"public void editProductPrice(String price){\r\n\t\twdlib.waitForElement(getProductText());\r\n\t\tif(getProductText().getText().equals(\"None Included\")){\r\n\t\t\tselPproductBtn.click();\r\n\t\t\tProductsPage pdpage=new ProductsPage();\r\n\t\t\tpdpage.selectProducts();\r\n\t\t\tdriver.navigate().refresh();\r\n\t\t\tselProductOpt.click();\r\n\t\t\twdlib.waitForElement(getProductText());\r\n\t\t\teditBtn.click();\r\n\t\t\taddNewPrice(price);\r\n\t\t}\r\n\t\telse{\r\n\t\t\t\r\n\t\t\teditBtn.click();\r\n\t\t\taddNewPrice(price);\r\n\t\t}\r\n\t\tdriver.navigate().refresh();\r\n\t}",
"public void saveOrUpdate(PosPrice posPrice) throws DataAccessException{\n super.saveOrUpdate(posPrice);\n }",
"public void setPrice(double price) {\n\t\tthis.price = price;\n\t}",
"public void setPrice(double price) {\n\t\tthis.price = price;\n\t}",
"public void setPrice(double price) {\n\t\tthis.price = price;\n\t}",
"public void setPrice(double price) \n\t{\n\t\tthis.price = price;\n\t}",
"public void setPrice(Double price) {\n\t\tthis.price = price;\n\t}",
"public void setPrice(int newPrice){\n productRelation.setCost(newPrice);\n }",
"public void setPriceActual (BigDecimal PriceActual);",
"private void saveChanges() {\n product.setName(productName);\n product.setPrice(price);\n\n viewModel.updateProduct(product, new OnAsyncEventListener() {\n @Override\n public void onSuccess() {\n Log.d(TAG, \"updateProduct: success\");\n Intent intent = new Intent(EditProductActivity.this, MainActivity.class);\n startActivity(intent);\n }\n\n @Override\n public void onFailure(Exception e) {\n Log.d(TAG, \"updateProduct: failure\", e);\n final androidx.appcompat.app.AlertDialog alertDialog = new androidx.appcompat.app.AlertDialog.Builder(EditProductActivity.this).create();\n alertDialog.setTitle(\"Can not save\");\n alertDialog.setCancelable(true);\n alertDialog.setMessage(\"Cannot edit this product\");\n alertDialog.setButton(androidx.appcompat.app.AlertDialog.BUTTON_NEGATIVE, \"ok\", (dialog, which) -> alertDialog.dismiss());\n alertDialog.show();\n }\n });\n }",
"public void changePrice(TripDTO trip, BigDecimal price);",
"@Override\n\tpublic void savePrice(Goods goods) {\n\t\tgoodsMapper.insert(goods);\n\t}",
"public boolean addOrUpdateCapitalMarkets(CapitalMarketsModel companyDetails) {\n //Use the Cached Connection\n SQLiteDatabase db = getWritableDatabase();\n Boolean transactionSuccessful = false;\n\n //As usual Wrap it in a transaction\n db.beginTransaction();\n try {\n ContentValues values = new ContentValues();\n values.put(KEY_COMPANY_OBJECT_ID, companyDetails.getCompanyObjectId());\n values.put(KEY_COMPANY_NAME, companyDetails.getCompanyName());\n values.put(KEY_COMPANY_IMAGE, companyDetails.getCompanyImage());\n values.put(KEY_COMPANY_ADDRESS, companyDetails.getCompanyAddress());\n values.put(KEY_COMPANY_STOCK_CODE, companyDetails.getCompanyStockCode());\n values.put(KEY_COMPANY_DESCRIPTION, companyDetails.getCompanyDescription());\n values.put(KEY_COMPANY_ESTABLISHED, companyDetails.getCompanyEstablished());\n values.put(KEY_COMPANY_CONTACTS, companyDetails.getCompanyContacts());\n values.put(KEY_COMPANY_INDUSTRY, companyDetails.getCompanyType());\n values.put(KEY_COMPANY_WEBSITE, companyDetails.getCompanyWebsite());\n values.put(KEY_COMPANY_STATUS, companyDetails.getCompanyStatus());\n values.put(KEY_COMPANY_SUMMARY, companyDetails.getCompanySummary());\n //Let's try to update the Saved Product if it exists.\n int rows = db.update(TABLE_BANKS, values, KEY_COMPANY_OBJECT_ID + \"= ?\", new String[]{companyDetails.getCompanyObjectId()});\n\n //Let's check if the update worked\n if (rows == 1) {\n //Ok, we have updated a Saved COMPANY, we could probably get the COMPANY updated at this point if we needed to\n db.setTransactionSuccessful();\n transactionSuccessful = true;\n\n } else {\n //No Such Bank Here, insert it\n db.insertOrThrow(TABLE_CAPITAL_MARKETS, null, values);\n db.setTransactionSuccessful();\n transactionSuccessful = true;\n }\n } catch (Exception e) {\n Log.d(TAG, \"Error trying to Update company table\");\n transactionSuccessful = false;\n } finally {\n db.endTransaction();\n }\n return transactionSuccessful;\n\n }",
"private void saveItemPriceTrend(final Price price) {\n try {\n ItemPriceEntity itemPrice = mDatabaseAccess.itemsDAO().selectLastItemPrice(\n price.getId());\n double sellPercentage = 0;\n double buyPercentage = 0;\n // calculates the sell and buy percentage if a price already exists\n if (itemPrice != null) {\n sellPercentage = 1 - (price.getSells().getUnitPrice() / itemPrice.getSellPrice());\n buyPercentage = 1 - (price.getBuys().getUnitPrice() / itemPrice.getBuyPrice());\n }\n // insert the data\n mDatabaseAccess.trendDAO().insertTrend(\n new TrendEntity(price.getId(), TrendType.BuyItems, buyPercentage));\n mDatabaseAccess.trendDAO().insertTrend(\n new TrendEntity(price.getId(), TrendType.SellItems, sellPercentage));\n } catch (Exception ex) {\n Log.e(TAG, \"Failed to process the item trend with the ID: \" + price.getId(), ex);\n }\n }",
"public void setOriginalPrice(Float OriginalPrice) {\n this.OriginalPrice = OriginalPrice;\n }",
"public void setCurrentCostPrice (BigDecimal CurrentCostPrice)\n\t{\n\t\tset_Value (COLUMNNAME_CurrentCostPrice, CurrentCostPrice);\n\t}",
"@Override\r\n\tpublic void saveCurrentBalance(Double btcprice, Double balance, Long userId) {\r\n\t\taccountDataDao.saveCurrentBalance(btcprice, balance, userId);\t\t\r\n\t}",
"@FXML\n\t private void updateProductPrice (ActionEvent actionEvent) throws SQLException, ClassNotFoundException {\n\t try {\n\t ProductDAO.updateProdPrice(prodIdText.getText(),newPriceText.getText());\n\t resultArea.setText(\"Price has been updated for, product id: \" + prodIdText.getText() + \"\\n\");\n\t } catch (SQLException e) {\n\t resultArea.setText(\"Problem occurred while updating price: \" + e);\n\t }\n\t }",
"public boolean hasPrice() {\n return ((bitField0_ & 0x00000010) == 0x00000010);\n }",
"@Override\n public void onPriceChange(String price) {\n poll.setPrice(YelpPriceLevel.fromYelpString(price));\n }",
"protected boolean addNewStockToMarket(String tickerSymbol, double sharePrice){\r\n if(stocksSymbolToPrice.containsKey(tickerSymbol)){\r\n return false;\r\n }\r\n //if the stock is already listed, return false\r\n //otherwise, add the key-value pair to the stocksSymbolToPrice map and return true;\r\n stocksSymbolToPrice.put(tickerSymbol, sharePrice);\r\n return true;\r\n }",
"@Override\n\tpublic void setPrice() {\n\t\tprice = 24.99;\n\n\t}",
"@Override\n\tpublic boolean update(ProductCategory procate) {\n\t\treturn false;\n\t}",
"private boolean saveData() {\n // get data from input controls\n collectDataFromUI();\n\n if (!validateData()) return false;\n\n boolean isTransfer = mCommon.transactionEntity.getTransactionType().equals(TransactionTypes.Transfer);\n if (!isTransfer) {\n mCommon.resetTransfer();\n }\n\n // Transaction. Need the id for split categories.\n\n if (!saveTransaction()) return false;\n\n // Split Categories\n\n if (mCommon.convertOneSplitIntoRegularTransaction()) {\n saveTransaction();\n }\n\n if(!mCommon.isSplitSelected()) {\n // Delete any split categories if split is unchecked.\n mCommon.removeAllSplitCategories();\n }\n if (!saveSplitCategories()) return false;\n\n return true;\n }",
"public boolean hasPrice() {\n return ((bitField0_ & 0x00000010) == 0x00000010);\n }",
"public boolean update(Product product);",
"public void setPrice(Double price);",
"public void updatePrice(Long productId, Money newPrice) {\n\t\t// Retrieve the MDS Entry object\n\t\tMDSEntry mdsEntry = treeMap.get(productId);\n\t\t// update the price\n\t\tmdsEntry.price = newPrice;\n\t\ttreeMap.replace(productId, mdsEntry);\n\t}",
"public void setPriceStdOld (BigDecimal PriceStdOld);",
"protected void setPrice(DukatAmount price){\r\n\t\tif(canHaveAsPrice(price))\r\n\t\t\tthis.price = price;\r\n\t}",
"@Override\n\tpublic boolean updateStock(int quant) {\n\t\treturn false;\n\t}",
"public void save(PosPrice posPrice) throws DataAccessException {\n super.save(posPrice);\n }",
"@Override\n\tpublic void doSave(SellOfer model, HttpServletRequest request,\n\t\t\tHttpServletResponse response) {\n\t\t if(StringUtil.isEmpty(model.getPrice())){\n\t\t\t model.setPrice(\"0\");\n\t\t }\n\t\t double dprice =Double.parseDouble(model.getPrice());\n\t BigDecimal bg = new BigDecimal(dprice/10000);\n\t double f1 = bg.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();\n\t model.setPrice(f1+\"\");\n\t model.setSource(\"001\");\n\t\t\n\t\tsuper.doSave(model, request, response);\n\t}",
"public void setPriceLimitOld (BigDecimal PriceLimitOld);",
"public void setPrice(Float price) {\n this.price = price;\n }",
"public void setPrice(Float price) {\r\n this.price = price;\r\n }",
"public void applyPrices(int effectiveDate, boolean setCurrentPrice) {\n int count = 0; // How many new prices were entered?\n for (SecurityRow row : allSecurities) {\n if(row.applyPrice(effectiveDate, setCurrentPrice)) count++;\n }\n \n loadCurrentPrices();\n \n // If any new prices were entered, refresh the view\n fireTableDataChanged();\n }",
"public void testUpdateProduct() {\n\t\tProduct product=productDao.selectProducts(33);\n\t\tproduct.setPrice(100.0);\n\t\tproduct.setQuantity(1);\n\t\tproductDao.updateProduct(product);//product has updated price and update quantity\n\t\tassertTrue(product.getPrice()==100.0);\n\t\tassertTrue(product.getQuantity()==1);\n\t}",
"private boolean saveData()\r\n {\n if (tableDataValid())\r\n {\r\n // get the modified rows\r\n Vector vecModifiedRows = getModifiedRows() ;\r\n if (vecModifiedRows != null)\r\n {\r\n System.out.println(\"obtd modified rows successfuly\") ;\r\n }\r\n\r\n HashMap hashStoredProcedure = (HashMap)tableStructureBeanPCDR.getHashStoredProceduresForThisTable();\r\n if(hashStoredProcedure == null)\r\n System.out.println(\"hashStoredProcedure == null\");\r\n //Get the update stored procedure associated witht this table.\r\n StoredProcedureBean updateStoredProcedure =\r\n (StoredProcedureBean)hashStoredProcedure.get(new Integer(1));\r\n\r\n RequestTxnBean requestTxnBean = new RequestTxnBean();\r\n requestTxnBean.setAction(\"MODIFY_DATA\");\r\n requestTxnBean.setStoredProcedureBean(updateStoredProcedure);\r\n requestTxnBean.setRowsToModify(vecModifiedRows) ;\r\n\r\n // the servlet will return if the saving process was successful or not\r\n Boolean success = (Boolean)getDataFromServlet(requestTxnBean) ;\r\n if (success == null) // Error while saving data\r\n {\r\n String msg = coeusMessageResources.parseMessageKey(\r\n \"saveFail_exceptionCode.1102\");\r\n\r\n CoeusOptionPane.showInfoDialog(msg);\r\n return false;\r\n }\r\n else\r\n {//Data Saved Successfully\r\n saveRequired = false;\r\n return true;\r\n }\r\n\r\n }// end if data validation\r\n else\r\n {\r\n return false;\r\n }\r\n }",
"public void save() {\n ProductData.saveData(tree);\n }",
"@Override\r\n\tpublic boolean updateBook(long ISBN, int price) {\n\t\tif (searchBook(ISBN).getISBN() == ISBN) {\r\n\t\t\ttransactionTemplate.setReadOnly(false);\r\n\t\treturn transactionTemplate.execute(new TransactionCallback<Boolean>() {\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic Boolean doInTransaction(TransactionStatus status) {\r\n\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\ttry {\r\n\t\t\t\r\n\t\t\t\t\t\tint rows = bookDAO.updateBook(ISBN, price);\r\n\t\t\t\t\t\tif (rows > 0)\r\n\t\t\t\t\t\t\treturn true;\r\n\r\n\t\t\t\t} catch (Exception exception) {\r\n\t\t\t\t\tstatus.setRollbackOnly();\r\n\t\t\t\t}\r\n\t\t\t\treturn false;\r\n\r\n\t\t\t}\r\n\t\t});\r\n\t\t}\r\n\t\treturn false;\r\n\t}"
] | [
"0.68450683",
"0.654263",
"0.6357688",
"0.6322423",
"0.6211837",
"0.6211276",
"0.61080074",
"0.6047645",
"0.6017085",
"0.6006013",
"0.5841136",
"0.5809556",
"0.5806451",
"0.58001995",
"0.5796951",
"0.579292",
"0.579101",
"0.5776985",
"0.5762277",
"0.5721214",
"0.57154906",
"0.56777084",
"0.56777084",
"0.5671984",
"0.5671984",
"0.5671287",
"0.5651058",
"0.56450874",
"0.5638587",
"0.5615885",
"0.5615391",
"0.55951685",
"0.5592906",
"0.5586004",
"0.55854267",
"0.5573123",
"0.55618197",
"0.5555634",
"0.5555634",
"0.5555634",
"0.55525035",
"0.5550154",
"0.5547869",
"0.5547869",
"0.5547869",
"0.5547869",
"0.5547869",
"0.5547869",
"0.5547869",
"0.5547832",
"0.5536864",
"0.5536864",
"0.5536611",
"0.55242544",
"0.5521738",
"0.5514994",
"0.5503285",
"0.5503285",
"0.55008376",
"0.5491156",
"0.5490835",
"0.5486759",
"0.5486759",
"0.5486759",
"0.5484006",
"0.5457971",
"0.54527754",
"0.54370534",
"0.54368895",
"0.54272413",
"0.5425309",
"0.54170394",
"0.5409984",
"0.5403652",
"0.5402768",
"0.54023623",
"0.539004",
"0.53853685",
"0.53793025",
"0.5372722",
"0.5370027",
"0.53587127",
"0.5338078",
"0.53375125",
"0.5328171",
"0.53235805",
"0.53178614",
"0.5311118",
"0.5309638",
"0.53079194",
"0.5303266",
"0.5290541",
"0.5287205",
"0.52839196",
"0.5283365",
"0.52786136",
"0.52734834",
"0.52715486",
"0.52714694",
"0.5268934"
] | 0.5889828 | 10 |
This is a separate method because, unlike the other things done in initializeData, these may need to be done again. Namely, after the user has entered new prices and applied them to the data store, we want those new prices to be shown in the "current price" column of our window. | void loadCurrentPrices() {
for(SecurityRow row : allSecurities) {
row.updateCurrentPrice();
}
fireTableRowsUpdated(0, allSecurities.size()-1);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void refreshData() {\n\t\tif (error == null) {\n\t\t\terror = \"\";\n\t\t}\n\t\terrorLabel.setText(error);\n\t\tif (error.trim().length() > 0) {\n\t\t\terror = \"\";\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// Get instance of system\n\t\tFoodTruckManagementSystem ftms = FoodTruckManagementSystem.getInstance();\n\t\t\n\t\t// Populate info\n\t\tlblItemname.setText(item.getName());\n\t\tlblItemPrice.setText(String.format(\"$%.2f\", item.getPrice()/100.0));\n\t\t\n\t\t\n\t\t// Populate list\n\t\tString prev = supplyList.getSelectedValue();\n\t\tlistModel.clear();\n\t\tIterator<Supply> its = item.getSupplies().iterator();\n\t\tSupply current;\n\t\twhile(its.hasNext()) {\n\t\t\tcurrent = its.next();\n\t\t\tlistModel.addElement(String.format(\"%.20s %.2f\", current.getSupplyType().getName(), current.getQuantity()));\n\t\t}\n\t\tif(prev != null) supplyList.setSelectedValue(prev, true);\n\t\t\n\t\t// Populate combo box\n\t\tprev = (String) ingredientsComboBox.getSelectedItem();\n\t\tingredientsComboBox.removeAllItems();\n\t\tIterator<SupplyType> itst = ftms.getSupplyTypes().iterator();\n\t\twhile(itst.hasNext()) {\n\t\t\tingredientsComboBox.addItem(itst.next().getName());\n\t\t}\n\t\tif(prev != null) ingredientsComboBox.setSelectedItem(prev);\n\t\t\n\t\t// Reset text field\n\t\tqtyTextField.setText(\"\");\n\t}",
"private void updatePriceAndSaving() {\n movieOrder = new MovieOrder(movie, Weekday.weekdayForValue(selectedDay), flagsApplied, numberOfTickets);\n\n tvTotalPriceNewTickets.setText(getResources().getString(\n R.string.total_price_new_tickets,\n movieOrder.getTotalPriceAfterDiscount(),\n movieOrder.getNumberOfTicketsAfterOfferIsApplied())\n );\n\n tvSavingsNewTickets.setText(getResources().getString(\n R.string.today_saving_new_tickets,\n movieOrder.getTotalSaving()\n ));\n }",
"private void updatePriceStats(double newPrice) {\n this.currentPrice = newPrice;\n this.currentAvgPrice = Double.parseDouble(decimalFormat.format(computeSMA(newPrice, currentAvgPrice, priceHistory)));\n this.priceChangePCT = Double.parseDouble(decimalFormat.format(computeDifferentialPCT(newPrice, currentAvgPrice)));\n }",
"private void updateComponents() {\n try {\n java.sql.Date cDate = new java.sql.Date(System.currentTimeMillis());\n java.sql.Date sDate = Date.valueOf(\"1971-01-01\");\n DefaultTableModel tData = or.getOrderData(sDate,cDate);\n oTable.setModel(tData);\n setSales(tData);\n } catch (Exception ex) {\n System.out.println(ex);\n }\n }",
"public void updateCurrentPriceAndValue (Double newPrice) {\n\t\t\n\t\tcurrentPrice = newPrice;\n\t\tcurrentValue = currentPrice * quantity;\n\t\t\n\t\t\n\t}",
"public void refreshData(float price) {\n if (price <= 0 || price == mLastPrice) {\n return;\n }\n mLastPrice = price;\n CombinedData data = mChartPrice.getData();\n if (data == null) return;\n LineData lineData = data.getLineData();\n if (lineData != null) {\n ILineDataSet set = lineData.getDataSetByIndex(0);\n if (set.removeLast()) {\n set.addEntry(new Entry(set.getEntryCount(), price));\n }\n }\n\n mChartPrice.notifyDataSetChanged();\n mChartPrice.invalidate();\n }",
"public void dataChanged() {\n // get latest data\n runs = getLatestRuns();\n wickets = getLatestWickets();\n overs = getLatestOvers();\n\n currentScoreDisplay.update(runs, wickets, overs);\n averageScoreDisplay.update(runs, wickets, overs);\n }",
"public synchronized void updateCurrentMarket() throws InvalidDataException {\n\t\tPrice topBuyPrice = (getBuySide().topOfBookPrice() == null) ? PriceFactory.makeLimitPrice(0) : getBuySide().topOfBookPrice();\n\t\tPrice topSellPrice = (getSellSide().topOfBookPrice() == null) ? PriceFactory.makeLimitPrice(0) : getSellSide().topOfBookPrice();\n\n\t\tString data = topBuyPrice.toString() + getBuySide().topOfBookVolume()\n\t\t\t\t\t+ topSellPrice.toString() + getSellSide().topOfBookVolume();\n\t\tif (!getLatestMarketData().equals(data)) {\n\t\t\tMarketDataDTO latestData = new MarketDataDTO(getStock(), topBuyPrice, \n\t\t\t\t\tgetBuySide().topOfBookVolume(), topSellPrice, getSellSide().topOfBookVolume());\n\t\t\tCurrentMarketPublisher.getInstance().publishCurrentMarket(latestData);\n\t\t\tsetLatestMarketData(data);\n\t\t}\n\t}",
"private void initializeData() {\n lblItem.setText(product.getName());\n txtReference.setText(product.getTransaction().getReferenceNumber());\n txtItem.setText(product.getName());\n txtDescription.setText(product.getDescription());\n txtBrand.setText(product.getBrand());\n txtModel.setText(product.getModel());\n txtQuantity.setText(String.valueOf(product.getQuantity()));\n txtUnit.setText(product.getUnit());\n txtProductDate.setDate(product.getProduct_date());\n txtOrigPrice.setText(String.valueOf(product.getOriginalPrice()));\n txtAgent.setText(product.getAgent());\n txtContactPerson.setText(product.getContactPerson());\n try { \n txtSupplier.setText(((Supplier)product.getSuppliers().toArray()[0]).getName());\n } catch(ArrayIndexOutOfBoundsException ex) {\n System.out.println(ex.toString());\n }\n }",
"private void refreshButtonClicked(ActionEvent event) {\n\n PriceFinder refreshedPrice = new PriceFinder(); // generates a new price to set as a temp item's new price\n\n itemView.testItem.setPrice(refreshedPrice.returnNewPrice());\n configureUI(); // essentially pushes the new item information to the panel\n\n showMessage(\"Item price updated! \");\n }",
"@Override\n\tpublic void updateData() {\n\t\tSpendPage spend = new SpendService().getSpendPage();\n\t\tvMonthSpend.setText(spend.monthSpend);\n\t\tvTodaySpend.setText(spend.todaySpend);\n\t\tvAvgSpendPerDay.setText(spend.avgSpendPerDay);\n\t\tvMonthAvailable.setText(spend.monthAvailable);\n\t\tvDayAvgAvailable.setText(spend.avgAvailablePerDay);\n\t\tvMonthLeftDay.setText(spend.leftDay);\n\t\t\n\t\tbar.setProgress(spend.usagePercentage);\n\t\tif (spend.isOverSpend) {\n\t\t\tvMonthAvailable.setForeground(ColorUtil.warningColor);\n\t\t\tvMonthSpend.setForeground(ColorUtil.warningColor);\n\t\t\tvTodaySpend.setForeground(ColorUtil.warningColor);\n\t\t} else {\n\t\t\tvMonthAvailable.setForeground(ColorUtil.grayColor);\n vMonthSpend.setForeground(ColorUtil.blueColor);\n vTodaySpend.setForeground(ColorUtil.blueColor);\n\t\t}\n\t\tbar.setForegroundColor(ColorUtil.getByPercentage(spend.usagePercentage));\n\t}",
"private void updatePriceView() {\n int subTotal = 0;\n int cartQuantity = 0;\n int calculatedDiscount = 0;\n\n DecimalFormat decimalFormatter = new DecimalFormat(\"₹#,##,###.##\");\n\n for (CartItem cartItem : cartList) {\n cartQuantity += cartItem.getQuantity();\n subTotal += cartItem.getQuantity() * cartItem.getPrice();\n }\n\n switch (discountType) {\n case AMOUNT:\n calculatedDiscount = discount;\n break;\n case PERCENTAGE:\n calculatedDiscount = (subTotal * discount) / 100;\n break;\n }\n\n subTotalView.setText(decimalFormatter.format(subTotal));\n\n String count = \"(\" + cartQuantity;\n\n if (cartQuantity < 2) {\n count += \" Item)\";\n } else {\n count += \" Items)\";\n }\n\n textNumberItems.setText(count);\n discountView.setText(decimalFormatter.format(calculatedDiscount));\n total = subTotal - calculatedDiscount;\n totalView.setText(decimalFormatter.format(total));\n updateCartNotification(cartQuantity);\n }",
"public void showData(){\n listName.setText(this.listName);\n listDescription.setText(this.description);\n Double Total = Lists.getInstance().getLists(this.listName).getTotal();\n listTotal.setText(pending.toString());\n\n this.data = FXCollections.observableArrayList(Lists.getInstance().getLists(this.listName).getItems());\n articleColumn.setCellValueFactory(\n new PropertyValueFactory<>(\"name\")\n );\n quantityColumn.setCellValueFactory(\n new PropertyValueFactory<>(\"quantity\")\n );\n priceColumn.setCellValueFactory(\n new PropertyValueFactory<>(\"price\")\n );\n totalColumn.setCellValueFactory(\n new PropertyValueFactory<>(\"total\")\n );\n stateColumn.setCellValueFactory(\n new PropertyValueFactory<>(\"state\")\n );\n this.itemsTable.setItems(data);\n\n }",
"private void setInitial_itemPrice()\n {\n\n calcTotalPrice(selectedItemQuantity, itemPrice);\n if(label_totalPrice.getText().equals(\"\"))\n {\n label_totalPrice.setText(\"\" + itemPrice);\n }\n\n }",
"public void setData() {\n tVShortTitle.setText(mCurrencyShortForm);\n tVCount.setText(mCountTitle.concat(String.valueOf(mMainListForActions.size())));\n tVFirstCurrency.setText(mFirstCurrencyTitle);\n tVChosenOrganizationPurchase.setText(getInfoString(mPurchaseTitle + \": \", mPurchaseValue));\n tVChosenOrganizationSale.setText(getInfoString(mSaleTitle + \": \", mSaleValue));\n tVChosenOrganizationDate.setText(mDate.substring(0, 10));\n if (mAction.equals(ConstantsManager.CONVERTER_ACTION_SALE)) {\n tVChosenAction.setText(mSaleTitle.toUpperCase());\n } else {\n tVChosenAction.setText(mPurchaseTitle.toUpperCase());\n }\n mTextWatcherAdapter.setActionForFirst(false);\n mTextWatcherAdapter.setActionForSecond(false);\n convertValue();\n }",
"public void update() \n\t{\n\t\tString inst = \"\";\n\t\tfloat cash = getCash();\n\t\tfloat quantity = getPosition(inst);\n\t\tfloat price = getPrice(inst);\n\n\t\t_data.add(new Float(price));\n\t\t\n\t\tif (_data.size() > _period)\n\t\t{\n\t\t\t_data.remove(0);\n\t\t\n\t\t\tfloat min = Float.MAX_VALUE;\n\t\t\tfloat max = Float.MIN_VALUE;\n\t\t\t\n\t\t\tfor (int i = 0; i < _data.size(); i++)\n\t\t\t{\n\t\t\t\tFloat value = (Float)_data.get(i);\n\t\t\t\t\n\t\t\t\tif (value.floatValue() > max)\n\t\t\t\t{\n\t\t\t\t\tmax = value.floatValue();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (value.floatValue() < min)\n\t\t\t\t{\n\t\t\t\t\tmin = value.floatValue();\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tfloat buylevel = min + (min * _minwin);\n\t\t\tfloat sellevel = max - (max * _maxloss);\n\t\t\tfloat sellevel2 = min + (min * _maxwin);\n\t\t\t\n\t\t\t// if price has risen by min win\n\t\t\t// but is below maximum win and\n\t\t\t// below maximum loss then buy\n\t\t\tif (price > buylevel && \n\t\t\t\t\tprice < sellevel2 &&\n\t\t\t\t\tbuylevel < sellevel &&\n\t\t\t\t\tprice > _previous)\n\t\t\t{\n\t\t\t\tif (cash > 0) \n\t\t\t\t{\n\t\t\t\t\taddAmountOrder(inst, cash);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (price < sellevel &&\n\t\t\t\t\tbuylevel > sellevel &&\n\t\t\t\t\tprice < _previous)\n\t\t\t{\n\t\t\t\tif (quantity > 0)\n\t\t\t\t{\n\t\t\t\t\taddQuantityOrder(inst, -quantity);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (price > sellevel2 &&\n\t\t\t\t\tprice > _previous)\n\t\t\t{\n\t\t\t\tif (quantity > 0)\n\t\t\t\t{\n\t\t\t\t\taddQuantityOrder(inst, -quantity);\n\t\t\t\t}\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t_data.remove(0);\n\t\t}\n\t\t\n\t\t_previous = price;\n\t}",
"void all_Data_retrieve_Price_Desc() {\n\t\t\tStatement stm=null;\n\t\t\tResultSet rs=null;\n\t\t\ttry{\n\t\t\t\t//Retrieve tuples by executing SQL command\n\t\t\t stm=con.createStatement();\n\t\t String sql=\"select * from \"+tableName+\" order by Price desc\";\n\t\t\t rs=stm.executeQuery(sql);\n\t\t\t DataGUI.model.setRowCount(0);\n\t\t\t //Add rows to table model\n\t\t\t while (rs.next()) {\n\t Vector<Object> newRow = new Vector<Object>();\n\t //Add cells to each row\n\t for (int i = 1; i <=colNum; i++) \n\t newRow.addElement(rs.getObject(i));\n\t DataGUI.model.addRow(newRow);\n\t }//end of while\n\t\t\t //Catch SQL exception\n\t }catch (SQLException e ) {\n\t \te.printStackTrace();\n\t\t } finally {\n\t\t \ttry{\n\t\t if (stm != null) stm.close(); \n\t\t }\n\t\t \tcatch (SQLException e ) {\n\t\t \t\te.printStackTrace();\n\t\t\t }\n\t\t }\n\t\t}",
"@Override\r\n\t\t\tpublic void handle(CellEditEvent<Products, String> arg0) {\n\t\t\t\targ0.getTableView().getItems().get(arg0.getTablePosition().getRow()).setPrice(arg0.getNewValue());\r\n\t\t\t\tProducts data=(Products) tbl_view.getSelectionModel().getSelectedItem();\r\n\t\t\t\tSystem.out.println(data.toString());\r\n\t\t\t\tConnectionManager.queryInsert(conn, \"UPDATE dbo.product SET price='\"+data.getPrice()+\"' WHERE id=\"+data.getId());\r\n\t\t\t\ttxt_cost.clear();\r\n\t\t\t\ttxt_date.clear();\r\n\t\t\t\ttxt_name.clear();\r\n\t\t\t\ttxt_price.clear();\r\n\t\t\t\ttxt_qty.clear();\r\n\t\t\t\ttxt_reorder.clear();\r\n\t\t\t\ttxt_search.clear();\r\n\t\t\t\tfetchData(FETCH_DATA);\r\n\t\t\t}",
"private void updateContent() {\n if (product != null) {\n etProductName.setText(product.getName());\n etPrice.setText(product.getPrice().toString());\n }\n }",
"public void changePrices()\n {\n String publisher = (String) publishers.getSelectedItem();\n if (publisher.equals(\"Any\"))\n {\n result.setText(\"I am sorry, but I cannot do that.\");\n return;\n }\n try\n { \n if (priceUpdateStmt == null)\n priceUpdateStmt = conn.prepareStatement(priceUpdate);\n priceUpdateStmt.setString(1, priceChange.getText());\n priceUpdateStmt.setString(2, publisher);\n int r = priceUpdateStmt.executeUpdate();\n result.setText(r + \" records updated.\"); \n } \n catch (SQLException e)\n {\n result.setText(\"\");\n while (e != null)\n {\n result.append(\"\" + e);\n e = e.getNextException();\n }\n }\n }",
"public void updatePrice(){\n\t\tprice = 0;\n\t\tfor (ParseObject selectedItem : selectedItems){\n\t\t\tprice += selectedItem.getInt(\"price\");\n\t\t}\n\n\t\tTextView orderTotal = (TextView) findViewById(R.id.orderTotal);\n\t\torderTotal.setText(\"$\" + price + \".00\");\n\t}",
"void all_Data_retrieve_Price_Asc() {\n\t\t\tStatement stm=null;\n\t\t\tResultSet rs=null;\n\t\t\ttry{\n\t\t\t\t//Retrieve tuples by executing SQL command\n\t\t\t stm=con.createStatement();\n\t\t String sql=\"select * from \"+tableName+\" order by Price asc\";\n\t\t\t rs=stm.executeQuery(sql);\n\t\t\t DataGUI.model.setRowCount(0);\n\t\t\t //Add rows to table model\n\t\t\t while (rs.next()) {\n\t Vector<Object> newRow = new Vector<Object>();\n\t //Add cells to each row\n\t for (int i = 1; i <=colNum; i++) \n\t newRow.addElement(rs.getObject(i));\n\t DataGUI.model.addRow(newRow);\n\t }//end of while\n\t\t\t //Catch SQL exception\n\t }catch (SQLException e ) {\n\t \te.printStackTrace();\n\t\t } finally {\n\t\t \ttry{\n\t\t if (stm != null) stm.close(); \n\t\t }\n\t\t \tcatch (SQLException e ) {\n\t\t \t\te.printStackTrace();\n\t\t\t }\n\t\t }\n\t}",
"@FXML\n\t private void updateProductPrice (ActionEvent actionEvent) throws SQLException, ClassNotFoundException {\n\t try {\n\t ProductDAO.updateProdPrice(prodIdText.getText(),newPriceText.getText());\n\t resultArea.setText(\"Price has been updated for, product id: \" + prodIdText.getText() + \"\\n\");\n\t } catch (SQLException e) {\n\t resultArea.setText(\"Problem occurred while updating price: \" + e);\n\t }\n\t }",
"public void defaultSetup() {\n\t\tthis.cart = this.endUser.getCart();\n\t\tLinkedList<Integer> prices = cart.getPrices();\n\t\tLinkedList<Integer> units = cart.getUnits();\n\t\tallProducts = FXCollections.observableList(cart.getProducts());\n\t\tallPrices = FXCollections.observableList(cart.getPrices());\n\t\tallUnits = FXCollections.observableList(cart.getUnits());\n\t\tlsvProduct.setItems(allProducts);\n\t\tlsvPrice.setItems(allPrices);\n\t\tlsvUnit.setItems(allUnits);\n\t\tint total_value = 0;\n\t\tfor (int i=0; i<prices.size();i++) {\n\t\t\ttotal_value += prices.get(i)*units.get(i);\n\t\t}\n\t\tlblTotal.setText(Integer.toString(total_value));\n\t}",
"public void setPriceListEntered (BigDecimal PriceListEntered);",
"private void initialize() {\n\t\tframe = new JFrame();\n\t\tframe.setTitle(\"Statistic\");\n\t\tframe.setResizable(false);\n\t\tframe.setBounds(100, 100, 500, 350);\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\tframe.getContentPane().setLayout(null);\n\n\t\tdmodel = new DefaultTableModel();\n\t\tinitTable(dmodel);\n\n\t\ttable = new JTable();\n\t\ttable.setModel(dmodel);\n\t\ttable.getColumnModel().getColumn(3).setPreferredWidth(200);\n\n\t\tscrollPane = new JScrollPane(table);\n\t\tscrollPane.setBounds(27, 105, 438, 164);\n\t\tframe.getContentPane().add(scrollPane);\n\n\t\tlblStatistic = new JLabel(\"Statistic\");\n\t\tlblStatistic.setFont(new Font(\"Lucida Grande\", Font.PLAIN, 22));\n\t\tlblStatistic.setBounds(207, 6, 88, 42);\n\t\tframe.getContentPane().add(lblStatistic);\n\n\t\tlblRevenueAtDate = new JLabel(\"Revenue at date\");\n\t\tlblRevenueAtDate.setFont(new Font(\"Lucida Grande\", Font.PLAIN, 18));\n\t\tlblRevenueAtDate.setBounds(27, 77, 147, 16);\n\t\tframe.getContentPane().add(lblRevenueAtDate);\n\n\t\ttxtDate = new JTextField();\n\t\ttxtDate.setFont(new Font(\"Lucida Grande\", Font.PLAIN, 18));\n\t\ttxtDate.setBounds(186, 73, 129, 20);\n\t\tframe.getContentPane().add(txtDate);\n\t\ttxtDate.setColumns(20);\n\n\t\tbtnSelectDate = new JButton(\"...\");\n\t\tbtnSelectDate.setBounds(327, 70, 27, 23);\n\t\tbtnSelectDate.addActionListener((e) -> {\n\t\t\tjframe = new JFrame();\n\t\t\ttxtDate.setText(new DatePickerUI(jframe).setPickedDate());\n\t\t\tdisplayStatistic(ProductsSales.getInstance());\n\t\t});\n\t\tframe.getContentPane().add(btnSelectDate);\n\n\t\tlblTotal = new JLabel(\"Total\");\n\t\tlblTotal.setFont(new Font(\"Lucida Grande\", Font.PLAIN, 25));\n\t\tlblTotal.setBounds(51, 281, 71, 34);\n\t\tframe.getContentPane().add(lblTotal);\n\n\t\tlabelShowTotal = new JLabel(\"0.00\");\n\t\tlabelShowTotal.setFont(new Font(\"Lucida Grande\", Font.PLAIN, 25));\n\t\tlabelShowTotal.setBounds(148, 281, 206, 30);\n\t\tlabelShowTotal.setHorizontalAlignment(SwingConstants.CENTER);\n\t\tframe.getContentPane().add(labelShowTotal);\n\n\t\tbtnClose = new JButton(\"Close\");\n\t\tbtnClose.setFont(new Font(\"Lucida Grande\", Font.PLAIN, 25));\n\t\tbtnClose.setBounds(366, 281, 99, 34);\n\t\tbtnClose.addActionListener((e) -> {\n\t\t\tclose();\n\t\t});\n\t\tframe.getContentPane().add(btnClose);\n\t}",
"public void refresh() {\r\n\t\tneeds.setText(needs());\r\n\t\tproduction.setText(production());\r\n\t\tjobs.setText(jobs());\r\n\t\tmarketPrices.setText(marketPrices());\r\n\t\tmarketSellAmounts.setText(marketSellAmounts());\r\n\t\tmarketBuyAmounts.setText(marketBuyAmounts());\r\n\t\tcompanies.setText(companies());\r\n\t\tmoney.setText(money());\r\n\t\ttileProduction.setText(tileProduction());\r\n\t\tcapital.setText(capital());\r\n\t\thappiness.setText(happiness());\r\n\t\tland.setText(land());\r\n\t\t//ArrayList of Agents sorted from lowest to highest in money is retrieved from Tile\r\n\t\tagents=tile.getAgentsByMoney();\r\n\t\tgui3.refresh();\r\n\t\tsliderPerson.setText(\"\"+agents.get(slider.getValue()).getMoney());\r\n\t\ttick.setText(tick());\r\n\t\tthis.pack();\r\n\t}",
"@FXML\n private void updatePrice()\n {\n running = true;\n scheduledExecutorService = Executors.newSingleThreadScheduledExecutor();\n\n scheduledExecutorService.scheduleAtFixedRate(() ->\n {\n try {\n currentPrice.setText(api.getPrice(selectedComboBoxPairing));\n } catch (BinanceApiException e) {\n e.printStackTrace();\n }\n\n }, 0, 4, TimeUnit.SECONDS);\n }",
"public void setPriceListOld (BigDecimal PriceListOld);",
"@Override\r\n\t\t\tpublic void handle(CellEditEvent<Products, String> arg0) {\n\t\t\t\targ0.getTableView().getItems().get(arg0.getTablePosition().getRow()).setCost(arg0.getNewValue());\r\n\t\t\t\tProducts data=(Products) tbl_view.getSelectionModel().getSelectedItem();\r\n\t\t\t\tSystem.out.println(data.toString());\r\n\t\t\t\tConnectionManager.queryInsert(conn, \"UPDATE dbo.product SET cost='\"+data.getCost()+\"' WHERE id=\"+data.getId());\r\n\t\t\t\ttxt_cost.clear();\r\n\t\t\t\ttxt_date.clear();\r\n\t\t\t\ttxt_name.clear();\r\n\t\t\t\ttxt_price.clear();\r\n\t\t\t\ttxt_qty.clear();\r\n\t\t\t\ttxt_reorder.clear();\r\n\t\t\t\ttxt_search.clear();\r\n\t\t\t\tfetchData(FETCH_DATA);\r\n\t\t\t}",
"public void update() {\r\n\t\tremoveAll();\r\n\t\tdrawGrid();\r\n\t\tplotDecades();\r\n\t\tgetEntries();\r\n\t}",
"public void setPrice(double newPrice) {\r\n price = newPrice;\r\n }",
"private void initialize() {\r\n frameProducts = new JFrame(\"PRODUCTS\");\r\n frameProducts.setBounds(100, 100, 500, 500);\r\n frameProducts.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n frameProducts.getContentPane().setLayout(null);\r\n\r\n textFields();\r\n labels();\r\n\r\n JButton buttonAdd = new JButton(\"ADD\");\r\n buttonAdd.setBounds(74, 146, 89, 23);\r\n buttonAdd.addActionListener(e -> {\r\n try {\r\n this.pdao.insertObject(textFieldName.getText() + \" \" + textFieldPrice.getText() + \" \" + textFieldIS.getText());\r\n } catch (SQLException throwables) {\r\n throwables.printStackTrace();\r\n }\r\n\r\n });\r\n frameProducts.getContentPane().add(buttonAdd);\r\n\r\n JButton buttonEdit = new JButton(\"EDIT\");\r\n buttonEdit.setBounds(201, 146, 89, 23);\r\n buttonEdit.addActionListener(e -> {\r\n try {\r\n this.pdao.updateObject(textFieldID.getText() + \" \" + textFieldName.getText() + \" \" + textFieldPrice.getText() + \" \" + textFieldIS.getText());\r\n } catch (Exception ex) {\r\n ex.printStackTrace();\r\n }\r\n });\r\n frameProducts.getContentPane().add(buttonEdit);\r\n\r\n JButton buttonDelete = new JButton(\"DELETE\");\r\n buttonDelete.setBounds(330, 146, 89, 23);\r\n buttonDelete.addActionListener(e -> {\r\n try {\r\n this.commands.deleteProduct(Integer.parseInt(textFieldID.getText()));\r\n } catch (Exception exception) {\r\n exception.printStackTrace();\r\n }\r\n });\r\n frameProducts.getContentPane().add(buttonDelete);\r\n\r\n JButton buttonView = new JButton(\"VIEW ALL PRODUCTS\");\r\n buttonView.setBounds(45, 239, 374, 45);\r\n buttonView.addActionListener(e -> {\r\n DefaultTableModel model = new DefaultTableModel(0, 4);\r\n try {\r\n initilizeTable(model);\r\n new ViewJTable(\"PRODUCTS\", model);\r\n } catch (SQLException throwables) {\r\n throwables.printStackTrace();\r\n }\r\n });\r\n frameProducts.getContentPane().add(buttonView);\r\n\r\n frameProducts.setVisible(true);\r\n }",
"public SaleOffPriceCreatorPanel() {\n initComponents();\n\n lookup = new AbstractLookup(content);\n\n saleOff = new SaleOff();\n promotion = new Promotion();\n\n tblSaleOffPrice.setRowHeight(26);\n\n tableCell = new SaleOffPiceTableCell(this);\n tblSaleOffPrice.getColumnModel().getColumn(0).setCellEditor(tableCell);\n tblSaleOffPrice.getColumnModel().getColumn(0).setCellRenderer(tableCell);\n\n tblSaleOffPrice.getColumnModel().getColumn(1).setCellEditor(tableCell);\n tblSaleOffPrice.getColumnModel().getColumn(1).setCellRenderer(tableCell);\n\n tblSaleOffPrice.getColumnModel().getColumn(2).setCellEditor(tableCell);\n tblSaleOffPrice.getColumnModel().getColumn(2).setCellRenderer(tableCell);\n\n tblSaleOffPrice.getColumnModel().getColumn(3).setCellEditor(tableCell);\n tblSaleOffPrice.getColumnModel().getColumn(3).setCellRenderer(tableCell);\n\n btnExit.addActionListener(this);\n btnNew.addActionListener(this);\n btnSave.addActionListener(this);\n btnSaveList.addActionListener(this);\n\n resetColorRowTable();\n\n }",
"public void onStockpriceChanged();",
"private void calculatePrice() {\n\t\tint temp = controller.getQualityPrice(hotel.getText(), quality.getText());\n\n\t\ttemp *= getDays();\n\n\t\tif (discountChoice > 0) {\n\t\t\tdouble discountTmp = (double) discountChoice / 100;\n\t\t\ttemp *= (1.00 - discountTmp);\n\t\t}\n\n\t\tprice.setText(Integer.toString(temp));\n\n\t}",
"public static void loadDeskPane()\n {\n \n final String sumIncomesQUERY = \"SELECT SUM(FinalPrice) FROM Sells\";\n incomesLabel.setText(String.valueOf(new DeskDatabase().sumMoney(sumIncomesQUERY)+\" €\"));\n \n // START storageInfosPane \n final String countProductsQUERY = \"SELECT COUNT(*) FROM Products\";\n productsLabel.setText(String.valueOf(new DeskDatabase().countRecords(countProductsQUERY)));\n final String sumSellingPriceQUERY = \"SELECT SUM(SellingPrice*Stock) FROM Products WHERE Stock > 0\";\n finalIncomesLabel.setText(String.valueOf(new DeskDatabase().sumMoney(sumSellingPriceQUERY))+\" €\");\n final String lowStockQUERY = \"SELECT COUNT(*) FROM Products WHERE Stock < 10\";\n lowStockLabel.setText(String.valueOf(new DeskDatabase().countRecords(lowStockQUERY)));\n // END storageInfosPane \n \n // START outcomesPane\n final String countPurchasesQUERY = \"SELECT COUNT(*) FROM Purchases\";\n purchasesLabel.setText(String.valueOf(new DeskDatabase().countRecords(countPurchasesQUERY)));\n final String sumOutcomesQUERY = \"SELECT SUM(PurchasePrice*Stock) FROM Products WHERE Stock > 0\";\n finalOutcomesLabel.setText(String.valueOf(new DeskDatabase().sumMoney(sumOutcomesQUERY))+\" €\");\n final String countSuppliersQUERY = \"SELECT COUNT(*) FROM Suppliers\";\n suppliersLabel.setText(String.valueOf(new DeskDatabase().countRecords(countSuppliersQUERY)));\n // END outcomesPane\n \n // START incomesPane\n final String countSalesQUERY = \"SELECT COUNT(*) FROM Sells\";\n salesLabel.setText(String.valueOf(new DeskDatabase().countRecords(countSalesQUERY)));\n final String sumProfitQUERY = \"SELECT SUM(SellingPrice*Stock)-SUM(PurchasePrice*Stock) FROM Products WHERE Stock >0\";\n profitLabel.setText(String.valueOf(new DeskDatabase().sumMoney(sumProfitQUERY))+\" €\");\n final String countClientsQUERY = \"SELECT COUNT(*) FROM Clients\";\n clientsLabel.setText(String.valueOf(new DeskDatabase().countRecords(countClientsQUERY)));\n // END incomesPane\n }",
"private void updateStandard(){\n\n // calculate bill total with a ten percent tip\n double tenPercentTip = currentBillTotal * .1;\n double tenPercentTotal = currentBillTotal + tenPercentTip;\n // set tip10EditText's text to tenPercentTip\n tip10EditText.setText(String.format(getString(R.string.two_dec_float), tenPercentTip));\n //set total10EditText's text to tenPercentTotal\n total10EditText.setText(String.format(getString(R.string.two_dec_float), tenPercentTotal));\n\n // calculate bill total with a fifteen percent tip\n double fifteenPercentTip = currentBillTotal * .15;\n double fifteenPercentTotal = currentBillTotal + fifteenPercentTip;\n // set tip15EditText's text to fifteenPercentTip\n tip15EditText.setText(String.format(getString(R.string.two_dec_float), fifteenPercentTip));\n //set total15EditText's text to fifteenPercentTotal\n total15EditText.setText(String.format(getString(R.string.two_dec_float), fifteenPercentTotal));\n\n // calculate bill total with a twenty percent tip\n double twentyPercentTip = currentBillTotal * .20;\n double twentyPercentTotal = currentBillTotal + twentyPercentTip;\n // set tip20EditText's text to twentyPercentTip\n tip20EditText.setText(String.format(getString(R.string.two_dec_float), twentyPercentTip));\n //set total20EditText's text to twentyPercentTotal\n total20EditText.setText(String.format(getString(R.string.two_dec_float), twentyPercentTotal));\n\n }",
"private void initialize() {\n\t\tframe = new JFrame();\n\t\tframe.getContentPane().setBackground(Color.WHITE);\n\t\tframe.setBounds(100, 100, 636, 378);\n\t\tframe.setTitle(\"CHANGE RENTAL PRICE\");\n\t\tframe.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);\n\t\tframe.getContentPane().setLayout(null);\n\t\t\n\t\tJLabel lblChangeRentalPrice = new JLabel(\"Change Rental Price -\");\n\t\tlblChangeRentalPrice.setFont(new Font(\"Dialog\", Font.BOLD, 23));\n\t\tlblChangeRentalPrice.setBounds(23, 12, 287, 33);\n\t\tframe.getContentPane().add(lblChangeRentalPrice);\n\t\t\n\t\tJLabel label_1 = new JLabel(\"Search By -\");\n\t\tlabel_1.setBounds(33, 92, 85, 15);\n\t\tframe.getContentPane().add(label_1);\n\t\t\n\t\tJComboBox<String> comboBox = new JComboBox<String>();\n\t\tcomboBox.setBounds(136, 87, 217, 24);\n\t\tframe.getContentPane().add(comboBox);\n\t\tcomboBox.addItem(\"DVD ID\");\n\t\tcomboBox.addItem(\"DVD NAME\");\n\t\t\n\t\tJLabel label = new JLabel(\"*Enter \"+comboBox.getSelectedItem()+\" -\");\n\t\tlabel.setBounds(33, 151, 132, 31);\n\t\tframe.getContentPane().add(label);\n\t\t\n\t\ttxtdvd = new JTextField();\n\t\ttxtdvd.setColumns(10);\n\t\ttxtdvd.setBounds(226, 157, 284, 19);\n\t\tframe.getContentPane().add(txtdvd);\n\t\t\n\t\tJButton button = new JButton(\"Change\");\n\t\tbutton.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\tif(txtdvd.getText().trim().length()==0 || txtprice.getText().trim().length()==0 )\n\t\t\t\t{\n\t\t\t\t\tJOptionPane.showMessageDialog(null, comboBox.getSelectedItem()+\" OR PRICE FIELD CAN NOT BE EMPTY !\",\"Error !\",JOptionPane.ERROR_MESSAGE);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t@SuppressWarnings(\"unused\")\n\t\t\t\tdouble d =Double.parseDouble(txtprice.getText());\n\t\t\t\ttry {\n\t\t\t\t\tClass.forName(\"com.mysql.jdbc.Driver\");\n\t\t\t\t\tConnection con =DriverManager.getConnection(\"jdbc:mysql://localhost:3306/rental_sys\",\"root\",\"vector\");\n\t\t\t\t\tString sid;\n\t\t\t\t\tif(comboBox.getSelectedItem().equals(\"DVD ID\"))\n\t\t\t\t\t\tsid = \"select * from dvd where dvd_id = ? and rented ='No' \";\n\t\t\t\t\telse\n\t\t\t\t\t\tsid = \"select * from dvd where name = ? and rented ='No' \";\n\t\t\t\t\tPreparedStatement ps =con.prepareStatement(sid);\n\t\t\t\t\tps.setString(1,txtdvd.getText().toString());\n\t\t\t\t\tResultSet rs=ps.executeQuery();\n\t\t\t\t\tif(rs.next())\n\t\t\t\t\t{\n\t\t\t\t\t\tJFrame frame1 = new JFrame(\"Rental Price\");\n\t\t\t\t\t\tif(JOptionPane.showConfirmDialog(frame1,\"Confirm if you want to Change Rental Price of DVD ?\",\"Change Price\",JOptionPane.YES_NO_OPTION)==JOptionPane.YES_NO_OPTION)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tString did;\n\t\t\t\t\t\t\tif(comboBox.getSelectedItem().equals(\"DVD ID\"))\n\t\t\t\t\t\t\t\tdid = \"update dvd set price = ? where dvd_id = ? \";\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tdid = \"update dvd set price = ? where name = ? \";\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tPreparedStatement ps1 =con.prepareStatement(did);\n\t\t\t\t\t\t\tdouble rp = Double.parseDouble(txtprice.getText());\n\t\t\t\t\t\t\tps1.setDouble(1,rp);\n\t\t\t\t\t\t\tps1.setString(2,txtdvd.getText().toString());\n\t\t\t\t\t\t\tps1.executeUpdate();\n\t\t\t\t\t\t\tJOptionPane.showMessageDialog(null, \"DVD PRICE IS UPDATED !\",\"Done !\",JOptionPane.INFORMATION_MESSAGE);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tJOptionPane.showMessageDialog(null, \"DVD NOT FOUND !\",\"Error !\",JOptionPane.ERROR_MESSAGE);\n\t\t\t\t\t}\n\t\t\t\t} catch (ClassNotFoundException | SQLException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\ttxtdvd.setText(null);\n\t\t\t\ttxtprice.setText(null);\n\t\t\t}\n\t\t\tcatch(NumberFormatException a)\n\t\t\t{\n\t\t\t\tJOptionPane.showMessageDialog(null,\"PLEASE ENTER VALID PRICE !\",\"Error !\",JOptionPane.ERROR_MESSAGE);\n\t\t\t}\n\t\t\t}\n\t\t\t}\n\t\t});\n\t\tbutton.setForeground(Color.RED);\n\t\tbutton.setBounds(33, 279, 114, 25);\n\t\tframe.getContentPane().add(button);\n\t\t\n\t\tJButton button_1 = new JButton(\"Reset\");\n\t\tbutton_1.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\ttxtdvd.setText(null);\n\t\t\t\ttxtprice.setText(null);\n\t\t\t}\n\t\t});\n\t\tbutton_1.setBounds(270, 279, 114, 25);\n\t\tframe.getContentPane().add(button_1);\n\t\t\n\t\tJButton button_2 = new JButton(\"Cancel\");\n\t\tbutton_2.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\tframe.setVisible(false);\n\t\t\t}\n\t\t});\n\t\tbutton_2.setBounds(482, 279, 114, 25);\n\t\tframe.getContentPane().add(button_2);\n\t\t\n\t\tJLabel lblEnterRentalPrice = new JLabel(\"*Enter Rental Price -\");\n\t\tlblEnterRentalPrice.setBounds(33, 209, 159, 31);\n\t\tframe.getContentPane().add(lblEnterRentalPrice);\n\t\t\n\t\ttxtprice = new JTextField();\n\t\ttxtprice.setColumns(10);\n\t\ttxtprice.setBounds(226, 215, 284, 19);\n\t\tframe.getContentPane().add(txtprice);\n\t\t\n\t\tJLabel label_2 = new JLabel(\"logo\");\n\t\tlabel_2.setIcon(new ImageIcon(change_price.class.getResource(\"/image/PicsArt_09-15-02.34.27.jpg\")));\n\t\tlabel_2.setBounds(490, 12, 134, 112);\n\t\tframe.getContentPane().add(label_2);\n\t\t\n\t\tcomboBox.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\tlabel.setText(\"*Enter \"+comboBox.getSelectedItem()+\" -\");\n\t\t\t}\n\t\t}\n\t\t);\n\t}",
"private void gridMain_CellLeave(Object sender, OpenDental.UI.ODGridClickEventArgs e) throws Exception {\n long codeNum = PIn.Long(ProcTable.Rows[e.getRow()][\"CodeNum\"].ToString());\n long feesched = FeeSchedC.getListShort()[listFeeSched.SelectedIndex].FeeSchedNum;\n Fee fee = Fees.getFee(codeNum,feesched);\n String strOld = \"\";\n if (fee != null)\n {\n strOld = fee.Amount.ToString(\"n\");\n }\n \n String strNew = gridMain.getRows().get___idx(e.getRow()).getCells()[e.getCol()].Text;\n if (StringSupport.equals(strOld, strNew))\n {\n return ;\n }\n \n if (!Security.isAuthorized(Permissions.Setup))\n {\n //includes dialog\n gridMain.getRows().get___idx(e.getRow()).getCells()[e.getCol()].Text = strOld;\n gridMain.Invalidate();\n return ;\n }\n \n double dNew = -1;\n if (!StringSupport.equals(strNew, \"\"))\n {\n try\n {\n dNew = PIn.Double(strNew);\n }\n catch (Exception __dummyCatchVar2)\n {\n gridMain.setSelected(new Point(e.getCol(), e.getRow()));\n MessageBox.Show(Lan.g(this,\"Please fix data entry error first.\"));\n return ;\n }\n\n gridMain.getRows().get___idx(e.getRow()).getCells()[e.getCol()].Text = dNew.ToString(\"n\");\n }\n \n //to standardize formatting. They probably didn't type .00\n //invalidate doesn't seem to be necessary here\n if (StringSupport.equals(strOld, \"\"))\n {\n //if no fee was originally entered and since it's no longer empty, then we need to insert a fee.\n //Somehow duplicate fees were being inserted so double check that this fee does not already exist.\n Fee tmpFee = Fees.getFee(codeNum,feesched);\n //Looks in cache.\n if (tmpFee != null)\n {\n return ;\n }\n \n //Fee exists. Must be unknown bug.\n fee = new Fee();\n fee.FeeSched = feesched;\n fee.CodeNum = codeNum;\n fee.Amount = dNew;\n Fees.insert(fee);\n Fees.getListt().Add(fee);\n }\n else\n {\n //if fee existed\n if (StringSupport.equals(strNew, \"\"))\n {\n //delete old fee\n Fees.delete(fee);\n Fees.getListt().Remove(fee);\n }\n else\n {\n //change fee\n fee.Amount = dNew;\n Fees.update(fee);\n Fees.getListt()[Fees.getListt().IndexOf(fee)].Amount = dNew;\n } \n } \n SecurityLogs.MakeLogEntry(Permissions.ProcFeeEdit, 0, Lan.g(this,\"Procedure\") + \": \" + ProcedureCodes.getStringProcCode(fee.CodeNum) + \", \" + Lan.g(this,\"Fee: \") + \"\" + fee.Amount.ToString(\"c\") + \", \" + Lan.g(this,\"Fee Schedule\") + \": \" + FeeScheds.getDescription(fee.FeeSched) + \". \" + Lan.g(this,\"Manual edit in grid from Procedure Codes list.\"), fee.CodeNum);\n }",
"@Override\r\n\t\t\tpublic void handle(CellEditEvent<Products, String> arg0) {\n\t\t\t\targ0.getTableView().getItems().get(arg0.getTablePosition().getRow()).setExpiry_date(arg0.getNewValue());\r\n\t\t\t\tProducts data=(Products) tbl_view.getSelectionModel().getSelectedItem();\r\n\t\t\t\tSystem.out.println(data.toString());\r\n\t\t\t\tConnectionManager.queryInsert(conn, \"UPDATE dbo.product SET expiry_date='\"+data.getExpiry_date()+\"' WHERE id=\"+data.getId());\r\n\t\t\t\ttxt_cost.clear();\r\n\t\t\t\ttxt_date.clear();\r\n\t\t\t\ttxt_name.clear();\r\n\t\t\t\ttxt_price.clear();\r\n\t\t\t\ttxt_qty.clear();\r\n\t\t\t\ttxt_reorder.clear();\r\n\t\t\t\ttxt_search.clear();\r\n\t\t\t\tfetchData(FETCH_DATA);\r\n\t\t\t}",
"private void refreshButtonClicked(ActionEvent event) {\n //--\n //-- WRITE YOUR CODE HERE!\n //--\n\n itemView.getItem().setPreviousPrice(itemView.getItem().getItemPrice());\n //itemView.getItem().setItemPrice(randPrice.getRandomPrice());\n itemView.getItem().setItemPrice(randPrice.getRandomPrice(itemView.getItem()));\n itemView.getItem().setItemChange();\n super.repaint();\n showMessage(\"Refresh clicked!\");\n }",
"public void displayCurrentValues() {\n currentX.setText(_DF.format(deltaX));\n currentY.setText(_DF.format(deltaY));\n currentZ.setText(_DF.format(deltaZ));\n }",
"private void updateTotal()\n {\n if(saleItems != null)\n {\n double tempVal = 0;\n\n for(int i = 0; i < saleItems.size(); i++)\n {\n if(saleItems.get(i) != null)\n {\n tempVal += saleItems.get(i).getPrice() * saleItems.get(i).getQuantity();\n }\n }\n totalText.setText(moneyFormat(String.valueOf(tempVal)));\n }\n }",
"public void updateTotalPrice(){\n\t\tBigDecimal discount = currentOrder.getDiscount();\n\t\tBigDecimal subtotal = currentOrder.getSubtotal();\n\t\tthis.subtotal.text.setText(CURR+subtotal.add(discount).toString());\n\t\tthis.discount.text.setText(CURR + discount.toString());\n\t\tthis.toPay.text.setText(CURR+subtotal.toString());\n\t}",
"private void loadData() {\r\n titleField.setText(existingAppointment.getTitle());\r\n descriptionField.setText(existingAppointment.getDescription());\r\n contactField.setText(existingAppointment.getContact());\r\n customerComboBox.setValue(customerList.stream()\r\n .filter(x -> x.getCustomerId() == existingAppointment.getCustomerId())\r\n .findFirst().get());\r\n typeComboBox.setValue(existingAppointment.getType());\r\n locationComboBox.setValue(existingAppointment.getLocation());\r\n startTimeComboBox.setValue(existingAppointment.getStart().toLocalTime().format(DateTimeFormatter.ofPattern(\"HH:mm\")));\r\n endTimeComboBox.setValue(existingAppointment.getEnd().toLocalTime().format(DateTimeFormatter.ofPattern(\"HH:mm\")));\r\n startDatePicker.setValue(existingAppointment.getStart().toLocalDate());\r\n endDatePicker.setValue(existingAppointment.getEnd().toLocalDate());\r\n }",
"public updatedata() {\n initComponents();\n }",
"@Override\n\t\tpublic void propertyChange(PropertyChangeEvent evt) {\n\n\t\t\tint curCol = theView.getTabsPane().getMakeSalePanel().getpSale().getCheckoutTable().getSelectedColumn();\n\t\t\tint curRow = theView.getTabsPane().getMakeSalePanel().getpSale().getCheckoutTable().getSelectedRow();\n\t\t\tif(curRow>=saleItems.size())\n\t\t\t{\n\t\t\t\tif(saleItems.size()<1)\n\t\t\t\t\ttheView.getTabsPane().getMakeSalePanel().disableCartButtons();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(curCol==2)\n\t\t\t{\n\t\t\t\t/*\n\t\t\t\t * Regular expressions for checking correct format od decimal and integer\n\t\t\t\t */\n\t\t\t\tString regexDecimal = \"^-?\\\\d*\\\\.\\\\d+$\";\n\t\t\t\tString regexInteger = \"^-?\\\\d+$\";\n\t\t\t\tString regexDouble = regexDecimal + \"|\" + regexInteger;\n\n\t\t\t\tif(!theView.getTabsPane().getMakeSalePanel().getpSale().getCheckoutTable().getValueAt(curRow, curCol).toString().matches(regexDouble))\n\t\t\t\t{\n\t\t\t\t\ttheView.getTabsPane().getMakeSalePanel().getpSale().getCheckoutTable().setValueAt(saleItems.get(curRow).getPrice(), curRow, curCol);\n\t\t\t\t\tJOptionPane.showMessageDialog(theView, \"Enter only valid price!\");\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tdouble newPrice = (double) theView.getTabsPane().getMakeSalePanel().getpSale().getCheckoutTable().getValueAt(curRow, curCol);\n\t\t\t\t\ttheView.getTabsPane().getMakeSalePanel().getpSale().getCheckoutTable().setValueAt(newPrice, curRow, curCol);\n\t\t\t\t\ttheView.getTabsPane().getMakeSalePanel().getpSale().getCheckoutTable().setValueAt((newPrice*(double)quantities.get(curRow)), curRow, 4);\n\t\t\t\t\tsaleItems.get(curRow).setPrice(newPrice);\n\t\t\t\t\ttheView.getTabsPane().getMakeSalePanel().getpSale().getCheckoutTable().repaint();\n\t\t\t\t\ttotal=0;\n\t\t\t\t\tfor(int i = 0 ; i<saleItems.size();i++)\n\t\t\t\t\t{\n\t\t\t\t\t\ttotal+=saleItems.get(i).getPrice()*(int)quantities.get(i);\n\t\t\t\t\t}\n\t\t\t\t\ttheView.getTabsPane().getMakeSalePanel().getpSale().setTotal(total);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(curCol==3)\n\t\t\t{\n\t\t\t\tif(!theView.getTabsPane().getMakeSalePanel().getpSale().getCheckoutTable().getValueAt(curRow, curCol).toString().matches(\"^\\\\d+$\"))\n\t\t\t\t{\n\t\t\t\t\ttheView.getTabsPane().getMakeSalePanel().getpSale().getCheckoutTable().setValueAt(quantities.get(curRow), curRow, curCol);\n\t\t\t\t\tJOptionPane.showMessageDialog(theView, \"Enter only whole positive numbers!\");\n\t\t\t\t}\n\t\t\t\telse if(saleItems.get(curRow)!=null&&(int)theView.getTabsPane().getMakeSalePanel().getpSale().getCheckoutTable().getValueAt(curRow, curCol)>saleItems.get(curRow).getAvailableStockLevel())\n\t\t\t\t{\n\t\t\t\t\ttheView.getTabsPane().getMakeSalePanel().getpSale().getCheckoutTable().setValueAt(quantities.get(curRow), curRow, curCol);\n\n\t\t\t\t\tJOptionPane.showMessageDialog(theView, \"Exeeded availible stock!\");\n\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tint newQuantity = (int) theView.getTabsPane().getMakeSalePanel().getpSale().getCheckoutTable().getValueAt(curRow, curCol);\n\n\t\t\t\t\ttheView.getTabsPane().getMakeSalePanel().getpSale().getCheckoutTable().setValueAt(newQuantity, curRow, curCol);\n\t\t\t\t\ttheView.getTabsPane().getMakeSalePanel().getpSale().getCheckoutTable().setValueAt((saleItems.get(curRow).getPrice()*newQuantity), curRow, 4);\n\t\t\t\t\tquantities.set(curRow, newQuantity);\n\t\t\t\t\ttotal=0;\n\t\t\t\t\tif(newQuantity<=0)\n\t\t\t\t\t{\n\t\t\t\t\t\tsaleItems.remove(curRow);\n\t\t\t\t\t\tquantities.remove(curRow);\n\t\t\t\t\t}\n\t\t\t\t\t\ttheView.getTabsPane().getMakeSalePanel().getpSale().getCheckoutTable().repaint();\t\n\t\t\t\t\t\tfor(int i = 0 ; i<saleItems.size();i++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(saleItems.get(i)!=null)\n\t\t\t\t\t\t\t\ttotal+=saleItems.get(i).getPrice()*(int)quantities.get(i);\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttheView.getTabsPane().getMakeSalePanel().getpSale().setTotal(total);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif(total>0.0)\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Total is bigger than zero\");\n\t\t\t\ttheView.getTabsPane().getMakeSalePanel().getpSale().getCompleteSaleButton().setEnabled(true);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Total is less than zero\");\n\t\t\t\ttheView.getTabsPane().getMakeSalePanel().getpSale().getCompleteSaleButton().setEnabled(false);\n\t\t\t}\n\t\t\tSystem.out.println(total);\n\t\t}",
"private void actuallyRefresh() {\n synchronized (this) {\n if (table != null) {\n table.recomputeModel(book, getDisplayedSecurities(), allowMissingPrices, timelySnapshotInterval);\n }\n }\n if (tablePane != null) {\n tablePane.setVisible(true);\n tablePane.revalidate();\n }\n }",
"private void calcPrice() {\n double itemPrice = 0;\n \n //get price of burger (base)\n if (singleRad.isSelected())\n {\n itemPrice = 3.50;\n }\n else \n {\n itemPrice = 4.75;\n }\n \n //check options add to item price\n if(cheeseCheckbox.isSelected())\n itemPrice = itemPrice += 0.50;\n if(baconCheckbox.isSelected())\n itemPrice = itemPrice += 1.25;\n if(mealCheckbox.isSelected())\n itemPrice = itemPrice += 4.00;\n \n //include the quantity for the item price\n int quantity= 1;\n if (quantityTextField.getText().equals(\"\"))\n quantityTextField.setText(\"1\");\n quantity = Integer.parseInt(quantityTextField.getText());\n itemPrice = itemPrice * quantity;\n\n \n //show the price no $ symbol\n \n itemPriceTextField.setText(d2.format(itemPrice));\n }",
"public ModelData modelData()\n\t{\n\t\treturn new PriceChangeEditModelData(this);\n\t}",
"private void refreshTableForUpdate()\n {\n //Was updating the values but don't believe this is necessary, as like budget items\n //a loss amount will stay the same unless changed by the user (later on it might be the\n //case that it can increase/decrease by a percentage but not now...)\n /*\n BadBudgetData bbd = ((BadBudgetApplication) this.getApplication()).getBadBudgetUserData();\n for (MoneyLoss loss : bbd.getLosses())\n {\n TextView valueView = valueViews.get(loss.expenseDescription());\n valueView.setText(BadBudgetApplication.roundedDoubleBB(loss.lossAmount()));\n }\n */\n }",
"@Override\n\tdouble updateTotalPrice() {\n\t\treturn 0;\n\t}",
"protected void setData() {\n \t\n \teditTextDate.setText(record.getDateTimeString());\n \t\n if (record.getOdometer() == 0) {\n \teditTextOdometer.setText(\"\");\n } else {\n \teditTextOdometer.setText(record.getOdometerString());\n }\n \n if (record.getGallons() == 0) {\n \teditTextGallons.setText(\"\");\n } else {\n \teditTextGallons.setText(record.getGallonsString());\n }\n \n checkBoxFullTank.setChecked(record.isFullTank());\n \n if (record.getCost() == 0) {\n \teditTextCost.setText(\"\");\n } else {\n \teditTextCost.setText(record.getCostString());\n }\n \n editTextNotes.setText(record.getNotes());\n }",
"public void priceUpdate(){\n \n double attractionPrices = 0;\n Attraction attraction;\n for(int i=0; i< getAttractionsList().size();i++)\n {\n attraction = (Attraction) getAttractionsList().get(i);\n attractionPrices += attraction.getPrice();\n }\n hotelPrice = diff(getEndDate(), getStartDate());\n price = getTravel().getPrice() + getHotel().getPrice()*(hotelPrice) \n + getTransport().getPrice()*getTravel().getDistance()\n + attractionPrices;\n }",
"public void updateProducts()\n {\n ObservableList<Product> inventoryProducts = this.inventory.getAllProducts();\n\n // Configure product table and bind with inventory products\n productIDColumn.setCellValueFactory(new PropertyValueFactory<Product, String>(\"id\"));\n productNameColumn.setCellValueFactory(new PropertyValueFactory<Product, String>(\"name\"));\n productInventoryColumn.setCellValueFactory(new PropertyValueFactory<Product, String>(\"stock\"));\n productPriceColumn.setCellValueFactory(new PropertyValueFactory<Product, String>(\"price\"));\n\n productTable.setItems(inventoryProducts);\n // Unselect parts in table after part is updated\n productTable.getSelectionModel().clearSelection();\n productTable.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);\n }",
"private void updateData() {\n // store if checkbox is enabled and update the label accordingly\n updateOneItem(jcbMaxTracks, jsMaxTracks, jnMaxTracks, Variable.MAXTRACKS,\n Variable.MAXTRACKS_ENABLED);\n updateOneItem(jcbMaxSize, jsMaxSize, jnMaxSize, Variable.MAXSIZE, Variable.MAXSIZE_ENABLED);\n updateOneItem(jcbMaxLength, jsMaxLength, jnMaxLength, Variable.MAXLENGTH,\n Variable.MAXLENGTH_ENABLED);\n if (jcbOneMedia.isSelected()) {\n data.put(Variable.ONE_MEDIA, jcbMedia.getSelectedItem());\n data.put(Variable.ONE_MEDIA_ENABLED, Boolean.TRUE);\n } else {\n // keep old value... data.remove(Variable.KEY_MEDIA);\n data.put(Variable.ONE_MEDIA_ENABLED, Boolean.FALSE);\n }\n data.put(Variable.CONVERT_MEDIA, jcbConvertMedia.isSelected());\n data.put(Variable.RATING_LEVEL, jsRatingLevel.getValue());\n data.put(Variable.NORMALIZE_FILENAME, jcbNormalizeFilename.isSelected());\n }",
"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 }",
"@Override\n public double getPrice(){\n \n return currentPrice; \n }",
"void stockPriceChanged(Stock stock, double oldValue, double newValue);",
"private void setDataForTicket(){\n int rowId = ticketGui.getSelectedRowId();\n Ticket ticket = controller.getTicketById(rowId);\n\n // setting the data from the ticket i got to the popup gui\n clientNameTextField.setText(ticket.getClientName());\n starIdTextField.setText(ticket.getStarId());\n emailTextField.setText(ticket.getEmail());\n phoneNumberTextField.setText(ticket.getPhoneNumber());\n deviceModelTextField.setText(ticket.getModel());\n descriptionTextArea.setText(ticket.getDescription());\n clubMemberNameTextField.setText(ticket.getMemberName());\n resolutionTextArea.setText(ticket.getResolution());\n\n }",
"public void updateData() {\n\t\tcal = eventsData.getCalendar();\n\t\tfirstDayOfWeek = eventsData.getFirstDayOfWeek();\n\t\tcurrentDayOfMonth = eventsData.getDayNumber();\n\t\tnumberOfDays = eventsData.getNumberOfDays();\n\t\tnumberOfWeeks = eventsData.getNumberOfWeeks();\n\t\tyear = eventsData.getYearNumber();\n\t\tmonth = eventsData.getMonthNumber();\n\t\tday = eventsData.getDayNumber();\n\t\tweek = eventsData.getDayOfWeek();\n\t}",
"private void updateText() {\n updateDateText();\n\n TextView weightText = findViewById(R.id.tvWeight);\n TextView lowerBPText = findViewById(R.id.tvLowerBP);\n TextView upperBPText = findViewById(R.id.tvUpperBP);\n\n mUser.weight.sortListByDate();\n mUser.bloodPressure.sortListsByDate();\n\n double weight = mUser.weight.getWeightByDate(mDate.getTime());\n int upperBP = mUser.bloodPressure.getUpperBPByDate(mDate.getTime());\n int lowerBP = mUser.bloodPressure.getLowerBPByDate(mDate.getTime());\n\n weightText.setText(String.format(Locale.getDefault(), \"Paino\\n%.1f\", weight));\n lowerBPText.setText(String.format(Locale.getDefault(), \"AlaP\\n%d\", lowerBP));\n upperBPText.setText(String.format(Locale.getDefault(), \"YläP\\n%d\", upperBP));\n\n ((EditText)findViewById(R.id.etWeight)).setText(\"\");\n ((EditText)findViewById(R.id.etLowerBP)).setText(\"\");\n ((EditText)findViewById(R.id.etUpperBP)).setText(\"\");\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\tframe.getContentPane().setLayout(null);\n\t\t\n\t\tJLabel lblNewLabel = new JLabel(\"Sales List\");\n\t\tlblNewLabel.setFont(new Font(\"Tahoma\", Font.BOLD, 20));\n\t\tlblNewLabel.setBounds(168, 10, 105, 25);\n\t\tframe.getContentPane().add(lblNewLabel);\n\t\t\n\t\tJLabel lblNewLabel_1 = new JLabel(\"Item:\");\n\t\tlblNewLabel_1.setFont(new Font(\"Tahoma\", Font.PLAIN, 14));\n\t\tlblNewLabel_1.setBounds(10, 48, 85, 13);\n\t\tframe.getContentPane().add(lblNewLabel_1);\n\t\t\n\t\tJLabel lblNewLabel_2 = new JLabel(\"Cost: $\");\n\t\tlblNewLabel_2.setFont(new Font(\"Tahoma\", Font.PLAIN, 14));\n\t\tlblNewLabel_2.setBounds(10, 82, 116, 13);\n\t\tframe.getContentPane().add(lblNewLabel_2);\n\t\t\n\t\tJLabel lblNewLabel_3 = new JLabel(\"Quantity:\");\n\t\tlblNewLabel_3.setFont(new Font(\"Tahoma\", Font.PLAIN, 14));\n\t\tlblNewLabel_3.setBounds(10, 111, 85, 13);\n\t\tframe.getContentPane().add(lblNewLabel_3);\n\t\t\n\t\titemField = new JTextField();\n\t\titemField.setBounds(107, 47, 256, 19);\n\t\tframe.getContentPane().add(itemField);\n\t\titemField.setColumns(10);\n\t\t\n\t\tcostField = new JTextField();\n\t\tcostField.setBounds(107, 76, 134, 19);\n\t\tframe.getContentPane().add(costField);\n\t\tcostField.setColumns(10);\n\t\t\n\t\tquantityField = new JTextField();\n\t\tquantityField.setBounds(105, 105, 136, 19);\n\t\tframe.getContentPane().add(quantityField);\n\t\tquantityField.setColumns(10);\n\t\t\n\t\taddBtn = new JButton(\"Add Item to List\");\n\t\taddBtn.setBounds(107, 134, 182, 21);\n\t\tframe.getContentPane().add(addBtn);\n\t\t\n\t\tJScrollPane scrollPane = new JScrollPane();\n\t\tscrollPane.setBounds(37, 178, 361, 56);\n\t\tframe.getContentPane().add(scrollPane);\n\t\t\n\t\ttextArea = new JTextArea();\n\t\tscrollPane.setViewportView(textArea);\n\t\t\n\t\tJLabel lblNewLabel_4 = new JLabel(\"Total Sales:\");\n\t\tlblNewLabel_4.setFont(new Font(\"Tahoma\", Font.PLAIN, 14));\n\t\tlblNewLabel_4.setBounds(10, 244, 85, 13);\n\t\tframe.getContentPane().add(lblNewLabel_4);\n\t\t\n\t\ttotalArea = new JTextArea();\n\t\ttotalArea.setBounds(90, 244, 199, 19);\n\t\tframe.getContentPane().add(totalArea);\n\t\t\n\t}",
"public void setPriceEntered (BigDecimal PriceEntered);",
"public void updateMoney()\n\t\t{\n\t\t\t\n\t\t\tFPlayer p1 = this.viewer;\n\t\t\tFPlayer p2 = (p1.equals(this.t.p1)) ? this.t.p2 : this.t.p1;\n\t\t\t\n\t\t\tItemStack om = new ItemStack(Material.GREEN_WOOL,1);\n\t\t\tItemMeta it = om.getItemMeta();\n\t\t\tit.setDisplayName(ChatColor.DARK_GREEN+ChatColor.BOLD.toString()+\"Money in trade:\");\n\t\t\tit.setLore(Arrays.asList(new String[] {\"\",Util.getMoney(this.t.getMoneyTraded(p1)),\"\",\"Click to add/remove money from trade\"}));\n\t\t\tom.setItemMeta(it);\n\t\t\t\n\t\t\tif (this.canAdd()) super.contents.put(0,new ItemSwapMenu(this,om,new MenuMoney(super.viewer,this.t)));\n\t\t\telse super.contents.put(0,new ItemDummy(this,om));\n\t\t\t\n\t\t\t// Trader money in trade\n\t\t\tItemStack tm = new ItemStack(Material.GREEN_WOOL,1);\n\t\t\tit = tm.getItemMeta();\n\t\t\tit.setDisplayName(ChatColor.DARK_GREEN+ChatColor.BOLD.toString()+\"Money in trade:\");\n\t\t\tit.setLore(Arrays.asList(new String[] {\"\",Util.getMoney(this.t.getMoneyTraded(p2))}));\n\t\t\ttm.setItemMeta(it);\n\t\t\tsuper.contents.put(8,new ItemDummy(this,tm));\n\t\t\tthis.composeInv();\n\t\t}",
"@Override\n\tpublic void viewPrice() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\tupdate();\n\t\t\t\tload(CustomersList.table);\n\t\t\t\tCustomersList.setTotalCompanyDemand();\n\t\t\t\tCustomersList.setTotalResive();\n\t\t\t\tCustomersList.setTotalShopping();\n\t\t\t\tCustomerPaidCheck();\n\t\t\t\tdispose();\n\n\t\t\t}",
"public void applyPrices(int effectiveDate, boolean setCurrentPrice) {\n int count = 0; // How many new prices were entered?\n for (SecurityRow row : allSecurities) {\n if(row.applyPrice(effectiveDate, setCurrentPrice)) count++;\n }\n \n loadCurrentPrices();\n \n // If any new prices were entered, refresh the view\n fireTableDataChanged();\n }",
"private void setDiscountedPrice() {\n seekbarNewprice.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {\n @Override\n public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {\n tvDiscountPerc.setText(progress * 5 + \"%\");\n try {\n double originalPrice = Double.parseDouble(etOriginalPrice.getText().toString());\n double sp = (progress * 5 * originalPrice) / 100;\n\n tvNewPrice.setText(String.format(Locale.US, \"%.2f\", originalPrice - sp));\n } catch (NumberFormatException ne) {\n ne.printStackTrace();\n }\n }\n\n @Override\n public void onStartTrackingTouch(SeekBar seekBar) {\n\n }\n\n @Override\n public void onStopTrackingTouch(SeekBar seekBar) {\n\n }\n });\n }",
"public void updateVariables(){\n Map<String, Integer> specialParameter = myLogic.getSpecialParameterToDisplay();\n liveScore.setText(Double.toString(myLogic.getScore()));\n for (String parameter: specialParameter.keySet()) {\n numLives.setText(parameter + specialParameter.get(parameter));\n }\n myMoney.setText(Double.toString(myLogic.getCash()));\n }",
"protected void storeCurrentValues() {\n }",
"public void initStockData() {\n\t\t\tStockBrokerImpl.this.stockData = new ArrayList<StockCompany>();\n\t\t\tthis.updateStockData();\n\t\t\tfor (final StockCompany company : StockBrokerImpl.this.stockData)\n\t\t\t\tSystem.out.println(company.getStockPrice());\n\n\t\t}",
"private void getDataView() {\n demanda = Double.parseDouble(jSpinner1.getValue().toString());\n costoPedido = Double.parseDouble(jSpinner2.getValue().toString());\n costoUnitario = Double.parseDouble(jSpinner3.getValue().toString());\n costoMantenimiento = Double.parseDouble(jSpinner4.getValue().toString());\n }",
"public void changeData() {\n\t\tDefaultTableModel dtm = new DefaultTableModel(dataModel.getData(),\n\t\t\t\tdataModel.getHeader());\n\t\tsetModel(dtm);\n\t}",
"public void setOriginalPrice(Float OriginalPrice) {\n this.OriginalPrice = OriginalPrice;\n }",
"@Override\n public void initialize(URL url, ResourceBundle rb) {\n people.addAll(sp.getAll());\n idP.setCellValueFactory(new PropertyValueFactory<>(\"path_photo\"));\n price1.setCellValueFactory(new PropertyValueFactory<>(\"price\"));\n\n tabble1.setItems(people);\n try {\n ResultSet rs = c.createStatement().executeQuery(\"select path_photo, price from shoppingcart\");\n while(rs.next()){\n data1.add(new ShoppingCart(rs.getString(\"path_photo\"), rs.getDouble(\"price\")));\n \n }\n \n\n// TODO\n } catch (SQLException ex) {\n Logger.getLogger(ShoppingCartController.class.getName()).log(Level.SEVERE, null, ex);\n }\n Item2.setCellValueFactory(new PropertyValueFactory<>(\"path_photo\"));\n Price2.setCellValueFactory(new PropertyValueFactory<>(\"price\"));\n table.setItems(data1);\n }",
"@Override\r\n\t\t\tpublic void handle(CellEditEvent<Products, String> arg0) {\n\t\t\t\targ0.getTableView().getItems().get(arg0.getTablePosition().getRow()).setName(arg0.getNewValue());\r\n\t\t\t\tProducts data=(Products) tbl_view.getSelectionModel().getSelectedItem();\r\n\t\t\t\tSystem.out.println(data.toString());\r\n\t\t\t\tConnectionManager.queryInsert(conn, \"UPDATE dbo.product SET name='\"+data.getName()+\"' WHERE id=\"+data.getId());\r\n\t\t\t\ttxt_cost.clear();\r\n\t\t\t\ttxt_date.clear();\r\n\t\t\t\ttxt_name.clear();\r\n\t\t\t\ttxt_price.clear();\r\n\t\t\t\ttxt_qty.clear();\r\n\t\t\t\ttxt_reorder.clear();\r\n\t\t\t\ttxt_search.clear();\r\n\t\t\t\tfetchData(FETCH_DATA);\r\n\t\t\t}",
"public void bldCrtnDspl() {\r\n ArrayList<PtkCarton> ptkCrtnList;\r\n ObservableList<PickTicketDetailByCartonRow> ptktCrtnDetailRow = FXCollections.observableArrayList();\r\n ptkCrtnList = ptktsum.getPtkCartonList();\r\n BigDecimal totU = BigDecimal.ZERO;\r\n BigDecimal totD = BigDecimal.ZERO;\r\n BigDecimal ptkSv = BigDecimal.ZERO;\r\n int totCtn = 0;\r\n int totPck = 0;\r\n Locale enUSLocale\r\n = new Locale.Builder().setLanguage(\"en\").setRegion(\"US\").build();\r\n NumberFormat currencyFormatter\r\n = NumberFormat.getCurrencyInstance(enUSLocale);\r\n DecimalFormat numFormatter = new DecimalFormat(\"#,###\");\r\n\r\n for (PtkCarton ptkCrt : ptkCrtnList) {\r\n if (fltrPtktCrt(ptkCrt)) {\r\n ptktCrtnDetailRow.add(new PickTicketDetailByCartonRow(ptkCrt));\r\n if (ptkSv.compareTo(ptkCrt.getPtktNo()) != 0) {\r\n totPck++;\r\n ptkSv = ptkCrt.getPtktNo();\r\n }\r\n totU = totU.add(ptkCrt.getTotu());\r\n totD = totD.add(ptkCrt.getTotd());\r\n totCtn++;\r\n }\r\n }\r\n lblPtkCnt.setText(numFormatter.format(totPck));\r\n lblTotU.setText(numFormatter.format(totU));\r\n lblTotD.setText(currencyFormatter.format(totD));\r\n lblCtnCnt.setText(numFormatter.format(totCtn));\r\n if (!ptktCrtnDetailRow.isEmpty()) {\r\n btnExport.setDisable(false);\r\n }\r\n\r\n tcPtkt.setCellValueFactory(cellData -> cellData.getValue().getPtktNo());\r\n tcCrtn.setCellValueFactory(cellData -> cellData.getValue().getCrtnNo().asObject());\r\n tcCrtn.setCellFactory(col -> new TableCell<PickTicketDetailByCartonRow, Double>() {\r\n @Override\r\n public void updateItem(Double crtn, boolean empty) {\r\n super.updateItem(crtn, empty);\r\n DecimalFormat numFormatter = new DecimalFormat(\"#########\");\r\n if (empty) {\r\n setText(null);\r\n } else {\r\n setText(numFormatter.format(crtn));\r\n }\r\n }\r\n });\r\n tcOrder.setCellValueFactory(cellData -> cellData.getValue().getOrdNo());\r\n tcSoldTo.setCellValueFactory(cellData -> cellData.getValue().getSoldTo());\r\n tcShipTo.setCellValueFactory(cellData -> cellData.getValue().getShipTo());\r\n tcCustNam.setCellValueFactory(cellData -> cellData.getValue().getCusName());\r\n tcShpNam.setCellValueFactory(cellData -> cellData.getValue().getShpName());\r\n tcOrTyp.setCellValueFactory(cellData -> cellData.getValue().getOrdType());\r\n tcShipVia.setCellValueFactory(cellData -> cellData.getValue().getsVia());\r\n tcWhse.setCellValueFactory(cellData -> cellData.getValue().getWhse());\r\n tcSku.setCellValueFactory(cellData -> cellData.getValue().getTotSku().asObject());\r\n tcUnits.setCellValueFactory(cellData -> cellData.getValue().getUnits().asObject());\r\n tcUnits.setCellFactory(col -> new TableCell<PickTicketDetailByCartonRow, Double>() {\r\n @Override\r\n public void updateItem(Double units, boolean empty) {\r\n super.updateItem(units, empty);\r\n DecimalFormat numFormatter = new DecimalFormat(\"###,###,###\");\r\n if (empty) {\r\n setText(null);\r\n } else {\r\n setText(numFormatter.format(units));\r\n }\r\n }\r\n });\r\n tcDollars.setCellValueFactory(cellData -> cellData.getValue().getDollars().asObject());\r\n tcDollars.setCellFactory(col -> new TableCell<PickTicketDetailByCartonRow, Double>() {\r\n @Override\r\n public void updateItem(Double dlrs, boolean empty) {\r\n DecimalFormat numFormatter = new DecimalFormat(\"$#,###.00\");\r\n super.updateItem(dlrs, empty);\r\n if (empty) {\r\n setText(null);\r\n } else {\r\n setText(numFormatter.format(dlrs));\r\n }\r\n }\r\n });\r\n tcStat.setCellValueFactory(cellData -> cellData.getValue().getStatus());\r\n tcCtnStat.setCellValueFactory(ctData -> ctData.getValue().getCtnStat());\r\n tcStDat.setCellValueFactory(value -> value.getValue().getStgSDate().asObject());\r\n tcStDat.setCellFactory(col -> new TableCell<PickTicketDetailByCartonRow, Double>() {\r\n @Override\r\n public void updateItem(Double stDat, boolean empty) {\r\n super.updateItem(stDat, empty);\r\n DecimalFormat numFormatter = new DecimalFormat(\"00000000\");\r\n if (empty) {\r\n setText(null);\r\n } else {\r\n String sDat = numFormatter.format(stDat);\r\n String sYr = sDat.substring(0, 4);\r\n String sMo = sDat.substring(4, 6);\r\n String sDa = sDat.substring(6, 8);\r\n setText(sMo + \"/\" + sMo + \"/\" + sYr);\r\n }\r\n }\r\n });\r\n tcStTim.setCellValueFactory(cellData -> cellData.getValue().getStgSTime().asObject());\r\n tcStTim.setCellFactory(col -> new TableCell<PickTicketDetailByCartonRow, Double>() {\r\n @Override\r\n public void updateItem(Double stTim, boolean empty) {\r\n super.updateItem(stTim, empty);\r\n DecimalFormat numFormatter = new DecimalFormat(\"000000\");\r\n if (empty) {\r\n setText(null);\r\n } else {\r\n String sTim = numFormatter.format(stTim);\r\n String sHr = sTim.substring(0, 2);\r\n String sMn = sTim.substring(2, 4);\r\n String sSec = sTim.substring(4, 6);\r\n setText(sHr + ':' + sMn + ':' + sSec);\r\n }\r\n }\r\n });\r\n tcCtnCmpDat.setCellValueFactory(ctData -> ctData.getValue().getStgCmpDat().asObject());\r\n tcCtnCmpDat.setCellFactory(col -> new TableCell<PickTicketDetailByCartonRow, Double>() {\r\n @Override\r\n public void updateItem(Double cmpDat, boolean empty) {\r\n super.updateItem(cmpDat, empty);\r\n DecimalFormat numFormatter = new DecimalFormat(\"00000000\");\r\n if (empty) {\r\n setText(null);\r\n } else {\r\n if (cmpDat == 0) {\r\n setText(\"\");\r\n } else {\r\n String sDat = numFormatter.format(cmpDat);\r\n String sYr = sDat.substring(0, 4);\r\n String sMo = sDat.substring(4, 6);\r\n String sDa = sDat.substring(6, 8);\r\n setText(sMo + \"/\" + sMo + \"/\" + sYr);\r\n }\r\n }\r\n }\r\n });\r\n tcCtnCmpTim.setCellValueFactory(cData -> cData.getValue().getStgCmpTim().asObject());\r\n tcCtnCmpTim.setCellFactory(col -> new TableCell<PickTicketDetailByCartonRow, Double>() {\r\n @Override\r\n public void updateItem(Double cmpTim, boolean empty) {\r\n super.updateItem(cmpTim, empty);\r\n DecimalFormat numFormatter = new DecimalFormat(\"000000\");\r\n if (empty || cmpTim == 0) {\r\n setText(null);\r\n } else {\r\n String sTim = numFormatter.format(cmpTim);\r\n String sHr = sTim.substring(0, 2);\r\n String sMn = sTim.substring(2, 4);\r\n String sSec = sTim.substring(4, 6);\r\n setText(sHr + ':' + sMn + ':' + sSec);\r\n }\r\n }\r\n });\r\n tcDur.setCellValueFactory(cellData -> cellData.getValue().getDur().asObject());\r\n tcDur.setCellFactory(col -> new TableCell<PickTicketDetailByCartonRow, Long>() {\r\n @Override\r\n public void updateItem(Long dur, boolean empty) {\r\n super.updateItem(dur, empty);\r\n if (empty) {\r\n setText(null);\r\n } else {\r\n long hrs = (long) dur / 3600;\r\n int min = (int) (dur % 3600) / 60;\r\n\r\n setText(String.format(\"%d Hrs %d Min\", hrs, min));\r\n }\r\n }\r\n });\r\n tcOpr.setCellValueFactory(cellData -> cellData.getValue().getOperator());\r\n tcStrDt.setCellValueFactory(cellData -> cellData.getValue().getOrStrDt().asObject());\r\n tcStrDt.setCellFactory(col -> new TableCell<PickTicketDetailByCartonRow, Double>() {\r\n @Override\r\n public void updateItem(Double stDat, boolean empty) {\r\n super.updateItem(stDat, empty);\r\n DecimalFormat numFormatter = new DecimalFormat(\"00000000\");\r\n if (empty) {\r\n setText(null);\r\n } else {\r\n String sDat = numFormatter.format(stDat);\r\n String sYr = sDat.substring(0, 4);\r\n String sMo = sDat.substring(4, 6);\r\n String sDa = sDat.substring(6, 8);\r\n setText(sMo + \"/\" + sMo + \"/\" + sYr);\r\n }\r\n }\r\n });\r\n tcCmpDt.setCellValueFactory(cellData -> cellData.getValue().getOrCmpDt().asObject());\r\n tcCmpDt.setCellFactory(col -> new TableCell<PickTicketDetailByCartonRow, Double>() {\r\n @Override\r\n public void updateItem(Double cmpDt, boolean empty) {\r\n super.updateItem(cmpDt, empty);\r\n DecimalFormat numFormatter = new DecimalFormat(\"00000000\");\r\n if (empty) {\r\n setText(null);\r\n } else {\r\n String sDat = numFormatter.format(cmpDt);\r\n String sYr = sDat.substring(0, 4);\r\n String sMo = sDat.substring(4, 6);\r\n String sDa = sDat.substring(6, 8);\r\n setText(sMo + \"/\" + sMo + \"/\" + sYr);\r\n }\r\n }\r\n });\r\n tcPrtDt.setCellValueFactory(cellData -> cellData.getValue().getPrtDate().asObject());\r\n tcPrtDt.setCellFactory(col -> new TableCell<PickTicketDetailByCartonRow, Double>() {\r\n @Override\r\n public void updateItem(Double prtDat, boolean empty) {\r\n super.updateItem(prtDat, empty);\r\n DecimalFormat numFormatter = new DecimalFormat(\"00000000\");\r\n if (empty) {\r\n setText(null);\r\n } else {\r\n String sDat = numFormatter.format(prtDat);\r\n String sYr = sDat.substring(0, 4);\r\n String sMo = sDat.substring(4, 6);\r\n String sDa = sDat.substring(6, 8);\r\n setText(sMo + \"/\" + sMo + \"/\" + sYr);\r\n }\r\n }\r\n });\r\n tcPrtTime.setCellValueFactory(cellData -> cellData.getValue().getPrtTime().asObject());\r\n tcPrtTime.setCellFactory(col -> new TableCell<PickTicketDetailByCartonRow, Double>() {\r\n @Override\r\n public void updateItem(Double prtTime, boolean empty) {\r\n super.updateItem(prtTime, empty);\r\n DecimalFormat numFormatter = new DecimalFormat(\"000000\");\r\n if (empty) {\r\n setText(null);\r\n } else {\r\n String sTim = numFormatter.format(prtTime);\r\n String sHr = sTim.substring(0, 2);\r\n String sMn = sTim.substring(2, 4);\r\n String sSec = sTim.substring(4, 6);\r\n setText(sHr + ':' + sMn + ':' + sSec);\r\n }\r\n }\r\n });\r\n\r\n tblPtkDtl.setItems(ptktCrtnDetailRow);\r\n\r\n }",
"public void displayCurrentValues() {\r\n currentX.setText(Float.toString(deltaX));\r\n currentY.setText(Float.toString(deltaY));\r\n currentZ.setText(Float.toString(deltaZ));\r\n }",
"private void updateTotal() {\n int total = table.getTotal();\n vip.setConsumption(total);\n if (total > 0)\n payBtn.setText(PAY + RMB + total);\n else if (total == 0)\n payBtn.setText(PAY);\n }",
"public void actionPerformed(ActionEvent e){\n //determine,who called action listener\n Object source = e.getSource();\n\n if(source == resetButton){\n //reset all TextFields and variables to the initial values\n stockprice = STOCKPRICE;\n stockpriceField.setText(numberFormatter.format(STOCKPRICE));\n strikeprice= STRIKEPRICE;\n strikepriceField.setText(numberFormatter.format(STRIKEPRICE));\n volatility=VOLATILITY;\n volatilityField.setText(numberFormatter.format(VOLATILITY));\n timetomaturity = TIMETOMATURITY;\n timetomaturityField.setText(numberFormatter.format(TIMETOMATURITY));\n interestrate = INTERESTRATE;\n interestrateField.setText(numberFormatter.format(INTERESTRATE));\n alphaone= ALPHAONE;\n alphaoneField.setText(numberFormatter.format(ALPHAONE));\n alphatwo= ALPHATWO;\n alphatwoField.setText(numberFormatter.format(ALPHATWO));\n ksi1= KSI1;\n ksi1Field.setText(numberFormatter.format(KSI1));\n ksi2= KSI2;\n ksi2Field.setText(numberFormatter.format(KSI2));\n ksi3= KSI3;\n ksi3Field.setText(numberFormatter.format(KSI3));\n sigmastar1= SIGMASTAR1;\n sigmastar1Field.setText(numberFormatter.format(SIGMASTAR1));\n sigmastar2= SIGMASTAR2;\n sigmastar2Field.setText(numberFormatter.format(SIGMASTAR2));\n rho = RHO;\n rhoField.setText(numberFormatter.format(RHO));\n intervals1=INTERVALS1;\n intervals1Field.setText(numberFormatter.format(INTERVALS1));\n intervals2=INTERVALS2;\n intervals2Field.setText(numberFormatter.format(INTERVALS2));\n simulations1=SIMULATIONS1;\n simulations1Field.setText(numberFormatter.format(SIMULATIONS1));\n simulations2=SIMULATIONS2;\n simulations2Field.setText(numberFormatter.format(SIMULATIONS2));\n bsprice = BSPRICE;\n bspriceField.setText(numberFormatter.format(BSPRICE));\n svprice = SVPRICE;\n svpriceField.setText(numberFormatter.format(SVPRICE));\n ssvprice = SSVPRICE;\n ssvpriceField.setText(numberFormatter.format(SSVPRICE));\n psprice = PSPRICE;\n pspriceField.setText(numberFormatter.format(PSPRICE));\n }\n\n if (source == calculate1Button) {\n if (callButton.isSelected()){\n if(normalDistributionAButton.isSelected()){\n double bscall = new\n BlackScholesFormula().BlackScholesCallA(stockprice,strikeprice,volatility,\n timetomaturity,interestrate);\n bspriceField.setText(numberFormatter.format(bscall));\n }\n else {\n for(stockprice=0.75; stockprice<1.26; stockprice=stockprice+0.01){\n double bscall = new\n BlackScholesFormula().BlackScholesCallB(stockprice,strikeprice,volatility,\n timetomaturity,interestrate);\n bspriceField.setText(numberFormatter.format(bscall));\n // to check -System.out.println(bscall);\n }\n }\n }\n else {\n if(normalDistributionAButton.isSelected()){\n double bsput = new\n BlackScholesFormula().BlackScholesPutA(stockprice,strikeprice,volatility,\n timetomaturity,interestrate);\n bspriceField.setText(numberFormatter.format(bsput));\n }\n else {\n double bsput = new\n BlackScholesFormula().BlackScholesPutB(stockprice,strikeprice,volatility,\n timetomaturity,interestrate);\n bspriceField.setText(numberFormatter.format(bsput));\n }\n }\n }\n if (source == calculate2Button) {\n if (callButton.isSelected()){\n if(normalDistributionAButton.isSelected()){\n double stvol1=new\n StochasticVolatilityFile1().simulateVolatility1(alphaone,ksi1,sigmastar1,\n intervals1,simulations1,volatility,timetomaturity);\n double svcall1=new BlackScholesFormula().BlackScholesCallA(stockprice,\n strikeprice,stvol1,timetomaturity,interestrate);\n double stvol2=new\n StochasticVolatilityFile1().simulateVolatility2(alphaone,ksi1,\n sigmastar1, intervals1,simulations1,volatility,timetomaturity);\n double svcall2=new BlackScholesFormula().BlackScholesCallA(stockprice,\n strikeprice,stvol2,timetomaturity,interestrate);\n double svcall=(svcall1+svcall2)/2;\n svpriceField.setText(numberFormatter.format(svcall));\n }\n\n // call with Normal-B\n else {\n for(stockprice=0.75; stockprice<1.26; stockprice=stockprice+0.01){\n double stvol1=new\n StochasticVolatilityFile1().simulateVolatility1(alphaone,ksi1,sigmastar1,\n intervals1,simulations1,volatility,timetomaturity);\n double svcall1=new\n BlackScholesFormula().BlackScholesCallB(stockprice,\n strikeprice, stvol1, timetomaturity, interestrate);\n double stvol2=new\n StochasticVolatilityFile1().simulateVolatility2(alphaone,ksi1,sigmastar1,\n intervals1,simulations1,volatility,timetomaturity);\n double svcall2=new\n BlackScholesFormula().BlackScholesCallB(stockprice, strikeprice, stvol2,\n timetomaturity, interestrate);\n double svcall=(svcall1+svcall2)/2;\n svpriceField.setText(numberFormatter.format(svcall));\n // System.out.println(svcall);\n }\n }\n }\n else{\n if(normalDistributionAButton.isSelected()){\n double stvol1=new\n StochasticVolatilityFile1().simulateVolatility1(alphaone,ksi1,\n sigmastar1,intervals1,simulations1,volatility,timetomaturity);\n double svput1=new BlackScholesFormula().BlackScholesPutA(stockprice,\n strikeprice, stvol1, timetomaturity, interestrate);\n\n double stvol2=new\n StochasticVolatilityFile1().simulateVolatility2(alphaone,ksi1,\n sigmastar1,intervals1,simulations1,volatility,timetomaturity);\n double svput2=new BlackScholesFormula().BlackScholesPutA(stockprice,\n strikeprice, stvol2, timetomaturity, interestrate);\n double svput=(svput1+svput2)/2;\n svpriceField.setText(numberFormatter.format(svput));\n }\n else {\n double stvol1=new\n StochasticVolatilityFile1().simulateVolatility1(alphaone,ksi1,\n sigmastar1,intervals1,simulations1,volatility,timetomaturity);\n double svput1=new BlackScholesFormula().BlackScholesPutB(stockprice,\n strikeprice,stvol1,timetomaturity, interestrate);\n double stvol2=new\n StochasticVolatilityFile1().simulateVolatility2(alphaone,ksi1,\n sigmastar1,intervals1,simulations1,volatility,timetomaturity);\n double svput2=new BlackScholesFormula().BlackScholesPutB(stockprice,\n strikeprice, stvol2, timetomaturity, interestrate);\n double svput=(svput1+svput2)/2;\n svpriceField.setText(numberFormatter.format(svput));\n }\n }\n }\n if (source == calculate3Button) {\n if (callButton.isSelected()){\n for(stockprice=0.75; stockprice<1.26; stockprice=stockprice+0.01){\n double ssv1=new StochasticPriceVolatility().getP1Call(alphatwo,\n sigmastar2,\n ksi2,\n rho,\n intervals2,\n simulations2,\n timetomaturity,\n volatility,\n stockprice,\n interestrate,\n strikeprice );\n double ssv2=new StochasticPriceVolatility().getP2Call(alphatwo,\n sigmastar2,\n ksi2,\n rho,\n intervals2,\n simulations2,\n timetomaturity,\n volatility,\n stockprice,\n interestrate,\n strikeprice );\n double ssv3=new StochasticPriceVolatility().getP3Call(alphatwo,\n sigmastar2,\n ksi2,\n rho,\n intervals2,\n simulations2,\n timetomaturity,\n volatility,\n stockprice,\n interestrate,\n strikeprice );\n double ssv4=new StochasticPriceVolatility().getP4Call(alphatwo,\n sigmastar2,\n ksi2,\n rho,\n intervals2,\n simulations2,\n timetomaturity,\n volatility,\n stockprice,\n interestrate,\n strikeprice );\n double ssv5=new StochasticPriceVolatility().getQ1Call(intervals2,\n simulations2,\n timetomaturity,\n volatility,\n stockprice,\n interestrate,\n strikeprice);\n double ssv6=new StochasticPriceVolatility().getQ2Call(intervals2,\n simulations2,\n timetomaturity,\n volatility,\n stockprice,\n interestrate,\n strikeprice);\n ssvpriceField.setText(numberFormatter.format((ssv1+ssv2+ssv3+ssv4+ssv5+ssv6\n )/6));\n //System.out.println((ssv1+ssv2+ssv3+ssv4+ssv5+ssv6)/6);\n }\n }\n else\n {\n double ssv1=new StochasticPriceVolatility().getP1Put(alphatwo,\n sigmastar2,\n ksi2,\n rho,\n intervals2,\n simulations2,\n timetomaturity,\n volatility,\n stockprice,\n interestrate,\n strikeprice );\n double ssv2=new StochasticPriceVolatility().getP2Put(alphatwo,\n sigmastar2,\n ksi2,\n rho,\n intervals2,\n simulations2,\n timetomaturity,\n volatility,\n stockprice,\n interestrate,\n strikeprice );\n double ssv3=new StochasticPriceVolatility().getP3Put(alphatwo,\n sigmastar2,\n ksi2,\n rho,\n intervals2,\n simulations2,\n timetomaturity,\n volatility,\n stockprice,\n interestrate,\n strikeprice );\n double ssv4=new StochasticPriceVolatility().getP4Put(alphatwo,\n sigmastar2,\n ksi2,\n rho,\n intervals2,\n simulations2,\n timetomaturity,\n volatility,\n stockprice,\n interestrate,\n strikeprice );\n double ssv5=new StochasticPriceVolatility(). getQ1Put(intervals2,\n simulations2,\n timetomaturity,\n volatility,\n stockprice,\n interestrate,\n strikeprice);\n double ssv6 =new StochasticPriceVolatility(). getQ2Put(intervals2,\n simulations2,\n timetomaturity,\n volatility,\n stockprice,\n interestrate,\n strikeprice);\n ssvpriceField.setText(numberFormatter.format((ssv1+ssv2+ssv3+ssv4+ssv5+ssv6)/6));\n }\n }\n if (source == calculate4Button) {\n if (callButton.isSelected()){\n if(normalDistributionAButton.isSelected()){\n double bscall3 = new\n PowerSeries().calculatePSA(stockprice,strikeprice,volatility,\n timetomaturity,interestrate,ksi3);\n pspriceField.setText(numberFormatter.format(bscall3));\n }\n else {\n for(stockprice=0.75; stockprice<1.26; stockprice=stockprice+0.01){\n double bscall3 = new\n PowerSeries().calculatePSB(stockprice,strikeprice,volatility,\n timetomaturity,interestrate,ksi3);\n pspriceField.setText(numberFormatter.format(bscall3));\n // to check - System.out.println(bscall3);\n }\n }\n }\n else {\n if(normalDistributionAButton.isSelected()){\n double bscall3 = new\n PowerSeries().calculatePSA(stockprice,strikeprice,volatility,\n timetomaturity,interestrate,ksi3);\n double putPrice=(strikeprice*Math.exp(- interestrate/100*\n timetomaturity/360)+(bscall3)-stockprice);\n pspriceField.setText(numberFormatter.format(putPrice));\n }\n else {\n double bscall3 = new\n PowerSeries().calculatePSB(stockprice,strikeprice,volatility,\n timetomaturity,interestrate,ksi3);\n double putPrice=(strikeprice*Math.exp(- interestrate/100*\n timetomaturity/360)+(bscall3)-stockprice);\n pspriceField.setText(numberFormatter.format(putPrice));\n }\n }\n }\n\n // CALCULATE ALL BUTTON\n if (source == calculateButton) {\n if (callButton.isSelected()){\n if(normalDistributionAButton.isSelected()){\n // BS Model\n double bscall = new\n BlackScholesFormula().BlackScholesCallA(stockprice,strikeprice,volatility,\n timetomaturity,interestrate);\n bspriceField.setText(numberFormatter.format(bscall));\n // SV Model\n double stvol1=new\n StochasticVolatilityFile1().simulateVolatility1(alphaone,ksi1,\n sigmastar1, intervals1, simulations1, volatility, timetomaturity);\n double svcall1=new\n BlackScholesFormula().BlackScholesCallA(stockprice, strikeprice, stvol1,\n timetomaturity, interestrate);\n double stvol2=new\n StochasticVolatilityFile1().simulateVolatility2(alphaone,ksi1,\n sigmastar1, intervals1, simulations1, volatility, timetomaturity);\n double svcall2=new\n BlackScholesFormula().BlackScholesCallA(stockprice,\n strikeprice, stvol2, timetomaturity, interestrate);\n double svcall=(svcall1+svcall2)/2 ;\n svpriceField.setText(numberFormatter.format(svcall));\n\n // SSV\n double ssv1=new StochasticPriceVolatility().getP1Call(alphatwo,\n sigmastar2,\n ksi2,\n rho,\n intervals2,\n simulations2,\n timetomaturity,\n volatility,\n stockprice,\n interestrate,\n strikeprice );\n double ssv2=new StochasticPriceVolatility().getP2Call(alphatwo,\n sigmastar2,\n ksi2,\n rho,\n intervals2,\n simulations2,\n timetomaturity,\n volatility,\n stockprice,\n interestrate,\n strikeprice );\n double ssv3=new StochasticPriceVolatility().getP3Call(alphatwo,\n sigmastar2,\n ksi2,\n rho,\n intervals2,\n simulations2,\n timetomaturity,\n volatility,\n stockprice,\n interestrate,\n strikeprice );\n double ssv4=new StochasticPriceVolatility().getP4Call(alphatwo,\n sigmastar2,\n ksi2,\n rho,\n intervals2,\n simulations2,\n timetomaturity,\n volatility,\n stockprice,\n interestrate,\n strikeprice );\n double ssv5=new StochasticPriceVolatility(). getQ1Call(intervals2,\n simulations2,\n timetomaturity,\n volatility,\n stockprice,\n interestrate,\n strikeprice);\n double ssv6=new StochasticPriceVolatility(). getQ2Call(intervals2,\n simulations2,\n timetomaturity,\n volatility,\n stockprice,\n interestrate,\n strikeprice);\n ssvpriceField.setText(numberFormatter.format((ssv1+ssv2+ssv3+ssv4+ssv5+ssv6)/6));\n // Series Solution\n double bscall3 = new\n PowerSeries().calculatePSA(stockprice,strikeprice,volatility,\n timetomaturity,interestrate,ksi3);\n pspriceField.setText(numberFormatter.format(bscall3));\n }\n // normaldistribution B\n else {\n // BS\n double bscall = new BlackScholesFormula().BlackScholesCallB(stockprice,strikeprice,\n volatility,timetomaturity,interestrate);\n bspriceField.setText(numberFormatter.format(bscall));\n // SV\n double stvol1=new StochasticVolatilityFile1().simulateVolatility1(alphaone,ksi1,\n sigmastar1, intervals1, simulations1, volatility, timetomaturity);\n double svcall1=new BlackScholesFormula().BlackScholesCallB(stockprice, strikeprice, stvol1,\n timetomaturity, interestrate);\n double stvol2=new StochasticVolatilityFile1().simulateVolatility2(alphaone,ksi1, sigmastar1,\n intervals1, simulations1, volatility, timetomaturity);\n\n double svcall2=new BlackScholesFormula().BlackScholesCallB(stockprice, strikeprice,\n stvol2, timetomaturity, interestrate);\n double svcall=(svcall1+svcall2)/2 ;\n svpriceField.setText(numberFormatter.format(svcall));\n\n // SSV\n double ssv1=new StochasticPriceVolatility().getP1Call(alphatwo,\n sigmastar2,\n ksi2,\n rho,\n intervals2,\n simulations2,\n timetomaturity,\n volatility,\n stockprice,\n interestrate,\n strikeprice );\n double ssv2=new StochasticPriceVolatility().getP2Call(alphatwo,\n sigmastar2,\n ksi2,\n rho,\n intervals2,\n simulations2,\n timetomaturity,\n volatility,\n stockprice,\n interestrate,\n strikeprice );\n double ssv3=new StochasticPriceVolatility().getP3Call(alphatwo,\n sigmastar2,\n ksi2,\n rho,\n intervals2,\n simulations2,\n timetomaturity,\n volatility,\n stockprice,\n interestrate,\n strikeprice );\n double ssv4=new StochasticPriceVolatility().getP4Call(alphatwo,\n sigmastar2,\n ksi2,\n rho,\n intervals2,\n simulations2,\n timetomaturity,\n volatility,\n stockprice,\n interestrate,\n strikeprice );\n double ssv5=new StochasticPriceVolatility(). getQ1Call(intervals2,\n simulations2,\n timetomaturity,\n volatility,\n stockprice,\n interestrate,\n strikeprice);\n double ssv6=new StochasticPriceVolatility(). getQ2Call(intervals2,\n simulations2,\n timetomaturity,\n volatility,\n stockprice,\n interestrate,\n strikeprice);\n ssvpriceField.setText(numberFormatter.format((ssv1+ssv2+ssv3+ssv4+ssv5+ssv6)/6));\n // Series Solution\n double bscall3 = new\n PowerSeries().calculatePSB(stockprice,strikeprice,volatility,\n timetomaturity,interestrate,ksi3);\n pspriceField.setText(numberFormatter.format(bscall3));\n }\n }\n // if put button is selected\n else{\n if(normalDistributionAButton.isSelected()){\n // BS\n double bsput = new\n BlackScholesFormula().BlackScholesPutA(stockprice,strikeprice,volatility,\n timetomaturity,interestrate);\n bspriceField.setText(numberFormatter.format(bsput));\n // SV\n double stvol1=new\n StochasticVolatilityFile1().simulateVolatility1(alphaone,ksi1,\n sigmastar1, intervals1, simulations1, volatility,timetomaturity);\n double svput1=new BlackScholesFormula().BlackScholesPutA(stockprice,\n strikeprice, stvol1, timetomaturity, interestrate);\n double stvol2=new\n StochasticVolatilityFile1().simulateVolatility2(alphaone,ksi1,\n sigmastar1, intervals1, simulations1, volatility, timetomaturity);\n double svput2=new BlackScholesFormula().BlackScholesPutA(stockprice,\n strikeprice, stvol2, timetomaturity, interestrate);\n double svput=(svput1+svput2)/2 ;\n svpriceField.setText(numberFormatter.format(svput));\n // SSV\n double ssv1=new StochasticPriceVolatility().getP1Put(alphatwo,\n sigmastar2,\n ksi2,\n rho,\n intervals2,\n simulations2,\n timetomaturity,\n volatility,\n stockprice,\n interestrate,\n strikeprice );\n double ssv2=new StochasticPriceVolatility().getP2Put(alphatwo,\n sigmastar2,\n ksi2,\n rho,\n intervals2,\n simulations2,\n timetomaturity,\n volatility,\n stockprice,\n interestrate,\n strikeprice );\n double ssv3=new StochasticPriceVolatility().getP3Put(alphatwo,\n sigmastar2,\n ksi2,\n rho,\n intervals2,\n simulations2,\n timetomaturity,\n volatility,\n stockprice,\n interestrate,\n strikeprice );\n double ssv4=new StochasticPriceVolatility().getP4Put(alphatwo,\n sigmastar2,\n ksi2,\n rho,\n intervals2,\n simulations2,\n timetomaturity,\n volatility,\n stockprice,\n interestrate,\n strikeprice );\n double ssv5=new StochasticPriceVolatility(). getQ1Put(intervals2,\n simulations2,\n timetomaturity,\n volatility,\n stockprice,\n interestrate,\n strikeprice);\n double ssv6=new StochasticPriceVolatility(). getQ2Put(intervals2,\n simulations2,\n timetomaturity,\n volatility,\n stockprice,\n interestrate,\n strikeprice);\n ssvpriceField.setText(numberFormatter.format((ssv1+ssv2+ssv3+ssv4+ssv5+ssv6)/6));\n // Series Solution\n double bscall3 = new\n PowerSeries().calculatePSA(stockprice,strikeprice,volatility,\n timetomaturity,interestrate,ksi3);\n double putPrice=(strikeprice*Math.exp(- interestrate/100*\n timetomaturity/360)+(bscall3)-stockprice);\n pspriceField.setText(numberFormatter.format(putPrice));\n }\n // is normaldistribution B is used (put)\n else {\n // BS\n double bsput = new\n BlackScholesFormula().BlackScholesPutB(stockprice,strikeprice,volatility,\n timetomaturity,interestrate);\n bspriceField.setText(numberFormatter.format(bsput));\n // SV\n double stvol1=new\n StochasticVolatilityFile1().simulateVolatility1(alphaone,ksi1,\n sigmastar1, intervals1, simulations1, volatility, timetomaturity);\n double svput1=new BlackScholesFormula().BlackScholesPutB(stockprice,\n strikeprice, stvol1, timetomaturity, interestrate);\n double stvol2=new\n StochasticVolatilityFile1().simulateVolatility2(alphaone,ksi1,\n sigmastar1, intervals1, simulations1, volatility, timetomaturity);\n double svput2=new BlackScholesFormula().BlackScholesPutB(stockprice,\n strikeprice, stvol2, timetomaturity, interestrate);\n double svput=(svput1+svput2)/2 ;\n svpriceField.setText(numberFormatter.format(svput));\n // SSV\n double ssv1=new StochasticPriceVolatility().getP1Put(alphatwo,\n sigmastar2,\n ksi2,\n rho,\n intervals2,\n simulations2,\n timetomaturity,\n volatility,\n stockprice,\n interestrate,\n strikeprice );\n double ssv2=new StochasticPriceVolatility().getP2Put(alphatwo,\n sigmastar2,\n ksi2,\n rho,\n intervals2,\n simulations2,\n timetomaturity,\n volatility,\n stockprice,\n interestrate,\n strikeprice );\n double ssv3=new StochasticPriceVolatility().getP3Put(alphatwo,\n sigmastar2,\n ksi2,\n rho,\n intervals2,\n simulations2,\n timetomaturity,\n volatility,\n stockprice,\n interestrate,\n strikeprice );\n double ssv4=new StochasticPriceVolatility().getP4Put(alphatwo,\n sigmastar2,\n ksi2,\n rho,\n intervals2,\n simulations2,\n timetomaturity,\n volatility,\n stockprice,\n interestrate,\n strikeprice );\n double ssv5=new StochasticPriceVolatility(). getQ1Put(intervals2,\n simulations2,\n timetomaturity,\n volatility,\n stockprice,\n interestrate,\n strikeprice);\n double ssv6=new StochasticPriceVolatility(). getQ2Put(intervals2,\n simulations2,\n timetomaturity,\n volatility,\n stockprice,\n interestrate,\n strikeprice);\n ssvpriceField.setText(numberFormatter.format((ssv1+ssv2+ssv3+ssv4+ssv5+ssv6)/6));\n // Series Solution\n double bscall3 = new\n PowerSeries().calculatePSB(stockprice,strikeprice,volatility,\n timetomaturity,interestrate,ksi3);\n double putPrice=(strikeprice*Math.exp(- interestrate/100*\n timetomaturity/360)+(bscall3)-stockprice);\n pspriceField.setText(numberFormatter.format(putPrice));\n }\n }\n } // closing calculate all\n }",
"public static void setPrice() {\n double summe = 0.0;\n for (Object obj : dlm.getDisplayedArtikel()) {\n if (obj instanceof Article) {\n Article art = (Article) obj;\n if (!art.isIsAbfrage()) {\n if (((art.isJugendSchutz() && art.isJugendSchutzOk())) || !art.isJugendSchutz()) {\n if (art.isEloadingAmmountOk() && !art.isPriceZero()) {\n summe += ((Article) ((obj))).getPreis() * ((Article) ((obj))).getAmount();\n }\n }\n }\n } else if (obj instanceof Karte) {\n Karte card = (Karte) obj;\n summe += card.getAufladung() / 100;\n }\n }\n for (Object obj : dlm.getRemovedObjects()) {\n if (obj instanceof Article) {\n if (!((Article) ((obj))).isStorno_error()) {\n summe -= ((Article) ((obj))).getPreis() * ((Article) ((obj))).getAmount();\n }\n } else if (obj instanceof Karte) {\n Karte card = (Karte) obj;\n summe -= card.getAufladung() / 100;\n }\n }\n if (Math.round(summe) == 0) {\n summe = 0;\n }\n if (GUIOperations.isTraining()) {\n summe += 1000;\n }\n tfSumme.setText(String.format(\"%.2f\", summe));\n }",
"private void update()\n {\n\n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n //System.out.println(\"UPDATE\");\n updateHumanPlayerMoney();\n updateListViewDoctorItems();\n updateListViewHospitalItems();\n updateListViewLogWindow();\n updateListViewComputerPlayer();\n load_figure();\n updateComputerPlayerMoney();\n }\n });\n }",
"private void updateUI() {\n mUser.weight.sortListByDate();\n mUser.bloodPressure.sortListsByDate();\n updateText();\n updateChart();\n }",
"public void updateDataComp() {\n\t\tdataEntryDao.updateDataComp();\n\t}",
"final void refresh() {\n try {\n Class.forName(\"com.mysql.jdbc.Driver\");\n String conURL = \"jdbc:mysql://localhost/enoriadb?\"\n + \"user=root&password=\";\n java.sql.Connection con = DriverManager.getConnection(conURL);\n\n java.sql.PreparedStatement pstmt = con.prepareStatement(\"SELECT * FROM tblproducts ORDER BY id DESC\");\n ResultSet rs = pstmt.executeQuery();\n DefaultTableModel tblmodel = (DefaultTableModel) prodTBL.getModel();\n tblmodel.setRowCount(0);\n\n while (rs.next()) {\n tblmodel.addRow(new Object[]{rs.getString(\"id\"),\n rs.getString(\"P_name\"),\n rs.getString(\"Qty\"),\n rs.getString(\"price\")});\n }\n\n //TFrCode.requestFocus();\n } catch (ClassNotFoundException ex) {\n Logger.getLogger(ProductClass.class.getName()).log(Level.SEVERE, null, ex);\n } catch (SQLException ex) {\n Logger.getLogger(ProductClass.class.getName()).log(Level.SEVERE, null, ex);\n }\n\n }",
"private void initialize() {\r\n\t\tframe = new JFrame(\"Get Future Value, PS4\");\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(\"Investment Amount\");\r\n\t\tlblNewLabel.setBounds(36, 44, 142, 25);\r\n\t\tframe.getContentPane().add(lblNewLabel);\r\n\t\t\r\n\t\tJLabel lblYears = new JLabel(\"Years\");\r\n\t\tlblYears.setBounds(36, 80, 142, 25);\r\n\t\tframe.getContentPane().add(lblYears);\r\n\t\t\r\n\t\tJLabel lblAnnualInteresetRate = new JLabel(\"Annual Interest Rate\");\r\n\t\tlblAnnualInteresetRate.setBounds(36, 116, 142, 25);\r\n\t\tframe.getContentPane().add(lblAnnualInteresetRate);\r\n\t\t\r\n\t\tJLabel lblFutureValue = new JLabel(\"Future Value\");\r\n\t\tlblFutureValue.setBounds(36, 152, 142, 25);\r\n\t\tframe.getContentPane().add(lblFutureValue);\r\n\t\t\r\n\t\tInv_amount = new JTextField();\r\n\t\tInv_amount.setBounds(207, 44, 109, 25);\r\n\t\tframe.getContentPane().add(Inv_amount);\r\n\t\tInv_amount.setColumns(10);\r\n\t\t\r\n\t\tYEARS = new JTextField();\r\n\t\tYEARS.setColumns(10);\r\n\t\tYEARS.setBounds(207, 82, 109, 25);\r\n\t\tframe.getContentPane().add(YEARS);\r\n\t\t\r\n\t\tRATE = new JTextField();\r\n\t\tRATE.setColumns(10);\r\n\t\tRATE.setBounds(207, 118, 109, 25);\r\n\t\tframe.getContentPane().add(RATE);\r\n\t\t\r\n\t\tFUTURE = new JTextField();\r\n\t\tFUTURE.setColumns(10);\r\n\t\tFUTURE.setBounds(207, 154, 109, 25);\r\n\t\tFUTURE.setBackground(Color.LIGHT_GRAY);\r\n\t\tframe.getContentPane().add(FUTURE);\r\n\t\t\r\n\t\t// button to make the event (calculate the future value)\r\n\t\t\r\n\t\tJButton btnNewButton = new JButton(\"Calculate\");\r\n\t\tbtnNewButton.setBounds(207, 188, 109, 29);\r\n\t\tframe.getContentPane().add(btnNewButton);\r\n\t\tbtnNewButton.addActionListener(new ActionListener(){\r\n\t\t\t\r\n\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\r\n\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\tdouble investment = Double.parseDouble(Inv_amount.getText());\r\n\t\t\t\tdouble years = Double.parseDouble(YEARS.getText());\r\n\t\t\t\tdouble annual_interest_rate = Double.parseDouble(RATE.getText());\r\n\t\t\t\tCalculate total = new Calculate();\r\n\t\t\t\tcalc_total = total.get_future(investment, years, annual_interest_rate);\r\n\t\t\t\tFUTURE.setText(\"$\" +calc_total);\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t});\r\n\t\r\n\t}",
"private void refreshCoins() {\n\t\t meCoinLabel.setText(\"硬币:\"+me_coin);\n\t\t leftCoinLabel.setText(\"硬币:\"+left_coin);\n\t\t rightCoinLabel.setText(\"硬币:\"+right_coin);\n\t\t \n\t}",
"@Override\r\n\t\t\tpublic void handle(CellEditEvent<Products, String> arg0) {\n\t\t\t\targ0.getTableView().getItems().get(arg0.getTablePosition().getRow()).setQuantity(arg0.getNewValue());\r\n\t\t\t\tProducts data=(Products) tbl_view.getSelectionModel().getSelectedItem();\r\n\t\t\t\tSystem.out.println(data.toString());\r\n\t\t\t\tConnectionManager.queryInsert(conn, \"UPDATE dbo.product SET quantity='\"+data.getQuantity()+\"' WHERE id=\"+data.getId());\r\n\t\t\t\ttxt_cost.clear();\r\n\t\t\t\ttxt_date.clear();\r\n\t\t\t\ttxt_name.clear();\r\n\t\t\t\ttxt_price.clear();\r\n\t\t\t\ttxt_qty.clear();\r\n\t\t\t\ttxt_reorder.clear();\r\n\t\t\t\ttxt_search.clear();\r\n\t\t\t\tfetchData(FETCH_DATA);\r\n\t\t\t}",
"@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jScrollPane1 = new javax.swing.JScrollPane();\n tbl = new javax.swing.JTable();\n backbtn = new javax.swing.JButton();\n jLabel1 = new javax.swing.JLabel();\n updatebtn = new javax.swing.JButton();\n deletebtn = new javax.swing.JButton();\n createbtn = new javax.swing.JButton();\n renewbtn = new javax.swing.JButton();\n\n tbl.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null, null, null, null, null},\n {null, null, null, null, null},\n {null, null, null, null, null},\n {null, null, null, null, null}\n },\n new String [] {\n \"Product ID\", \"Market Name\", \"Floor Price\", \"Ceiling Price\", \"Target Price\"\n }\n ));\n jScrollPane1.setViewportView(tbl);\n\n backbtn.setText(\"Back\");\n backbtn.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n backbtnActionPerformed(evt);\n }\n });\n\n jLabel1.setFont(new java.awt.Font(\"Lucida Grande\", 0, 18)); // NOI18N\n jLabel1.setText(\"Market Offer Catalog Manage\");\n\n updatebtn.setText(\"Update\");\n updatebtn.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n updatebtnActionPerformed(evt);\n }\n });\n\n deletebtn.setText(\"Delete\");\n deletebtn.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n deletebtnActionPerformed(evt);\n }\n });\n\n createbtn.setText(\"Create\");\n createbtn.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n createbtnActionPerformed(evt);\n }\n });\n\n renewbtn.setText(\"Refresh\");\n renewbtn.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n renewbtnActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(51, 51, 51)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(createbtn, javax.swing.GroupLayout.PREFERRED_SIZE, 88, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addComponent(updatebtn)\n .addGap(18, 18, 18)\n .addComponent(deletebtn, javax.swing.GroupLayout.PREFERRED_SIZE, 88, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jLabel1)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(renewbtn)\n .addGap(18, 18, 18)\n .addComponent(backbtn))\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 569, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addContainerGap(102, Short.MAX_VALUE))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(51, 51, 51)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(backbtn)\n .addComponent(jLabel1)\n .addComponent(renewbtn))\n .addGap(18, 18, 18)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 180, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(deletebtn)\n .addComponent(updatebtn)\n .addComponent(createbtn))\n .addContainerGap(270, Short.MAX_VALUE))\n );\n }",
"private void buttonToSetIncomeMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_buttonToSetIncomeMouseClicked\n this.updateData(\"+\");\n this.setVisible(false);\n }",
"private void updatePriceLabel(double aPrice) {\n price = aPrice;\n String out = String.format(\"<html><b>Price</b><br>$%.2f</html>\", price);\n priceLabel.setText(out);\n }",
"private void populate() {\r\n \tSharedPreferences settings = getSharedPreferences(TEMP, 0);\r\n \tLong tempId = settings.getLong(DbAdapter.KEY_ROWID, -1);\r\n \tif (tempId != null && tempId.equals(mRowId)) {\r\n \t\t// load from properties\r\n \tmTime = settings.getLong(DbAdapter.KEY_DATE, -1);\r\n \tDate date = new Date();\r\n \tDateFormat dateFormat = android.text.format.DateFormat.getDateFormat(getApplicationContext());\r\n \tString text = dateFormat.format(date);\r\n \tmDatePickerText.setText(text);\r\n \tmPayeeText.setText(settings.getString(DbAdapter.KEY_PAYEE, \"\"));\r\n \tmAmountText.setText(settings.getString(DbAdapter.KEY_AMOUNT, \"\"));\r\n \tmCategoryText.setText(settings.getString(DbAdapter.KEY_CATEGORY, \"\"));\r\n \tmMemoText.setText(settings.getString(DbAdapter.KEY_MEMO, \"\"));\r\n \tmTagText.setText(settings.getString(DbAdapter.KEY_TAG, \"\"));\r\n \t} else if (mRowId != null) {\r\n \t// load existing from db\r\n \tmDbHelper.open();\r\n \tCursor cursor = mDbHelper.fetch(mRowId);\r\n \tstartManagingCursor(cursor);\r\n \tDate date = new Date();\r\n \tmTime = cursor.getLong(\r\n \t\t\tcursor.getColumnIndexOrThrow(DbAdapter.KEY_DATE));\r\n \tDateFormat dateFormat = android.text.format.DateFormat.getDateFormat(getApplicationContext());\r\n \tString text = dateFormat.format(date);\r\n \tmDatePickerText.setText(text);\r\n \tmPayeeText.setText(cursor.getString(\r\n \t\t\tcursor.getColumnIndexOrThrow(DbAdapter.KEY_PAYEE)));\r\n \tmAmountText.setText(cursor.getString(\r\n \t\t\tcursor.getColumnIndexOrThrow(DbAdapter.KEY_AMOUNT)));\r\n \tmCategoryText.setText(cursor.getString(\r\n \t\t\tcursor.getColumnIndexOrThrow(DbAdapter.KEY_CATEGORY)));\r\n \tmMemoText.setText(cursor.getString(\r\n \t\t\tcursor.getColumnIndexOrThrow(DbAdapter.KEY_MEMO)));\r\n \tmTagText.setText(cursor.getString(\r\n \t\t\tcursor.getColumnIndexOrThrow(DbAdapter.KEY_TAG)));\r\n \tmDbHelper.close();\r\n } else { // new entry\r\n\t\t\tsetToday();\r\n\t\t\tupdateDate();\r\n }\r\n }",
"@FXML\n private void priceNA()\n {\n currentPrice.setText(\"N/A\");\n }",
"private void requestData() {\n Jc11x5Factory.getInstance().getJobPriceList(mHandler);\n }",
"public void refreshList() {\n PartDAO partDAO = new PartDAO();\n for (Part p : partDAO.getAll()) {\n if (p.getStockLevel() > 0) {\n Label partLabel = new Label(\"ID: \" + p.getPartID() + \" / Name: \" + p.getName() + \" / Stock: \" + p.getStockLevel());\n partHashMap.put(partLabel.getText(), p);\n partList.getItems().add(partLabel);\n }\n }\n Customer customer = new Customer();\n CustomerDAO customerDAO = new CustomerDAO();\n for(Customer c: customerDAO.getAll()) {\n if(jobReference.getJob().getCustomerID() == Integer.parseInt(c.getCustomerID())) {\n customer.setFirstName(c.getFirstName());\n customer.setLastName(c.getLastName());\n break;\n }\n }\n if(jobReference.getJob().getRegistrationID() == null) {\n jobDetailsLbl.setText(\"Date: \" + jobReference.getJob().getDateBookedIn() + \" / Name: \" + customer.getFirstName() + \" \" + customer.getLastName() + \" / Part-only job\");\n }\n else {\n jobDetailsLbl.setText(\"Date: \" + jobReference.getJob().getDateBookedIn() + \" / Name: \" + customer.getFirstName() + \" \" + customer.getLastName() + \" / Car ID: \" + jobReference.getJob().getRegistrationID());\n }\n stockUsedField.setText(\"1\");\n }",
"public void updateDataCell();",
"@Override\n public void initialize(URL url, ResourceBundle rb) {\n selectedProduct = MainScreenController.getProductToModify();\n assocParts = selectedProduct.getAllAssociatedParts();\n\n partIdColumn.setCellValueFactory(new PropertyValueFactory<>(\"id\"));\n partNameColumn.setCellValueFactory(new PropertyValueFactory<>(\"name\"));\n partInventoryColumn.setCellValueFactory(new PropertyValueFactory<>(\"stock\"));\n partPriceColumn.setCellValueFactory(new PropertyValueFactory<>(\"price\"));\n partTableView.setItems(Inventory.getAllParts());\n\n assocPartIdColumn.setCellValueFactory(new PropertyValueFactory<>(\"id\"));\n assocPartNameColumn.setCellValueFactory(new PropertyValueFactory<>(\"name\"));\n assocPartInventoryColumn.setCellValueFactory(new PropertyValueFactory<>(\"stock\"));\n assocPartPriceColumn.setCellValueFactory(new PropertyValueFactory<>(\"price\"));\n assocPartTableView.setItems(assocParts);\n\n productIdText.setText(String.valueOf(selectedProduct.getId()));\n productNameText.setText(selectedProduct.getName());\n productInventoryText.setText(String.valueOf(selectedProduct.getStock()));\n productPriceText.setText(String.valueOf(selectedProduct.getPrice()));\n productMaxText.setText(String.valueOf(selectedProduct.getMax()));\n productMinText.setText(String.valueOf(selectedProduct.getMin()));\n }",
"public void setCurrentCostPrice (BigDecimal CurrentCostPrice)\n\t{\n\t\tset_Value (COLUMNNAME_CurrentCostPrice, CurrentCostPrice);\n\t}"
] | [
"0.6579778",
"0.6536777",
"0.65306383",
"0.64478683",
"0.64375955",
"0.6395011",
"0.6307614",
"0.6263193",
"0.62513924",
"0.61846894",
"0.6152379",
"0.61378217",
"0.6137602",
"0.6128398",
"0.6113553",
"0.6110154",
"0.60684234",
"0.6063212",
"0.6051113",
"0.600128",
"0.59862435",
"0.5967265",
"0.5906837",
"0.5903139",
"0.58934903",
"0.58582425",
"0.5854955",
"0.5828653",
"0.58022743",
"0.57828397",
"0.57665414",
"0.57638687",
"0.5758503",
"0.5747353",
"0.573119",
"0.5724877",
"0.5723345",
"0.5718594",
"0.5717666",
"0.5716079",
"0.5712912",
"0.5704308",
"0.5704051",
"0.5681202",
"0.5680328",
"0.56744456",
"0.56724256",
"0.56652594",
"0.5662795",
"0.5658295",
"0.5656745",
"0.56539196",
"0.5646606",
"0.56291455",
"0.56246334",
"0.56236374",
"0.56126845",
"0.56111753",
"0.5609477",
"0.56067127",
"0.56057525",
"0.55963254",
"0.55935854",
"0.5589328",
"0.5584841",
"0.55807275",
"0.5580124",
"0.5579342",
"0.55725485",
"0.5569488",
"0.5566644",
"0.5562298",
"0.5558836",
"0.55523235",
"0.55501163",
"0.5545785",
"0.55457085",
"0.5541114",
"0.5536549",
"0.5533986",
"0.55234057",
"0.55233365",
"0.5522887",
"0.55198437",
"0.551941",
"0.5519382",
"0.5517722",
"0.5517401",
"0.55146223",
"0.55052274",
"0.5504153",
"0.5493671",
"0.5493239",
"0.5488254",
"0.5485298",
"0.5478953",
"0.54754937",
"0.54714286",
"0.5471406",
"0.546851"
] | 0.6935364 | 0 |
Takes the prices (and other information) entered by the user, and applies them to (enters them into) the Moneydance data store. | public void applyPrices(int effectiveDate, boolean setCurrentPrice) {
int count = 0; // How many new prices were entered?
for (SecurityRow row : allSecurities) {
if(row.applyPrice(effectiveDate, setCurrentPrice)) count++;
}
loadCurrentPrices();
// If any new prices were entered, refresh the view
fireTableDataChanged();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void calculatePrice() {\n\t\tint temp = controller.getQualityPrice(hotel.getText(), quality.getText());\n\n\t\ttemp *= getDays();\n\n\t\tif (discountChoice > 0) {\n\t\t\tdouble discountTmp = (double) discountChoice / 100;\n\t\t\ttemp *= (1.00 - discountTmp);\n\t\t}\n\n\t\tprice.setText(Integer.toString(temp));\n\n\t}",
"private void calcPrice() {\n double itemPrice = 0;\n \n //get price of burger (base)\n if (singleRad.isSelected())\n {\n itemPrice = 3.50;\n }\n else \n {\n itemPrice = 4.75;\n }\n \n //check options add to item price\n if(cheeseCheckbox.isSelected())\n itemPrice = itemPrice += 0.50;\n if(baconCheckbox.isSelected())\n itemPrice = itemPrice += 1.25;\n if(mealCheckbox.isSelected())\n itemPrice = itemPrice += 4.00;\n \n //include the quantity for the item price\n int quantity= 1;\n if (quantityTextField.getText().equals(\"\"))\n quantityTextField.setText(\"1\");\n quantity = Integer.parseInt(quantityTextField.getText());\n itemPrice = itemPrice * quantity;\n\n \n //show the price no $ symbol\n \n itemPriceTextField.setText(d2.format(itemPrice));\n }",
"public void handleAddition() {\n\t\tString tempCryptoCurrency = cryptoCurrency.getText().toUpperCase();\n\t\t\n\t\tboolean notValid = !isCryptoInputValid(tempCryptoCurrency);\n\t\t\n\t\tif(notValid) {\n\t\t\ttempCryptoCurrency = null;\n\t\t}\n\t\t\n\t\t// is set to false in case a textField is empty \n\t\tboolean inputComplete = true;\n\t\t\n\t\t// Indicates whether the portfolio actually contains the number of coins to be sold\n\t\tboolean sellingAmountOk = true;\n\t\t\n\t\t/*\n\t\t * If the crypto currency is to be sold, a method is called that \n\t\t * checks whether the crypto currency to be sold is in the inventory at all.\n\t\t */\n\t\tif(type.getValue().toString() == \"Verkauf\" && cryptoCurrency.getText() != null ) {\t\n\t\t\tif(numberOfCoins.getText() == null || numberOfCoins.getText().isEmpty() || Double.valueOf(numberOfCoins.getText()) == 0.0) {\n\t\t\t\tsellingAmountOk = false;\n\t\t\t}else {\n\t\t\t\tsellingAmountOk = cryptoCurrencyAmountHold(Double.valueOf(numberOfCoins.getText()), cryptoCurrency.getText().toUpperCase());\n\t\t\t}\n\t\t\t\n\t\t} \n\t\t\n\t\t\n\t\tList<TextField> labelList = new ArrayList<>();\n\t\t\n\t\t// list of textFields which should be validate for input\n\t\tlabelList.add(price);\n\t\tlabelList.add(numberOfCoins);\n\t\tlabelList.add(fees);\n\t\t\t\n\t\t// validates if the textField input is empty\n\t\tfor (TextField textField : labelList) {\n\t\t\t\n\t\t\tif (textField.getText().trim().isEmpty()) {\n\t\t\t\tinputComplete = false;\n\t\t\t}\n\t\t\t\n\t\t\tif (validateFieldInput(textField.getText()) == false){\n\t\t\t\tinputComplete = false;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Logic to differentiate whether a warning is displayed or not.\n\t\tif (sellingAmountOk == false) {\n\t\t\tAlert alert = new Alert(AlertType.ERROR);\n\t\t\talert.initOwner(dialogStage);\n\t\t\talert.setTitle(\"Eingabefehler\");\n\t\t\talert.getDialogPane().getStylesheets().add(getClass().getResource(\"Style.css\").toExternalForm());\n\t\t\talert.getDialogPane().getStyleClass().add(\"dialog-pane\");\n\t\t\talert.setHeaderText(\"Ungueltige Anzahl, bitte korrigieren\");\n\t\t\talert.showAndWait();\n\t\t}else if (inputComplete == false) {\n\t\t\tAlert alert = new Alert(AlertType.ERROR);\n\t\t\talert.initOwner(dialogStage);\n\t\t\talert.setTitle(\"Eingabefehler\");\n\t\t\talert.getDialogPane().getStylesheets().add(getClass().getResource(\"Style.css\").toExternalForm());\n\t\t\talert.getDialogPane().getStyleClass().add(\"dialog-pane\");\n\t\t\talert.setHeaderText(\"Eingabe ist unvollstaendig oder ungueltig\");\n\t\t\talert.showAndWait();\n\t\t} else if (tempCryptoCurrency == null) {\n\t\t\tAlert alert = new Alert(AlertType.ERROR);\n\t\t\talert.initOwner(dialogStage);\n\t\t\talert.setTitle(\"Eingabefehler\");\n\t\t\talert.getDialogPane().getStylesheets().add(getClass().getResource(\"Style.css\").toExternalForm());\n\t alert.getDialogPane().getStyleClass().add(\"dialog-pane\");\n\t\t\talert.setHeaderText(\"Symbol fuer Coin existiert nicht\");\n\t\t\talert.showAndWait();\n\t\t}\n\t\telse {\n\t\t\t// if no type is entered, \"Kauf\" is automatically set\n\t\t\tif (type.getValue() == null){\n\t\t\t\ttype.setValue(\"Kauf\");\n\t\t\t}\n\t\t\t\n\t\t\tif (datePicker.getValue() == null) {\n\t\t\t\tdatePicker.setValue(LocalDate.now());\n\t\t\t}\n\n\t\t\t// Calls a method for calculating the total\n\t\t\tDouble tempTotal = calculateTotal(type.getValue().toString(), Double.valueOf(price.getText()),\n\t\t\t\t\tDouble.valueOf(numberOfCoins.getText()), Double.valueOf(fees.getText()));\n\n\t\t\tDouble tempNbrOfCoins = Double.valueOf(numberOfCoins.getText());\n\n\t\t\t\n\t\t\tif (type.getValue().toString() == \"Verkauf\") {\n\t\t\t\ttempNbrOfCoins = tempNbrOfCoins * -1;\n\t\t\t}\n\n\t\t\tif (transaction == null) {\n\t\t\t\tsaveTransaction(Double.valueOf(price.getText()), fiatCurrency.getText(), datePicker.getValue(), tempCryptoCurrency,\n\t\t\t\t\t\ttype.getValue().toString(), tempNbrOfCoins, Double.valueOf(fees.getText()), tempTotal);\n\t\t\t} else {\n\t\t\t\tupdateTransaction(transaction, Double.valueOf(price.getText()), fiatCurrency.getText(), datePicker.getValue(),\n\t\t\t\t\t\ttempCryptoCurrency, type.getValue().toString(), tempNbrOfCoins, Double.valueOf(fees.getText()),\n\t\t\t\t\t\ttempTotal);\n\t\t\t}\n\t\t\tmainApp.openPortfolioDetailView();\n\n\t\t\t/*\n\t\t\t * Sets the transaction to zero to know whether to add a new transaction or\n\t\t\t * update an existing transaction when opening next time the dialog.\n\t\t\t */\n\t\t\tthis.transaction = null;\n\n\t\t}\n\t}",
"double calculatePrice();",
"private void calculateEarnings()\n {\n // get user input\n int items = Integer.parseInt( itemsSoldJTextField.getText() );\n double price = Double.parseDouble( priceJTextField.getText() );\n Integer integerObject = \n ( Integer ) commissionJSpinner.getValue();\n int commissionRate = integerObject.intValue();\n \n // calculate total sales and earnings\n double sales = items * price;\n double earnings = ( sales * commissionRate ) / 100;\n \n // display the results\n DecimalFormat dollars = new DecimalFormat( \"$0.00\" );\n grossSalesJTextField.setText( dollars.format( sales ) );\n earningsJTextField.setText( dollars.format( earnings ) );\n\n }",
"public void changePrices()\n {\n String publisher = (String) publishers.getSelectedItem();\n if (publisher.equals(\"Any\"))\n {\n result.setText(\"I am sorry, but I cannot do that.\");\n return;\n }\n try\n { \n if (priceUpdateStmt == null)\n priceUpdateStmt = conn.prepareStatement(priceUpdate);\n priceUpdateStmt.setString(1, priceChange.getText());\n priceUpdateStmt.setString(2, publisher);\n int r = priceUpdateStmt.executeUpdate();\n result.setText(r + \" records updated.\"); \n } \n catch (SQLException e)\n {\n result.setText(\"\");\n while (e != null)\n {\n result.append(\"\" + e);\n e = e.getNextException();\n }\n }\n }",
"public void setPriceEntered (BigDecimal PriceEntered);",
"public void setPriceListEntered (BigDecimal PriceListEntered);",
"private void updateTransaction() {\n LogUtils.logEnterFunction(Tag);\n\n String inputtedAmount = etAmount.getText().toString().trim().replaceAll(\",\", \"\");\n if (inputtedAmount.equals(\"\") || Double.parseDouble(inputtedAmount) == 0) {\n etAmount.setError(getResources().getString(R.string.Input_Error_Amount_Empty));\n return;\n }\n\n if (mAccount == null) {\n ((ActivityMain) getActivity()).showError(getResources().getString(R.string.Input_Error_Account_Empty));\n return;\n }\n\n Double amount = Double.parseDouble(inputtedAmount);\n int categoryId = mCategory != null ? mCategory.getId() : 0;\n String description = tvDescription.getText().toString();\n int accountId = mAccount.getId();\n String strEvent = tvEvent.getText().toString();\n Event event = null;\n\n if (!strEvent.equals(\"\")) {\n event = mDbHelper.getEventByName(strEvent);\n if (event == null) {\n long eventId = mDbHelper.createEvent(new Event(0, strEvent, mCal, null));\n if (eventId != -1) {\n event = mDbHelper.getEvent(eventId);\n }\n }\n }\n\n // Less: Repayment, More: Lend\n if(mCategory.getDebtType() == Category.EnumDebt.LESS || mCategory.getDebtType() == Category.EnumDebt.MORE) {\n\n boolean isDebtValid = true;\n if(mCategory.getDebtType() == Category.EnumDebt.LESS) { // Income -> Debt Collecting\n List<Debt> debts = mDbHelper.getAllDebtByPeople(tvPeople.getText().toString());\n\n Double lend = 0.0, debtCollect = 0.0;\n for(Debt debt : debts) {\n if(mDbHelper.getCategory(debt.getCategoryId()).isExpense() && mDbHelper.getCategory(debt.getCategoryId()).getDebtType() == Category.EnumDebt.MORE) {\n lend += debt.getAmount();\n }\n\n if(!mDbHelper.getCategory(debt.getCategoryId()).isExpense() && mDbHelper.getCategory(debt.getCategoryId()).getDebtType() == Category.EnumDebt.LESS) {\n debtCollect += debt.getAmount();\n }\n }\n\n if(debtCollect + amount > lend) {\n isDebtValid = false;\n ((ActivityMain) getActivity()).showError(getResources().getString(R.string.message_debt_collect_invalid));\n }\n\n } // End DebtType() == Category.EnumDebt.LESS\n if(isDebtValid) {\n Transaction transaction = new Transaction(mTransaction.getId(),\n TransactionEnum.Income.getValue(),\n amount,\n categoryId,\n description,\n 0,\n accountId,\n mCal,\n 0.0,\n \"\",\n event);\n\n int row = mDbHelper.updateTransaction(transaction);\n if (row == 1) { // Update transaction OK\n\n if(mDbHelper.getDebtByTransactionId(mTransaction.getId()) != null) {\n Debt debt = mDbHelper.getDebtByTransactionId(mTransaction.getId());\n debt.setCategoryId(mCategory.getId());\n debt.setAmount(amount);\n debt.setPeople(tvPeople.getText().toString());\n\n int debtRow = mDbHelper.updateDebt(debt);\n if(debtRow == 1) {\n ((ActivityMain) getActivity()).showToastSuccessful(getResources().getString(R.string.message_transaction_update_successful));\n cleanup();\n // Return to last fragment\n getFragmentManager().popBackStackImmediate();\n } else {\n // Revert update\n mDbHelper.updateTransaction(mTransaction);\n ((ActivityMain) getActivity()).showToastSuccessful(getResources().getString(R.string.message_transaction_update_fail));\n }\n } else {\n Debt newDebt = new Debt();\n newDebt.setCategoryId(mCategory.getId());\n newDebt.setTransactionId((int) mTransaction.getId());\n newDebt.setAmount(amount);\n newDebt.setPeople(tvPeople.getText().toString());\n\n long debtId = mDbHelper.createDebt(newDebt);\n if(debtId != -1) {\n ((ActivityMain) getActivity()).showToastSuccessful(getResources().getString(R.string.message_transaction_create_successful));\n cleanup();\n // Return to last fragment\n getFragmentManager().popBackStackImmediate();\n } else {\n // Revert update\n mDbHelper.updateTransaction(mTransaction);\n ((ActivityMain) getActivity()).showToastSuccessful(getResources().getString(R.string.message_transaction_update_fail));\n }\n } // End create new Debt\n\n } // End Update transaction OK\n } // End isDebtValid\n\n } else { // CATEGORY NORMAL\n Transaction transaction = new Transaction(mTransaction.getId(),\n TransactionEnum.Income.getValue(),\n amount,\n categoryId,\n description,\n 0,\n accountId,\n mCal,\n 0.0,\n \"\",\n event);\n\n int row = mDbHelper.updateTransaction(transaction);\n if (row == 1) { // Update transaction OK\n if(mDbHelper.getDebtByTransactionId(mTransaction.getId()) != null) {\n mDbHelper.deleteDebt(mDbHelper.getDebtByTransactionId(mTransaction.getId()).getId());\n }\n // Return to last fragment\n getFragmentManager().popBackStackImmediate();\n }\n }\n\n LogUtils.logLeaveFunction(Tag);\n }",
"public void priceCheck() {\n\t\tnew WLPriceCheck().execute(\"\");\n\t}",
"public void priceUpdate(){\n \n double attractionPrices = 0;\n Attraction attraction;\n for(int i=0; i< getAttractionsList().size();i++)\n {\n attraction = (Attraction) getAttractionsList().get(i);\n attractionPrices += attraction.getPrice();\n }\n hotelPrice = diff(getEndDate(), getStartDate());\n price = getTravel().getPrice() + getHotel().getPrice()*(hotelPrice) \n + getTransport().getPrice()*getTravel().getDistance()\n + attractionPrices;\n }",
"void editTakingPrice() throws PresentationException {\n\t\tTakingPrice tp = null;\n\t\tint codebar_item;\n\t\tint code_supermarket;\n\t\tint newCodeItem;\n\n\t\tprinter.printMsg(\"Digite o código do item a ser alterado? \");\n\t\tcodebar_item = reader.readNumber();\n\n\t\tprinter.printMsg(\"Digite o código do supermercado a ser alterado? \");\n\t\tcode_supermarket = reader.readNumber();\n\n\t\tprinter.printMsg(\n\t\t\t\t\" Digite a data da tomada de preço do item: (Ex.Formato: '2017-12-16 10:55:53' para 16 de dezembro de 2017, 10 horas 55 min e 53 seg)\");\n\t\tString dateTP = reader.readText();\n\t\tdateTP = reader.readText();\n\n\t\tString pattern = \"yyyy-mm-dd hh:mm:ss\";\n\t\tSimpleDateFormat simpleDateFormat = new SimpleDateFormat(pattern);\n\t\tDate dateTPF = null;\n\t\ttry {\n\t\t\tdateTPF = simpleDateFormat.parse(dateTP);\n\t\t} catch (ParseException e) {\n\t\t\tthrow new PresentationException(\"Não foi possível executar a formatação da data no padrão definido\", e);\n\t\t\t// e.printStackTrace();\n\t\t}\n\t\t// pensando em cadastrar o novo preço sem editar o preço antigo. Senão terei que\n\t\t// controlar por muitos atributos.\n\n\t\tif (tpm.checksExistence(codebar_item, code_supermarket, dateTPF)) {\n\t\t\ttp = tpm.getTakingPrice(codebar_item, code_supermarket, dateTPF);\n\t\t\tint codeSupermarket = tp.getCodeSupermarket();\n\t\t\tdouble priceItem = tp.getPrice();\n\t\t\tDate dateTPE = tp.getDate();\n\t\t\tint respEdit = 0;\n\n\t\t\ttpm.deleteTakingPrice(codebar_item, code_supermarket, dateTPE);\n\n\t\t\tdo {\n\t\t\t\ttry {\n\t\t\t\t\trespEdit = this.askWhatEdit(tp);\n\n\t\t\t\t} catch (NumeroInvalidoException e) {\n\t\t\t\t\tthrow new PresentationException(\"A opção digitada não é uma opção válida\", e);\n\t\t\t\t}\n\n\t\t\t\tif (respEdit == 1) {\n\t\t\t\t\tprinter.printMsg(\" Digite o novo código do item: \");\n\t\t\t\t\tnewCodeItem = reader.readNumber();\n\t\t\t\t\ttry {\n\t\t\t\t\t\tthis.saveTakingPrice(newCodeItem, priceItem, codeSupermarket, dateTPE);\n\t\t\t\t\t} catch (PresentationException e) {\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t} else if (respEdit == 2) {\n\t\t\t\t\tprinter.printMsg(\" Digite o novo código do supermercado: \");\n\t\t\t\t\tint newCodeSupermarket = 0;\n\t\t\t\t\tnewCodeSupermarket = reader.readNumber();\n\t\t\t\t\ttry {\n\t\t\t\t\t\tthis.saveTakingPrice(codebar_item, priceItem, newCodeSupermarket, dateTPE);\n\t\t\t\t\t} catch (PresentationException e) {\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t} else if (respEdit == 3) {\n\t\t\t\t\tprinter.printMsg(\" Digite o novo preço do item: \");\n\t\t\t\t\tdouble newPriceItem = 0;\n\t\t\t\t\tnewPriceItem = reader.readNumberDouble();\n\t\t\t\t\ttry {\n\t\t\t\t\t\tthis.saveTakingPrice(codebar_item, newPriceItem, codeSupermarket, dateTPE);\n\t\t\t\t\t} catch (PresentationException e) {\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t} else if (respEdit == 4) {\n\t\t\t\t\tprinter.printMsg(\n\t\t\t\t\t\t\t\" Digite a nova data da tomada de preço do item: (Ex.Formato: '2017-12-16 10:55:53' para 16 de dezembro de 2017, 10 horas 55 min e 53 seg)\");\n\t\t\t\t\tString date = reader.readText();\n\t\t\t\t\tdate = reader.readText();\n\n\t\t\t\t\t// String pattern = \"yyyy-mm-dd hh:mm:ss\";\n\t\t\t\t\t// SimpleDateFormat simpleDateFormat = new SimpleDateFormat(pattern);\n\t\t\t\t\tDate newDateTP = null;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tnewDateTP = simpleDateFormat.parse(date);\n\t\t\t\t\t} catch (ParseException e) {\n\t\t\t\t\t\tthrow new PresentationException(\"A opção digitada não é uma opção válida\", e);\n\t\t\t\t\t\t// e.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t\tSystem.out.println(\"Date:\" + date);\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\tthis.saveTakingPrice(codebar_item, priceItem, codeSupermarket, newDateTP);\n\t\t\t\t\t} catch (PresentationException e) {\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t} while (respEdit != 1 & respEdit != 2 & respEdit != 3 & respEdit != 4);\n\n\t\t} else\n\n\t\t{\n\t\t\tprinter.printMsg(\"Não existe tomada de preço com estes códigos cadastrados.\");\n\t\t}\n\n\t}",
"private void changePrice() {\n\t\tint sic_idHolder; // declares sic_idHolder\n\t\tdouble priceHolder; // declares priceHolder\n\t\t\n\t\tSystem.out.println(\"Please enter the SIC-ID of the book you'd like to change the price of:\");\n\t\tsic_idHolder = scan.nextInt();\n\t\tscan.nextLine();\n\t\t\n\t\tif(inventoryObject.cardExists(sic_idHolder)) { // checks to see if card exists\n\t\t\tSystem.out.println(\"Please enter the new price of the book:\");\n\t\t\tpriceHolder = scan.nextDouble();\n\t\t\tscan.nextLine();\n\t\t\tif(priceHolder < 0) { // checks to see if priceHolder is negative\n\t\t\t\tSystem.out.println(\"The price cannot be below zero\\n\");\n\t\t\t\tgetUserInfo();\n\t\t\t}\n\t\t\tinventoryObject.changePrice(sic_idHolder, priceHolder);\n\t\t\tgetUserInfo();\n\t\t}\n\t\telse {\n\t\t\tSystem.out.println(\"The ID you entered does not exist\\n\");\n\t\t\tgetUserInfo();\n\t\t}\n\t}",
"public static void setPrice() {\n double summe = 0.0;\n for (Object obj : dlm.getDisplayedArtikel()) {\n if (obj instanceof Article) {\n Article art = (Article) obj;\n if (!art.isIsAbfrage()) {\n if (((art.isJugendSchutz() && art.isJugendSchutzOk())) || !art.isJugendSchutz()) {\n if (art.isEloadingAmmountOk() && !art.isPriceZero()) {\n summe += ((Article) ((obj))).getPreis() * ((Article) ((obj))).getAmount();\n }\n }\n }\n } else if (obj instanceof Karte) {\n Karte card = (Karte) obj;\n summe += card.getAufladung() / 100;\n }\n }\n for (Object obj : dlm.getRemovedObjects()) {\n if (obj instanceof Article) {\n if (!((Article) ((obj))).isStorno_error()) {\n summe -= ((Article) ((obj))).getPreis() * ((Article) ((obj))).getAmount();\n }\n } else if (obj instanceof Karte) {\n Karte card = (Karte) obj;\n summe -= card.getAufladung() / 100;\n }\n }\n if (Math.round(summe) == 0) {\n summe = 0;\n }\n if (GUIOperations.isTraining()) {\n summe += 1000;\n }\n tfSumme.setText(String.format(\"%.2f\", summe));\n }",
"private void updatePriceAndSaving() {\n movieOrder = new MovieOrder(movie, Weekday.weekdayForValue(selectedDay), flagsApplied, numberOfTickets);\n\n tvTotalPriceNewTickets.setText(getResources().getString(\n R.string.total_price_new_tickets,\n movieOrder.getTotalPriceAfterDiscount(),\n movieOrder.getNumberOfTicketsAfterOfferIsApplied())\n );\n\n tvSavingsNewTickets.setText(getResources().getString(\n R.string.today_saving_new_tickets,\n movieOrder.getTotalSaving()\n ));\n }",
"public void doCalculation() throws BadInputFormatException {\r\n\t\tSet<LocalDate> allTradingDays = dateEntityMap.keySet();\r\n\r\n\t\tfor (LocalDate ld : allTradingDays) {\r\n\t\t\tDouble outgoingUsd = 0d;\r\n\t\t\tDouble incomingUsd = 0d;\r\n\t\t\tList<TradeEntity> entitiesOnThisDay = dateEntityMap.get(ld);\r\n\r\n\t\t\tfor (TradeEntity e : entitiesOnThisDay) {\r\n\t\t\t\tif (e.getBuySell().equalsIgnoreCase(\"B\")) {\r\n\t\t\t\t\toutgoingUsd += e.getPricePerUnit() * e.getUnits() * e.getAgreedFx();\r\n\r\n\t\t\t\t} else if (e.getBuySell().equalsIgnoreCase(\"S\")) {\r\n\t\t\t\t\tincomingUsd += e.getPricePerUnit() * e.getUnits() * e.getAgreedFx();\r\n\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthrow new BadInputFormatException(\"The value of BuyOrSell must be either S or B\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\tupdateTotalIncomingForEntity(e, incomingUsd);\r\n\t\t\t\tupdateTotalOutgoingForEntity(e, outgoingUsd);\r\n\t\t\t}\r\n\r\n\t\t\tdateOutgoingUsdMap.put(ld, outgoingUsd);\r\n\t\t\tdateIncomingUsdMap.put(ld, incomingUsd);\r\n\t\t}\r\n\t}",
"public void updatePrice(){\n\t\tprice = 0;\n\t\tfor (ParseObject selectedItem : selectedItems){\n\t\t\tprice += selectedItem.getInt(\"price\");\n\t\t}\n\n\t\tTextView orderTotal = (TextView) findViewById(R.id.orderTotal);\n\t\torderTotal.setText(\"$\" + price + \".00\");\n\t}",
"public void updateconsumption(HealthSearch healthSearcher,int amount,String id, String time,double price) {\n\t\ttry {\n\t\t\tConnection connection = this.getConnection();\n\t\t\tPreparedStatement stmt = connection.prepareStatement(\"SELECT protein, energy, fiber,price FROM diet_conclusion where id = ? AND date = ?\");\n\t\t\tstmt.setString(1,id);\n\t\t\tstmt.setString(2,time.substring(0,8));\n\t\t\tResultSet rs = stmt.executeQuery();\n\t\t\tif(rs.next()) {\n\t\t\t\tdouble previous_energy =0;\n\t\t\t\tdouble previous_fiber =0;\n\t\t\t\tdouble previous_protein =0;\n\t\t\t\tdouble previous_price = 0;\n\t\t\t\tdouble current_protein = 0;\n\t\t\t\tdouble current_energy =0;\n\t\t\t\tdouble current_fiber = 0;\n\t\t\t\tdouble current_price = 0;\n\t\t\t\tprevious_protein = rs.getDouble(1);\n\t\t\t\tprevious_energy = rs.getDouble(2);\n\t\t\t\tprevious_fiber = rs.getDouble(3);\n\t\t\t\tprevious_price = rs.getDouble(4);\n\n\t\t\t\tcurrent_price = price + previous_price;\n\n\n\t\t\t\tif( !healthSearcher.getProtein().equals(\"0\")) {\n\t\t\t\t\t current_protein = previous_protein + Double.parseDouble(healthSearcher.getProtein())*amount/100.0;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tcurrent_protein = previous_protein;\n\n\t\t\t\t}\n\t\t\t\tif( !healthSearcher.getEnergy().equals(\"0\")) {\n\t\t\t\t\tcurrent_energy = previous_energy + Double.parseDouble(healthSearcher.getEnergy())*amount/100.0;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tcurrent_energy = previous_energy;\n\t\t\t\t}\n\t\t\t\tif( !healthSearcher.getFiber().equals(\"0\")) {\n\t\t\t\t\tcurrent_fiber = previous_fiber + Double.parseDouble(healthSearcher.getFiber())*amount/100.0;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tcurrent_fiber = previous_fiber;\n\t\t\t\t}\n\t\t\t\tPreparedStatement stmt2 = connection.prepareStatement(\n\t\t\t\t\"UPDATE diet_conclusion SET protein = ?, energy = ?, fiber = ?, price=? WHERE id = ? AND date = ?;\");\n\n\t\t\t\tstmt2.setDouble(1, current_protein);\n\t\t\t\tstmt2.setDouble(2, current_energy);\n\t\t\t\tstmt2.setDouble(3, current_fiber);\n\t\t\t\tstmt2.setDouble(4, current_price);\n\t\t\t\tstmt2.setString(5, id);\n\t\t\t\tstmt2.setString(6, time.substring(0,8));\n\t\t\t\tstmt2.execute();\n\t\t\t\tstmt2.close();\n\t\t\t}\n\t\t\telse {\n\t\t\t\tPreparedStatement stmt1 = connection.prepareStatement(\n\t\t\t\t\t\t\"INSERT INTO diet_conclusion VALUES(?,?,?,?,?,?)\");\n\t\t\t\tstmt1.setString(1,id);\n\t\t\t\tstmt1.setString(2, time.substring(0,8));\n\t\t\t\tstmt1.setDouble(3, Double.parseDouble(healthSearcher.getProtein())*amount/100.0);\n\t\t\t\tstmt1.setDouble(4, Double.parseDouble(healthSearcher.getEnergy())*amount/100.0);\n\t\t\t\tstmt1.setDouble(5, Double.parseDouble(healthSearcher.getFiber())*amount/100.0);\n\t\t\t\tstmt1.setDouble(6, price);\n\t\t\t\tstmt1.execute();\n\t\t\t\tstmt1.close();\n\t\t\t}\n\t\t\tstmt.close();\n\t\t\trs.close();\n\t\t\tconnection.close();\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(e);\n\t\t}\n\t}",
"public void UpdatePFStorePrices()\n {\n PlayFabClientModels.GetStoreItemsRequest req = new PlayFabClientModels.GetStoreItemsRequest();\n req.StoreId = cStoreId;\n\n PlayFabErrors.PlayFabResult<PlayFabClientModels.GetStoreItemsResult> result = PlayFabClientAPI.GetStoreItems(req);\n\n String errors = CompileErrorsFromResult(result);\n Log.d(TAG, \"GetStoreItems: \" + (errors == null? \"success\" : errors));\n\n if(result.Result != null)\n {\n for(PlayFabClientModels.StoreItem item : result.Result.Store)\n {\n Log.d(TAG, \"Store Item ID: \" + item.ItemId);\n\n if(item.VirtualCurrencyPrices.containsKey(cVC))\n {\n mStorePrices.put(item.ItemId, Objects.requireNonNull(item.VirtualCurrencyPrices.get(cVC)));\n }\n }\n }\n }",
"public double runPrice(int age) {\n\t\t// PriceCRUD for calculating price later\n\t\tPriceCRUD<CinemaClassPrice> cinemaClassCRUD = new PriceCRUD<>(CinemaClassPrice.class);\n\t\tPriceCRUD<MovieTypePrice> movieTypeCRUD = new PriceCRUD<>(MovieTypePrice.class);\n\t\tPriceCRUD<DayPrice> dayCRUD = new PriceCRUD<>(DayPrice.class);\n\t\tPriceCRUD<AgePrice> ageCRUD = new PriceCRUD<>(AgePrice.class);\n\t\t\n\t\t// Get cinema class price\n\t\tCinemaCRUD<Cinema> cinemaCRUD = new CinemaCRUD<Cinema>(Cinema.class, Showtimes.getCineplexId());\n\t\tCinemaClass cinemaClass = cinemaCRUD.getCinemaType(this.showtimes.getCinemaId());\n\t\tCinemaClassPrice cinemaClassPrice = cinemaClassCRUD.getElementPrice(cinemaClass);\n\t\t\n\t\t// Get movie type price\n\t\tMovieCRUD<Movie> movieCRUD = new MovieCRUD<>(Movie.class);\n\t\tMovieType movieType = movieCRUD.getMovieById(this.showtimes.getMovieId()).getType();\n\t\tMovieTypePrice movieTypePrice = movieTypeCRUD.getElementPrice(movieType);\n\t\t\n\t\t// Get Day type price\n\t\tDayType dayType = DateTimeHelper.getDayType(this.showtimes.getDate());\n\t\tDayPrice dayTypePrice = dayCRUD.getElementPrice(dayType);\n\t\t\n\t\t// Get Age Range Price\n\t\tAgePrice agePrice = ageCRUD.getElementPrice(age);\n\t\t\n\t\t// Print receipt for 1 ticket\n\t\tSystem.out.println(cinemaClassPrice.toString());\n\t\tSystem.out.println(movieTypePrice.toString());\n\t\tSystem.out.println(dayTypePrice.toString());\n\t\tSystem.out.println(agePrice.toString());\n\t\tdouble ticketPrice = cinemaClassPrice.getPrice()+movieTypePrice.getPrice()+dayTypePrice.getPrice()+agePrice.getPrice();\n\t\tSystem.out.println(\"Ticket price: \"+ticketPrice);\n\t\t\n\t\treturn ticketPrice;\n\t}",
"public void setPriceList (BigDecimal PriceList);",
"private void update() {\n\n\t\tfloat shopping = Float.parseFloat(label_2.getText());\n\t\tfloat giveing = Float.parseFloat(label_5.getText());\n\t\tfloat companyDemand = Float.parseFloat(label_7.getText());\n\n\t\ttry {\n\t\t\tPreparedStatement statement = DBConnection.connection\n\t\t\t\t\t.prepareStatement(\"update customer_list set Shopping_Account = \"\n\t\t\t\t\t\t\t+ shopping\n\t\t\t\t\t\t\t+ \" , Giving_Money_Account = \"\n\t\t\t\t\t\t\t+ giveing\n\t\t\t\t\t\t\t+ \", Company_demand = \"\n\t\t\t\t\t\t\t+ companyDemand\n\t\t\t\t\t\t\t+ \" where Name = '\"\n\t\t\t\t\t\t\t+ name\n\t\t\t\t\t\t\t+ \"' And Last_Name = '\"\n\t\t\t\t\t\t\t+ lastName + \"' \");\n\t\t\tstatement.execute();\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\n\t\t}\n\n\t}",
"public void doChangeTicketPrices();",
"double calculateNewPrice(double discount_rate, double price);",
"public void setPrice(double price){this.price=price;}",
"double purchasePrice();",
"void calculate() {\n if (price <= 1000)\n price = price - (price * 2 / 100);\n else if (price > 1000 && price <= 3000)\n price = price - (price * 10 / 100);\n else\n price = price - (price * 15 / 100);\n }",
"public void setPrice(Money price) {\n this.price = price;\n }",
"public void setPrice(Double price);",
"@Override\n\tpublic void doUpdate(SellOfer model, HttpServletRequest request,\n\t\t\tHttpServletResponse response) {\n\t\t if(StringUtil.isEmpty(model.getPrice())){\n\t\t\t\t model.setPrice(\"0\");\n\t\t\t }\n\t\t\t double dprice =Double.parseDouble(model.getPrice());\n\t\t BigDecimal bg = new BigDecimal(dprice/10000);\n\t\t double f1 = bg.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();\n\t\t model.setPrice(f1+\"\");\n\t\t model.setSource(\"001\");\n\t\t model.setSellContent(\"\");\n\t\tsuper.doUpdate(model, request, response);\n\t}",
"public void update() \n\t{\n\t\tString inst = \"\";\n\t\tfloat cash = getCash();\n\t\tfloat quantity = getPosition(inst);\n\t\tfloat price = getPrice(inst);\n\n\t\t_data.add(new Float(price));\n\t\t\n\t\tif (_data.size() > _period)\n\t\t{\n\t\t\t_data.remove(0);\n\t\t\n\t\t\tfloat min = Float.MAX_VALUE;\n\t\t\tfloat max = Float.MIN_VALUE;\n\t\t\t\n\t\t\tfor (int i = 0; i < _data.size(); i++)\n\t\t\t{\n\t\t\t\tFloat value = (Float)_data.get(i);\n\t\t\t\t\n\t\t\t\tif (value.floatValue() > max)\n\t\t\t\t{\n\t\t\t\t\tmax = value.floatValue();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (value.floatValue() < min)\n\t\t\t\t{\n\t\t\t\t\tmin = value.floatValue();\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tfloat buylevel = min + (min * _minwin);\n\t\t\tfloat sellevel = max - (max * _maxloss);\n\t\t\tfloat sellevel2 = min + (min * _maxwin);\n\t\t\t\n\t\t\t// if price has risen by min win\n\t\t\t// but is below maximum win and\n\t\t\t// below maximum loss then buy\n\t\t\tif (price > buylevel && \n\t\t\t\t\tprice < sellevel2 &&\n\t\t\t\t\tbuylevel < sellevel &&\n\t\t\t\t\tprice > _previous)\n\t\t\t{\n\t\t\t\tif (cash > 0) \n\t\t\t\t{\n\t\t\t\t\taddAmountOrder(inst, cash);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (price < sellevel &&\n\t\t\t\t\tbuylevel > sellevel &&\n\t\t\t\t\tprice < _previous)\n\t\t\t{\n\t\t\t\tif (quantity > 0)\n\t\t\t\t{\n\t\t\t\t\taddQuantityOrder(inst, -quantity);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (price > sellevel2 &&\n\t\t\t\t\tprice > _previous)\n\t\t\t{\n\t\t\t\tif (quantity > 0)\n\t\t\t\t{\n\t\t\t\t\taddQuantityOrder(inst, -quantity);\n\t\t\t\t}\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t_data.remove(0);\n\t\t}\n\t\t\n\t\t_previous = price;\n\t}",
"public BigDecimal getPriceListEntered();",
"public void priceUpdate(String security, double price) {\n logger.debug(\"There is a price update for stock: \" + security + \" :: updated price: \" + price);\n stockMap.get(security).setPricePerUnit(price);\n for (Map.Entry<String, PersonalStock> entrySet : personalStockMap.entrySet()) {\n entrySet.getValue().priceUpdate(security, price);\n }\n }",
"public void stockPurchase(String stockCode, String stockAmount){\r\n\t\tcost = 0;\r\n\t\t\r\n\t\tSystem.out.println(stockAmount);\r\n\t\tSystem.out.println(stockCode);\r\n\t\tSystem.out.println(words[0]);\r\n\t\t\r\n\t\ttry {\r\n\t\t\tConnection con = DriverManager.getConnection(dbUrl, name, pw);\r\n\t\t\tStatement state = con.createStatement();\r\n\t\t\tprepSt = con.prepareStatement(\"INSERT INTO portfolio (stocktick, stock, ask, bid, amount, cost)\"\r\n\t\t\t\t\t+ \" VALUES (?, ?, ?, ?, ?, ?)\");\r\n\t\t\tprepSt.setString(1, stockCode);\r\n\t\t\tprepSt.setString(2, words[0]);\r\n\t\t\tprepSt.setDouble(3, Double.parseDouble(words[1]));\r\n\t\t\tprepSt.setDouble(4, Double.parseDouble(words[2]));\r\n\t\t\tprepSt.setInt(5, Integer.parseInt(stockAmount));\r\n\t\t\tprepSt.setDouble(6, amountInt);\r\n\t\t\t\r\n\t\t\tprepSt.executeUpdate();\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"Insert Complete\");\r\n\t\t\tcurrent = current - amountInt;\r\n\t\t\t\r\n\t\t\tprepSt = con.prepareStatement(\"UPDATE funds SET current = ?\");\r\n\t\t\tprepSt.setDouble(1, current);\r\n\t\t\t\r\n\t\t\tprepSt.executeUpdate();\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"Update Complete\");\r\n\t\t\t\r\n\t\t\tResultSet res = state.executeQuery(\"SELECT * FROM portfolio\");\r\n\t\t\t\r\n\t\t\twhile(res.next()){\r\n\t\t\t\tcost = cost + res.getDouble(\"cost\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tfunds.setText(\"Funds Available: $\" + NumberFormat.getNumberInstance().format(current) + \" Invested: $\" + NumberFormat.getNumberInstance().format(cost));\r\n\t\t\t\r\n\t \tprepSt.close();\r\n\t \tcon.close();\r\n\t\t}\r\n\t\t\r\n\t\tcatch (SQLException e) {\r\n\t\t\t\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t \tsearchPanel.remove(bpAction);\r\n\t \tsearchPanel.remove(seAction);\r\n\t}",
"private void convert()\n {\n if (choiceBox.getValue().equals(\"US-Dollar\"))\n {\n try\n {\n double euro = DEC2FORMAT.parse(txtEuro.getText()).doubleValue();\n double dollar = currencyConverter.euroToDollar(euro);\n txtYen.setText(DEC2FORMAT.format(dollar));\n }\n catch (ParseException e)\n {\n System.out.println(e.getMessage());\n }\n }\n else\n {\n try\n {\n double euro = DEC2FORMAT.parse(txtEuro.getText()).doubleValue();\n double yen = currencyConverter.euroToYen(euro);\n txtYen.setText(DEC2FORMAT.format(yen));\n }\n catch (ParseException e)\n {\n System.out.println(e.getMessage());\n }\n }\n }",
"public void calculate(View v) {\n EditText inputBill = findViewById(R.id.inputBill);\n EditText inputTipPercent = findViewById(R.id.inputTipPercent);\n String num1Str = inputBill.getText().toString();\n String num2Str = inputTipPercent.getText().toString();\n\n // multiply Bill by Tip to get Tip in dollars\n double num1 = Double.parseDouble(num1Str);\n double num2 = Double.parseDouble(num2Str);\n double tipInDollar = num1 * (num2 / 100);\n double total = num1 + tipInDollar;\n\n // show tip in dollars\n TextView lblTipAmount = findViewById(R.id.lblTipAmount);\n lblTipAmount.setText(String.valueOf(tipInDollar));\n\n // show total price with tip included\n TextView lblTotalAmount = findViewById(R.id.lblTotalAmount);\n lblTotalAmount.setText(String.valueOf(total));\n }",
"double applyTax(double price);",
"float calculatePrice () \n\t{\n\t\tfloat final_price = 0;\n\t\tfinal_price = (float)(price * quantity); // price * number of items\n\t\tfinal_price += final_price*(.10); // add tax\n\t\tif(perishable.equals(\"P\"))\n\t\t{\n\t\t\tfloat ship = (float)(20* weight)*quantity; // add shipping\n\t\t\tship += ship*.20;\n\t\t\tfinal_price += ship;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfinal_price += (20* weight)*quantity; // add shipping\n\t\t}\n\t\treturn final_price;\n\t}",
"public static void main(String[] args){\n UnitPriceConverter item;//create new object item\n item = new UnitPriceConverter();//initialize all values to 0\n Scanner input;// declare new scanner input\n int choice = 1;// declare and initilize variables for user to continue entering new data, price of an item, weight in pounds\n double price = 0;\n double weight = 0;\n \n while(choice == 1){//loop that continues if user wants to enter in new values for price or weight\n input = new Scanner(System.in); //initialize input scanner\n System.out.println(\"Enter a new price: \");//ask user for price\n price = input.nextDouble();//take input from user and assign to variable price\n item.setPriceOfItem(price);//change item object value for price\n System.out.println(item.toString());// display changes to object\n System.out.println(\"Enter a new weight in pounds: \");//ask user to enter in weight\n weight = input.nextDouble();//take input from user and assign to variable weight\n item.setWeightInPounds(weight);//change item object value for weight\n System.out.println(item.toString());//display changes to object\n System.out.println(\"Would you like to reset the price and/or the weight in pounds?(Enter 1 for yes, 0 for no): \");//ask user would he like to make more changes\n choice = input.nextInt();//get user choice\n }\n System.out.println(item.toString());//display final values for object\n System.out.println(\"Goodbye\");//goodbye message\n }",
"public BigDecimal getPriceEntered();",
"CarPaymentMethod processHotDollars();",
"private void setDiscountedPrice() {\n seekbarNewprice.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {\n @Override\n public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {\n tvDiscountPerc.setText(progress * 5 + \"%\");\n try {\n double originalPrice = Double.parseDouble(etOriginalPrice.getText().toString());\n double sp = (progress * 5 * originalPrice) / 100;\n\n tvNewPrice.setText(String.format(Locale.US, \"%.2f\", originalPrice - sp));\n } catch (NumberFormatException ne) {\n ne.printStackTrace();\n }\n }\n\n @Override\n public void onStartTrackingTouch(SeekBar seekBar) {\n\n }\n\n @Override\n public void onStopTrackingTouch(SeekBar seekBar) {\n\n }\n });\n }",
"public void setPotatoesPrice(double p);",
"public void calculatePrice(int job_ID){\n double total_price = 0.0;\n double total_discount = 0.0;\n try {\n Stm = conn.prepareStatement(\"SELECT * FROM Job WHERE Job_ID = ?;\");\n Stm.setInt(1, job_ID);\n ResultSet rs = Stm.executeQuery();\n while (rs.next()){\n Stm = conn.prepareStatement(\"SELECT * FROM Customer WHERE Account_no = ?;\");\n Stm.setInt(1, rs.getInt(14));\n ResultSet rs1 = Stm.executeQuery();\n while (rs1.next()){\n if (rs1.getString(2).equals(\"Valued\")){\n if(rs1.getString(6).equals(\"Variable\")){\n total_discount = Double.parseDouble(decimalFormat.format(variableDiscount.getTotal_Discount(job_ID, rs1.getInt(1))));\n }\n else if (rs1.getString(6).equals(\"Flexible\")){\n total_discount = Double.parseDouble(decimalFormat.format(flexibleDiscount.getTotalDiscount(job_ID, rs1.getInt(1))));\n }\n else{\n total_discount = Double.parseDouble(decimalFormat.format(fixedDiscount.getTotalDiscount(job_ID, rs1.getInt(1))));\n }\n }\n else {\n total_discount = 0.0;\n }\n }\n rs1.close();\n total_price = Double.parseDouble(decimalFormat.format(rs.getDouble(8) - total_discount));\n }\n rs.close();\n Stm.close();\n updateJobPrice(job_ID, total_price, total_discount);\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }",
"public static void main(String[] args) {\n\n\t\tScanner keyboard = new Scanner(System.in);\n\n\t\tSystem.out.println(\"Enter cutoff price for discount>>>\");\n\t\tprice = keyboard.nextDouble();\n\t\tSystem.out.print(\" Enter discount rate as a whole number>>>\");\n\t\tdiscount = keyboard.nextDouble();\n\t\tsavings = computeDiscountInfo(price, discount);\n\n\t\tSystem.out.println(\" Special this week on any service over \" + price);\n\t\tdisplayInfo();\n\t\tcomputeDiscountInfo(34, 34);\n\t}",
"void edit(Price Price);",
"public void setPriceStdEntered (BigDecimal PriceStdEntered);",
"public static void main (String[] args) {\n\t\t\n\t\t\n\t\tScanner inp = new Scanner(System.in);\n\t\tSystem.out.println(\"Is there a sale? True or False\");\n\t\tboolean sale = inp.nextBoolean();\n\t\t\n\t\t\n\t double discount;\n\t\tdouble finalPrice;\n\t\tdouble price;\n\t\t\n\t\tif (!sale) {\n\t\t\tSystem.out.println(\"I am not shopping\");\n\t\t}else {\n\t\t\tSystem.out.println(\"What is the actual price?\");\n\t\t\tprice = inp.nextDouble();\n\t\t\t\n\t\tif (price<20) {\n\t\t\tdiscount = price *0.10;\n\t\t\t//finalPrice = price - discount;\n\t\t} else if (price>=20 && price<=100) {\n\t\t\tdiscount = price *0.20;\n\t\t\t//finalPrice = price - discount;\n\t\t} else if (price>=100 && price<=500) {\n\t\t\tdiscount = price *0.30;\n\t\t\t//finalPrice = price - discount;\n\t\t} else {\n\t\t\tdiscount = price *0.50;\n\t\t\t\n\t\t\t\n\t\t}\n\t\t finalPrice = price - discount;\n\t\t\t\nSystem.out.println(\"After discount \"+discount+\" the price of the item reduce from \"+price+\" to \"+finalPrice);\n\t\t\t\n\t\t}\n\t\t\n\t}",
"public void setPrice(double price)\n {\n this.price = price;\n }",
"@Override\n\tpublic void doSave(SellOfer model, HttpServletRequest request,\n\t\t\tHttpServletResponse response) {\n\t\t if(StringUtil.isEmpty(model.getPrice())){\n\t\t\t model.setPrice(\"0\");\n\t\t }\n\t\t double dprice =Double.parseDouble(model.getPrice());\n\t BigDecimal bg = new BigDecimal(dprice/10000);\n\t double f1 = bg.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();\n\t model.setPrice(f1+\"\");\n\t model.setSource(\"001\");\n\t\t\n\t\tsuper.doSave(model, request, response);\n\t}",
"@Override\n\tpublic double GetValue() {\n\t\tdouble spot = inputs.getSpot();\n\t\tdouble strike = inputs.getStrike();\n\t\tdouble vol = inputs.getVol();\n\t\tint noSteps=inputs.getNoSteps();\n\t\tdouble expiry=inputs.getExpiry();\n\t OptionType type=inputs.getType();\n\t ExerciseType exercise=inputs.getExercise();\n\t InterestRate interestRate=inputs.getR();\n\t\t\n\t double timestep = expiry/noSteps;\n\t double DF = Math.exp(-interestRate.GetRate(1.)*timestep);\n\t double temp1 = Math.exp((interestRate.GetRate(1.) + vol * vol)*timestep);\n\t double temp2 = 0.5 * (DF + temp1);\n\t double up = temp2 + Math.sqrt(temp2*temp2 - 1);\n\t double down = 1/ up;\n\t double probaUp = (Math.exp(interestRate.GetRate(1.) * timestep) - down)/(up -down) ;\n\t double probaDown = 1 - probaUp;\n\n\t //stock price tree\n\t\tstockPrice[0][0]=spot;\n\t for (int n = 1; n <= noSteps; n ++) {\n for (int j = n; j > 0; j--){\n \tstockPrice[j][n] = up * stockPrice[j-1][n-1];\n }\n \t\tstockPrice[0][n] = down * stockPrice[0][n-1];\n }\n\t \n\t //last column set payoffs\n\t\tfor (int j = 0; j <= noSteps; j++) {\n\t\t\t\tif(type.equals(OptionType.CALL)) {\n\t\t\t\t\tpayOff[j][noSteps] = Math.max(this.stockPrice[j][noSteps] - strike, .0);\n\t\t\t\t}else {\n\t\t\t\t\tpayOff[j][noSteps] = Math.max(strike - this.stockPrice[j][noSteps], .0);\n\t\t\t\t}\n\t\t}\n\n\t\t\n\t //payoff tree in backwardation\n\t \n\t for (int i = noSteps ; i >= 1; i--) {\n for (int j = 0; j <= i-1; j++) {\n\t \tif(exercise.equals(ExerciseType.AMERICAN)) { \n\t //American\t\n\t \t\tif(type.equals(OptionType.CALL)) {\n\t \t\t\t\tpayOff[j][i-1] = Math.max(DF * (probaUp * payOff[j+1][i] + probaDown * payOff[j][i]) ,\n\t \t\t\t\tMath.max(this.stockPrice[j][i-1] - strike, .0));\n\t \t\t\t\n\t \t\t}else \tpayOff[j][i-1] = Math.max(DF * (probaUp * payOff[j+1][i] + probaDown * payOff[j][i]) ,\n\t \t\t\t\tMath.max(strike - this.stockPrice[j][i-1] , .0));\n\t \t}else { \n\t \t\t\t//European put and call option\n\t \t\t\t\tpayOff[j][i-1] = DF * (probaUp * payOff[j+1][i] + probaDown * payOff[j][i]);\n\t }\n }\n }\n\t \n\t double deltaUp = (payOff[0][2]-payOff[1][2])/(stockPrice[0][2]-stockPrice[1][2]);\n\t double deltaDown = (payOff[1][2]-payOff[2][2])/(stockPrice[1][2]-stockPrice[2][2]);\n\t delta = (deltaUp + deltaDown) /2;\n\t gamma = (deltaUp-deltaDown)/((stockPrice[0][2]-stockPrice[2][2])/2);\n\t theta = (payOff[1][2]-payOff[0][0])/(365*2*timestep);//time in days\n\t \n\t long rounded = Math.round(payOff[0][0]*10000);\n\t return rounded/10000.0;\n\t}",
"public double applyDiscount(){\n SaleDTO saleDTO = sale.createSaleDTO();\n List<DiscountDTO> itemDiscounts=dc.findDiscounts(saleDTO,new ItemDiscount());\n List<DiscountDTO> saleDiscounts=dc.findDiscounts(saleDTO,new SaleDiscount());\n \n sale.applyItemDiscounts(itemDiscounts);\n sale.applyDiscounts(saleDiscounts);\n return sale.getTotalPrice();\n }",
"public void setPrice(double price)\n {\n this.price = price;\n }",
"private void processor(PriceEvent e) {\n store.append(Price.fromEvent(e));\n }",
"public void updateMoney()\n\t\t{\n\t\t\t\n\t\t\tFPlayer p1 = this.viewer;\n\t\t\tFPlayer p2 = (p1.equals(this.t.p1)) ? this.t.p2 : this.t.p1;\n\t\t\t\n\t\t\tItemStack om = new ItemStack(Material.GREEN_WOOL,1);\n\t\t\tItemMeta it = om.getItemMeta();\n\t\t\tit.setDisplayName(ChatColor.DARK_GREEN+ChatColor.BOLD.toString()+\"Money in trade:\");\n\t\t\tit.setLore(Arrays.asList(new String[] {\"\",Util.getMoney(this.t.getMoneyTraded(p1)),\"\",\"Click to add/remove money from trade\"}));\n\t\t\tom.setItemMeta(it);\n\t\t\t\n\t\t\tif (this.canAdd()) super.contents.put(0,new ItemSwapMenu(this,om,new MenuMoney(super.viewer,this.t)));\n\t\t\telse super.contents.put(0,new ItemDummy(this,om));\n\t\t\t\n\t\t\t// Trader money in trade\n\t\t\tItemStack tm = new ItemStack(Material.GREEN_WOOL,1);\n\t\t\tit = tm.getItemMeta();\n\t\t\tit.setDisplayName(ChatColor.DARK_GREEN+ChatColor.BOLD.toString()+\"Money in trade:\");\n\t\t\tit.setLore(Arrays.asList(new String[] {\"\",Util.getMoney(this.t.getMoneyTraded(p2))}));\n\t\t\ttm.setItemMeta(it);\n\t\t\tsuper.contents.put(8,new ItemDummy(this,tm));\n\t\t\tthis.composeInv();\n\t\t}",
"public void amount() {\n \t\tfloat boxOHamt=boxOH*.65f*48f;\n \t\tSystem.out.printf(boxOH+\" boxes of Oh Henry ($0.65 x 48)= $%4.2f \\n\",boxOHamt);\n \t\tfloat boxCCamt=boxCC*.80f*48f;\n \t\tSystem.out.printf(boxCC+\" boxes of Coffee Crisp ($0.80 x 48)= $%4.2f \\n\", boxCCamt);\n \t\tfloat boxAEamt=boxAE*.60f*48f;\n \t\tSystem.out.printf(boxAE+\" boxes of Aero ($0.60 x 48)= $%4.2f \\n\", boxAEamt);\n \t\tfloat boxSMamt=boxSM*.70f*48f;\n \t\tSystem.out.printf(boxSM+\" boxes of Smarties ($0.70 x 48)= $%4.2f \\n\", boxSMamt);\n \t\tfloat boxCRamt=boxCR*.75f*48f;\n \t\tSystem.out.printf(boxCR+\" boxes of Crunchies ($0.75 x 48)= $%4.2f \\n\",boxCRamt);\n \t\tSystem.out.println(\"----------------------------------------------\");\n \t\t//display the total prices\n \t\tsubtotal=boxOHamt+boxCCamt+boxAEamt+boxSMamt+boxCRamt;\n \t\tSystem.out.printf(\"Sub Total = $%4.2f \\n\", subtotal);\n \t\ttax=subtotal*.07f;\n \t\tSystem.out.printf(\"Tax = $%4.2f \\n\", tax);\n \t\tSystem.out.println(\"==============================================\");\n \t\ttotal=subtotal+tax;\n \t\tSystem.out.printf(\"Amount Due = $%4.2f \\n\", total);\n \t}",
"double checkout() {\n\t\tdouble total = 0;\n\t\tfor (Fruit item : fruitList){\n\t\t\ttotal += item.getPrice();\t\n\t\t}\t\n\t\t\n\t\t// Apply offers and calculate total\n\t\tdouble discountGetOneFree = Offer.getOfferBuyOneGetOneFree(getFruitNameList(), new Apple() );\n\t\tdiscountGetOneFree += Offer.getOfferBuyOneGetOneFree(getFruitNameList(), new Banana() );\n\t\tdouble discountThreeForTwo = Offer.getOfferThreeForTwo(getFruitNameList(), new Orange() );\n\t\tdiscountThreeForTwo += Offer.getOfferThreeForTwo(getFruitNameList(), new Melon() );\t\t\n\t\tdouble discountCheapestForFree = Offer.cheapestFruitForFree(getFruitList());\n\t\ttotal += - discountGetOneFree - discountThreeForTwo - discountCheapestForFree;\n\t\t\n\t\tDecimalFormat df = new DecimalFormat(\"#,##0.00\");\n\t\t// Print out the total cost and saving\n\t\tSystem.out.println(String.format(\"£ %s Total cost\", df.format(total)));\n\t\tif (discountGetOneFree > 0)\n\t\t\tSystem.out.println(String.format(\"£ %s Promotional Saving *** Buy One Get One Free ***\", df.format(discountGetOneFree)));\n\t\tif (discountThreeForTwo > 0)\n\t\t\tSystem.out.println(String.format(\"£ %s Promotional Saving *** 3 for the price of 2 ***\", df.format(discountThreeForTwo)));\n\t\tif (discountCheapestForFree > 0)\n\t\t\tSystem.out.println(String.format(\"£ %s Promotional Saving *** Cheapest for free ***\", df.format(discountCheapestForFree)));\n\t\t\t\t\t\n\t\treturn total;\t\t\n\t}",
"private void calculatePrice() {\r\n int price = 0;\r\n int day = show.getDateTime().getDayOfMonth();\r\n int month = show.getDateTime().getMonthValue();\r\n \r\n for (int i = 0; i < seats.size(); i++) {\r\n String option = seats.get(i);\r\n \r\n if (Arrays.stream(sectionNames).parallel().anyMatch(option::contains)) {\r\n String section = option.replaceAll(\"\\\\d\",\"\");\r\n int number = Integer.parseInt(option.replaceAll(\"\\\\D+\",\"\"));\r\n \r\n if (section.equals(\"m\")) {\r\n if (number <= 100) {\r\n price += mainFloorPrice;\r\n } else {\r\n price += mainFloorPremium;\r\n }\r\n } else if (section.equals(\"sb\")) {\r\n if (number <= 25) {\r\n price += southBalconyPrice;\r\n } else {\r\n price += southBalconyPremium;\r\n }\r\n } else if (section.equals(\"wb\")) {\r\n price += westBalconyPrice;\r\n } else if (section.equals(\"eb\")) {\r\n price += eastBalconyPrice;\r\n }\r\n }\r\n }\r\n \r\n if (seats.size() >= 5 && seats.size() <= 10 && !(month == 12 && (day == 26 || day == 27))) {\r\n price -= (2 * seats.size());\r\n }\r\n \r\n if (seats.size() >= 11 && seats.size() <= 20 && !(month == 12 && (day == 26 || day == 27))) {\r\n price -= (5 * seats.size());\r\n }\r\n \r\n if (month == 12 && (day == 26 || day == 27)) {\r\n price = seats.size() * 20;\r\n }\r\n \r\n totalPrice = price;\r\n }",
"public void stockSold(String stockCode){\t\r\n\t\taskInt = Double.parseDouble(words[2]);\r\n\t\tcost = 0;\r\n\t\t\r\n\t\ttry {\r\n\t\t\t\r\n\t\t\tConnection con = DriverManager.getConnection(dbUrl, name, pw);\r\n\t\t\tStatement state = con.createStatement();\r\n\t\t\tResultSet res = state.executeQuery(\"SELECT * FROM portfolio\");\r\n\t\t\twhile(res.next()){\r\n\t\t\t\tif(res.getString(\"stocktick\").equals(stockCode)){\r\n\t\t\t\t\tint saleAmount = res.getInt(\"amount\");\r\n\t\t\t\t\tamountInt = saleAmount;\r\n\t\t\t\t\tamountInt = amountInt * askInt;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tprepSt = con.prepareStatement(\"DELETE FROM portfolio WHERE stocktick = ?\");\r\n\t\t\tprepSt.setString(1, stockCode);\r\n\t\t\t\r\n\t\t\tprepSt.executeUpdate();\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"Deletion Complete\");\r\n\t\t\tcurrent = current + amountInt;\r\n\t\t\t\r\n\t\t\tprepSt = con.prepareStatement(\"UPDATE funds SET current = ?\");\r\n\t\t\tprepSt.setDouble(1, current);\r\n\t\t\t\r\n\t\t\tprepSt.executeUpdate();\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"Update Complete\");\r\n\t\t\t\r\n\t\t\tres = state.executeQuery(\"SELECT * FROM portfolio\");\r\n\t\t\t\r\n\t\t\twhile(res.next()){\r\n\t\t\t\tcost = cost + res.getDouble(\"cost\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tfunds.setText(\"Funds Available: $\" + NumberFormat.getNumberInstance().format(current) + \" Invested: $\" + NumberFormat.getNumberInstance().format(cost));\r\n\t\t\t\r\n\t\t\tprepSt.close();\r\n\t\t\tstate.close();\r\n\t \tcon.close();\r\n\t\t} \r\n\t\t\r\n\t\tcatch (SQLException e) {\r\n\t\t\t\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\r\n\t\tstatus.setText(\"Sale Complete. You have sold $\" + NumberFormat.getNumberInstance().format(amountInt) + \" worth of \" + stock.getText() + \" shares.\");\r\n\t \tsearchPanel.remove(bpAction);\r\n\t \tsearchPanel.remove(seAction);\r\n\t}",
"public static void main(String[] args) throws InterruptedException {\n Item item1 = new Item(\"Coca-cola\", 200);\n System.out.println(\"Price before discount: \" + item1.getPrice());\n System.out.println(\"Price after discount: \" + item1.calculateDiscount()); //should be same price, 200, there's no doscount for this type\n\n ItemWithDiscount item2 = new ItemWithDiscount(\"Coca-cola Zero\", 2.0);\n System.out.println(\"\\nPrice before discount: \" + item2.getPrice());\n item2.setDiscount(10);\n System.out.println(\"Price after discount: \" + item2.calculateDiscount()); // 2 - 0.2 = 1.8\n\n\n //CHECK BUY PAY DISCOUNT\n BuyMorePayLess item04 = new BuyMorePayLess(\"Milk\", 10);\n BuyMorePayLess item05 = new BuyMorePayLess(\"Milk\", 10);\n BuyMorePayLess item06 = new BuyMorePayLess(\"Milk\", 1);\n item04.setBuyPayOffer(3,2);\n item04.calculateDiscount();\n\n //Check TakeItAll discount\n ItemTakeItAll item07 = new ItemTakeItAll(\"Tuna\",5.00);\n ItemTakeItAll item08 = new ItemTakeItAll(\"Tuna\",5.00);\n\n// item07.setDiscount(10);\n item07.setMinimumNumber(1);\n System.out.println(\"##################\" + item07.calculateDiscount());\n\n // USERS\n LoyalCustomer customer01 = new LoyalCustomer(\"Giorgi Tsipuria\", \"giobaski\", \"123\",\n \"Gonsiori 33\",\"55945239\");\n\n //B A S K E T S\n Basket basket01 = new Basket(\"Tartu 46\", \"Kairi\", customer01);\n basket01.insertItem(item1); //200 -> 200\n basket01.insertItem(item2); // 2.0 -> 1.8\n System.out.println(\"Total payment in basket: \" + basket01.caclulatePayment()); //201.8 + 201.8 * 0.1 = 221.98\n\n\n\n\n\n //1. Create Store\n Store store = new Store(\"Raua 16\");\n\n //2. sign into store\n Cashier currentCashier = store.cashierAuthentication();\n\n //3.\n Menu currentMenu = store.openMenu();\n\n //4. new basket\n currentMenu.openNewBasket(customer01);\n\n\n //5.Cashier starts adding items into new basket\n System.out.println(currentMenu.getBasket());\n currentMenu.getBasket().insertItem(item1);\n currentMenu.getBasket().insertItem(item2);\n\n\n System.out.println(\"######Basket By ID:\");\n currentMenu.printBasketInfoById(2);\n System.out.println(\"########\");\n\n\n //6. Calculate total price for the current basket\n currentMenu.getBasket().caclulatePayment();\n System.out.println(currentMenu.getBasket());\n System.out.println(\"currents items: \");\n System.out.println(currentMenu.getBasket().getItems());\n\n //7. Logout cashier\n Thread.sleep(10000);\n currentMenu.exit();\n\n\n // Additional features\n System.out.println(\"points of the loyal customer: \" + customer01.getPoints());\n\n System.out.println(\"Bonus for cashier: \" + currentCashier.calculateBonus() + \" Euros\");\n\n\n\n\n\n\n }",
"void loadCurrentPrices() {\n for(SecurityRow row : allSecurities) {\n row.updateCurrentPrice();\n }\n fireTableRowsUpdated(0, allSecurities.size()-1);\n }",
"public void setInputPrice(BigDecimal inputPrice) {\r\n this.inputPrice = inputPrice;\r\n }",
"public void setPrice(float itemPrice) \n {\n price = itemPrice;\n }",
"public void updateStockData() {\n\t\t\ttry {\n\t\t\t\tthis.dataURL = new URL(this.url);\n\t\t\t} catch (final MalformedURLException e) {\n\t\t\t\tSystem.out\n\t\t\t\t\t\t.println(\"CRITICAL ERROR: The impossible has happened! The hard-hoded URL was malformed.\");\n\t\t\t\tSystem.exit(1);\n\t\t\t}\n\t\t\tScanner scanner;\n\t\t\ttry {\n\t\t\t\tscanner = new Scanner(this.dataURL.openStream());\n\t\t\t\twhile (scanner.hasNextLine())\n\t\t\t\t\ttry {\n\t\t\t\t\t\tscanner\n\t\t\t\t\t\t\t\t.findInLine(Pattern\n\t\t\t\t\t\t\t\t\t\t.compile(\"([0-9.]*),\\\"([0-9a-zA-Z._-]*)\\\",\\\"([a-zA-Z._\\\\s-]*)\\\"\"));\n\t\t\t\t\t\tfinal MatchResult result = scanner.match();\n\t\t\t\t\t\tboolean found = false;\n\t\t\t\t\t\tfor (final StockCompany company : StockBrokerImpl.this.stockData)\n\t\t\t\t\t\t\tif (company.getCompanySymbol().equals(\n\t\t\t\t\t\t\t\t\tresult.group(2))) {\n\t\t\t\t\t\t\t\tfinal Double stockPrice = Double\n\t\t\t\t\t\t\t\t\t\t.parseDouble(result.group(1));\n\t\t\t\t\t\t\t\tcompany.setStockPrice(stockPrice);\n\t\t\t\t\t\t\t\tfound = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!found)\n\t\t\t\t\t\t\tStockBrokerImpl.this.stockData\n\t\t\t\t\t\t\t\t\t.add(new StockCompany(result.group(3),\n\t\t\t\t\t\t\t\t\t\t\tresult.group(2), Double\n\t\t\t\t\t\t\t\t\t\t\t\t\t.parseDouble(result\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.group(1))));\n\n\t\t\t\t\t\tscanner.nextLine();\n\n\t\t\t\t\t} catch (final NumberFormatException e) {\n\t\t\t\t\t\tSystem.out\n\t\t\t\t\t\t\t\t.println(\"CRITICAL ERROR: Update data corrupted. [Virtually impossible]\");\n\t\t\t\t\t\tSystem.exit(1);\n\t\t\t\t\t}\n\t\t\t\tscanner.close();\n\t\t\t} catch (final IOException e) {\n\t\t\t\tSystem.out\n\t\t\t\t\t\t.println(\"ERROR: Connection to stock price update feed could not be established.\");\n\t\t\t}\n\t\t}",
"public void setPrice(double price) {\n this.price = price;\n }",
"public void setPrice(double price) {\n this.price = price;\n }",
"public void setPrice(double price) {\n this.price = price;\n }",
"public void setPrice(double price) {\n this.price = price;\n }",
"public void setPrice(double price) {\n this.price = price;\n }",
"public void setPrice(double price) {\n this.price = price;\n }",
"public void setPrice(double price) {\n this.price = price;\n }",
"public void setPrice(Double price) {\r\n this.price = price;\r\n }",
"@Override\n public double calculatePrice() {\n return getVolume() * (1.0 + (getAlcoholPercent() / 100.0)) * this.liquids.size();\n }",
"public void setPrice(double price) {\r\n this.price = price;\r\n }",
"public void setPrice(double price) {\r\n this.price = price;\r\n }",
"public void setPrice(double price) {\r\n this.price = price;\r\n }",
"public void discountPrices()\n {\n System.out.print( \"Enter amount of purchases: \" );\n int cost = scan.nextInt();\n int discount = cost - cost / 10;\n if ( cost > 1000 )\n {\n System.out.print( \"Discounted price: \" + discount );\n }\n else\n {\n System.out.print( \"Discounted price: \" + cost );\n }\n\n }",
"public static void updateSharePrice(){\r\n\t\r\n\tMap<String, ShareMarket> allShareDetails = ShareMarketHashMap.getShareMarket();\r\n\tdisplayMap(allShareDetails);\r\n\tShareMarket editUniqueShareQuantity = new ShareMarket();\r\n\tSystem.out.println('\\n'+\"Enter Share Name for updating price : \");\r\n\tString updateShareName = input.next();\r\n\tif(!allShareDetails.containsKey(updateShareName))\t{\r\n\t\tSystem.out.println(\"Share doesn't exist :( .You will be returned to main menu\" +'\\n');\r\n\t\treturn;\r\n\t}\r\n\tSystem.out.println(\"Enter Share Price : \");\r\n\tif(!input.hasNextInt()) {\r\n\t\tSystem.out.println(\"Price entered in invalid, it should be a postive integer.You will be returned to main menu\" + '\\n');\r\n\t\treturn;\r\n\t}\t\r\n\tint updateSharePrice = input.nextInt();\t\t\t\r\n\teditUniqueShareQuantity.setShareName(updateShareName);\r\n\teditUniqueShareQuantity.setSharePrice(updateSharePrice);\r\n\teditUniqueShareQuantity.setShareQuantity(allShareDetails.get(updateShareName).getShareQuantity());\r\n\tallShareDetails.put(editUniqueShareQuantity.getShareName(),editUniqueShareQuantity);\r\n\tShareMarketHashMap.editShare();\r\n\tMap<String, ShareMarket> allShareDetailsupdated = ShareMarketHashMap.getShareMarket();\r\n\tSystem.out.println(\"Share Name: \" + allShareDetailsupdated.get(updateShareName).getShareName() +',' + \" Share Price:\" + allShareDetailsupdated.get(updateShareName).getSharePrice() +',' + \" Share Quantity:\" + allShareDetailsupdated.get(updateShareName).getShareQuantity());\r\n\tSystem.out.println(\"Successfully updated price, please find above available shares\" +'\\n');\t\r\n}",
"@Override\n public double calculatePrice(String svcName, List<DimensionData> eventData) {\n Map<String, String> evDataMap = eventData.stream()\n .collect(Collectors.toMap(d -> d.getName(), d -> d.getValue()));\n \n //Now, Fetch the Service\n Service svc = getService(svcName);\n \n //Create an evaluator\n Monetize360Evaluator evaluator = getEvaluator(svc);\n \n //Evaluate all Dimensions, with the user provided data\n evaluateDimensions(svc, evDataMap, evaluator);\n \n //Now finally Calculate the price\n Number price = (Number) evaluator.evaluate(svc.getSvcFormula());\n \n log.info(\"Evaluated Price for svc {}\", price);\n \n return price.doubleValue();\n }",
"public void findByPrice() {\n boolean validate = true;\n price = 0;\n System.out.print(\"Enter price you want to find: \");\n while (validate) {\n price = Validation.validateDoubleNumber(price);\n validate = false;\n }\n tree.findByPrice(price);\n }",
"CleanPrice getCleanPrice();",
"public void setPrice(Double price) {\n this.price = price;\n }",
"public void setPrice(Double price) {\n this.price = price;\n }",
"double getPrice();",
"double getPrice();",
"double getPrice();",
"public void setPrice(Float price) {\r\n this.price = price;\r\n }",
"@Override\n\tpublic void execute() {\n\t\tsuper.execute();\n\t\ttry {\n\t\t\tprice = 0;\n\n\t\t\tCampaign c = Crosstalk.getInstance().getKnownCampaign(campaign);\n\t\t\tif (c == null) {\n\t\t\t\terror = true;\n\t\t\t\tmessage = \"No campaign defined: \" + campaign;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\tif (tokenData.isAuthorized(c.customer_id) == false) {\n\t\t\t\terror = true;\n\t\t\t\tmessage = \"No such campaign\";\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tCreative cr = c.getCreativeById(this.creative);\n\t\t\tif (cr == null) {\n\t\t\t\terror = true;\n\t\t\t\tmessage = \"No creative defined: \" + creative + \" in \" + campaign;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tprice = cr.price;\n\t\t\tif (cr.deals != null) {\n\t\t\t\tdeals = new ArrayList();\n\t\t\t\tfor (Deal d : cr.deals) {\n\t\t\t\t\tMap<String, Double> m = new HashMap();\n\t\t\t\t\tm.put(d.id, d.price);\n\t\t\t\t\tdeals.add(m);\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\terror = true;\n\t\t\tmessage = e.getMessage();\n\t\t\treturn;\n\t\t}\n\t}",
"public void setPrice(Float price) {\n this.price = price;\n }",
"@Override\n protected void onPostExecute(Void aVoid){\n super.onPostExecute(aVoid);\n this.dialog.dismiss();\n String url = this.item.getUrl();\n if(url.contains(HOME_DEPOT)){\n String[] values = this.textPrice.split(\" \");\n double dollars = Double.parseDouble(values[1]);\n double cents = Double.parseDouble(values[2])/100;\n this.currentPrice = dollars + cents;\n this.initTextPrice = this.initTextPrice.replace(\",\",(\"\"));\n this.initialPrice = Double.parseDouble(initTextPrice.substring(1));\n Toast.makeText(ctx,\"Done updating\",Toast.LENGTH_LONG).show();\n }\n else if (url.contains(AMAZON)){\n this.currentPrice = Double.parseDouble(this.textPrice.substring(1));//amazon\n Toast.makeText(ctx,\"Done updating\",Toast.LENGTH_LONG).show();\n }\n else if (url.contains(WALMART)){\n String[] values = this.textPrice.split(\" \");\n this.currentPrice = Double.parseDouble(values[0].substring(1));\n this.initialPrice = Double.parseDouble(values[2].substring(1));\n Toast.makeText(ctx,\"Done updating\",Toast.LENGTH_LONG).show();\n }\n else{\n Toast.makeText(ctx,\"Store Not supported\",Toast.LENGTH_LONG).show();\n this.currentPrice = 0.0;\n\n }\n\n\n if(this.initTextPrice == null){\n this.initialPrice = this.currentPrice;\n }\n\n\n\n item.setInitialPrice(this.initialPrice);\n item.setCurrentPrice(this.currentPrice);\n item.calculatePercentageChange();\n item.setChange();\n DatabaseItemManager d = new DatabaseItemManager(ctx);\n d.updateItem(item);\n adapter.notifyDataSetChanged();\n\n\n\n }",
"@Override \n\tpublic TradeAction tick(double price) {\n\t\tma10before=average(priceQ10);\n\t\t\n\t\tif (priceQ10.size()<10)\n\t\t{\n\t\t\tpriceQ10.offer(price);\n\t\t}\n\t\tif(priceQ10.size()==10)\n\t\t{\n\t\t\tpriceQ10.poll();\n\t\t\tpriceQ10.offer(price);\t\t\n\t\t}\n\t\t\n\t\t ma10after=average(priceQ10);\n\t\t \n\t\t// 60 days moving average\n\t\tma60before=average(priceQ60);\n\t\tif (priceQ60.size()<60)\n\t\t{\n\t\t\tpriceQ60.offer(price);\n\t\t}\n\t\tif(priceQ60.size()==60)\n\t\t{\n\t\t\tpriceQ60.poll();\n\t\t\tpriceQ60.offer(price);\t\t\n\t\t}\n\t\tma60after=average(priceQ60);\n\t\t\t\n\t\t//buy when its 10 day moving average goes above the 60 day moving average\n\t\tif((ma10before < ma60before) & (ma10after > ma60after))\n\t\t{\n\t\t\tprofit = profit - price;\n\t\t\t//System.out.println(\"buy\");\n\t\t\t//System.out.println(\"profit is\");\n\t\t\t//System.out.println(profit);\n\t\t\tif(mark==1){\n\t\t\t\tmark=-1;\n\t\t\t\treturn TradeAction.BUY;\n\t\t\t}\n\t\t\telse \n\t\t\t\treturn TradeAction.DO_NOTHING;\n\t\t\t\n\t\t}\n\t\t//buy when its 10 day moving average goes below the 60 day moving average\n\t\tif((ma10before > ma60before) & (ma10after < ma60after))\n\t\t{\n\t\t\tprofit = profit + price;\n\t\t\t//System.out.println(\"sell\");\n\t\t\t//System.out.println(\"profit is\");\n\t\t\t//System.out.println(profit);\n\t\t\tif(mark==-1){\n\t\t\t\tmark=1;\n\t\t\t\treturn TradeAction.SELL;\n\t\t\t}\n\t\t\telse \n\t\t\t\treturn TradeAction.DO_NOTHING;\n\t\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn TradeAction.DO_NOTHING;\t\t\t\n\t\t}\n\n\t}",
"private void storeTrip(Player p){\r\n\t\tSystem.out.println(\"Welcome to the store!\");\r\n\t\tSystem.out.println(\"Just a reminder, you have $\" + p.getMoney() + \" to spend!\");\r\n\t\tSystem.out.println(\"Please Select An Option: \");\r\n\t\tSystem.out.println(\"1. Buy Food\");\r\n\t\tSystem.out.println(\"2. Buy Toys\");\r\n\t\tSystem.out.println(\"3. Leave the store\");\r\n\t\tArrayList<Toy> storetoys = store.getToys();\r\n\t\tArrayList<Food> storefood = store.getFoods();\r\n\t\tint[] toyamounts = store.getToyamounts();\r\n\t\tint[] foodamounts = store.getFoodamounts();\r\n\t\tint buyoption; //The buying option\r\n\t\tint c; //Counter\r\n\r\n\t\tint selectedoption = getNumber(1, 3);\r\n\t\tswitch(selectedoption){\r\n\t\t//Buy food\r\n\t\tcase 1:\r\n\t\t\tc = 1;\r\n\t\t\tfor(Food f : storefood){\r\n\t\t\t\tSystem.out.println(c + \". \" + f.getName() + \"\\nPrice: $\" + f.getValue() + \" Stock: \" + foodamounts[c-1]);\r\n\t\t\t\tSystem.out.println(\"\");\r\n\t\t\t\tc++;\r\n\t\t\t}\r\n\t\t\tbuyoption = getNumber(1, storefood.size());\r\n\t\t\tFood selectedfood = storefood.get(buyoption -1);\r\n\t\t\tif(p.getMoney() > selectedfood.getValue() && foodamounts[buyoption-1] > 0){\r\n\t\t\t\tp.setMoney(p.getMoney() - selectedfood.getValue());\r\n\t\t\t\tfoodamounts[buyoption -1]--; //Take one away, as it has been sold.\r\n\t\t\t\tp.addFood(selectedfood);\r\n\t\t\t\tstore.setFoodamounts(foodamounts);\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\t\t//Buy toys\r\n\t\tcase 2:\r\n\t\t\tc = 1;\r\n\t\t\tfor(Toy t : storetoys){\r\n\t\t\t\tSystem.out.println(c + \". \" + t.getName() + \"\\nPrice: $\" + t.getPrice() + \" Stock: \" + toyamounts[c-1]);\r\n\t\t\t\tSystem.out.println(\"\");\r\n\t\t\t\tc++;\r\n\t\t\t}\r\n\t\t\tbuyoption = getNumber(1, storetoys.size());\r\n\t\t\tToy selectedtoy = storetoys.get(buyoption -1);\r\n\t\t\tif(p.getMoney() > selectedtoy.getPrice() && toyamounts[buyoption-1] > 0){\r\n\t\t\t\tp.setMoney(p.getMoney() - selectedtoy.getPrice());\r\n\t\t\t\ttoyamounts[buyoption -1]--; //Take one away, as it has been sold.\r\n\t\t\t\tp.addToy(selectedtoy);\r\n\t\t\t\tstore.setToyamounts(toyamounts);\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tSystem.out.println(\"\\n\\n\\n\\n\\n\\nError. Either the store was out of stock for the selected product or the player was out of money.\");\r\n\t\t\t}\r\n\t\tcase 3:\r\n\t\t\tbreak;\r\n\r\n\t\tdefault:\r\n\t\t\tSystem.out.println(\"ERROR\");\r\n\t\t}\r\n\t}",
"private void createTransaction() {\n\n String inputtedAmount = etAmount.getText().toString().trim().replaceAll(\",\", \"\");\n\n if (inputtedAmount.equals(\"\") || Double.parseDouble(inputtedAmount) == 0) {\n etAmount.setError(getResources().getString(R.string.Input_Error_Amount_Empty));\n return;\n }\n\n if (mAccount == null) {\n ((ActivityMain) getActivity()).showError(getResources().getString(R.string.Input_Error_Account_Empty));\n return;\n }\n\n if(mCategory == null) {\n ((ActivityMain) getActivity()).showError(getResources().getString(R.string.Input_Error_Category_Income_Empty));\n return;\n }\n\n Double amount = Double.parseDouble(etAmount.getText().toString().replaceAll(\",\", \"\"));\n if(amount < 0) {\n ((ActivityMain) getActivity()).showError(getResources().getString(R.string.Input_Error_Amount_Invalid));\n return;\n }\n\n int CategoryId = mCategory != null ? mCategory.getId() : 0;\n String Description = tvDescription.getText().toString();\n int accountId = mAccount.getId();\n String strEvent = tvEvent.getText().toString();\n Event event = null;\n\n if (!strEvent.equals(\"\")) {\n event = mDbHelper.getEventByName(strEvent);\n if (event == null) {\n long eventId = mDbHelper.createEvent(new Event(0, strEvent, mCal, null));\n if (eventId != -1) {\n event = mDbHelper.getEvent(eventId);\n }\n }\n }\n\n boolean isDebtValid = true;\n // Less: DebtCollect, More: Borrow\n if(mCategory.getDebtType() == Category.EnumDebt.LESS) { // Income -> Debt Collecting\n List<Debt> debts = mDbHelper.getAllDebtByPeople(tvPeople.getText().toString());\n\n Double lend = 0.0, debtCollect = 0.0;\n for(Debt debt : debts) {\n if(mDbHelper.getCategory(debt.getCategoryId()).isExpense() && mDbHelper.getCategory(debt.getCategoryId()).getDebtType() == Category.EnumDebt.MORE) {\n lend += debt.getAmount();\n }\n\n if(!mDbHelper.getCategory(debt.getCategoryId()).isExpense() && mDbHelper.getCategory(debt.getCategoryId()).getDebtType() == Category.EnumDebt.LESS) {\n debtCollect += debt.getAmount();\n }\n }\n\n if(debtCollect + amount > lend) {\n isDebtValid = false;\n ((ActivityMain) getActivity()).showError(getResources().getString(R.string.message_debt_collect_invalid));\n }\n }\n\n if(isDebtValid) {\n Transaction transaction = new Transaction(0,\n TransactionEnum.Income.getValue(),\n amount,\n CategoryId,\n Description,\n 0,\n accountId,\n mCal,\n 0.0,\n \"\",\n event);\n\n long newTransactionId = mDbHelper.createTransaction(transaction);\n\n if (newTransactionId != -1) {\n\n if(mCategory.getDebtType() == Category.EnumDebt.LESS || mCategory.getDebtType() == Category.EnumDebt.MORE) {\n Debt newDebt = new Debt();\n newDebt.setCategoryId(mCategory.getId());\n newDebt.setTransactionId((int) newTransactionId);\n newDebt.setAmount(amount);\n newDebt.setPeople(tvPeople.getText().toString());\n\n long debtId = mDbHelper.createDebt(newDebt);\n if(debtId != -1) {\n ((ActivityMain) getActivity()).showToastSuccessful(getResources().getString(R.string.message_transaction_create_successful));\n cleanup();\n\n if(getFragmentManager().getBackStackEntryCount() > 0) {\n // Return to last fragment\n getFragmentManager().popBackStackImmediate();\n }\n } else {\n ((ActivityMain) getActivity()).showError(getResources().getString(R.string.message_transaction_create_fail));\n mDbHelper.deleteTransaction(newTransactionId);\n }\n } else {\n ((ActivityMain) getActivity()).showToastSuccessful(getResources().getString(R.string.message_transaction_create_successful));\n cleanup();\n\n if(getFragmentManager().getBackStackEntryCount() > 0) {\n // Return to last fragment\n getFragmentManager().popBackStackImmediate();\n }\n }\n\n } else {\n ((ActivityMain) getActivity()).showError(getResources().getString(R.string.message_transaction_create_fail));\n }\n }\n\n }",
"private void billing_calculate() {\r\n\r\n // need to search patient before calculating amount due\r\n if (billing_fullNameField.equals(\"\")){\r\n JOptionPane.showMessageDialog(this, \"Must search for a patient first!\\nGo to the Search Tab.\",\r\n \"Need to Search Patient\", JOptionPane.ERROR_MESSAGE);\r\n }\r\n if (MainGUI.pimsSystem.lookUpAppointmentDate(currentPatient).equals(\"\")){\r\n JOptionPane.showMessageDialog(this, \"No Appointment to pay for!\\nGo to Appointment Tab to make one.\",\r\n \"Nothing to pay for\", JOptionPane.ERROR_MESSAGE);\r\n }\r\n\r\n // patient has been searched - get info from patient info panel\r\n else {\r\n\r\n currentPatient = MainGUI.pimsSystem.patient_details\r\n (pInfo_lastNameTextField.getText(), Integer.parseInt(pInfo_ssnTextField.getText()));\r\n // patient has a policy, amount due is copay: $50\r\n // no policy, amount due is cost amount\r\n double toPay = MainGUI.pimsSystem.calculate_charge(currentPatient, billing_codeCB.getSelectedItem().toString());\r\n billing_amtDueField.setText(\"$\" + doubleToDecimalString(toPay));\r\n\r\n\r\n\r\n JOptionPane.showMessageDialog(this, \"Amount Due Calculated.\\nClick \\\"Ok\\\" to go to Payment Form\",\r\n \"Calculate\", JOptionPane.DEFAULT_OPTION);\r\n\r\n paymentDialog.setVisible(true);\r\n }\r\n\r\n }",
"public void setPriceActual (BigDecimal PriceActual);",
"private void totalPrice() {\n double totalPrice;\n \n String stu = studentSubTotal.getText();\n stu = stu.substring(1);\n double stuTotal = Double.parseDouble(stu);\n\n String adult = adultSubTotal.getText();\n adult = adult.substring(1);\n double adultTotal = Double.parseDouble(adult);\n\n String senior = seniorSubTotal.getText();\n senior = senior.substring(1);\n double seniorTotal = Double.parseDouble(senior);\n\n totalPrice = stuTotal + adultTotal + seniorTotal;\n NumberFormat gbp = NumberFormat.getCurrencyInstance(Locale.UK);\n String totalStr = String.valueOf(gbp.format(totalPrice));\n totalPriceTextField.setText(totalStr);\n\n }",
"double calculatePrice(VehicleType vehicleType, Date entryTime, Date exitTime);",
"private void updatePriceStats(double newPrice) {\n this.currentPrice = newPrice;\n this.currentAvgPrice = Double.parseDouble(decimalFormat.format(computeSMA(newPrice, currentAvgPrice, priceHistory)));\n this.priceChangePCT = Double.parseDouble(decimalFormat.format(computeDifferentialPCT(newPrice, currentAvgPrice)));\n }",
"private void trade_shortsell() {\n\t\ttext_code.setText(code);\n\t\t\n\t\tDecimalFormat df=new DecimalFormat(\"#.00\");\n\t\ttext_uprice.setText(df.format(Double.parseDouble(information[2])*1.1) );//涨停价\n\t\t\n\t\ttext_downprice.setText(df.format(Double.parseDouble(information[2])*0.9));//跌停价\n\t\t\n\t\t//getfundown().setText(homepage.get_table_userinfo().getItem(1).getText(1));//可用资金\n\t\t\n\t\t//double d1 = Double.parseDouble(homepage.get_table_userinfo().getItem(1).getText(1));\n\t\t//double d2 = Double.parseDouble(information[3]);\n\t\t//text_limitnum.setText(Integer.toString( (int)(d1/d2) ) );//可卖数量\n\t\t\n\n\t}",
"Price getTradePrice();"
] | [
"0.64819187",
"0.64398485",
"0.6439019",
"0.6348215",
"0.61839336",
"0.61037594",
"0.6100739",
"0.6052285",
"0.5995636",
"0.5972338",
"0.59630716",
"0.59372306",
"0.5930919",
"0.5912269",
"0.58911157",
"0.5888824",
"0.5830498",
"0.58094734",
"0.58034307",
"0.5787172",
"0.57835287",
"0.5783487",
"0.57761043",
"0.5767789",
"0.5756874",
"0.57492024",
"0.57464087",
"0.57347053",
"0.5713945",
"0.57100797",
"0.570085",
"0.5697162",
"0.5696417",
"0.56699634",
"0.56692106",
"0.5667407",
"0.5666852",
"0.5660496",
"0.5649286",
"0.56481224",
"0.56441337",
"0.56411755",
"0.5634663",
"0.5630965",
"0.5628991",
"0.5627612",
"0.56273884",
"0.5624688",
"0.56168264",
"0.5613712",
"0.56109",
"0.5602144",
"0.5590228",
"0.5589842",
"0.5589797",
"0.55841756",
"0.5569231",
"0.5563379",
"0.55520713",
"0.5551589",
"0.55502987",
"0.55428445",
"0.55375314",
"0.5532926",
"0.55237657",
"0.55237657",
"0.55237657",
"0.55237657",
"0.55237657",
"0.55237657",
"0.55237657",
"0.55234146",
"0.55233246",
"0.55152446",
"0.55152446",
"0.55152446",
"0.55152136",
"0.5513813",
"0.5510631",
"0.5510223",
"0.55010134",
"0.5500955",
"0.5500955",
"0.54905677",
"0.54905677",
"0.54905677",
"0.54860693",
"0.54803085",
"0.5479402",
"0.5476809",
"0.54761475",
"0.54746556",
"0.5470148",
"0.5466743",
"0.5463603",
"0.545972",
"0.5450579",
"0.5448348",
"0.54448116",
"0.5440243"
] | 0.583442 | 16 |
Get the data represented in any one cell of the table, given the row number and column number. Used only by Swing. | public Object getValueAt(int row, int column) {
switch(column) {
case SECURITY_NAME_COLUMN: return allSecurities.get(row).security;
case CURRENT_PRICE_COLUMN: return allSecurities.get(row).currentPrice;
case NEW_PRICE_COLUMN: return allSecurities.get(row).newPrice;
default: return "?";
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public abstract T getCell(int row, int column);",
"Object getDataValue(String column, int row);",
"protected abstract double getCell(\r\n int row,\r\n int col);",
"public Object getCell(int col, int row) {\n Vector data = ((DefaultTableModel) getModel()).getDataVector();\n return ((Vector) data.get(row)).get(col);\n }",
"Object getDataValue(final int row, final int column);",
"ICell getCellAt(int col, int row) throws IllegalArgumentException;",
"public Cell getCell( int rowIndex, int colIndex )\n {\n return cells[ colIndex ][ rowIndex ];\n }",
"String getValue(String column, int row);",
"public Object getValueAt(int row, int col) {\n\t\tList rowList = data.get(row);\n\t\tObject result = null;\n\t\tif (col<rowList.size()) {\n\t\t\tresult = rowList.get(col);\n\t\t}\n\t\t\n\t\t// _apparently_ it's ok to return null for a \"blank\" cell\n\t\treturn(result);\n\t}",
"public Object getCell(int column) {\r\n switch (column) {\r\n case 0:\r\n return _internalEvent.getDate() ;\r\n case 1:\r\n return _internalEvent.getFileName() ;\r\n case 2:\r\n return new Integer(_internalEvent.getEventCode()) ;\r\n case 3:\r\n return _internalEvent.getEventDescription() ;\r\n case 4:\r\n return _internalEvent.getExtendedMessage() ;\r\n default:\r\n return \"\" ;\r\n }\r\n }",
"public int get_cell(int row,int col)\n{\n\treturn cell[row][col] ;\t\n}",
"public Cell getCell(int row, int column) {\n return cells[row][column];\n }",
"Cell getCellAt(Coord coord);",
"public int getValue(int row, int column);",
"public Cell getCellValue(int rowNum, int columnNum) {\n\t\treturn cells[rowNum][columnNum];\n\t}",
"@Override\n public Object getValueAt(int row, int column) {\n return this.data[row][column];\n }",
"String getRawCellAt(Coord coord);",
"Object getColumnValue(int colIndex);",
"public Object getValueAt(int row, int column) {\r\n if (_debugTable == null) {\r\n return \"\" ;\r\n }\r\n try {\r\n Object o = _debugTable.getTableCell(row, column) ;\r\n return (o != null) ? o : \"\" ;\r\n } catch (Exception e) {\r\n return \"\" ;\r\n }\r\n }",
"@Override\n public Object getValueAt(int row, int column) { return data[row][column]; }",
"public Object getValueAt(int row, int col)\r\n\t{\r\n\t\treturn cellData[row][col];\r\n\t}",
"public abstract AwtCell get(int y, int x);",
"public String getCellText(int row, int col) {\n\t\treturn input.get(row).get(col);\n\t}",
"public abstract Number getNumber(int columnIndex);",
"public native Object getEditedCell(int rowNum, int colNum) /*-{\r\n var self = [email protected]::getOrCreateJsObj()();\r\n var ret = self.getEditedCell(rowNum, colNum);\r\n return $wnd.SmartGWT.convertToJavaType(ret);\r\n }-*/;",
"@Override\n\tpublic Object getValueAt(int row, int col) {\n\t\treturn data[row][col];\n\t}",
"@Override\n\tpublic Object getValueAt(int row, int col) {\n\t\treturn data[row][col];\n\t}",
"public abstract Object getValueAt(int nodeIndex,int nodeRow,int nodeColumn);",
"@Override\r\n public Object getValueAt(int rowIndex, int columnIndex) {\n Hashtable rowData = fixHashtables[rowIndex];\r\n return rowData.get(getColumnName(columnIndex));\r\n }",
"public int getCell() {\n return this.cell;\n }",
"@Override\n\tpublic Object getValueAt(int rowIndex, int colIndex) {\n\t\treturn rowData.get(rowIndex).get(colIndex);\n\t}",
"public TableCell getCell() {\n return cell;\n }",
"public Object getValueAt(int row, int column){\n return dataEntries[row][column];\n }",
"public Object getValueAt(int row, int col) {\n return data[row][col];\n }",
"public Integer getValueForCell(int x, int y)\n {\n Integer value=_cells[x][y].getValue();\n return value;\n }",
"Value evaluateCellAt(int col, int row);",
"@Override\n public Object getValueAt(int aRow, int aColumn) {\n return model.getValueAt(aRow, aColumn); \n }",
"public Cell get(int row, int col) {\n\t\treturn myGrid.get(row, col);\n\t}",
"public double getCell(int row, int col) {\n int di = row - col;\n\n if (di == 0) {\n return B[row];\n } else if (di == -1) {\n return C[row];\n } else if (di == 1) {\n return A[row];\n } else return 0;\n }",
"public GoLCell getCell(int x, int y)\n\t{\n \treturn myGoLCell[x][y];\n\t}",
"public Object getValueAt(int aRow, int aColumn) \n {\n if (rowCount >= aRow && colCount >= aColumn)\n return (rowData[aRow][aColumn]); \n else\n return(null);\n }",
"public String getValueAt(int rowIndex, int columnIndex);",
"@Override\r\n\tpublic Integer getCell(Integer x, Integer y) {\n\t\treturn game[x][y];\r\n\t}",
"private Cell get_cell(int row, int col){\n if (! cell_in_bounds(row,col)) return null;\n return this.cells[row][col];\n }",
"public static String getCellData(int RowNum, int ColNum) throws Exception{\n\n XSSFSheet ExcelWSheet;\n XSSFCell Cell;\n\n try{\n ExcelWSheet = setExcelFile();\n Cell = ExcelWSheet.getRow(RowNum).getCell(ColNum);\n if(Cell.getCellType().equals(CellType.NUMERIC)){\n int x = (int) Cell.getNumericCellValue();\n String y = Integer.toString(x);\n return y;\n\n }else{\n return Cell.getStringCellValue();\n }\n\n }catch (Exception e){\n return\"\";\n\n }\n\n }",
"T getRowData(int rowNumber);",
"public Object getValueAt(int row, int col) throws Exception{\r\n Object obj = null;\r\n if(data!= null){\r\n\tobj = ((Vector) data.elementAt(row)).elementAt(col);\r\n }\r\n return obj;\r\n }",
"private Element getTd(int row, int col) {\n return table.getChild(row).getChild(col);\n }",
"public Object getValueAt(int row, int col) {\n return data[row][col];\n }",
"public Object getValueAt(int rowIndex, int columnIndex) {\r\n if (table.isValidRow(rowIndex)) {\r\n return this.table.getValue(rowIndex, columnIndex);\r\n } else {\r\n return null;\r\n }\r\n }",
"@SuppressWarnings(\"unchecked\")\n\tpublic T get( int row, int column ) {\n\t\tString S = C + \": get(): \";\n\t\tcheckBounds( row, column, S );\n\t\treturn (T)data[row * numCols + column];\n\t}",
"public static String getCellData(int RowNum, int ColNum) throws Exception{\n\n \tString CellData=\"\";\n\t\t\ttry{\n\n \t\t\tCell = ExcelWSheet.getRow(RowNum).getCell(ColNum);\n \t\t\tint type = Cell.getCellType();\n \t\t\t\t\tif (type == XSSFCell.CELL_TYPE_NUMERIC){\n \t\t\t\t\t\t System.out.println((int)Cell.getNumericCellValue());\n \t\t\t\t\t\t int numdata=(int)Cell.getNumericCellValue();\n \t\t\t\t\t\t CellData=String.valueOf(numdata);\n \t\t\t\t\t}else if(type==XSSFCell.CELL_TYPE_STRING){\n \t\t\t\t\t\tCellData = Cell.getStringCellValue();\n \t\t\t\t\t\tSystem.out.println(CellData);\n \t\t\t\t\t}\n \t\t\t\t\t \n\n \t\t\treturn CellData;\n\n \t\t\t}catch (Exception e){\n\n\t\t\t\treturn\"\";\n\n \t\t\t}\n\n }",
"public Object getValueAt(int row, int col)\n\t{\n\t\t// invalid row\n\t\tif (row < 0 || row >= m_data.rows.size())\n\t\t\treturn null;\n\t//\t\tthrow new java.lang.IllegalArgumentException(\"Row invalid\");\n\t\tif (col < 0 || col >= m_data.cols.size())\n\t\t\treturn null;\n\t//\t\tthrow new java.lang.IllegalArgumentException(\"Column invalid\");\n\t\t//\n\t\tArrayList<Object> myRow = (ArrayList<Object>)m_data.rows.get(row);\n\t\t// invalid column\n\t\tif (myRow == null || col >= myRow.size())\n\t\t\treturn null;\n\t\t// setValue\n\t\treturn myRow.get(col);\n\t}",
"@Override\r\n public Object getValueAt(int rowIndex, int columnIndex) {\n Hashtable rowData = chineseHashtables[rowIndex];\r\n return rowData.get(getColumnName(columnIndex));\r\n }",
"public TableCell get(String columnName) {\n if (ownerTable == null) {\n throw new IllegalStateException(\n \"This table row does not belong to a table. Use \" +\n \"get(int) instead.\");\n }\n \n Integer columnIndex = \n ownerTable.tableColumnNameIndexMap.get(columnName);\n \n if (columnIndex == null) {\n throw new IllegalArgumentException(\"\\\"\" +\n columnName + \"\\\": no such column.\");\n }\n \n return tableCellList.get(columnIndex);\n }",
"public Object getValueAt( int row, int column ) \r\n throws IllegalStateException\r\n {\r\n if ( !connectedToDatabase ) \r\n throw new IllegalStateException( \"Not Connected to Database\" );\r\n try \r\n {\r\n resultSet.absolute( row + 1 );\r\n return resultSet.getObject( column + 1 );\r\n }\r\n catch ( SQLException sqlException ) \r\n {\r\n sqlException.printStackTrace();\r\n }\r\n \r\n return \"\";\r\n }",
"public Cell getCell(int x, int y) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\treturn cells[x][y];\r\n\t\t\t\t} catch (ArrayIndexOutOfBoundsException e) { // fora dos limites\r\n\t\t\t\t\treturn null;\r\n\t\t\t\t}\r\n\t\t\t}",
"public Cell getCellAt (int x, int y) {\n return grid[x-1][y-1];\n }",
"int getRowIndex();",
"public Object getValueAt(int rowIndex, int columnIndex)\r\n {\r\n return data[rowIndex][columnIndex];\r\n }",
"@Override\n public Object getValueAt(int row, int column) {\n return sessionRow.get(row * column);\n }",
"public String getCellData(int rowIndex, int cellIndex){\n\t\t\n\t\tHSSFRow row= sheet.getRow(rowIndex);\n\t\treturn getData(row, cellIndex);\n\t}",
"@Override\r\n\tpublic Object getValueAt(int arg0, int arg1) {\n\t\treturn rowData[arg0][arg1];\r\n\t}",
"protected Object getCellValue(int row, String column) {\r\n\r\n\t\t// translate\r\n\t\tif(NAME.equals(column))\r\n\t\t{\r\n\t\t\tIUnitIf unit = getId(row);\r\n\t\t\tString name = MsoUtils.getUnitName(getId(row), true);\t\t\t\r\n\t\t\treturn unit.isChanged()?name.concat(\"*\"):name;\r\n\t\t}\r\n\t\telse if(VIEW.equals(column))\r\n\t\t\treturn getId(row);\r\n\r\n\t\t// not supported\r\n\t\treturn null;\r\n\r\n\t}",
"public static String getCellData(int ROWNum, int ColNum) {\n cell= excelWSheet.getRow(ROWNum).getCell(ColNum);\n DataFormatter formatter = new DataFormatter();\n String cellData = formatter.formatCellValue(cell);\n return cellData;\n }",
"public Object getValueAt(int row, int col) {\n\t\treturn data[row][col];\n\t}",
"public Object getValueAt(int row, int col) {\n\t\treturn data[row][col];\n\t}",
"public StrColumn getEbiCell() {\n return delegate.getColumn(\"ebi_cell\", DelegatingStrColumn::new);\n }",
"public Object getValueAt(int row, int column) {\n Preso cli = lista.get(row);\n /*if (column == Id) {\n return cli.getId();\n } else*/ if (column == Nome) {\n return cli.getNome();\n } if (column == Tempo) {\n return cli.getTempo();\n } else\n\n return \"\"; //Nunca deve ocorrer \n }",
"String getColumn(int index);",
"String getColumn(int index);",
"WebElement getCell(final String header) {\n return getCells().get(getHeaders().indexOf(header));\n }",
"@Override\n public Object getValueAt(int row, int column) {\n if (row >= blockList.size())\n return null;\n Object value;\n Response block = blockList.get(row);\n //\n // Get the value for the requested cell\n //\n switch (column) {\n case 0: // Date\n value = new Date(block.getLong(\"timestamp\") * 1000 + Nxt.getEpoch());\n break;\n case 1: // Height\n value = block.getInt(\"height\");\n break;\n case 2: // Block identifier\n value = block.getString(\"block\");\n break;\n case 3: // Block version\n value = block.getInt(\"version\");\n break;\n case 4: // Block transaction count\n value = block.getInt(\"numberOfTransactions\");\n break;\n case 5: // Block generator\n value = block.getString(\"generatorRS\");\n break;\n default:\n throw new IndexOutOfBoundsException(\"Table column \"+column+\" is not valid\");\n }\n return value;\n }",
"public String getRealCell(){\n\t\treturn userInput;\n\t}",
"public static String getCellData(int rowIndex, int colIndex) {\n\t\treturn sheet.getRow(rowIndex).getCell(colIndex).toString();\n\t}",
"public Cell getCell(int row, int col) {\n return board[row][col];\n }",
"public String fullCellText();",
"public abstract void processCell(int rowIndex, int colIndex);",
"public org.edna.mxv1.xsdata.XSDataCell getCell(\n ) {\n return this._cell;\n }",
"int getCell(int x, int y) {\n try {\n return hiddenGrid[x][y];\n } catch (IndexOutOfBoundsException hiddenIndex) {}\n return hiddenGrid[x][y];\n }",
"Object[] getDataRow(final int index);",
"@Override\r\n\tpublic Cell getCell(Location loc)\r\n\t{\n\t\tint row = loc.getRow();\r\n\t\tint col = loc.getCol();\r\n\t\treturn cells[row][col];\r\n\t}",
"public Object getValueAt(int row, int col) {\n Noeud noeud = noeuds.get(row);\n //voici les cellules pour chaque colonne\n return switch (col) {\n case 0 -> noeud.getNomDuFichier();\n case 1 -> noeud.getMot();\n case 2 -> noeud.getFrequence();\n default -> null;\n };\n }",
"public Cell getCell() {\n\t\treturn cell;\n\t}",
"@Override\r\n public Object getValueAt(int rowIndex, int columnIndex) {\n return ((Vector)this.rowData.get(rowIndex)).get(columnIndex);\r\n }",
"public CrosstabCell getCellByPoint(Point p) {\r\n\r\n for (int i=0; i<getCrosstabElement().getCells().size(); ++i)\r\n {\r\n CrosstabCell cell = (CrosstabCell)this.getCrosstabElement().getCells().elementAt(i);\r\n if (cell.getBounds().contains(p) && (isDefaultCellMode() == (cell.getType() == CrosstabCell.NODATA_CELL)))\r\n {\r\n return cell;\r\n }\r\n }\r\n\r\n return null;\r\n }",
"public Object getValueAt(int row, int column)\n {\n return getModel().getDataAt(row, convertColumnIndexToModel(column));\n }",
"public abstract boolean getCell(int x, int y);",
"public static String getCellStringData(int rowNum, int cellNum){\n String cellData=null;\n try {\n cellData = sheet.getRow(rowNum).getCell(cellNum).getStringCellValue();\n System.out.println(cellData);\n\n }catch(Exception e){\n System.out.println(e.getMessage());\n System.out.println(e.getCause());\n e.printStackTrace();\n }\n return cellData;\n }",
"public Cell<C> getCellAt(int x, int y) {\n\t\tCell<C> c = null;\n\t\tMap<Integer, Cell<C>> xCol = cellLookup.get(x);\n\t\tif (null != xCol) {\n\t\t\tc = xCol.get(y);\n\t\t}\n\n\t\treturn c;\n\t}",
"int getCellid();",
"List<WebElement> getCells() {\n return row.findElements(By.tagName(\"td\"));\n }",
"public Object get(int row) {\n\t\treturn null;\n\t}",
"public Cell getSelectedCell() {\n return selectedCell;\n }",
"public int getCellIndex(int column, int row) {\n\t\treturn ((row - 1) * width) + (column - 1);\n\t}",
"public Cell getRowValuesForCompare(Row row,int cellNum){\n return row.getCell(cellNum);\n }",
"public int getCell(int row, int col)\n {\n if (inBounds(row, col))\n return grid[row][col];\n else\n return OUT_OF_BOUNDS;\n }",
"public Object getValueAt(int rowIndex, int columnIndex)\n {\n return al.get(rowIndex)[columnIndex];\n }",
"public int GetFirstPossibleValueInTheCell()\n {\n return this._valuesToPut.get(0);\n }",
"public String getcellData(int rowNumber,int cellNumber) {\n\t\tcell =sheet.getRow(rowNumber).getCell(cellNumber);\n\t\treturn cell.getStringCellValue();\n\t\t\n\n\t}",
"public Object getValueAt(int row, int column) {\n\t\tString[] rowValues = this.records.get(row);\n return rowValues[column];\n\t}"
] | [
"0.7484968",
"0.7011976",
"0.6984171",
"0.6978295",
"0.69609386",
"0.69488585",
"0.6913547",
"0.6874658",
"0.68220234",
"0.67378896",
"0.67329955",
"0.6683297",
"0.66494983",
"0.6640914",
"0.6618477",
"0.66122854",
"0.6612248",
"0.6609267",
"0.6606261",
"0.6577398",
"0.65297407",
"0.6526141",
"0.65052974",
"0.6481104",
"0.6466602",
"0.64620733",
"0.64620733",
"0.644932",
"0.6427754",
"0.64217025",
"0.6420945",
"0.63588357",
"0.634708",
"0.6338062",
"0.6334515",
"0.6326351",
"0.63238794",
"0.63236713",
"0.63153744",
"0.63116086",
"0.63092405",
"0.62977207",
"0.62635297",
"0.6242716",
"0.6232576",
"0.62286544",
"0.6222033",
"0.6211445",
"0.6205973",
"0.620104",
"0.61953485",
"0.6186054",
"0.61624736",
"0.6155971",
"0.6147483",
"0.6139072",
"0.613499",
"0.6124445",
"0.61199164",
"0.61132085",
"0.6108163",
"0.61062443",
"0.6087992",
"0.6083299",
"0.60821235",
"0.60664153",
"0.60664153",
"0.6054824",
"0.6052865",
"0.60510397",
"0.60510397",
"0.60230255",
"0.6010008",
"0.59940517",
"0.5979937",
"0.59799236",
"0.59695065",
"0.5969195",
"0.5965205",
"0.5963712",
"0.5961765",
"0.5960984",
"0.59490836",
"0.59477425",
"0.5933443",
"0.59189564",
"0.5916001",
"0.58760107",
"0.58676445",
"0.5866704",
"0.5866209",
"0.586355",
"0.58609915",
"0.586051",
"0.5860219",
"0.58566904",
"0.58547485",
"0.58493865",
"0.5847801",
"0.5840504",
"0.5834029"
] | 0.0 | -1 |
Used by JTable to determine whether a given table cell should be made editable or not. Returns "true" if and only if the cell in question is in the "New Price" column. | @Override
public boolean isCellEditable (int row, int column) {
return (column == NEW_PRICE_COLUMN);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public boolean isCellEditable (int rowIndex, int columnIndex) {\n return true;\n }",
"public boolean isCellEditable(int row, int col) { return (col!=0); }",
"public boolean isCellEditable(int rowIndex, int columnIndex) {\r\n return (this.table.canAddRow() && this.table.canRemoveRow());\r\n }",
"@Override\n public boolean isCellEditable(int rowIndex, int columnIndex) {\n return (columnIndex == SEL_INDEX);\n }",
"public boolean isCellEditable(int row, int col) {\r\n return true;\r\n }",
"public boolean isCellEditable(int row, int col) {\n return true;\n }",
"public boolean isCellEditable(int row, int column){\n return true;\n }",
"public boolean isCellEditable(int row, int column){ \r\n return false; \r\n }",
"@Override\n public boolean isCellEditable(int row, int column) {\n return editable;\n }",
"@Override\n public boolean isCellEditable(int row, int column) {\n return editable;\n }",
"public boolean isCellEditable(int row, int col) {\r\n return false;\r\n }",
"@Override\n public boolean isCellEditable(int rowIndex, int columnIndex)\n {\n return columnIndex == 1;\n }",
"public boolean isCellEditable (int rowIndex, int columnIndex)\n\t{\n\t\treturn true;\n\t}",
"@Override\r\n public boolean isCellEditable(int row, int col) {\r\n return true;\r\n }",
"@Override\n\tpublic boolean isCellEditable(EventObject anEvent) {\n\t\tlog.info(\"|------表格单元格编辑模型------|\\t\"+\"isCellEditable\\t\");\n\t\treturn true;\n\t}",
"@Override\n public boolean isCellEditable(int row, int column) {\n return isEditable[column];\n }",
"public boolean isCellEditable(int row, int col)\n {\n return col != 0;\n }",
"@Override\r\n\tpublic boolean isCellEditable(int rowIndex, int columnIndex) {\n\t\treturn false;\r\n\t}",
"@Override\r\n\tpublic boolean isCellEditable(int rowIndex, int columnIndex) {\n\t\treturn false;\r\n\t}",
"public boolean isCellEditable(int row, int column){\r\n return false;\r\n }",
"@Override\n public boolean isCellEditable(int rowIndex, int columnIndex) {\n return columnIndex == 1;\n }",
"@Override\n public boolean isCellEditable(int rowIndex,\n int columnIndex) {\n return false;\n }",
"@Override\n\tpublic boolean isCellEditable(int rowIndex, int columnIndex) {\n\t\treturn false;\n\t}",
"@Override\n\tpublic boolean isCellEditable(int rowIndex, int columnIndex) {\n\t\treturn false;\n\t}",
"@Override\r\n\tpublic boolean isCellEditable(EventObject anEvent) {\n\t\treturn true;\r\n\t}",
"public boolean isCellEditable(int rowIndex, int columnIndex) {\r\n return (columnIndex == 0 || columnIndex == 2);\r\n }",
"public boolean isCellEditable(int row, int column) {\n\t\t\t\t\t\t\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t\t\t\t\t\t\t}",
"@Override\n public boolean isCellEditable(int row, int column) { \n return model.isCellEditable(row, column); \n }",
"public boolean isCellEditable(int row, int column) {\n return false;\n }",
"public boolean isCellEditable(int rowIndex, int columnIndex) {\n return (columnIndex == 0);\n }",
"@Override\n public boolean isCellEditable(int row, int col) {\n return col == 2;\n }",
"@Override\n\t public boolean isCellEditable(int row, int column)\n\t {\n\t return false;\n\t }",
"@Override\r\n\tpublic boolean isCellEditable(int rowIndex, int columnIndex)\r\n\t{\r\n\t\treturn columnIndex == 1 || columnIndex == 2;\r\n\t}",
"@Override\n public boolean isCellEditable(int rowIndex, int columnIndex) {\n return false;\n }",
"@Override\n public boolean isCellEditable(int rowIndex, int columnIndex) {\n return false;\n }",
"public boolean isCellEditable(int row, int column) \n\t {\n\t return false;\n\t }",
"@Override\n\t\t public boolean isCellEditable(int row, int column) {\n\t\t //all cells false therefore they are not editable\n\t\t return false;\n\t\t }",
"@Override\n\tpublic boolean isCellEditable(int arg0, int arg1) {\n\t\treturn false;\n\t}",
"@Override\n\tpublic boolean isCellEditable(int arg0, int arg1) {\n\t\treturn false;\n\t}",
"public boolean isCellEditable(int rowIndex, int vColIndex) {\r\n\t return false;\r\n\t }",
"public boolean isCellEditable(int row, int column)\r\n\t{\r\n\t\treturn true;\r\n\t}",
"public boolean isCellEditable(int row, int column) {\n\t\t\t\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t\t\t\t}",
"public boolean isCellEditable(int row, int col) {\n\t\treturn true;\n\t}",
"@Override\r\n\t\tpublic boolean isCellEditable(int row, int col) {\n\t\t\tif (col == 1 || col == 2) {\r\n\t\t\t\treturn true;\r\n\t\t\t} else {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}",
"public boolean isCellEditable(int rowIndex, int columnIndex) {\n\t\treturn false;\r\n\t}",
"@Override\n public boolean isCellEditable(int arg0, int arg1) {\n return false;\n }",
"@Override\n public boolean isCellEditable(int arg0, int arg1) {\n return false;\n }",
"@Override\r\n public boolean isCellEditable(int row, int col) {\n return (col == Column.Active.ordinal());\r\n }",
"@Override\n\t\t public boolean isCellEditable(int row, int column) {\n\t\t //all cells false\n\t\t return false;\n\t\t }",
"@Override\n\tpublic boolean isCellEditable(int row, int column) {\n\t\tswitch (column) {\n\t\tcase 0:\n\t\t\treturn true;\n\t\tcase 1:\n\t\t\treturn false;\n\t\t}\n\t\treturn false;\n\t}",
"public boolean isCellEditable(int row, int col)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}",
"public boolean isCellEditable(int row, int column) {\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}",
"public boolean isCellEditable(int row, int col) {\n //Note that the data/cell address is constant,\n //no matter where the cell appears onscreen.\n return false;\n }",
"public boolean isCellEditable(int row, int col) {\n //Note that the data/cell address is constant,\n //no matter where the cell appears onscreen.\n return false;\n }",
"@Override\r\n public boolean isCellEditable(int rowIndex, int vColIndex) {\n return false;\r\n }",
"public boolean isCellEditable(int row, int col) {\n\t\t if (col ==2) {\r\n\t\t return true;\r\n\t\t } else {\r\n\t\t return false;\r\n\t\t }\r\n\t\t }",
"public boolean isCellEditable(int row, int col) {\n\t\t\treturn false;\n\t\t}",
"public boolean isCellEditable(int row, int col) {\n\t\t\treturn false;\n\t\t}",
"@Override\n public boolean isCellEditable(int row, int column) {\n return false;\n }",
"@Override\r\n\t\t\t\t public boolean isCellEditable(int row, int column) {\n\t\t\t\t return column == 3 || column == 4;\r\n\t\t\t\t }",
"@Override\r\n public boolean isCellEditable(int rowIndex, int vColIndex) {\r\n return false;\r\n }",
"@Override\r\n public boolean isCellEditable(int rowIndex, int vColIndex) {\r\n return false;\r\n }",
"@Override\r\n public boolean isCellEditable(int rowIndex, int vColIndex) {\r\n return false;\r\n }",
"public boolean isCellEditable(int row, int col) {\n\t if (col ==1) {\r\n\t return true;\r\n\t } else {\r\n\t return false;\r\n\t }\r\n\t }",
"@Override\n public boolean isCellEditable(int row, int col) {\n //Note that the data/cell address is constant,\n //no matter where the cell appears onscreen.\n return col==0;\n }",
"@Override\n public boolean isCellEditable(int rowIndex, int columnIndex) {\n return columnIndex == VALUE_COLUMN;\n }",
"public boolean isCellEditable(int row, int col) {\r\n\t\t\t\treturn col == 2;\r\n\t\t\t}",
"@Override\n public boolean isCellEditable(int row, int column) {\n return column == DownloadCompletedTable.OPERATING;\n }",
"@Override\n\t\t\tpublic boolean isCellEditable(int row, int column) {\n\t\t\t\treturn false;\n\t\t\t}",
"@Override\n\t\t\tpublic boolean isCellEditable(int row, int column) {\n\t\t\t\treturn false;\n\t\t\t}",
"@Override\n\t\t\tpublic boolean isCellEditable(int row, int column) {\n\t\t\t\treturn false;\n\t\t\t}",
"@Override\n\t\t\tpublic boolean isCellEditable(int row, int column) {\n\t\t\t\treturn false;\n\t\t\t}",
"@Override\n\t\t\tpublic boolean isCellEditable(int row, int column) {\n\t\t\t\treturn false;\n\t\t\t}",
"public boolean isCellEditable(int row, int col) {\n\t\treturn col > 0;\n\t}",
"@Override\r\n public boolean isCellEditable(int rowIndex, int vColIndex) {//C.P.M no sera editable\r\n return false;\r\n }",
"public boolean isCellEditable(int row, int col) \n {\n //Note that the data/cell address is constant,\n //no matter where the cell appears onscreen.\n return this.getColumnClass(col) != String.class;\n }",
"@Override\n public boolean isCellEditable(int row, int column) {\n\n return false;\n\n }",
"public boolean isCellEditable(int row,int column){\n\t\t\t\treturn false;\n\t\t\t}",
"public boolean isCellEditable(int rowIndex,int columnIndex){\r\n\t\t\tif (columnIndex != Person.COL_COLOR)\r\n\t\t\t\treturn true;\r\n\t\t\treturn false;\r\n\t\t}",
"public boolean isCellEditable(int row, int column)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}",
"public boolean isCellEditable(int row, int column)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}",
"@Override\n public boolean isCellEditable(int iRow, int iCol) {\n return false;\n }",
"@Override\n public boolean isCellEditable(int row, int column) \n {\n return false;\n }",
"@Override\n public boolean isCellEditable(int row, int column) {\n return false;\n }",
"@Override\n public boolean isCellEditable(int row, int column) {\n return false;\n }",
"public boolean isCellEditable(int row, int col) {\r\n \tif(this.creation == Creation.COLUMN){\r\n \t\tif(col == 0){\r\n \t\t\treturn false;\r\n \t\t}\r\n \t\telse\r\n \t\t\treturn true;\r\n \t}\r\n \telse{\r\n \t\treturn true;\r\n \t}\r\n \r\n }",
"public boolean isCellEditable(EventObject event) {\n \t\t\t\n \t\t\tif (event == null) return true;\n \t\t\t\n \t\t\treturn false;\t\t\n \t\t}",
"public boolean isCellEditable(int row, int col) {\n //Note that the data/cell address is constant,\n //no matter where the cell appears onscreen.\n // set 0 to some value\n if (col < 1) {\n return false;\n } else {\n return true;\n }\n }",
"public boolean isCellEditable(int row, int col)\n\t{\n\t\tif(col>0) return true;\n\t\treturn false;\n\t}",
"public boolean isCellEditable(int row, int column) {\n\t\t if(column == 3){ \r\n\t\t \treturn true;\r\n\t\t }\r\n\t\t else{\r\n\t\t \treturn false;\r\n\t\t }\r\n\t\t }",
"@Override\r\n public boolean isCellEditable(int rowIndex, int vColIndex) {//C.P.M le decimos que no seran editables los componetnes\r\n return false;\r\n }",
"@Override\r\n\t\t\t\t\tpublic boolean isCellEditable(EventObject arg0) {\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}",
"public boolean isCellEditable(EventObject event) {\n\tboolean retValue = false;\n\n\tif(!realEditor.isCellEditable(event))\n\t return false;\n\tif(canEditImmediately(event))\n\t retValue = true;\n\telse if(canEdit && shouldStartEditingTimer(event)) {\n\t startEditingTimer();\n\t}\n\telse if(timer != null && timer.isRunning())\n\t timer.stop();\n\tif(retValue)\n\t prepareForEditing();\n\treturn retValue;\n }",
"@Override\n public boolean isCellEditable(int row, int column) {\n return false;\n }",
"public boolean isCellEditable(int rowIndex, int columnIndex)\r\n {\r\n if( columnIndex == 0 ) return false;\r\n if( rowIndex == 5 ) return false;\r\n if( rowIndex < 5 && columnIndex > 1 ) return false;\r\n return true;\r\n }",
"@Override\n public boolean isCellEditable(int row, int col) {\n if (col == 0) return false;\n String attribute = data[row][0].toString();\n return attribute.equals(\"Description\")||\n attribute.equals(\"Generated\")||\n attribute.equals(\"Scannum\")||\n attribute.equals(\"Patient ID\")||\n attribute.equals(\"Exp Date\")||\n attribute.equals(\"Exp Time\")||\n attribute.equals(\"db_name\") ||\n attribute.equals(\"Data type string\") ||\n attribute.equals(\"History\");\n }",
"public boolean isCellEditable(int row, int col) {\n \tswitch(col){\n \tcase 0:\n \t\treturn false;\n \tcase 1:\n \t\treturn false;\n \tcase 2:\n \t\treturn false;\n \tdefault:\n \t\treturn false;\n \t}\n }",
"public boolean isCellEditable(int row, int col) {\r\n //Note that the data/cell address is constant,\r\n //no matter where the cell appears onscreen.\r\n \t\r\n \t//Testing\r\n \t//System.out.println(\"row = \" + row + \", column = \" + col);\r\n \t//System.out.println((boolean)getValueAt(row,2));\r\n \t\r\n if (col == 3) {\r\n \t//Testing\r\n \t//System.out.println((boolean)getValueAt(row,2));\r\n \r\n \treturn (boolean)getValueAt(row,2);\r\n } else {\r\n return true;\r\n }\r\n }",
"public boolean isCellEditable(int rowIndex, int columnIndex) {\r\n\tParameter parameter = getValueAt(rowIndex);\r\n\tif(parameter instanceof SpeciesContextSpecParameter) {\r\n\t\tSpeciesContext sc = ((SpeciesContextSpecParameter) parameter).getSpeciesContext();\r\n\t\tSimulationContext simContext = fieldSpeciesContextSpec.getSimulationContext();\r\n\t\tif(simContext.getAssignmentRule(sc) != null) {\r\n\t\t\treturn false;\t// not editable if it's an assignment rule variable\r\n\t\t}\r\n\t\tif(simContext.getRateRule(sc) != null) {\r\n\t\t\treturn false;\t// not editable if it's a rate rule variable\r\n\t\t}\r\n\t}\r\n\tif (columnIndex == COLUMN_NAME){\r\n\t\treturn parameter.isNameEditable();\r\n\t}else if (columnIndex == COLUMN_VALUE){\r\n\t\treturn parameter.isExpressionEditable();\r\n\t}\r\n\treturn false;\r\n}",
"public boolean isCellEditable(int row, int column) {\n\t\t\t\tif(column == 3 || column == 6){ \r\n\t\t \treturn true;\r\n\t\t }\r\n\t\t else{\r\n\t\t \treturn false;\r\n\t\t }\r\n\t\t }"
] | [
"0.79494804",
"0.7936127",
"0.7875074",
"0.784297",
"0.7841319",
"0.78057253",
"0.78053385",
"0.78044623",
"0.7779407",
"0.7779407",
"0.77777684",
"0.77555573",
"0.7754068",
"0.77536124",
"0.77378523",
"0.7733718",
"0.77223736",
"0.7716748",
"0.7716748",
"0.770902",
"0.7708262",
"0.76939535",
"0.76922786",
"0.76922786",
"0.7688855",
"0.7687268",
"0.7680945",
"0.76672107",
"0.76660484",
"0.7651586",
"0.76512706",
"0.7642545",
"0.76421285",
"0.76419234",
"0.76419234",
"0.7640189",
"0.7638159",
"0.76379526",
"0.76379526",
"0.76361215",
"0.7632359",
"0.76215655",
"0.7617993",
"0.7609243",
"0.7603591",
"0.75971204",
"0.75971204",
"0.7593978",
"0.75871754",
"0.7571338",
"0.7568607",
"0.7556478",
"0.7555127",
"0.7555127",
"0.7546505",
"0.7539027",
"0.7538683",
"0.7538683",
"0.75380707",
"0.75304794",
"0.7529807",
"0.7529807",
"0.7529807",
"0.75230163",
"0.7518875",
"0.7510538",
"0.7504471",
"0.7501857",
"0.7497414",
"0.7497414",
"0.7497414",
"0.7497414",
"0.7497414",
"0.7495643",
"0.74881905",
"0.7480417",
"0.74794716",
"0.7479083",
"0.7462855",
"0.7455475",
"0.7455475",
"0.74525493",
"0.7440335",
"0.7408184",
"0.7408184",
"0.7406568",
"0.7395631",
"0.73932433",
"0.7390663",
"0.7383529",
"0.7368737",
"0.73603356",
"0.73538834",
"0.7343409",
"0.7338857",
"0.73242337",
"0.7317344",
"0.73116356",
"0.7306153",
"0.7302329"
] | 0.8355121 | 0 |
Called by JTable when a table cell has been edited, to let this "table model" object know the new value, so that it may store that value. | @Override
public void setValueAt (Object value, int row, int col) {
SecurityRow secRow = allSecurities.get(row);
if (col == NEW_PRICE_COLUMN) {
if(value==null) {
secRow.newPrice = null;
} else if(value instanceof Double) {
secRow.newPrice = (Double)value;
} else {
double d = StringUtils.parseRate(String.valueOf(value), decimalChar);
secRow.newPrice = d==0 ? null : d;
}
fireTableCellUpdated (row, col);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void cellChanged(String newCellValue) {\n\t \n }",
"public void cellValueChanged(int row, int col, String oldValue, String newValue);",
"public void onCellEdit(CellEditEvent event) {\n Object oldValue = event.getOldValue();\n Object newValue = event.getNewValue();\n Object o = event.getSource();\n System.out.println(\"event called: \" + newValue + \" \" + oldValue);\n System.out.println(o.toString());\n DataTable table = (DataTable) event.getComponent();\n Long id = (Long) table.getRowKey();\n System.out.println(\"#### row key is : \" + id + \" ####\");\n if (newValue != null && !newValue.equals(oldValue)) {\n FacesMessage msg = new FacesMessage(FacesMessage.SEVERITY_INFO, \"Cell Changed\", \"Old: \" + oldValue + \", New:\" + newValue);\n FacesContext.getCurrentInstance().addMessage(null, msg);\n for (Gnome gnome : user.getCart()) {\n if ((gnome.getId() != null) && (gnome.getId().compareTo(id) == 0)) {\n System.out.println(\"cart size on cell edit \" + user.getCart().size());\n gnome.setShopQuantity((Integer) newValue);\n userFacade.updateCart(user, gnome);\n }\n }\n }\n }",
"@Override\n\tpublic void tableChanged(TableModelEvent arg0) {\n\t\t\n\t}",
"public void tableChanged(TableModelEvent e) {\n\t\t\t\tint row = e.getFirstRow();\n\t\t\t\tint column = e.getColumn();\n\t\t\t\tif(column == -1){\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tString value_in_table = String.valueOf(newModel.getValueAt(row, column));\n\t\t\t\t//System.out.println(value_in_table);\n\t\t\t\tif(column == 1){\n\t\t\t\t\tcolumns_view.get(row).x = Integer.valueOf(value_in_table);\n\t\t\t\t}\n\t\t\t\telse if(column ==2){\n\t\t\t\t\tcolumns_view.get(row).y = Integer.valueOf(value_in_table);\n\t\t\t\t}\n\t\t\t\telse if(column ==3){\n\t\t\t\t\tcolumns_view.get(row).width = Integer.valueOf(value_in_table);\n\t\t\t\t}\n\t\t\t\telse if(column ==4){\n\t\t\t\t\tcolumns_view.get(row).height = Integer.valueOf(value_in_table);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tSystem.out.println(\"out of column range\");\n\t\t\t\t}\n\t\t\t\t//System.out.println(columns_view.size());\n\t\t\t\t(model.views).get(1).updateView();\n\t\t\t}",
"@Override\n\tpublic void tableChanged(TableModelEvent e) {\n\t\tint row = e.getFirstRow();\n\t\tint column = e.getColumn();\n\t\tTableModel model = (TableModel)e.getSource();\n\t\tString columnName = model.getColumnName(column);\n\t\tObject data = model.getValueAt(row, column);\n\t\tdb.update(row, columnName, data);\n\t}",
"@Override\n public void setValueAt(Object value, int row, int col) {\n data[row][col] = value;\n fireTableCellUpdated(row, col);\n }",
"@Override\n\t\t\tpublic void editingStopped(ChangeEvent arg0) {\n\n\t\t\t\tSystem.out.println(tree.getCellEditor().getCellEditorValue());\n\t\t\t\ttree.getModel().valueForPathChanged(tree.getSelectionPath(),\n\t\t\t\t\t\ttree.getCellEditor().getCellEditorValue() + \"zzz\");\n\t\t\t\ttree.updateUI();\n\t\t\t}",
"@FXML\n public void changeMarksCellEvent(CellEditEvent<UGSubjectMarks, Integer> edittedCell) throws SQLException, ClassNotFoundException{\n UGSubjectMarks markSelected = subjectmarktbl.getSelectionModel().getSelectedItem();\n markSelected.SetSubMark(Integer.parseInt(edittedCell.getNewValue().toString()));\n int newMarks = Integer.parseInt(edittedCell.getNewValue().toString());\n UGSubject.setSubjectMarks(Integer.parseInt(studentID.getText()), sem, markSelected.getSubName(), newMarks);\n \n \n }",
"@Override\r\n public void tableChanged(TableModelEvent e) {\n\r\n }",
"@Override\n public void recordChanged(int row, int column, String newValue) {\n if (currentRow == row) {\n recordForm.setValueAt(newValue, column);\n// if (recordNotifier.needsSuggestion(row, column)) {\n// recordList.\n// }\n }\n }",
"@Override\n public void changed(ObservableValue observableValue, Object oldValue, Object newValue) {\n if(table_progressive.getSelectionModel().getSelectedItem() != null) \n { \n TableViewSelectionModel selectionModel = table_progressive.getSelectionModel();\n ObservableList selectedCells = selectionModel.getSelectedCells();\n TablePosition tablePosition = (TablePosition) selectedCells.get(0); \n String[] liste_value=newValue.toString().split(\",\");\n selected_row_table_progressive=tablePosition.getRow()+1; \n selected_row_table_progressive_nom=liste_value[1].trim();\n selected_row_table_progressive_prenom=liste_value[2].trim();\n // Object val = tablePosition.getTableColumn().getCellData(newValue); \n }\n }",
"@Override\n public void changed(ObservableValue observableValue, Object oldValue, Object newValue) {\n if(table_progressive.getSelectionModel().getSelectedItem() != null) \n { \n TableViewSelectionModel selectionModel = table_progressive.getSelectionModel();\n ObservableList selectedCells = selectionModel.getSelectedCells();\n TablePosition tablePosition = (TablePosition) selectedCells.get(0); \n String[] liste_value=newValue.toString().split(\",\");\n selected_row_table_progressive=tablePosition.getRow()+1; \n selected_row_table_progressive_nom=liste_value[1].trim();\n selected_row_table_progressive_prenom=liste_value[2].trim();\n // Object val = tablePosition.getTableColumn().getCellData(newValue); \n }\n }",
"private void poTableEdited(javax.swing.event.TableModelEvent evt){\n \tString[] tmp0=new String[18];\n \tint r=evt.getFirstRow();\n \tint c=evt.getColumn();\n \tjavax.swing.table.TableModel m=(javax.swing.table.TableModel)evt.getSource();\n \tfor (int i = 0; i<18; i++){\n \t\ttmp0[i]=m.getValueAt(r, i).toString();\n \t}\n \t\n \tObject[] tmp1=new inventorycontroller.function.PurchaseOrderProcessor(dbInterface1)\n \t .calculateNetAmt(tmp0, c);\n \tfor (int i = 0; i<18; i++){\n \t\tm.setValueAt(tmp1[i], r, i);\n \t}\n \tupdatePoTotal();\n }",
"public void updateDataCell();",
"@Override\r\n\t\t\tpublic void update(final ViewerCell cell) {\n\t\t\t}",
"@Override\r\n\t\t\tpublic void update(final ViewerCell cell) {\n\t\t\t}",
"@Override\n public boolean isCellEditable(int rowIndex, int columnIndex) {\n return columnIndex == VALUE_COLUMN;\n }",
"@Override\n public void tableChanged(TableModelEvent e) {\n fireTableChanged(e);\n }",
"@Override\r\n\t\t\tpublic void modifyText(ModifyEvent me) {\n\t\t\t\tString newValue = newEditor.getText();\r\n\t\t\t\teditor.getItem().setText(VALUE_COLUMN_NO, newValue);\r\n\t\t\t\t//isEditorModify = true;\r\n\t\t\t\t//propertyInfo.setValue(newValue);\r\n\t\t\t}",
"@Override\r\n\tprotected void setValue(Object element, Object value) {\r\n\t\t// update the whole table\r\n\t\tgetViewer().refresh();\r\n\t}",
"public abstract void setCellValue(int cellValue, int row, int col);",
"public void valueChanged(ListSelectionEvent e) {\n if (!e.getValueIsAdjusting()) {\n selRow = table.getSelectedRow();\n }\n }",
"@Override\n public void setValueAt(Object aValue, int aRow, int aColumn) {\n model.setValueAt(aValue, aRow, aColumn); \n }",
"@Override\n public void setValueAt(Object value, int row, int column) {\n this.data[row][column] = value;\n fireTableDataChanged();\n }",
"@SuppressWarnings(\"unchecked\")\r\n\tprivate void editFocusedCell() {\r\n\t\tfinal TablePosition<ArbeitspaketTableData, ?> focusedCell = tabelle.focusModelProperty().get()\r\n\t\t\t\t.focusedCellProperty().get();\r\n\t\ttabelle.edit(focusedCell.getRow(), focusedCell.getTableColumn());\r\n\t}",
"@Override\n protected void handleCellContentChange(int row,\n int column,\n Object oldValue,\n Object newValue)\n {\n // Store the log note with the log data and write it to the log\n // notes file\n perfLog.getPerfLogData().get(row).setNotes(newValue.toString());\n perfLog.writeLogNotes(row);\n }",
"void valueChanged(CalcModel model);",
"void valueChanged(CalcModel model);",
"public void tableChanged(TableModelEvent e) \n {\n fireTableChanged(e);\n }",
"@Override\r\n\t\t\tpublic void handle(CellEditEvent<Products, String> arg0) {\n\t\t\t\targ0.getTableView().getItems().get(arg0.getTablePosition().getRow()).setPrice(arg0.getNewValue());\r\n\t\t\t\tProducts data=(Products) tbl_view.getSelectionModel().getSelectedItem();\r\n\t\t\t\tSystem.out.println(data.toString());\r\n\t\t\t\tConnectionManager.queryInsert(conn, \"UPDATE dbo.product SET price='\"+data.getPrice()+\"' WHERE id=\"+data.getId());\r\n\t\t\t\ttxt_cost.clear();\r\n\t\t\t\ttxt_date.clear();\r\n\t\t\t\ttxt_name.clear();\r\n\t\t\t\ttxt_price.clear();\r\n\t\t\t\ttxt_qty.clear();\r\n\t\t\t\ttxt_reorder.clear();\r\n\t\t\t\ttxt_search.clear();\r\n\t\t\t\tfetchData(FETCH_DATA);\r\n\t\t\t}",
"@Override\r\n\t\t\tpublic void handle(CellEditEvent<Products, String> arg0) {\n\t\t\t\targ0.getTableView().getItems().get(arg0.getTablePosition().getRow()).setQuantity(arg0.getNewValue());\r\n\t\t\t\tProducts data=(Products) tbl_view.getSelectionModel().getSelectedItem();\r\n\t\t\t\tSystem.out.println(data.toString());\r\n\t\t\t\tConnectionManager.queryInsert(conn, \"UPDATE dbo.product SET quantity='\"+data.getQuantity()+\"' WHERE id=\"+data.getId());\r\n\t\t\t\ttxt_cost.clear();\r\n\t\t\t\ttxt_date.clear();\r\n\t\t\t\ttxt_name.clear();\r\n\t\t\t\ttxt_price.clear();\r\n\t\t\t\ttxt_qty.clear();\r\n\t\t\t\ttxt_reorder.clear();\r\n\t\t\t\ttxt_search.clear();\r\n\t\t\t\tfetchData(FETCH_DATA);\r\n\t\t\t}",
"public void changeLastNameCellEvent(CellEditEvent edittedCell) {\r\n Student personSelected = tableView.getSelectionModel().\r\n getSelectedItem();\r\n personSelected.setLastName(edittedCell.getNewValue().toString());\r\n }",
"@Override\r\n\t\t\tpublic void handle(CellEditEvent<Products, String> arg0) {\n\t\t\t\targ0.getTableView().getItems().get(arg0.getTablePosition().getRow()).setCost(arg0.getNewValue());\r\n\t\t\t\tProducts data=(Products) tbl_view.getSelectionModel().getSelectedItem();\r\n\t\t\t\tSystem.out.println(data.toString());\r\n\t\t\t\tConnectionManager.queryInsert(conn, \"UPDATE dbo.product SET cost='\"+data.getCost()+\"' WHERE id=\"+data.getId());\r\n\t\t\t\ttxt_cost.clear();\r\n\t\t\t\ttxt_date.clear();\r\n\t\t\t\ttxt_name.clear();\r\n\t\t\t\ttxt_price.clear();\r\n\t\t\t\ttxt_qty.clear();\r\n\t\t\t\ttxt_reorder.clear();\r\n\t\t\t\ttxt_search.clear();\r\n\t\t\t\tfetchData(FETCH_DATA);\r\n\t\t\t}",
"public void update() {\n tableChanged(new TableModelEvent(this));\n }",
"@Override\n public boolean isCellEditable (int row, int column) {\n return (column == NEW_PRICE_COLUMN);\n }",
"public void changeFirstNameCellEvent(CellEditEvent edittedCell) {\r\n Student personSelected = tableView.getSelectionModel().\r\n getSelectedItem();\r\n personSelected.setFirstName(edittedCell.getNewValue().toString());\r\n }",
"public void tableChanged(WTableModelEvent event)\n {\n if ((event.getType() == WTableModelEvent.CONTENTS_CHANGED)\n && (event.getColumn() == WTableModelEvent.ALL_COLUMNS)\n && (event.getFirstRow() == WTableModelEvent.ALL_ROWS))\n {\n this.repaint();\n }\n else if ((event.getType() == WTableModelEvent.CONTENTS_CHANGED)\n \t\t&& event.getFirstRow() != WTableModelEvent.ALL_ROWS\n \t\t&& !m_readWriteColumn.isEmpty())\n {\n \tint[] indices = this.getSelectedIndices();\n \tListModelTable model = this.getModel();\n \tif (event.getLastRow() > event.getFirstRow())\n \t\tmodel.updateComponent(event.getFirstRow(), event.getLastRow());\n \telse\n \t\tmodel.updateComponent(event.getFirstRow());\n \tif (indices != null && indices.length > 0)\n \t{\n \t\tthis.setSelectedIndices(indices);\n \t}\n }\n\n return;\n }",
"public void updateTable()\r\n {\r\n ((JarModel) table.getModel()).fireTableDataChanged();\r\n }",
"public void tableChanged(TableModelEvent e) {\n if (log.isDebugEnabled()) {\n log.debug(\"TableModelChanged! firing summary model changed!\");\n }\n\n _updating = true;\n if (_selectedSequence != null) {\n _selectedSequence.refreshSummaries();\n }\n _tableModel.fireTableChangedEvent();\n _updating = false;\n }",
"public void itemStateChanged(ItemEvent e)\r\n {\r\n System.out.println(\"*** get cell editor value:in itemStateChanged event ***\" +txtCell.getText()) ;\r\n super.fireEditingStopped();\r\n }",
"public void setValueAt(Object value, int row, int col) {\n \n \t\tFermentable m = (Fermentable) data.get(row);\n \t\ttry {\n \t\t\tswitch (col) {\n \t\t\t\tcase 0 :\n \t\t\t\t\tm.setName(value.toString());\n\t\t\t\t\tif (NewSwingApp.DEBUG){\n \t\t\t\t\t\tSystem.out.println(\"value is:\" + value);\n\t\t\t\t\t}\n \t\t\t\tcase 1 :\n \t\t\t\t\tm.setAmount(Double.parseDouble(value.toString()));\n \t\t\t\tcase 2 :\n \t\t\t\t\tm.setUnits(value.toString());\n \t\t\t\tcase 3 :\n \t\t\t\t\tm.setPppg(Double.parseDouble(value.toString()));\n \t\t\t\tcase 4 :\n \t\t\t\t\tm.setLov(Double.parseDouble(value.toString()));\n \t\t\t\tcase 5 :\n \t\t\t\t\tm.setCost(Double.parseDouble(value.toString()));\n \t\t\t\tcase 6 :\n \t\t\t\t\tm.setPercent(Double.parseDouble(value.toString()));\n \n \t\t\t}\n \t\t} catch (Exception e) {\n \t\t};\n \n \t\tfireTableCellUpdated(row, col);\n \t\t\n \t}",
"@Override\n\tpublic void cellLabelChanged(Object cell, Object value, boolean autoSize) {\n\t\tmodel.beginUpdate();\n\t\ttry {\n\t\t\tSpot spot = cellToVertexMap.get(cell);\n\t\t\tif (null == spot)\n\t\t\t\treturn;\n\t\t\tString str = (String) value;\n\t\t\tspot.setName(str);\n\t\t\tgetModel().setValue(cell, str);\n\n\t\t\tif (autoSize) {\n\t\t\t\tcellSizeUpdated(cell, false);\n\t\t\t}\n\t\t} finally {\n\t\t\tmodel.endUpdate();\n\t\t}\n\t}",
"protected abstract V makeModelCellValue(C column);",
"public void setValueAt(Object value, int row, int col) {\n if(row < getRowCount()){\n if (DEBUG) {\n System.out.println(\"Setting value at \" + row + \",\" + col\n + \" to \" + value\n + \" (an instance of \"\n + value.getClass() + \")\");\n }\n String[] r = data.get(row);\n r[col] = (String) value;\n fireTableCellUpdated(row, col);\n\n if (DEBUG) {\n System.out.println(\"New value of data:\");\n printDebugData();\n }\n }\n }",
"@Override\n\tpublic void tableChanged(TableModelEvent e) {\n\t\tSystem.out.println(e.toString());\n\t\t//tableDaysModel.addAufgabe(aufgabe);\n\t}",
"@Override\n\tpublic Object getCellEditorValue() {\n\t\tlog.info(\"|------表格单元格编辑模型------|\\t\"+\"getCellEditorValue\\t\"+\n\t\t\t\ttable.getEditingRow()+\",\"+table.getEditingColumn());\n\t\treturn comboBox.getSelectedItem().toString();\n\t}",
"@Override\n public Object getValueAt(int aRow, int aColumn) {\n return model.getValueAt(aRow, aColumn); \n }",
"public void updatedTable() {\r\n\t\tfireTableDataChanged();\r\n\t}",
"@Override\n public void setValueAt(Object aValue, int rowIndex, int columnIndex) {\n }",
"public void updateTable() {\n ((AbstractTableModel) table.getModel()).fireTableDataChanged();\n }",
"public void setValueAt(Object value, int row, int col) {\n\t\t// data[row][col] = value;\n\t\tfireTableCellUpdated(row, col);\n\t}",
"@Override\n public boolean isCellEditable(int row, int column) { \n return model.isCellEditable(row, column); \n }",
"public void setValueAt(Object value, int row, int col)\n {\n if (col != 1)\n return;\n\n prop_map.put(row,value);\n fireTableCellUpdated(row, col);\n }",
"private void editingStopped()\n {\n if ( m_originalValue == null )\n {\n if ( m_field.getText().length() != 0 )\n {\n stopCellEditing();\n }\n \n return;\n }\n \n if ( ! m_originalValue.equals( m_field.getText() ) )\n {\n stopCellEditing();\n }\n }",
"@Override\n\tpublic void setValueAt(Object aValue, int rowIndex, int columnIndex) {\n\t\t\n\t}",
"@Override\r\n\tpublic void valuesChanged() {\r\n\t}",
"public Object getCellEditorValue() {\r\n System.out.println(\"*** get cell editor value: ***\" +txtCell.getText()) ;\r\n Object oldValue = tblProtoCorresp.getValueAt(selRow,selColumn);\r\n Object newValue = ((CoeusTextField)txtCell).getText();\r\n TableColumn column = codeTableColumnModel.getColumn(selColumn) ;\r\n ColumnBean columnBean = (ColumnBean)column.getIdentifier() ;\r\n \r\n //this window has only two combox columns to display\r\n newValue = (ComboBoxBean)((CoeusComboBox)getComponent()).getSelectedItem();\r\n\r\n\r\n if (checkDependency(selRow, \"\"))\r\n {\r\n if(!CheckUniqueId(newValue.toString(), selRow, selColumn))\r\n {\r\n String msg = coeusMessageResources.parseMessageKey(\r\n \"chkPKeyUniqVal_exceptionCode.2401\");\r\n \r\n CoeusOptionPane.showInfoDialog(msg); \r\n return oldValue; //fail in uniqueid check\r\n }\r\n }\r\n else\r\n {\r\n return oldValue;//fail in dependency check\r\n }\r\n \r\n\r\n\r\n\r\n //when the cell value changed,\r\n //set AC_TYPE only the this row is first time be modified.\r\n //\"U\" means this row needs to update.\r\n if (selRow > -1)\r\n {\r\n if (codeTableModel.getValueAt(sorter.getIndexForRow(selRow),codeTableModel.getColumnCount()-1) == null)\r\n {\r\n if (tblProtoCorresp.getValueAt(selRow,selColumn)!=null)\r\n {\r\n if (!(tblProtoCorresp.getValueAt(selRow,selColumn).toString().equals(((CoeusTextField)txtCell).getText())))\r\n {\r\n codeTableModel.setValueAt(\"U\", sorter.getIndexForRow(selRow), codeTableModel.getColumnCount()-1);\r\n // set the user name\r\n codeTableModel.setValueAt(userId, sorter.getIndexForRow(selRow), tableStructureBeanPCDR.getUserIndex() );\r\n saveRequired = true;\r\n System.out.println(\"*** Set AcType to U in getCellEditorValue***\") ;\r\n }\r\n }\r\n else\r\n {\r\n codeTableModel.setValueAt(\"U\", sorter.getIndexForRow(selRow), codeTableModel.getColumnCount()-1);\r\n // set the user name\r\n codeTableModel.setValueAt(userId, sorter.getIndexForRow(selRow), tableStructureBeanPCDR.getUserIndex() );\r\n saveRequired = true;\r\n System.out.println(\"*** Set AcType to U in getCellEditorValue***\") ;\r\n }\r\n }\r\n\r\n }\r\n\r\n if (selColumn == 0 || selColumn == 1 )\r\n return (ComboBoxBean)((CoeusComboBox)getComponent()).getSelectedItem();\r\n\r\n return ((CoeusTextField)txtCell).getText();\r\n }",
"public void setValueAt(Object value, int row, int col)\n\t{\n\t\tdatas.set(row,value);\n\t\tfireTableCellUpdated(row, col);\n\t}",
"@Override\n\tpublic void setValueAt(Object aValue, int rowIndex, int columnIndex) {\n\n\t}",
"@Override\n\tpublic boolean valueChanged() {\n\t\treturn false;\n\t}",
"@Override\r\n\t\t\tpublic void handle(CellEditEvent<Products, String> arg0) {\n\t\t\t\targ0.getTableView().getItems().get(arg0.getTablePosition().getRow()).setName(arg0.getNewValue());\r\n\t\t\t\tProducts data=(Products) tbl_view.getSelectionModel().getSelectedItem();\r\n\t\t\t\tSystem.out.println(data.toString());\r\n\t\t\t\tConnectionManager.queryInsert(conn, \"UPDATE dbo.product SET name='\"+data.getName()+\"' WHERE id=\"+data.getId());\r\n\t\t\t\ttxt_cost.clear();\r\n\t\t\t\ttxt_date.clear();\r\n\t\t\t\ttxt_name.clear();\r\n\t\t\t\ttxt_price.clear();\r\n\t\t\t\ttxt_qty.clear();\r\n\t\t\t\ttxt_reorder.clear();\r\n\t\t\t\ttxt_search.clear();\r\n\t\t\t\tfetchData(FETCH_DATA);\r\n\t\t\t}",
"public void valueChanged(ListSelectionEvent e) {\r\n\t\tif (e.getValueIsAdjusting() == false)\r\n\t\t\tsetSelectedObjects();\r\n\r\n\t\tgetTable().repaint();\r\n\t}",
"public interface ITableCellEditingListener {\n\t\t/**Called whenever the value in a cell has been edited.\n\t\t * @param row index of the row\n\t\t * @param col index of the column\n\t\t * @param oldValue old value in the cell\n\t\t * @param newValue new value in the cell.\n\t\t */\n\t\tpublic void cellValueChanged(int row, int col, String oldValue, String newValue);\n\t}",
"@Override\n public void focusLost(FocusEvent e) {\n String newValue = recordForm.getValueAt(currentColumn);\n recordNotifier.changeRecord(currentRow, currentColumn, newValue);\n }",
"@Override\n\tpublic boolean isCellEditable(EventObject anEvent) {\n\t\tlog.info(\"|------表格单元格编辑模型------|\\t\"+\"isCellEditable\\t\");\n\t\treturn true;\n\t}",
"public void setCell(Object value, int col, int row) {\n ((DefaultTableModel) getModel()).setValueAt(value, row, col);\n }",
"@Override\n public void changed(ObservableValue observableValue, Object oldValue, Object newValue) {\n if(verTabla.getSelectionModel().getSelectedItem() != null) { \n //System.out.println(newValue);\n String []values = newValue.toString().replace(\"[\", \"\").replace(\"]\", \"\") .split(\",\");\n editarIDProv.setText(values[0]);\n editarNombrePro.setText(values[1]);\n editarDescripcionPro.setText(values[2]);\n editarCantidadPro.setText(values[3]);\n editarIVAProv.setText(values[4]);\n editarPrecioPro.setText(values[5]);\n editarIDProvePro.setText(values[6]);\n }\n }",
"@Override\r\n\tpublic void setValueAt(Object aValue, int rowIndex, int columnIndex) {\n\t\t\r\n\t}",
"public void tableChanged(TableModelEvent evt) {\n setRowHeight(ROW_HEIGHT);\n\n PropertyEditor editor;\n Component comp;\n Dimension prefSize;\n\n for (int i = 0; i < getRowCount(); i++) {\n editor = tableModel.getPropertyEditor(i);\n if (editor != null) {\n comp = editor.getCustomEditor();\n if (comp != null) {\n prefSize = comp.getPreferredSize();\n if (prefSize.height > ROW_HEIGHT) {\n setRowHeight(i, prefSize.height);\n }\n }\n }\n }\n }",
"@Override\n\tpublic void setValueAt(Object value, int row, int column) {\n\t\tswitch (column) {\n\t\tcase 0:\n\t\t\tString expr = value.toString();\n\t\t\texpressions.set(row, expr);\n\t\t\tString result = executeExpr(expr, row);\n\n\t\t\tvalues.set(row, result);\n\t\t\tupdateModel();\n\t\t\tif (row + 1 == expressions.size()) {\n\t\t\t\texpressions.add(\"\");\n\t\t\t\tvalues.add(\"\");\n\t\t\t\tfireTableRowsInserted(row + 1, row + 1);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 1:\n\t\t\t// just reset column 2; ignore edits\n\t\t\tfireTableDataChanged();\n\t\t}\n\t}",
"@Override\r\n\t\t\t\t\tpublic boolean isCellEditable(EventObject arg0) {\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}",
"public void valueChanged(ListSelectionEvent lse) {\r\n if(!lse.getValueIsAdjusting()) {\r\n int rowIndex = model.getMinSelectionIndex();\r\n \r\n if(rowIndex == -1) {\r\n return ;\r\n }\r\n\r\n for (int i = 0; i < record.length; i++) {\r\n record[i] = \r\n (String)tableModel.getValueAt(rowIndex, i);\r\n }\r\n\r\n nameTf.setText(record[0]);\r\n locationTf.setText(record[1]);\r\n specialtiesTf.setText(record[2]);\r\n sizeTf.setText(record[3]);\r\n rateTf.setText(record[4]);\r\n ownerTf.setText(record[5]);\r\n recNoTf.setText(record[6]);\r\n updateStatus(\"Choose record.\");\r\n }\r\n }",
"public void setValueAt(Object value, int row, int col)\r\n throws IllegalStateException {\r\n\r\n if(columnsAreNum != null && columnsAreNum.length>0){\r\n\t for(int i =0; i< columnsAreNum.length; i++){\r\n\t if(col == columnsAreNum[i]){\r\n\t value = new Double(tranferStringToNum(value.toString()));\r\n\t break;\r\n\t }\r\n\t }\r\n\t}\r\n //Set value at cell\r\n ( (Vector) data.elementAt(row)).setElementAt(value, col);\r\n //Set status modify to this row.\r\n if (!(Integer.parseInt( ( (Vector) data.elementAt(row)).elementAt\r\n (numberOfcolumns).toString()) == IS_INSERTED)) {\r\n ((Vector) data.elementAt(row)).setElementAt(new Integer(IS_MODIFIED),\r\n numberOfcolumns);\r\n this.updatedStatus = true;\r\n }\r\n }",
"@Override\r\n\t\t\tpublic void handle(CellEditEvent<Products, String> arg0) {\n\t\t\t\targ0.getTableView().getItems().get(arg0.getTablePosition().getRow()).setExpiry_date(arg0.getNewValue());\r\n\t\t\t\tProducts data=(Products) tbl_view.getSelectionModel().getSelectedItem();\r\n\t\t\t\tSystem.out.println(data.toString());\r\n\t\t\t\tConnectionManager.queryInsert(conn, \"UPDATE dbo.product SET expiry_date='\"+data.getExpiry_date()+\"' WHERE id=\"+data.getId());\r\n\t\t\t\ttxt_cost.clear();\r\n\t\t\t\ttxt_date.clear();\r\n\t\t\t\ttxt_name.clear();\r\n\t\t\t\ttxt_price.clear();\r\n\t\t\t\ttxt_qty.clear();\r\n\t\t\t\ttxt_reorder.clear();\r\n\t\t\t\ttxt_search.clear();\r\n\t\t\t\tfetchData(FETCH_DATA);\r\n\t\t\t}",
"void valueChanged(T oldValue, T newValue);",
"protected void valueChanged() {\r\n \t\tint newValue = slider.getSelection();\r\n \t\tint oldValue = this.intValue;\r\n \t\tintValue = newValue;\r\n \t\tjava.beans.PropertyChangeEvent event = new java.beans.PropertyChangeEvent(\r\n \t\t\t\tthis, IPropertyEditor.VALUE, oldValue, newValue);\r\n \t\tvalueChangeListener.valueChange(event);\r\n \t}",
"@Override\n public boolean isCellEditable(int row, int column) {\n return false;\n }",
"public void valueChanged(ListSelectionEvent e)\n\t\t\t{\n\t\t\t\tint row = recipeTable.getSelectedRow();\n\t\t\t\tif(row == -1) //in case the table has not been built\n\t\t\t\t\treturn;\n\t\t\t\t//get the name of the selected recipe\n\t\t\t\tString nameSelected = (String)recipeTable.getValueAt(row, 1);\n\t\t\t\t//using the name of recipe get the JTextArea & updates the txt box\n\t\t\t\ttxtView = entryMap.get(nameSelected);\n\t\t\t\t//redraw the scroll pane with new txt box\n\t\t\t\trecipeViewer.repaint();\n\t\t\t}",
"public void editingStopped(ChangeEvent event) {\n \t\t\tString newValue = getCellEditorValue().toString();\n \t\t\t\n \t\t\t// the userObject was changed to this String\n \t\t\t// reset it to the old userObject, which we stored\n \t\t\t// in selectedGeoElement (see valueChanged()) \n \t\t\t// only nodes with a GeoElement as userObject can be edited!\t\t\n \t\t\tselectedNode.setUserObject(selectedGeoElement);\n \t\t\t\n \t\t\t// change this GeoElement in the Kernel \n \t\t\t\n \t\t\t// allow shift-double-click on a PointonPath in Algebra View to \n \t\t\t// change without redefine\n \t\t\tboolean redefine = !selectedGeoElement.isPointOnPath();\n \t\t\t\n \t\t\tGeoElement geo = kernel.getAlgebraProcessor().changeGeoElement(selectedGeoElement, newValue, redefine);\t\t\t\n \t\t\tif (geo != null) {\t\t\t\t\n \t\t\t\tselectedGeoElement = geo;\n \t\t\t\tselectedNode.setUserObject(selectedGeoElement);\n \t\t\t}\t\t\t\n \t\t\t\n \t\t\t((DefaultTreeModel)getModel()).nodeChanged(selectedNode); // refresh display \n \t\t}",
"@Override\n public void valueChanged(ListSelectionEvent e) {\n currentRow = recordList.getSelectedIndex();\n setRowValues(currentRow, currentColumn);\n if (selectionAction == WAITING_ON_SELECTION) {\n selectionAction = SENDING_SELECTION;\n }\n if (selectionAction == SENDING_SELECTION) {\n selectionAction = FINISHED_SELECTION;\n cellNotifier.select(currentRow, currentColumn); // Notify GUI to select\n }\n \n \n }",
"@Override\n public void changed(ObservableValue observableValue, Object oldValue, Object newValue) {\n if(verTabla.getSelectionModel().getSelectedItem() != null) { \n //System.out.println(newValue);\n String []values = newValue.toString().replace(\"[\", \"\").replace(\"]\", \"\") .split(\",\");\n editarIDProv.setText(values[0]);\n editarNombrePro.setText(values[1]);\n editarDescripcionPro.setText(values[2]);\n editarCantidadPro.setText(values[3]);\n editarIVAProv.setText(values[4]);\n editarPrecioPro.setText(values[5]);\n editarIDProvePro.setText(values[6]);\n }\n }",
"@Override\r\n public void changed(ObservableValue<? extends Number> observable, Number oldValue, Number newValue) {\n try {\r\n int i = newValue.intValue();\r\n if (i < 0) {\r\n\r\n } else {\r\n if (tanggal.getCellData(i) == null) {\r\n\r\n } else {\r\n dtanggal.setValue(LocalDate.parse(tanggal.getCellData(i)));\r\n }\r\n ids = kode_transaksi.getCellData(i);\r\n tkode_bahan.setText(kode_bahan.getCellData(i));\r\n tnama.setText(nama_bahan.getCellData(i));\r\n tjumlah.setText(jumlah_total.getCellData(i));\r\n tharga.setText(harga_satuan.getCellData(i));\r\n cakunuang.getEditor().setText(tabledata.get(i).kode_akun_keuangan + \"-\"\r\n + tabledata.get(i).nama_akun_keuangan);\r\n }\r\n } catch (Exception e) {\r\n oh.error(e);\r\n }\r\n\r\n }",
"@Override\n public void setValueAt(Object aValue, int row, int column) {\n final Object origValue = this.getModel().getValueAt(row, column);\n if (!origValue.equals(aValue)) {\n final Object value = shiftTableModelRecord.getValueAt(row, column);\n if (value != TypeOfShiftTwelveHours.NONE && column != 3) {\n super.setValueAt(aValue, row, column);\n return;\n }\n final int v = JOptionPane.showConfirmDialog(null,\n \"Chystáte se změnit typ směny. Provést změnu?\",\n \"Změna typu směny\",\n JOptionPane.YES_NO_OPTION);\n if (v == JOptionPane.YES_OPTION) {\n super.setValueAt(aValue, row, column);\n }\n }\n }",
"private void handleMouseInput(MouseEvent mouseEvent) {\n if (simulator.isEditable()) {\n updateCell();\n }\n }",
"@Override\n public void setValueAt(Object aValue, int rowIndex, int columnIndex) {\n if (columnIndex == VALUE_COLUMN) {\n String rowDataType = constantList.get(rowIndex).getDataType();\n String rowScale = constantList.get(rowIndex).getScale();\n if (ValidityUtil.isValidValue(aValue,rowDataType,rowScale)) {\n constantList.get(rowIndex).setValue(aValue);\n fireTableCellUpdated(rowIndex, columnIndex);\n } else {\n DialogUtil.displayError(ExperimentalConditionsTableModel.class, \"constantstable.validvaluerequired\");\n }\n \n \n }\n \n }",
"@Override\n public void onCellPreview(CellPreviewEvent<GridRecord> event) {\n boolean isClick = \"click\".equals(event.getNativeEvent().getType());\n if (isClick && event.getColumn()==0) {\n GridRecord record = event.getValue();\n Boolean existing = column.getValue(record);\n column.setValue(!existing, event.getValue());\n }\n }",
"private void editingStopped()\n {\n if ( m_originalValue == null )\n {\n stopCellEditing();\n \n return;\n }\n \n if ( ! m_originalValue.equals( m_field.isSelected() ) )\n {\n stopCellEditing();\n }\n }",
"@Override\r\n public boolean isCellEditable(int row, int col) {\r\n return true;\r\n }",
"protected abstract double setCell(\r\n int row,\r\n int col,\r\n double valueToSet);",
"public void setEditable(){\r\n treatmentTabletv.setEditable(true);\r\n //treatment id editable\r\n treatmentIDColumn.setEditable(true);\r\n treatmentIDColumn.setCellFactory(TextFieldTableCell.forTableColumn());\r\n treatmentIDColumn.setOnEditCommit(new EventHandler<TableColumn.CellEditEvent<treatment, String>>() {\r\n @Override\r\n public void handle(TableColumn.CellEditEvent<treatment, String> t){\r\n treatment tm = ((treatment) t.getTableView().getItems().get(t.getTablePosition().getRow()));\r\n //if text field is left empty, show error\r\n if (t.getNewValue().length() == 0){\r\n dataRefresh();\r\n Notifications.create().title(\"Error Updating Treatment ID\")\r\n .text(\"Treatment ID text field is empty. Text fields may not be left empty. Please insert a valid Treatment ID that does not already exist!!\")\r\n .showError();\r\n }\r\n //if Treatment ID is a duplicate, show error\r\n else if (checkDuplicate(t.getNewValue())){\r\n dataRefresh();\r\n Notifications.create().title(\"Duplicate Error Updating Treatment ID\")\r\n .text(\"Treatment ID already exists. Please insert a valid Treatment ID that does not already exist!!\")\r\n .showError();\r\n }\r\n //else update treatment ID\r\n else {\r\n String dataUpdate = \"update treatment set treatmentID = ? where treatmentName = ? \";\r\n try {\r\n ps = mysql.prepareStatement(dataUpdate);\r\n ps.setString(1, t.getNewValue());\r\n ps.setString(2, tm.getTreatmentNameProperty());\r\n ps.executeUpdate();\r\n ps.close();\r\n ps = null;\r\n\r\n } catch (SQLException e) {\r\n e.printStackTrace();\r\n //maybe add an exception code here\r\n }\r\n tm.setIdProperty(t.getNewValue());\r\n }\r\n }\r\n\r\n });\r\n //treatmentName editable\r\n treatmentNameColumn.setEditable(true);\r\n treatmentNameColumn.setCellFactory(TextFieldTableCell.forTableColumn());\r\n treatmentNameColumn.setOnEditCommit(new EventHandler<TableColumn.CellEditEvent<treatment, String>>() {\r\n @Override\r\n public void handle(TableColumn.CellEditEvent<treatment, String> t){\r\n treatment tm = ((treatment) t.getTableView().getItems().get(t.getTablePosition().getRow()));\r\n //if text field is left empty, show error\r\n if (t.getNewValue().length() == 0){\r\n dataRefresh();\r\n Notifications.create().title(\"Error Updating Treatment Name\")\r\n .text(\"Treatment Name text field is empty. Text fields may not be left empty. Please insert a valid Treatment Name!\")\r\n .showError();\r\n }\r\n else {\r\n String dataUpdate = \"update treatment set treatmentName = ? where treatmentID = ? \";\r\n try {\r\n ps = mysql.prepareStatement(dataUpdate);\r\n ps.setString(1, t.getNewValue());\r\n ps.setString(2, tm.getIdProperty());\r\n ps.executeUpdate();\r\n ps.close();\r\n ps = null;\r\n\r\n } catch (SQLException e) {\r\n e.printStackTrace();\r\n //maybe add an exception code here\r\n }\r\n tm.setTreatmentNameProperty(t.getNewValue());\r\n }\r\n }\r\n });\r\n //medicine id editable\r\n medicineIDColumn.setEditable(true);\r\n medicineIDColumn.setCellFactory(TextFieldTableCell.forTableColumn());\r\n medicineIDColumn.setOnEditCommit(new EventHandler<TableColumn.CellEditEvent<treatment, String>>() {\r\n\r\n @Override\r\n public void handle(TableColumn.CellEditEvent<treatment, String> t){\r\n treatment tm = ((treatment) t.getTableView().getItems().get(t.getTablePosition().getRow()));\r\n //if text field is left empty, show error\r\n if (t.getNewValue().length() == 0){\r\n dataRefresh();\r\n Notifications.create().title(\"Error Updating Treatment's Medicine ID\")\r\n .text(\"Treatment's Medicine ID text field is empty. Text fields may not be left empty. Please insert a valid Treatment's Medicine ID!\")\r\n .showError();\r\n }\r\n /*\r\n else if (checkDuplicate(t.getNewValue())){\r\n dataRefresh();\r\n Notifications.create().title(\"Duplicate Error Updating Treatment ID\")\r\n .text(\"Treatment ID already exists. Please insert a valid Treatment ID that does not already exist!!\")\r\n .showError();\r\n }\r\n */\r\n //else update medicine id\r\n else {\r\n String dataUpdate = \"update treatment set medicineID = ? where treatmentID = ? \";\r\n try {\r\n ps = mysql.prepareStatement(dataUpdate);\r\n ps.setString(1, t.getNewValue());\r\n ps.setString(2, tm.getIdProperty());\r\n ps.executeUpdate();\r\n ps.close();\r\n ps = null;\r\n\r\n } catch (SQLException e) {\r\n e.printStackTrace();\r\n //maybe add an exception code here\r\n }\r\n tm.setMedicineIDProperty(t.getNewValue());\r\n }\r\n\r\n }\r\n });\r\n\r\n //department id editable\r\n departmentIDColumn.setEditable(true);\r\n departmentIDColumn.setCellFactory(TextFieldTableCell.forTableColumn());\r\n departmentIDColumn.setOnEditCommit(new EventHandler<TableColumn.CellEditEvent<treatment, String>>() {\r\n\r\n @Override\r\n public void handle(TableColumn.CellEditEvent<treatment, String> t){\r\n treatment tm = ((treatment) t.getTableView().getItems().get(t.getTablePosition().getRow()));\r\n //if text field is left empty, show error\r\n if (t.getNewValue().length() == 0){\r\n dataRefresh();\r\n Notifications.create().title(\"Error Updating Treatment's Department ID\")\r\n .text(\"Treatment's Department ID text field is empty. Text fields may not be left empty. Please insert a valid Treatment Department ID!\")\r\n .showError();\r\n }\r\n /*\r\n else if (checkDuplicate(t.getNewValue())){\r\n dataRefresh();\r\n Notifications.create().title(\"Duplicate Error Updating Treatment's ID\")\r\n .text(\"Treatment ID already exists. Please insert a valid Treatment ID that does not already exist!!\")\r\n .showError();\r\n }\r\n */\r\n //else update department ID\r\n else {\r\n String dataUpdate = \"update treatment set departmentID = ? where treatmentID = ? \";\r\n try {\r\n ps = mysql.prepareStatement(dataUpdate);\r\n ps.setString(1, t.getNewValue());\r\n ps.setString(2, tm.getIdProperty());\r\n ps.executeUpdate();\r\n ps.close();\r\n ps = null;\r\n\r\n } catch (SQLException e) {\r\n e.printStackTrace();\r\n //maybe add an exception code here\r\n }\r\n tm.setDepartmentIDProperty(t.getNewValue());\r\n }\r\n\r\n }\r\n });\r\n //disease id editable\r\n diseaseIDColumn.setEditable(true);\r\n diseaseIDColumn.setCellFactory(TextFieldTableCell.forTableColumn());\r\n diseaseIDColumn.setOnEditCommit(new EventHandler<TableColumn.CellEditEvent<treatment, String>>() {\r\n\r\n @Override\r\n public void handle(TableColumn.CellEditEvent<treatment, String> t){\r\n treatment tm = ((treatment) t.getTableView().getItems().get(t.getTablePosition().getRow()));\r\n //if text field is left empty, show error\r\n if (t.getNewValue().length() == 0){\r\n dataRefresh();\r\n Notifications.create().title(\"Error Updating Treatment's Disease ID\")\r\n .text(\"Treatment's Disease ID text field is empty. Text fields may not be left empty. Please insert a valid Treatment Disease ID!\")\r\n .showError();\r\n }\r\n /*\r\n else if (checkDuplicate(t.getNewValue())){\r\n dataRefresh();\r\n Notifications.create().title(\"Duplicate Error Updating Treatment ID\")\r\n .text(\"Treatment ID already exists. Please insert a valid Treatment ID that does not already exist!!\")\r\n .showError();\r\n }\r\n */\r\n //else update disease ID\r\n else {\r\n String dataUpdate = \"update treatment set diseaseID = ? where treatmentID = ? \";\r\n try {\r\n ps = mysql.prepareStatement(dataUpdate);\r\n ps.setString(1, t.getNewValue());\r\n ps.setString(2, tm.getIdProperty());\r\n ps.executeUpdate();\r\n ps.close();\r\n ps = null;\r\n\r\n } catch (SQLException e) {\r\n e.printStackTrace();\r\n //maybe add an exception code here\r\n }\r\n tm.setDiseaseIDProperty(t.getNewValue());\r\n }\r\n }\r\n });\r\n }",
"public void setValueAt(Object value, int row, int col) {\r\n pvValues[row][col] = value;\r\n fireTableCellUpdated(row, col);\r\n }",
"public synchronized void setCellValue(byte in_cellValue)\n {\n cellValue = (in_cellValue > DEAD) ? ALIVE : DEAD;\n }",
"public void tableChanged(TableModelEvent e) {\n int row = e.getFirstRow();\n TableModel model = (TableModel)e.getSource();\n// Als er een wijziging is aangebracht de 'opslaan' knop activeren\n btnOpslaan.setEnabled(true);\n lblSysteemMelding.setText(\" \");\n// Juiste gegevens voor in de db bepalen aan de hand van de status van een gebruiker.\n int rolID;\n if (model.getValueAt(row,5).equals(\"Gedeactiveerd\")){\n rolID = 2;\n } else if (model.getValueAt(row,5).equals(\"Administrator\")) {\n rolID = 3;\n } else {\n rolID = 4;\n }\n// Wijziging klaarzetten voor opslag repo / db.\n beheerGebruikersController.buildUpdate(new Administrator(\n (String)model.getValueAt(row,3),\n (String)model.getValueAt(row,1),\n (String)model.getValueAt(row,2),\n rolID,\n (String)model.getValueAt(row,4),\n (String)model.getValueAt(row,0),\n 0));\n\n }",
"@Override\n public boolean isCellEditable(int row, int column) \n {\n return false;\n }",
"public void valueChanged(ListSelectionEvent event) {\n try{\n System.out.println(jTable1.getValueAt(jTable1.getSelectedRow(), 1).toString());\n formArtist = (Artist) jTable1.getValueAt(jTable1.getSelectedRow(), 1);\n \n updateData();\n }\n catch(Exception e){\n \n }\n }",
"final private void fireColumnChanged( final int columnIndex )\r\n {\r\n final int rowCount = getRowCount();\r\n if( rowCount > 0 )\r\n {\r\n final TableModelEvent tme = new TableModelEvent\r\n ( this\r\n , 0\r\n , rowCount - 1\r\n , columnIndex\r\n , TableModelEvent.UPDATE\r\n );\r\n fireTableChanged( tme );\r\n }\r\n }",
"private void updateTable() {\n updateTableData();\n TableModelEvent e = new TableModelEvent(articleTableModel);\n\n articleTable.tableChanged(e);\n }",
"@Override\n\tpublic void valueChange(ValueChangeEvent event) {\n\t\t\n\t}",
"public void setValueAt(Object value, int row, int col) {\n\t\tList rowList = data.get(row);\n\t\t\n\t\t// make this row long enough\n\t\tif (col>=rowList.size()) {\n\t\t\twhile (col>=rowList.size()) rowList.add(null);\n\t\t}\n\n\t\t// install the data\n\t\trowList.set(col, value);\n\t\t\n\t\t// notify model listeners of cell change\n\t\tfireTableCellUpdated(row, col);\n\t}"
] | [
"0.7865587",
"0.73932093",
"0.73261493",
"0.6943357",
"0.68466574",
"0.679608",
"0.67103016",
"0.6661072",
"0.657268",
"0.65611786",
"0.6545059",
"0.6498529",
"0.6498529",
"0.6495536",
"0.64932466",
"0.64915895",
"0.64915895",
"0.648913",
"0.6487393",
"0.6463568",
"0.64620167",
"0.6451123",
"0.6441501",
"0.6430713",
"0.642503",
"0.6391252",
"0.6382931",
"0.6370483",
"0.6370483",
"0.63679475",
"0.6350789",
"0.6342239",
"0.6341953",
"0.6326172",
"0.6310057",
"0.6295157",
"0.62907267",
"0.62460077",
"0.62426174",
"0.6224675",
"0.6221614",
"0.62173146",
"0.6208322",
"0.6187411",
"0.61683756",
"0.6160718",
"0.61562866",
"0.6148906",
"0.6148323",
"0.613569",
"0.611547",
"0.6101773",
"0.6094379",
"0.6090673",
"0.6083408",
"0.6078228",
"0.6072861",
"0.60692155",
"0.60593224",
"0.6050832",
"0.6047592",
"0.60440177",
"0.6025599",
"0.602131",
"0.6020778",
"0.60196155",
"0.60195357",
"0.59996676",
"0.5996534",
"0.5994894",
"0.59878945",
"0.59858656",
"0.5984022",
"0.5977087",
"0.59694403",
"0.5968955",
"0.5967105",
"0.59625006",
"0.59618056",
"0.59609187",
"0.595148",
"0.5951332",
"0.5947587",
"0.5927294",
"0.59266955",
"0.5926657",
"0.59229225",
"0.5918565",
"0.5907796",
"0.58975375",
"0.5896338",
"0.5886812",
"0.58865726",
"0.58813906",
"0.58796895",
"0.58765435",
"0.5875522",
"0.58556765",
"0.5851698",
"0.58500797"
] | 0.61575407 | 46 |
[START write_message] Write a message to the database | public void basicReadWrite() {
FirebaseDatabase database = FirebaseDatabase.getInstance();
DatabaseReference myRef = database.getReference("message");
myRef.setValue("Hello, World!");
// [END write_message]
// [START read_message]
// Read from the database
myRef.addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
// This method is called once with the initial value and again
// whenever data at this location is updated.
String value = dataSnapshot.getValue(String.class);
Log.d(TAG, "Value is: " + value);
}
@Override
public void onCancelled(DatabaseError error) {
// Failed to read value
Log.w(TAG, "Failed to read value.", error.toException());
}
});
// [END read_message]
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void writeString(String message);",
"void write(String message) {\n this.message = message;\n }",
"void sendMessage(String message) {\n writer.println(message);\n }",
"public static void writeFile(String msg){\n\t\ttry { \n File f1 = new File(\"/Users/snehithraj/eclipse-workspace/ThreePhaseCommit/src/ServerDB.txt\");\n if(!f1.exists()) {\n f1.createNewFile();\n } \n FileWriter fileWriter = new FileWriter(f1.getName(),true);\n BufferedWriter bw = new BufferedWriter(fileWriter);\n bw.write(msg);\n bw.close();\n } catch(IOException e){\n e.printStackTrace();\n }\n }",
"public static void sendMessage(String message) {\r\n\t\tbtService.write(message.getBytes());\r\n\t}",
"public void writeChatServerMessage(String message) {\n\t\tSystem.out.println(\"WRITING \" + message);\n\t\tif(m_chatSession != null)\n\t\t\tm_chatSession.write(message);\n\t}",
"public void sendMessage(String message)\n\t\t{\n\t\t\twriter.println(message);\n\t\t\twriter.flush();\n\t\t}",
"public void write(String message){\n this.write(message, false);\n }",
"private void writeMessageInDataFile(String message){\n try {\n String messageToWrite = \"\\n\" + this + message;\n messagesManager.add(messageToWrite); // adds last message to last 15 messages queue\n Files.write(Paths.get(\"messages.txt\"), messageToWrite.getBytes(), StandardOpenOption.APPEND); // writes last message in messages database\n }catch (IOException e) {\n System.err.println(\"*** ERROR ***\\nCouldn't write in data file.\");\n }\n }",
"public void sendMessage(String message) {}",
"private static void write(String message) {\n\t\tFile log = new File(filePath);\t// File for the database log\n\t\tboolean isNew = false;\t\t\t// Stores if the file created is a new or an old one\n\t\t\n\t\ttry {\n\t\t\tif (!log.exists()) {\n\t\t\t\tisNew = log.createNewFile();\n\t\t\t} // End if\n\t\t\tPrintWriter pw = new PrintWriter(new FileWriter(log, true));\n\t\t\t\n\t\t\tif (Boolean.TRUE.equals(isNew)) {\n\t\t\t\tpw.append(\"Database operations log:\");\n\t\t\t} // End if\n\t\t\tpw.append(message);\n\t\t\tpw.close();\n\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"public void sendMessage(String message){\n pw.print(message);\n pw.flush();\n }",
"public void sendMessage(String message) {\n printWriter.append(message);\n printWriter.flush();\n }",
"public static void write(String message) {\n System.out.println(message);\n }",
"public void sendMessage(String message) {\n try {\n bos.write(message);\n bos.newLine();\n bos.flush();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"public void sendMessageToServer(String message) {\n if (outputStream != null) {\n outputStream.println(message);\n } else {\n System.out.println(\"No OutputStream!\");\n }\n }",
"public void sendMessage(String message);",
"void saveMessage(int id,String msg) throws SQLException {\n\t\tpst=con.prepareStatement(\"INSERT INTO message VALUES(?,?)\");\n\t\tpst.setInt(1, id);\n\t\tpst.setString(2, msg);\n\t\t\n\t\tpst.executeUpdate();\n\t}",
"public boolean send_message(String SID, String RID, String message)\r\n {\r\n DBConnect db = new DBConnect();\r\n try\r\n {\r\n \r\n String SQL = \"insert into MESSAGES(SID, RID,message) values ('\" + SID + \"', '\" + RID + \"', '\"+ message + \"')\";\r\n System.out.println(\"\"+SQL);\r\n try\r\n {\r\n \r\n db.pstmt = db.conn.prepareStatement(SQL);\r\n \r\n try\r\n {\r\n if (db.pstmt.executeUpdate() != 0)\r\n return true;\r\n }\r\n catch(Exception e)\r\n {\r\n\r\n }\r\n } \r\n catch(Exception e)\r\n {\r\n \r\n }\r\n finally\r\n {\r\n try\r\n {\r\n db.conn.close();\r\n }\r\n catch (Exception e)\r\n {\r\n \r\n }\r\n }\r\n } \r\n catch(Exception e)\r\n {\r\n \r\n }\r\n return false;\r\n}",
"public void sendMessage(String message){\n\t if (mOut != null && !mOut.checkError()) {\n\t mOut.println(message+\"\\n\");\n\t mOut.flush();\n\t }\n\t }",
"public static void write(String path, String message) {\r\n\t\t\r\n\t\t// open the file\r\n\t\tFile file = new File(path);\r\n\t\t\r\n\t\t\r\n\t\t// if the file does not exist try to create one\r\n\t\tif (!file.exists())\r\n\t\t\tfile = createFile(path);\r\n\t\t\r\n\t\t\r\n\t\t// write to the file\r\n\t\ttry {\r\n\t\t\t// open stream\r\n\t\t\tFileWriter fWrite = new FileWriter(file);\r\n\t\t\tBufferedWriter bufferedWriter = new BufferedWriter(fWrite);\r\n\t\t\t\r\n\t\t\t// write new lines if any was found\r\n\t\t\tfor (String i : message.split(\"(\\n)+\")) {\r\n\t\t\t\tbufferedWriter.write(i);\r\n\t\t\t\tbufferedWriter.newLine();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// close anything was opened\r\n\t\t\tbufferedWriter.close();\r\n\t\t\tfWrite.close();\r\n\r\n\t\t} catch (Exception e) {\r\n\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t}",
"public void write(String message) {\n System.out.println(\"Sent \" + message + \" to client \" + client + \".\");\n out.println(message);\n }",
"void messageWriter(MessageWriter messageWriter);",
"public void sendMessage(String message) {\n\t\tsocketTextOut.println(message);\n\t\tsocketTextOut.flush();\n\t}",
"@Override\n\tpublic void SendMessage(String message) {\n\t\t\n\t\ttry\n\t\t{\n\t\tprintWriters.get(clients.get(0)).println(message);\n\t\t}\n\t\tcatch(Exception e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\n\t}",
"public synchronized void writeLogMessage(String message){\n\t\tTimestamp timeStamp= new Timestamp(System.currentTimeMillis());\n\t\tString key = this.sessionName + \" \" + timeStamp;\n\t\tString value = message; \n\t\ttry {\n\t\t\tPrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(this.filename, true)));\n\t\t\tout.println(key + \" : \" + value);\n\t\t\tout.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t\tSystem.out.println(\"There was an error writing to the log\");\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\n\t}",
"void sendMessage(String msg);",
"public void write(String message) {\n Log.d(TAG, \"...Data to send: \" + message + \"...\");\n byte[] msgBuffer = message.getBytes();\n try {\n mmOutStream.write(msgBuffer);\n } catch (IOException e) {\n Log.d(TAG, \"...Error data send: \" + e.getMessage() + \"...\");\n }\n }",
"public void write(String message) {\n Log.d(TAG, \"...Data to send: \" + message + \"...\");\n byte[] msgBuffer = message.getBytes();\n try {\n mmOutStream.write(msgBuffer);\n } catch (IOException e) {\n Log.d(TAG, \"...Error data send: \" + e.getMessage() + \"...\");\n }\n }",
"public void write(String message) {\n\t Log.d(TAG, \"...Данные для отправки: \" + message + \"...\");\n\t byte[] msgBuffer = message.getBytes();\n\t try {\n\t mmOutStream.write(msgBuffer);\n\t } catch (IOException e) {\n\t Log.d(TAG, \"...Ошибка отправки данных: \" + e.getMessage() + \"...\"); \n\t }\n\t }",
"public synchronized void write(String message) {\n\t\tcontent.add(message);\n\n\t\tnotify();\n }",
"public void WriteCypherMessage(String m)\r\n {\r\n WriteMessage(Cypher(m.getBytes()));\r\n }",
"public synchronized int saveMessageToDB(Connection connection, String message) throws SQLException\n {\n message = message.replaceAll(\"<p> </p>\", \"\");\n String queryFormat = \"INSERT INTO messagetext (messageText) VALUES('\" + message + \"')\";\n Statement statement = (Statement) connection.createStatement();\n boolean rowsAffected = statement.execute(queryFormat);\n if(rowsAffected) {\n System.out.println(\"Error in getting ID\");\n return 0;\n }\n ResultSet result = statement.executeQuery(\"SELECT LAST_INSERT_ID() AS id\");\n result.next();\n int messageTextID = result.getInt(\"id\");\n return messageTextID;\n }",
"public void WriteMessage(byte[] message)\r\n {\r\n try {\r\n out.write(new Integer(message.length).byteValue());\r\n out.write(message);\r\n out.flush();\r\n }catch (Exception e){\r\n System.out.println(e);\r\n }\r\n }",
"@Override\r\n\tpublic void sendMessage(String message) {\n\t\t\r\n\t}",
"public void writeMassege() {\n m = ChatClient.message;\n jtaChatHistory.setText(\"You : \" + m);\n //writeMassageServer();\n }",
"public void writeTcpMessage(String message) {\n\t\tm_tcpSession.write(message);\n\t}",
"void appendMessage(String message) throws RemoteException;",
"private void updateDatabase(users.Message msg, DatabaseConnection dc) {\n\t\tStringBuilder sb = new StringBuilder();\n\t\tsb.append(\"INSERT into \" + this.messagesTable + \" \");\n\t\tsb.append(\"(id, type, datesent, timesent, senderid, receiverid, opened, replied, subject, body) \");\n\t\tsb.append(\"VALUES \"); //(1, 2, 3, \"20141225\", 100, 5);\");\n\t\tsb.append(\"(\" + msg.id + \", \" + msg.type + \", \");\n\t\tsb.append(\"\\\"\"+msg.datesent + \"\\\", \\\"\" + msg.timesent + \"\\\", \");\n\t\tsb.append(msg.senderid + \", \\\"\" + msg.receiverid + \"\\\", \");\n\t\tsb.append(msg.opened + \", \" + msg.replied + \", \");\n\t\tsb.append(\"\\\"\"+msg.subject + \"\\\", \\\"\" + msg.body + \"\\\");\");\n\t\tdc.executeUpdate(sb.toString());\n\t}",
"public void sendMessage(ChatMessage msg) {\n\t\ttry {\n\t\t\tsOutput.writeObject(msg);\n\t\t}\n\t\tcatch(IOException e) {\n\t\t\tdisplay(\"Exception writing to server: \" + e);\n\t\t}\n\t}",
"@Override\r\n\tpublic void addMessage(Integer receive_id, Integer send_id, String content,Timestamp createtime) {\n\t\tString sql=\"insert into message(receive_id,send_id,content,createtime,isread,result) values(?,?,?,?,?,?)\";\r\n\t\tObject[] args=new Object[] {receive_id,send_id,content,createtime,0,0};\r\n\t\ttry {\r\n\t\t\tupdate(conn, sql, args);\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}",
"public int insertChatMessage(String username, String message)throws SQLException {\n String query = \"INSERT INTO \"+TABLE+\" VALUES(?,?,?)\";\n java.sql.Timestamp date = new java.sql.Timestamp(new java.util.Date().getTime());\n PreparedStatement ps = connection.prepareStatement(query);\n ps.setTimestamp(1, date);\n ps.setString(2, username);\n ps.setString(3, message);\n \n int res = ps.executeUpdate();\n return res;\n }",
"public synchronized void send(String message) {\n writer.println(message);\n writer.flush();\n }",
"public void write(String message) {\n Log.d(TAG, \"...Данные для отправки: \" + message + \"...\");\n byte[] msgBuffer = message.getBytes();\n try {\n mmOutStream.write(msgBuffer);\n } catch (IOException e) {\n Log.d(TAG, \"...Ошибка отправки данных: \" + e.getMessage() + \"...\");\n }\n }",
"long sendMessage(int roomId, String message) throws RoomNotFoundException, RoomPermissionException, IOException;",
"public void putMessage (Message message);",
"void sendMessage(String message) throws SocketIOException;",
"private void handleWrite(SelectionKey key, String message, SSLClientSession session) throws IOException {\n\t\t\tSSLSocketChannel ssl_socket_channel = session.getSSLSocketChannel();\n\t\t\t\n\t\t\tByteBuffer out_message = ssl_socket_channel.getAppSendBuffer();\n\t\t\t\n\t\t\tif(message != null) \n\t\t\t\tout_message.put(message.getBytes());\n\t\t\t\n//\t\t\tOutputHandler.println(\"Server: writing \"+new String(out_message.array(), 0, out_message.position()));\n\t\t\tint count = 0;\n\t\t\t\n\t\t\twhile (out_message.position() > 0) {\n\t\t\t\tcount = ssl_socket_channel.write();\n\t\t\t\tif (count == 0) {\n//\t\t\t\t\tOutputHandler.println(\"Count was 0.\");\n\t\t\t\t\tbreak;\n\t\t\t\t}\n//\t\t\t\telse {\n//\t\t\t\t\tOutputHandler.println(\"Count was \"+count);\n//\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (out_message.position() > 0) {\n\t\t\t\t// short write:\n\t\t\t\t// Register for OP_WRITE and come back here when ready\n\t\t\t\tkey.interestOps(key.interestOps() | SelectionKey.OP_WRITE);\n\t\t\t\t\n\t\t\t\tsession.rewrite = true;\n\t\t\t} else {\n\t\t\t\tif(session.out_messages.isEmpty()) { \n\t\t\t\t\t// Write succeeded, don�t need OP_WRITE any more\n\t\t\t\t\tkey.interestOps(key.interestOps() & ~SelectionKey.OP_WRITE);\n\t\t\t\t} \n\t\t\t\t\n\t\t\t\tsession.rewrite = false;\n\t\t\t}\n\t\t}",
"public void storeMessage(Message message) {\n Entity messageEntity = new Entity(\"Message\", message.getId().toString());\n messageEntity.setProperty(\"user\", message.getUser());\n messageEntity.setProperty(\"text\", message.getText());\n messageEntity.setProperty(\"timestamp\", message.getTimestamp());\n\n datastore.put(messageEntity);\n }",
"public void write(String message) throws DukeException {\n try {\n this.writer.write(message);\n } catch (IOException e) {\n throw Ui.ioException(e);\n }\n }",
"@Override\n\tpublic void write(Message arg0) throws JMSException {\n\n\t}",
"void messageSent();",
"public void writeMessage(String message) throws IOException\n\t{\n\t\tSystem.out.println(\"______Writing______\");\n\t\twriter.write(\"PRIVMSG \" + StaticVariables.CHANNEL + \" :\" + message + \"\\r\\n\");\n\t\twriter.flush();\n\t}",
"public static void sendMessage(String message) {\n getBwapi().sendText(message);\n }",
"public void addMessage(String message);",
"public abstract void outWrite(final String msg);",
"@Override\n public void sendMessage(Message<JsonPayload> message) throws IOException {\n System.out.println(\"Trying to send a message...\");\n outputMessageStream.write(message.getContent().getJson());\n outputMessageStream.newLine();\n outputMessageStream.flush();\n socket.shutdownOutput();\n }",
"public void sendMessage(String message) {\n\n\t\tif (mOut != null && !mOut.checkError()) {\n\n\t\t\t// If encryption connection has been made\n\n\t\t\tif (diffieHellmanModule.isConnected()) {\n\t\t\t\tmessage = diffieHellmanModule.encryptString(message);\n\t\t\t}\n\n\t\t\tmOut.println(message);\n\t\t\tmOut.flush();\n\t\t}\n\t}",
"public void sendMessage(String message) {\n\t\tSystem.out.println(\"DEBUG : response sent by server = \" + message);\n\t\tprinter.println(message);\n\t}",
"public static void storeMessage(Message m, String destination)\n\t\t\tthrows Exception {\n\t\tString filename = destination + DB_FILE_TYPE;\n\t\tString path = DB_FOLDER + filename;\n\n\t\tFile f = new File(path);\n\t\tFileWriter fr = new FileWriter(f, true);\n\t\tPrintWriter pr = new PrintWriter(fr);\n\t\t// Saves the message for the destination.\n\t\t// Sets the UID of the message to be stored.\n\t\tint nextUid = getNextUid(destination);\n\t\tm.setUid(nextUid);\n\t\t// write the json string of the message to the file\n\t\tpr.println(m.getJSONString());\n\n\t\tfr.close();\n\t\tpr.close();\n\t}",
"private static void storeMessage(String tokenId,String db,String user,String password){\n JSONArray jsonArray = getMailMessageList(tokenId);\n for (int i=0; i<jsonArray.length();i++)\n {\n for (int j=0;j<jsonArray.getJSONObject(i).getJSONArray(\"messages\").length();j++)\n {\n String messageId = jsonArray.getJSONObject(i).getJSONArray(\"messages\").getJSONObject(j)\n .getString(\"id\");\n addIntoDB(getMailMessage(tokenId, messageId),db,user,password);/*insert each mail details into DB */\n }\n }\n }",
"public void writeThrough(Message message) {\n Entity messageEntity = new Entity(\"chat-messages\", message.getId().toString());\n messageEntity.setProperty(\"uuid\", message.getId().toString());\n messageEntity.setProperty(\"conv_uuid\", message.getConversationId().toString());\n messageEntity.setProperty(\"author_uuid\", message.getAuthorId().toString());\n messageEntity.setProperty(\"content\", message.getContent());\n messageEntity.setProperty(\"creation_time\", message.getCreationTime().toString());\n datastore.put(messageEntity);\n }",
"public void createMessage(int tid, int uid, int rank, String detail);",
"public void save(String msg) {\n\t\tSystem.out.println(\"测试——msg\"+msg);\n\t}",
"public int Write(String message) {\n\tchildStdin.AddCharacters(message);\n\treturn message.length();\n }",
"public void writeMsg(MamaMsg msg, MamaDictionary dictionary, MamaSubscription subscription);",
"public void writeToFile(String messageToWrite) throws IOException {\n writer.write(messageToWrite);\n }",
"public void sendTextMessageViaHANBExample(String message) \n throws InstanceNotFoundException, MBeanException, ReflectionException;",
"public static void sendMessages(String fileName, String message) {\r\n\r\n try {\r\n String stagFile = getStageFile(fileName);\r\n if(!Files.exists(Paths.get(stagFile))) Files.createFile(Paths.get(stagFile));\r\n Files.write(Paths.get(getStageFile(fileName)),\r\n message.getBytes(), StandardOpenOption.APPEND);\r\n ServerFunc.printToConsole(\"INFO\",\"Appending local staging file @\" + getStageFile(fileName));\r\n\r\n } catch (IOException ioe) {\r\n ioe.printStackTrace();\r\n }\r\n }",
"private void writeMessage(Message message) throws IOException {\n Message.Command temp = message.getCommand();\n if (temp != Message.Command.GET_RESERVED && temp != Message.Command.GET_AVAILABLE) {\n connectionLoggerService.add(\"Bank : \" + message.toString());\n }\n objectOutputStream.reset();\n objectOutputStream.writeObject(message);\n }",
"public void sendMessage ( String message ) {\n\t\texecute ( handle -> handle.sendMessage ( message ) );\n\t}",
"protected void sendMessage(final String message) {\n\n logger.debug(LOG_TAG + \".sendMessage()\");\n\n // send message to client\n printWriter.println(message);\n\n }",
"public void clientToServerChatMessage(String message){\n String chatMessage = message;\n System.out.println(\"chatmessage\" + chatID + \" \" + chatMessage);\n toServer.println(\"chatmessage\" + chatID + \" \" + chatMessage);\n toServer.flush();\n }",
"public void sendMessage(String message) {\r\n\r\n synchronized (this) {\r\n //count++;\r\n if (mBufferOut != null && !mBufferOut.checkError()) {\r\n Log.i(TAG, \"message: \" + message);\r\n mBufferOut.print(message);\r\n mBufferOut.flush();\r\n }\r\n }\r\n }",
"public void postMessage(Message message){\n messageRepository.addMessage(message);\n }",
"public void sendMessage(String msg){\n \n try{\n out.writeObject(msg.toString()); \n \n }catch(Exception e){\n e.printStackTrace();\n }\n }",
"public void sendMessage(NetMessage message) {\n ClientDirector.getDataManager().sendMessage(message);\n }",
"private void sendMessage(String content, String room) {\n }",
"public void saveMessage(Message message) {\n log.info(\"Saved message: \" + message.getText());\n }",
"private void sendMessage(String message){\n PostTask pt = new PostTask();\n pt.execute();\n }",
"void sendMessage(ChatMessage msg) {\n\t\ttry {\n\t\t\tsOutput.writeObject(msg);\n\t\t}\n\t\tcatch(IOException e) {\n\t\t\tdisplay(\"Não foi possível enviar a mesagem !!!\");\n\t\t}\n\t}",
"@Override\r\n public void writeMessage(Message msg) throws IOException {\n final StringBuilder buf = new StringBuilder();\r\n msg.accept(new DefaultVisitor() {\r\n\r\n @Override\r\n public void visitNonlocalizableTextFragment(VisitorContext ctx,\r\n NonlocalizableTextFragment fragment) {\r\n buf.append(fragment.getText());\r\n }\r\n\r\n @Override\r\n public void visitPlaceholder(VisitorContext ctx, Placeholder placeholder) {\r\n buf.append(placeholder.getTextRepresentation());\r\n }\r\n\r\n @Override\r\n public void visitTextFragment(VisitorContext ctx, TextFragment fragment) {\r\n buf.append(fragment.getText());\r\n }\r\n });\r\n out.write(buf.toString().getBytes(UTF8));\r\n }",
"private void write(String command) throws IOException {\n if (connected) {\n try {\n writer.write(command);\n writer.newLine();\n writer.flush();\n } catch (IOException e) {\n System.out.println(\"Could not read from server -> ServerCommunication:write()\");\n System.out.println(e);\n }\n } else {\n throw new IOException(\"Not Connected\");\n }\n }",
"private void sendMessageToClient(String message) {\n try {\n outputStream.writeObject(message);\n outputStream.flush();\n } catch (IOException e) {\n System.out.println(\"Erreur lors de l'envoi du message au client\");\n }\n }",
"public void storeMessage(Message message) {\n Entity messageEntity = new Entity(\"Message\", message.getId().toString());\n messageEntity.setProperty(\"user\", message.getUser());\n messageEntity.setProperty(\"text\", message.getText());\n messageEntity.setProperty(\"timestamp\", message.getTimestamp());\n messageEntity.setProperty(\"recipient\", message.getRecipient());\n datastore.put(messageEntity);\n }",
"public void sendMessage(ChatMessage msg) {\n try{\n loginOutput.writeObject(msg);\n }\n catch(IOException e){\n display(\"Exception on send message to server: \" + e);\n }\n }",
"public void writeMessage( String message ) {\n\t\tui.writeMessage(message);\n\t}",
"public void sendMessage(String msg) {\n try {\n out.write(msg);\n out.newLine();\n out.flush();\n \n } catch (IOException e) {\n \tshutdown();\n e.printStackTrace();\n }\n }",
"public void sendMessageToRabbitMQ(String message) {\n CachingConnectionFactory connectionFactory = new CachingConnectionFactory(rabbitProperties.getHost(), rabbitProperties.getPort());\n connectionFactory.setUsername(rabbitProperties.getUsername());\n connectionFactory.setPassword(rabbitProperties.getPassword());\n connectionFactory.setVirtualHost(rabbitProperties.getVirtualHost());\n AmqpAdmin admin = new RabbitAdmin(connectionFactory);\n admin.declareQueue(new Queue(\"/topic/tracker-data\"));\n AmqpTemplate template = new RabbitTemplate(connectionFactory);\n template.convertAndSend(\"/topic/tracker-data\", message);\n connectionFactory.destroy();\n simpMessagingTemplate.convertAndSend(\"/topic/tracker-data\", message);\n }",
"private void sendData(String message) {\n\t\t\ttry {\n\t\t\t\toutput.writeObject(message);\n\t\t\t\toutput.flush(); // flush output to client\n\t\t\t} catch (IOException ioException) {\n\t\t\t\tSystem.out.println(\"\\nError writing object\");\n\t\t\t}\n\t\t}",
"private void sendMessage(String message){\n\t\ttry{\n\t\t\toutput.writeObject(\"Punk Ass Server: \" + message);\n\t\t\toutput.flush();\n\t\t\tshowMessage(\"\\nPunk Ass Server: \" + message); \n\t\t}catch(IOException ioe){\n\t\t\tchatWindow.append(\"\\n Message not sent, try again or typing something else\");\n\t\t\t\n\t\t}\n\t\t\n\t}",
"void send(String message);",
"void writeData(String messageToBeSent) {\n\n try {\n if (clientSocket != null) {\n outputStream = clientSocket.getOutputStream();\n ObjectOutputStream objectOutputStream = new ObjectOutputStream(outputStream);\n objectOutputStream.writeObject(messageToBeSent);\n outputStream.flush();\n }\n\n if (getLog().isDebugEnabled()) {\n getLog().debug(\"Artifact configurations and test cases data sent to the synapse agent successfully\");\n }\n } catch (IOException e) {\n getLog().error(\"Error while sending deployable data to the synapse agent \", e);\n }\n }",
"private void sendMessage(String sender, String receiver, String msg) {\n //Map key value pairs\n Map<String, Object> message = new HashMap<>();\n message.put(\"sender\", sender);\n message.put(\"receiver\", receiver);\n message.put(\"message\", msg);\n message.put(\"isSeen\", false);\n message.put(\"createdAt\", FieldValue.serverTimestamp());\n\n //Upload to firestore\n db.collection(\"messages\").document()\n .set(message)\n .addOnSuccessListener(aVoid -> Utility.showToast(this, \"Message sent\"))\n .addOnFailureListener(e -> {\n Utility.showToast(this, \"Error: Submission failed\");\n Log.w(TAG, \"Error writing document\", e);\n });\n }",
"void write(String text);",
"protected void doWrite(Message<?> message) {\n\t\ttry {\n\t\t\tTcpConnection connection = getConnection();\n\t\t\tif (connection == null) {\n\t\t\t\tthrow new MessageMappingException(message, \"Failed to create connection\");\n\t\t\t}\n\t\t\tif (logger.isDebugEnabled()) {\n\t\t\t\tlogger.debug(\"Got Connection \" + connection.getConnectionId());\n\t\t\t}\n\t\t\tconnection.send(message);\n\t\t} catch (Exception e) {\n\t\t\tString connectionId = null; \n\t\t\tif (this.connection != null) {\n\t\t\t\tconnectionId = this.connection.getConnectionId();\n\t\t\t}\n\t\t\tthis.connection = null;\n\t\t\tif (e instanceof MessageMappingException) {\n\t\t\t\tthrow (MessageMappingException) e;\n\t\t\t}\n\t\t\tthrow new MessageMappingException(message, \"Failed to map message using \" + connectionId, e);\n\t\t}\n\t}",
"public void sendMessageToServer(MessageWrapper message) {\n sendMessage(serviceDevice, message);\n }",
"private void sendAIUIMessage(String message) {\n AIUIMessage msg = new AIUIMessage(AIUIConstant.CMD_WRITE, 0, 0, \"data_type=text\", message.getBytes());\n mAiuiAgent.sendMessage(msg);\n }",
"public void doPost(String message) {\n\t\ttry {\n\t\t\tconnection.openOutputStream();\n\t\t} catch (IOException e) {\n\t\t\tSystem.err.println(\"Failed to post the message. \" + e);\n\t\t}\n\t}"
] | [
"0.6779535",
"0.66118914",
"0.65341854",
"0.63412106",
"0.6287925",
"0.6285562",
"0.6270428",
"0.62647235",
"0.61723",
"0.60927904",
"0.6073272",
"0.60715055",
"0.60609984",
"0.6012551",
"0.6002688",
"0.59807557",
"0.5977693",
"0.5953188",
"0.5952468",
"0.5941175",
"0.59303385",
"0.5918374",
"0.59180176",
"0.58940554",
"0.58851486",
"0.58643365",
"0.5862416",
"0.58056813",
"0.58056813",
"0.5789003",
"0.57728684",
"0.5771189",
"0.5768484",
"0.57574505",
"0.5735489",
"0.57281756",
"0.5723617",
"0.5719107",
"0.5717519",
"0.56992763",
"0.5675194",
"0.56616664",
"0.56413674",
"0.56411356",
"0.562958",
"0.56169415",
"0.56102794",
"0.5604312",
"0.55990696",
"0.55854404",
"0.5573191",
"0.5571357",
"0.5571033",
"0.5570201",
"0.554896",
"0.55384374",
"0.55348545",
"0.55283666",
"0.55280805",
"0.55197525",
"0.55192906",
"0.5518451",
"0.55128855",
"0.5505978",
"0.55059487",
"0.5503137",
"0.55008805",
"0.54988503",
"0.54973066",
"0.54915506",
"0.54900396",
"0.54887336",
"0.5485215",
"0.5484445",
"0.5473787",
"0.5463199",
"0.5460779",
"0.5460168",
"0.5454561",
"0.5443387",
"0.5442895",
"0.543748",
"0.54340214",
"0.54323846",
"0.5428206",
"0.54262817",
"0.54238236",
"0.54129636",
"0.541282",
"0.54057205",
"0.54002464",
"0.53996116",
"0.53892016",
"0.53857076",
"0.5384672",
"0.53793025",
"0.53779626",
"0.5371037",
"0.5370885"
] | 0.592176 | 22 |
This method is called once with the initial value and again whenever data at this location is updated. | @Override
public void onDataChange(DataSnapshot dataSnapshot) {
String value = dataSnapshot.getValue(String.class);
Log.d(TAG, "Value is: " + value);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tprotected void init() {\n\t\tupdateValues();\r\n\t}",
"public void initialize() {\r\n\t\tsetValue(initialValue);\r\n\t}",
"private void onChange() {\n startTime = -1L;\n endTime = -1L;\n minLat = Double.NaN;\n maxLat = Double.NaN;\n minLon = Double.NaN;\n maxLon = Double.NaN;\n }",
"synchronized void reset() {\n\n // no change if called before getValue() or called twice\n lastValue = currValue = startValue;\n }",
"public void update() {\n\t\tmLast = mNow;\n\t\tmNow = get();\n\t}",
"@Override\r\n\tpublic void updateData() {\n\t\t\r\n\t}",
"private void notifyInitialValue() {\r\n if (this.bindingSource != null) {\r\n updateTarget(this.bindingSource.getInitialValue());\r\n }\r\n else {\r\n updateTarget(null);\r\n }\r\n }",
"private void Initialized_Data() {\n\t\t\r\n\t}",
"@Override\n\t\tpublic void update() {\n\n\t\t}",
"@Override\n\t\tpublic void update() {\n\n\t\t}",
"@Override\n\t\tpublic void update() {\n\n\t\t}",
"@Override\n public void onRefresh() {\n if(mLatitude == null || mLongitude == null){\n mLatitude = DEFAULT_LAT;\n mLongitude = DEFAULT_LON;\n loadZomatoData(mLatitude, mLongitude);\n } else {\n loadZomatoData(mLatitude,mLongitude);\n }\n }",
"private void setLocationData(Location location){\r\n currentLat = location.getLatitude();\r\n currentLng = location.getLongitude();\r\n }",
"public void updatePositionValue(){\n m_X.setSelectedSensorPosition(this.getFusedPosition());\n }",
"@Override\r\n\t\tpublic void update() {\n\t\t\t\r\n\t\t}",
"@Override\r\n\t\tpublic void update() {\n\t\t\t\r\n\t\t}",
"private void initValues() {\n \n }",
"public void updateInformation() {\r\n onFirstCycle = false;\r\n lastLocation = player.getLocation();\r\n preparedAppearance = false;\r\n }",
"@Override\n public void onLocationChanged(Location location) {\n mLastLocation = location;\n\n\n }",
"private void updateGeo(Double latitude, Double longitude) {\n latitudeValue = latitude;\n longitudeValue = longitude;\n }",
"private void updateLocationUI() {\n if (mCurrentLocation != null) {\n Log.e(\"UPDATE GEO\", \"LAT \" + mCurrentLocation.getLatitude() + \" LON \" +\n mCurrentLocation.getLongitude() + \" LAST UPDATE \" + mLastUpdateTime);\n }\n }",
"protected void initialize() {\n \tsetSetpoint(0.0);\n }",
"@Override\r\n\tpublic void update() {\n\t\tsuper.update();\r\n\t}",
"@Override\n\t\tpublic void onLocationChanged(Location args0) {\n\t\t\t mCurrentLocation = args0;\n\t mLastUpdateTime = DateFormat.getTimeInstance().format(new Date());\n\t updateUI();\n\n\t\t}",
"public void willbeUpdated() {\n\t\t\n\t}",
"protected void storeCurrentValues() {\n }",
"public synchronized void updateData() {\n updateDataFields(this::defaultFetcher);\n }",
"@Override\n\tpublic int update() {\n\t\treturn 0;\n\t}",
"private void initLocationData() {\n\n // init google client and request for fused location provider\n fusedLocationProviderClient = LocationServices.getFusedLocationProviderClient(context);\n\n locationRequest = new LocationRequest()\n //.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY) // GPS quality location points\n .setPriority(LocationRequest.PRIORITY_BALANCED_POWER_ACCURACY) // optimized for battery\n .setInterval(20000) // at least once every 20 seconds\n .setFastestInterval(10000); // at most once every 10 seconds\n\n locationCallback = new LocationCallback() {\n @Override\n public void onLocationResult(LocationResult locationResult) {\n\n Point userPoint;\n if (locationResult != null) {\n // update user location\n Location lastLocation = locationResult.getLastLocation();\n userPoint = new Point(lastLocation.getLatitude(), lastLocation.getLongitude());\n // cache location\n PreferencesCache.setLastLatitude(lastLocation.getLatitude());\n PreferencesCache.setLastLongitude(lastLocation.getLongitude());\n } else {\n // get cached data\n userPoint = new Point(PreferencesCache.getLastLatitude(), PreferencesCache.getLastLongitude());\n }\n\n navigator.updateUserLocation(userPoint);\n }\n };\n }",
"@Override\n protected void initialize() {\n m_oldTime = Timer.getFPGATimestamp();\n m_oldError= m_desiredDistance;\n }",
"private void reset() {\n //todo test it !\n longitude = 0.0;\n latitude = 0.0;\n IDToday = 0L;\n venVolToday = 0L;\n PM25Today = 0;\n PM25Source = 0;\n DBCanRun = true;\n DBRunTime = 0;\n isPMSearchRunning = false;\n isLocationChanged = false;\n isUploadRunning = false;\n refreshAll();\n locationInitial();\n DBInitial();\n sensorInitial();\n }",
"private void initialData() {\n\n }",
"private void updateValues(){\n if (mCelsian != null) {\n mCelsian.readMplTemp();\n mCelsian.readShtTemp();\n mCelsian.readRh();\n mCelsian.readPres();\n mCelsian.readUvaValue();\n mCelsian.readUvbValue();\n mCelsian.readUvdValue();\n mCelsian.readUvcomp1Value();\n mCelsian.readUvcomp2Value();\n }\n }",
"public void updateData() {}",
"@Override\n\tpublic void initValue() {\n\t\t\n\t}",
"@Override\n protected void initLocation() {\n }",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"@Override\n protected void onSetInitialValue(boolean restorePersistedValue,\n Object defaultValue) {\n setLocationString(restorePersistedValue ?\n getPersistedString(loc_string) : (String) defaultValue);\n }",
"@Override\n public void update() {\n \n }",
"@Override\r\n\tpublic void update() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void update() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void update() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void update() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void update() {\n\t\t\r\n\t}",
"public void updateValues() {\r\n\t\tSystem.out.println(\"LastTime: \" + lastTime);\r\n\t\t// System.out.println(\"Rerouted: \" + restoredLSP.toString());\r\n\t\t// System.out.println(\"Crack rerouted success: \" +\r\n\t\t// reroutedLSP.toString());\r\n\t\tSystem.out.println(\"Number of Crack rerouted success: \"\r\n\t\t\t\t+ reroutedLSP.size());\r\n\t}",
"@Override\r\n\tpublic void update() {\r\n\t}",
"@Override\r\n\tpublic void update() {\r\n\r\n\t}",
"@Override\r\n public void update() {\r\n this.total = calculateTotal();\r\n }",
"public void onLocationChange() {\n\t\tupdateWeather();\n\t\tgetLoaderManager().restartLoader(FORECAST_LOADER_ID, null, this);\n\t}",
"public void update() {\n\t\tupdate(1);\n\t}",
"@Override\r\n public void update() {\r\n this.highestRevenueRestaurant = findHighestRevenueRestaurant();\r\n this.total = calculateTotal();\r\n }",
"public void recalibrateData() {\r\n\t\tclicks = random.nextInt(65535); //may need tweaking. the sensor sends 2 bytes worth of data but 65k is probably too big of a range to be reasonable\r\n\t}",
"@Override\n\tpublic void onLocationChanged(Location location) {\n\t\tphysAddr = this.initLocationManager();\n\t}",
"public void init() {\n\t\tdouble v = MathUtils.toNum(get(\"value\"));\n\t\tlong v100 = (long) MathUtils.toNum(get(\"value100\"));\n\t\tif (v100 != 100*v) {\n\t\t\tv100 = (long) (v*100);\n\t\t\tput(\"value100\", v100);\n\t\t}\n\t}",
"protected void assignCurrentValue() {\n\t\tcurrentValue = new Integer(counter + incrValue);\n\t}",
"@Override\n\tprotected void onStart() {\n \tElevator.getInstance().setMotorValue(val);\n }",
"@Override\n public void onLocationChanged(Location location) {\n currentLatitude = location.getLatitude();\n currentLongitude = location.getLongitude();\n\n }",
"public void refresh() {\r\n\t\tinit();\r\n\t}",
"public void reset() {\n _valueLoaded = false;\n _value = null;\n }",
"public void startRefresh() {\n SmartDashboard.putNumber(\"Ele P\", 0.0);\n SmartDashboard.putNumber(\"Ele I\", 0.0);\n SmartDashboard.putNumber(\"Ele D\", 0.0);\n SmartDashboard.putNumber(\"Ele Set\", 0.0);\n }",
"protected void updateLocationUI() {\n if (mCurrentLocation != null) {\n //TrackDataCSVHelper myCSV2 = new TrackDataCSVHelper();\n //mDistanceFromWaypointText.setText(String.valueOf(myCSV2.getLon(track, this))); //<-- used this to test getting proper lat/lon\n //mDistanceFromWaypointText.setText(String.format(\"%s: %f\", \"Dist from WP\", mDistanceFromWaypoint));\n //mZoneStatusText.setText(\"IN THE ZONE? \" + mIsInZone);\n //mNumberUpdates.setText(String.valueOf(mNum));\n }\n }",
"public void dispatch() {\n if (getScrollChild() == null) {\n return;\n }\n\n peer.ignoreSetValue = true;\n adjuster.setValue(value);\n peer.ignoreSetValue = false;\n }",
"public void internalStore() {\r\n\t\tdata = busInt.get();\r\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\tpublic void update() {}",
"@Override\n\tpublic void update() {}",
"@Override\n \tpublic void onLocationChanged(Location location) {\n \t\tthis.location = location;\n \t}",
"public void update() {\n\t\tfinal StarSystem oldLocation = getPlayer().getLocation();\n\t\tfinal StarSystem newLocation = getChart().getSelected();\n\t\tgetPlayer().setLocation(newLocation);\n\t\tgetPlayer().setFuel(-oldLocation.distanceToStarSystem(newLocation));\n\t\tgetChart().setSelected(null);\n\t\tgetChart().repaint();\n\t\tplanetLbl.setText(\"Current Location: \" + player.getLocation().getName()\n\t\t\t\t+ \"....Tech Level: \" + player.getLocation().getTechLevel());\n\n\t}",
"@Override\n public void update() {\n }",
"private void sample() {\n Number value = gauge.get();\n this.inner.set(value != null ? value.doubleValue() : 0);\n }",
"@Override\n\tpublic void resetLocation() {\n\t\t\n\t}",
"public void reset() {\n firstUpdate = true;\n }",
"private void updateLocationUI() {\n mCurrentLocationStr = mCurrentPlace.getAddress().toString();\n mCurrentLatLng = mCurrentPlace.getLatLng();\n if(mCurrentLocationStr.isEmpty())\n mCurrentLocationStr = String.format(\"(%.2f, %.2f)\",mCurrentLatLng.latitude, mCurrentLatLng.longitude);\n\n mAddLocation.setText(mCurrentLocationStr);\n mAddLocation.setTextColor(mSecondaryTextColor);\n mClearLocation.setVisibility(View.VISIBLE);\n }",
"private void updateLocationUI() {\r\n if (mCurrentLocation != null) {\r\n CityName = mCurrentLocation.getLatitude()+ mCurrentLocation.getLongitude();\r\n }\r\n }",
"@Override\n\tpublic void update() { }",
"@Override\r\n\tpublic void update() {\n\t}",
"@Override\r\n\tpublic void update() {\n\t}",
"@Override\n public void onLocationChanged(Location location) {\n if(!firstLocCheck){\n drive = new Drive(location.getLatitude(),location.getLongitude(),Car.carList.get(carIndex),startTime);\n firstLocCheck = true;\n } else {\n Drive.curLat = location.getLatitude();\n Drive.curLong = location.getLongitude();\n }\n System.out.println(\"Location has changed\");\n System.out.println(location.getLatitude() + \" | \" + location.getLongitude());\n\n //updateLoc(location);\n //locProvider = location.getProvider();\n }",
"@Override\n public String updateLat() {\n return mylat;\n }",
"@Override\n public void onLocationChanged(Location location) {\n setLocation(location);\n mLastUpdateTime = DateFormat.getTimeInstance().format(new Date());\n mTime = new SimpleDateFormat(K.TIMESTAMP_FORMAT_STRING).format(Calendar\n .getInstance().getTime()).toString();\n androidLocationUI.updateUI();\n if (application.isLogging()) {\n new Thread(new Runnable() {\n @Override\n public void run() {\n saveData();\n }\n }).start();\n }\n }",
"@Override\n public void onConnected(Bundle arg0) {\n mLastLocation=locationHelper.getLocation();\n }",
"public void update() {\n if (System.currentTimeMillis() >= currSampleTimeInMillis + sampleDuration) {\n lastSampleTimeInMillis = currSampleTimeInMillis;\n lastPositionInTicks = currPositionInTicks;\n currSampleTimeInMillis = System.currentTimeMillis();\n currPositionInTicks = motor.getCurrentPosition();\n }\n }",
"private void assumeValues() {\n\n if (isDisposed.get()) return;\n\n {// set map values\n MapPosition currentMapPosition = this.map.getMapPosition();\n if (this.mapCenter != null && getCenterGps())\n currentMapPosition.setPosition(this.mapCenter.latitude, this.mapCenter.longitude);\n\n // heading for map must between -180 and 180\n if (mapBearing < -180) mapBearing += 360;\n currentMapPosition.setBearing(mapBearing);\n currentMapPosition.setTilt(this.tilt);\n this.map.setMapPosition(currentMapPosition);\n }\n\n if (this.myPosition != null) {\n if (!ThreadUtils.isMainThread())\n this.map.post(new Runnable() {\n @Override\n public void run() {\n myLocationModel.setPosition(myPosition.latitude, myPosition.longitude, arrowHeading);\n myLocationAccuracy.setPosition(myPosition.latitude, myPosition.longitude, accuracy);\n map.updateMap(true);\n }\n });\n else {\n myLocationModel.setPosition(myPosition.latitude, myPosition.longitude, arrowHeading);\n myLocationAccuracy.setPosition(myPosition.latitude, myPosition.longitude, accuracy);\n map.updateMap(true);\n }\n }\n\n {// set yOffset at dependency of tilt\n if (this.tilt > 0) {\n float offset = MathUtils.linearInterpolation\n (Viewport.MIN_TILT, Viewport.MAX_TILT, 0, 0.8f, this.tilt);\n this.map.viewport().setMapScreenCenter(offset);\n } else {\n this.map.viewport().setMapScreenCenter(0);\n }\n }\n\n {// set mapOrientationButton tilt\n if (this.tilt > 0) {\n float buttonTilt = MathUtils.linearInterpolation\n (Viewport.MIN_TILT, Viewport.MAX_TILT, 0, -60f, this.tilt);\n this.mapOrientationButton.setTilt(buttonTilt);\n } else {\n this.mapOrientationButton.setTilt(0);\n }\n }\n }",
"@Override\n public void update() {\n }",
"private void updateLocation() {\n myLocationOnScreenRef.set(myComponent.getLocationOnScreen());\n }",
"public void refreshData() {\n\n if (!mUpdatingData) {\n new RefreshStateDataTask().execute((Void) null);\n }\n }",
"private void setData() {\n\n }",
"public void reset(){\n value = 0;\n }",
"public void updateLocation();",
"@Override\n public void onLocationChange(Location loc) {\n user.setRelativePosition(loc.getX(), loc.getY());\n map.addStep(new PointF(loc.getX(), loc.getY()));\n //messageHandler.sendEmptyMessage(MESSAGE_REFRESH);\n }",
"@Override\n\tpublic void update() {\n\n\t}",
"@Override\n\tpublic void update() {\n\n\t}",
"@Override\n\tpublic void update() {\n\n\t}",
"@Override\n\tpublic void update() {\n\n\t}",
"@Override\n\tpublic void update() {\n\n\t}",
"@Override\n\tpublic void update() {\n\n\t}",
"protected void updateDisplay() {\r\n setValue(Integer.toString(value.getValue()));\r\n }",
"@Override\r\n\tpublic void onLocationChange(Location loc) {\n\t\tuser.setRelativePosition(loc.getX(), loc.getY());\r\n\t\tmap.addStep(new PointF(loc.getX(),loc.getY()));\r\n\t\tmessageHandler.sendEmptyMessage(MESSAGE_REFRESH);\r\n\t}",
"@Override \n public void onLocationChanged(Location location) { \n mostRecentLocation = location; \n }",
"@Override\n\tpublic void update() {\n\t\t\n\t}",
"@Override\n\tpublic void update() {\n\t\t\n\t}"
] | [
"0.6856542",
"0.6654883",
"0.6446471",
"0.64045274",
"0.62937367",
"0.62570226",
"0.62508667",
"0.624989",
"0.6217914",
"0.6217914",
"0.6217914",
"0.61913645",
"0.6187112",
"0.61626685",
"0.6160627",
"0.6160627",
"0.61481184",
"0.614558",
"0.6142754",
"0.6118363",
"0.6087983",
"0.60775137",
"0.60732204",
"0.60703427",
"0.6056895",
"0.6055453",
"0.60546345",
"0.6054223",
"0.6051069",
"0.60471123",
"0.6037719",
"0.6017332",
"0.6016473",
"0.6007601",
"0.5990483",
"0.5986395",
"0.59851384",
"0.59689265",
"0.59683985",
"0.59615046",
"0.59615046",
"0.59615046",
"0.59615046",
"0.59615046",
"0.5958242",
"0.594287",
"0.59418666",
"0.5937245",
"0.5934195",
"0.59159356",
"0.59081286",
"0.5906132",
"0.5905515",
"0.5902108",
"0.58980954",
"0.5896514",
"0.58822805",
"0.5881727",
"0.58796126",
"0.5864834",
"0.5840819",
"0.5829503",
"0.58259916",
"0.58239263",
"0.5821117",
"0.5821117",
"0.5820587",
"0.5815942",
"0.58117074",
"0.580967",
"0.5805761",
"0.5799243",
"0.5795482",
"0.57919407",
"0.57892895",
"0.5787571",
"0.5787571",
"0.5786608",
"0.5784424",
"0.5769878",
"0.57665694",
"0.5756872",
"0.57555073",
"0.5750877",
"0.57464033",
"0.5738473",
"0.57328475",
"0.5731573",
"0.5731547",
"0.57271314",
"0.57260245",
"0.57260245",
"0.57260245",
"0.57260245",
"0.57260245",
"0.57260245",
"0.5723563",
"0.572117",
"0.57182354",
"0.5716495",
"0.5716495"
] | 0.0 | -1 |
Failed to read value | @Override
public void onCancelled(DatabaseError error) {
Log.w(TAG, "Failed to read value.", error.toException());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"boolean shouldReadValue();",
"Object readValue();",
"private @NotNull ErrorValue finishReadingError()\n throws IOException, JsonFormatException {\n stepOver(JsonToken.VALUE_NUMBER_INT, \"integer value\");\n int errorCode;\n try { errorCode = currentValueAsInt(); } catch (JsonParseException ignored) {\n throw expected(\"integer error code\");\n }\n stepOver(JsonFormat.ERROR_MESSAGE_FIELD);\n stepOver(JsonToken.VALUE_STRING, \"string value\");\n String message = currentText();\n // TODO read custom error properties here (if we decide to support these)\n stepOver(JsonToken.END_OBJECT);\n return new ErrorValue(errorCode, message, null);\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(TAG, \"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(@NonNull DatabaseError databaseError) {\n Log.w(TAG, \"Failed to read value.\" + databaseError.toString());\n }",
"Text getValue() throws IOException;",
"@Override\n public void onCancelled(@NonNull DatabaseError error) {\n Log.w(TAG, \"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(\"Firebase read \", \"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n // Failed to read value\n Log.w(TAG, \"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError databaseError) {\n Log.w(TAG, \"Failed to read value.\", databaseError.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(TAG, \"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(\"Tag\",\"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(\"Tag\",\"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.d(UIUtil.TAG, \"Failed to read value.\", error.toException());\n }",
"@Test\n void deserialize_test_with_invalid_value() {\n assertThatThrownBy(\n () -> jsonConverter.readValue(\"{\\\"transport\\\": -1}\", TestDTO.class)\n ).isInstanceOf(DataConversionException.class);\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(\"TAG\", \"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(TAG, \"Failed to read value.\", error.toException());\n }",
"abstract Object getValue (String str, ValidationContext vc) throws DatatypeException;",
"@Override\r\n public void onCancelled(DatabaseError error) {\n Log.w(TAG, \"Failed to read value.\", error.toException());\r\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(\"TAG\", \"Failed to read value.\", error.toException());\n }",
"public int readValue() { \n\t\treturn (port.readRawValue() - offset); \n\t}",
"@Override\r\n public Object getValueFromString(String text_p) throws Exception\r\n {\n return null;\r\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(\"Failed to read value.\", error.toException());\n }",
"protected E readValue(LineReader reader, long indexElement) throws IOException {\n int length = (int) getValueLength(indexElement);\n if (length == 0) {\n return getValueConverter().bytesToValue(buffer, 0);\n }\n long valPos = getValuePosition(indexElement);\n if (log.isTraceEnabled()) {\n log.trace(\"readValue: Retrieving value of length \" + length + \" from file at position \" + valPos);\n }\n synchronized (this) {\n reader.seek(valPos);\n if (buffer.length < length) {\n buffer = new byte[length];\n }\n reader.readFully(buffer, 0, length);\n }\n/* for (int i = 0 ; i < length ; i++) {\n System.out.println(buffer[i]);\n }\n */\n return getValueConverter().bytesToValue(buffer, length);\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(TAG, \"Failed to read test value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(\"\", \"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(\"\", \"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(\"TAG\", \"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(\"TAG\", \"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(\"TAG\", \"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(\"TAG\", \"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(\"TAG\", \"Failed to read value.\", error.toException());\n }",
"java.lang.String getValue();",
"java.lang.String getValue();",
"java.lang.String getValue();",
"java.lang.String getValue();",
"java.lang.String getValue();",
"java.lang.String getValue();",
"public String getValue() {\n/* 99 */ return this.value;\n/* */ }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(\"Jinx\", \"Failed to read value.\", error.toException());\n }",
"@Test(expected = IllegalArgumentException.class)\n public void testFromValueWithException() {\n System.out.println(\"fromValue\");\n String value = \"DELETED\";\n StatusType expResult = StatusType.DELETED;\n StatusType result = StatusType.fromValue(value);\n assertEquals(expResult, result);\n }",
"public ValueOutOfBoundsException(String message){\n super(message);\n //do nothing else\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(null, \"Failed to read value.\", error.toException());\n }",
"private @NotNull Val finishReadingValue(@NotNull Tag tag) throws IOException, JsonFormatException {\n\n DatumType type = tag.type;\n @NotNull JsonToken token = currentToken();\n // null?\n if (token == JsonToken.VALUE_NULL) return type.createValue(null);\n // error?\n final @Nullable String firstFieldName;\n if (token == JsonToken.START_OBJECT) { // can be a record or an error\n firstFieldName = nextFieldName(); // advances to next token (field name or end object - in valid cases)\n if (JsonFormat.ERROR_CODE_FIELD.equals(firstFieldName)) return type.createValue(finishReadingError());\n } else firstFieldName = null;\n // datum\n final @NotNull Datum datum = finishReadingDatum(token, firstFieldName, type);\n return datum.asValue();\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(\"Oof2\", \"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(\"Oof2\", \"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(UIUtil.TAG, \"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(\"Payments\", \"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(\"taches \", \"Failed to read value.\", error.toException());\n }",
"String getValue();",
"String getValue();",
"String getValue();",
"String getValue();",
"String getValue();",
"String getValue();",
"String getValue();",
"String getValue();",
"String getValue();",
"String getValue();",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(\"ASDG\", \"Failed to read value.\", error.toException());\n }",
"Object nextValue() throws IOException;",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.d(\"ERROR TAG\", \"Failed to read value.\", error.toException());\n }",
"private void read() {\n\t\tticketint = preticketint.getInt(\"ticketint\", 0);\r\n\t\tLog.d(\"ticketint\", \"ticketint\" + \"read\" + ticketint);\r\n\t}",
"@BeforeStep\n\tprivate void retriveValue(StepExecution stepExecution) throws PhotoOmniException{\n\t\tif (LOGGER.isDebugEnabled()) {\n\t\t\tLOGGER.debug(\" Entering into PMByWICCustomReader.retriveValue() \");\n\t\t}\n\t\ttry {\n\t\t\tJobExecution objJobExecution = stepExecution.getJobExecution();\n\t\t\tExecutionContext objExecutionContext = objJobExecution.getExecutionContext();\n\t\t\tobjPMBYWICReportPrefDataBean = (PMBYWICReportPrefDataBean) objExecutionContext.get(\"refDataKey\");\n\t\t} catch (Exception e) {\n\t\t\tLOGGER.error(\" Error occoured at PMByWICCustomReader.retriveValue() >----> \" + e);\n\t\t\tthrow new PhotoOmniException(e.getMessage());\n\t\t}finally {\n\t\t\tif (LOGGER.isDebugEnabled()) {\n\t\t\t\tLOGGER.debug(\" Exiting From PMByWICCustomReader.retriveValue() >----> \");\n\t\t\t}\n\t\t}\n\t}",
"private void checkNotUnknown() {\n if (isUnknown())\n throw new AnalysisException(\"Unexpected 'unknown' value!\");\n }",
"public InvalidRifValueException(Throwable cause) {\n super(cause);\n }",
"@Override\r\n public void onCancelled(DatabaseError error) {\n Log.w(\"\", \"Failed to read value.\", error.toException());\r\n //showProgress(false);\r\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(TAG, \"Failed to read value.\", error.toException());\n }",
"public void testInvalidTextValueWithBrokenUTF8() throws Exception\n {\n final byte[] input = readResource(\"/data/clusterfuzz-cbor-35979.cbor\");\n try (JsonParser p = MAPPER.createParser(input)) {\n assertToken(JsonToken.VALUE_STRING, p.nextToken());\n p.getText();\n fail(\"Should not pass\");\n } catch (StreamReadException e) {\n verifyException(e, \"Truncated UTF-8 character in Short Unicode Name (36 bytes)\");\n }\n\n }",
"public Address getValue() throws UnmappedAddressException, UnalignedAddressException, WrongTypeException;",
"public String getStringValue() {\n throw new OurBadException(\" Item '\" + this.serialize() + \"' is not a string.\");\n }",
"public static int getValue_from_die()\n {\n return value_from_die;\n }",
"@Override\n public void onCancelled(@NonNull DatabaseError error) {\n Log.i(\"OnCancelled\", \"Failed to read value.\", error.toException());\n }",
"@Override\n public void onCancelled(DatabaseError error) {\n Log.w(\"error\", \"Failed to read value.\", error.toException());\n }",
"protected Object readUnknownData() throws IOException {\r\n byte[] bytesValue;\r\n Byte[] bytesV;\r\n Preferences.debug(\"Unknown data; length is \" + elementLength + \" fp = \" + getFilePointer() + \"\\n\", 2);\r\n\r\n if (elementLength <= 0) {\r\n Preferences.debug(\"Unknown data; Error length is \" + elementLength + \"!!!!!\\n\", 2);\r\n\r\n return null;\r\n }\r\n\r\n bytesValue = new byte[elementLength];\r\n read(bytesValue);\r\n bytesV = new Byte[elementLength];\r\n\r\n for (int k = 0; k < bytesValue.length; k++) {\r\n bytesV[k] = new Byte(bytesValue[k]);\r\n }\r\n\r\n return bytesV;\r\n }",
"@Test\n public void shouldThrowExceptionIfFailsToGetVariableAsIntByOid() throws IOException {\n expect(configuration.createPDU(PDU.GET)).andReturn(new PDU());\n expect(snmpInterface.send(isA(PDU.class), same(target))).andThrow(new IOException());\n\n replayAll();\n final Integer variableAsInt = session.getVariableAsInt(\"1\");\n\n assertNull(variableAsInt);\n verifyAll();\n\n }",
"public void testGetValue() {\n for (int i = 0; i < 10; i++) {\n test1.append(new Buffer(i, rec));\n }\n test1.prev();\n test1.moveToPos(8);\n assertTrue(test1.getValue().inRange(8));\n for (int i = 0; i < 10; i++) {\n test1.next();\n }\n try {\n test1.getValue();\n }\n catch (Exception e) {\n assertTrue(e instanceof NoSuchElementException);\n }\n }",
"public abstract String getValue();",
"public abstract String getValue();",
"public abstract String getValue();",
"@Override\r\n\t\tpublic long getValue() {\n\t\t\treturn -1;\r\n\t\t}",
"public void _read(org.omg.CORBA.portable.InputStream istream)\r\n {\r\n value = EtudiantDejaInscritExceptionHelper.read(istream);\r\n }"
] | [
"0.6520245",
"0.644224",
"0.62601036",
"0.6077715",
"0.6027265",
"0.59389204",
"0.5928014",
"0.5897478",
"0.5892562",
"0.5891626",
"0.5821752",
"0.5813256",
"0.5813256",
"0.58093756",
"0.58006567",
"0.5798476",
"0.5776234",
"0.5774579",
"0.57361126",
"0.5728217",
"0.57143444",
"0.5699661",
"0.56832033",
"0.5677442",
"0.5675753",
"0.5673998",
"0.5673998",
"0.5639195",
"0.5639195",
"0.5639195",
"0.5639195",
"0.5639195",
"0.56246144",
"0.56246144",
"0.56246144",
"0.56246144",
"0.56246144",
"0.56246144",
"0.5616912",
"0.56142795",
"0.5613676",
"0.5605406",
"0.5584552",
"0.5570884",
"0.5567774",
"0.5567774",
"0.55625266",
"0.5544951",
"0.55435926",
"0.55421937",
"0.55421937",
"0.55421937",
"0.55421937",
"0.55421937",
"0.55421937",
"0.55421937",
"0.55421937",
"0.55421937",
"0.55421937",
"0.5525155",
"0.55243915",
"0.55217975",
"0.5517537",
"0.551731",
"0.55162007",
"0.5509505",
"0.5503448",
"0.55026805",
"0.549577",
"0.5493651",
"0.5481864",
"0.547583",
"0.54632115",
"0.54314864",
"0.54267025",
"0.5424288",
"0.5423057",
"0.54224277",
"0.54224277",
"0.54224277",
"0.54200286",
"0.54182553"
] | 0.5678807 | 37 |
Access method for the lockFlag property. | public Integer getLockFlag() {
return lockFlag;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setLockFlag(Integer aLockFlag) {\n lockFlag = aLockFlag;\n }",
"public void setLockFlag(Integer aLockFlag) {\n lockFlag = aLockFlag;\n }",
"public void setLockFlag(Integer aLockFlag) {\n lockFlag = aLockFlag;\n }",
"public long getLockStatus() {\r\n return lockStatus;\r\n }",
"public boolean GetIsLock()\n {\n return this._lock;\n }",
"public boolean getLocked() {\n\t\treturn isLocked;\n\t}",
"public boolean isLock() {\n return isLock;\n }",
"public final boolean getLocked() {\n return locked;\n }",
"public Long getLockNum() {\n return lockNum;\n }",
"public Lock getLock();",
"public Lock getLock() {\n return lock;\n }",
"public boolean isLockEnabled() {\r\n\t\treturn lockEnabled;\r\n\t}",
"public Object getLock() {\n return dataLock;\n }",
"public final long lock() {\n explicitlyLocked = true;\n return byteBase.longLockPointer();\n }",
"public boolean isLocked() { return RMUtils.boolValue(get(\"Locked\")); }",
"public @Bool boolean getLocked()\n\t\tthrows PropertyNotPresentException;",
"@Override\n\tpublic Lock getLock() {\n\t\treturn this.lock;\n\t}",
"public int getLockon() {\r\n return lockon;\r\n }",
"@ManyToOne\n\t@JoinColumn(name=\"LockStatus\", nullable=false)\n\t@Fetch(FetchMode.SELECT)\n\t@NotFound(action=NotFoundAction.IGNORE)\n\tpublic AccessStatus getLockStatus() {\n\t\treturn this.lockStatus;\n\t}",
"public LockingMode lockingMode() {\n return lockingMode;\n }",
"public boolean isLocked() {\r\n return isLocked;\r\n }",
"public boolean isLocked();",
"@Override\n\tpublic boolean isLocked() { return true; }",
"public boolean isLocked() {\n return mLocked;\n }",
"public boolean isLocked() {\n return mLocked;\n }",
"public boolean isLocked() {\n return isLocked;\n }",
"final public Lock test_get_lock() {\r\n\t\treturn lock_;\r\n\t}",
"public LockOnChange getLockOnChangeMode(){\r\n return this.lockOnChangeMode;\r\n }",
"boolean isLocked();",
"boolean isLocked();",
"final Object getLockObject() {\n return timeManager;\n }",
"public boolean isLocked()\n\t{\n\t\treturn locked;\n\t}",
"public boolean getlock()\r\n\t{\r\n\t\tif(cnt > 10)\r\n\t\t{\r\n\t\t\tcnt = 0;\r\n\t\t\treturn unlocked;\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"public boolean isLocked() {\n\t\treturn isLocked;\n\t}",
"public String getLockId() {\n return lockId;\n }",
"public String getLockType() {\n return this.lockType;\n }",
"public boolean isLocked() {\r\n \treturn false;\r\n }",
"public ApplicationLockLevel lockLevel() {\n return this.lockLevel;\n }",
"public abstract ReentrantLock getLock();",
"public @Bool boolean isLocked()\r\n\t\tthrows PropertyNotPresentException;",
"@Override\n public int getFlag() {\n return flag_;\n }",
"@Override\n public int getFlag() {\n return flag_;\n }",
"public @NotNull ReentrantLock getLock() {\n return lock;\n }",
"public Date getLockTime() {\n\t\treturn lockTime;\n\t}",
"public void SetIsLock(boolean isLock)\n {\n this._lock = isLock;\n }",
"public Map<String, Boolean> getLockedOperations() {\n return this.lockedOperations;\n }",
"public boolean isLocked() {\n return (lockId == null ? false : true);\n }",
"public void setLockEnabled(boolean lockEnabled) {\r\n\t\tthis.lockEnabled = lockEnabled;\r\n\t}",
"public Boolean getLockAll() {\n return lockAll;\n }",
"public int getFlag()\n {\n return flag;\n }",
"public Boolean getFlag() {\n return flag;\n }",
"public Long getLockTypeId()\n/* */ {\n/* 58 */ return this.lockTypeId;\n/* */ }",
"public String getLockUser() {\n return lockUser;\n }",
"public boolean isLocked() {\n\t\tif (locked == true)\n\t\t\treturn true;\n\t\treturn false;\n\t}",
"protected final Object getTreeLock() {\n return Component.LOCK;\n }",
"public Long getOtherLockNum() {\n return otherLockNum;\n }",
"public void lock() {\n\n }",
"public void setLocked(boolean value) {\n\t\tisLocked = value;\n\t}",
"public String isLockedFor() {\n return (lockId == null ? \"\" : lockId);\n }",
"public boolean getSpecialUnlocked() {\n\t\treturn this.specialUnlocked;\n\t}",
"public void lock() {\n\t\tlocked = true;\n\t}",
"public SimpleLock readLock() {\n\n\t\treturn readerLock;\n\t}",
"final long internalLongLock() {\n return byteBase.longLockPointer();\n }",
"public boolean getFlag(){\n\t\treturn flag;\n\t}",
"@ApiModelProperty(required = true, value = \"1APP8 Managed administrative status\")\n @JsonProperty(\"locked\")\n public Boolean getLocked() {\n return locked;\n }",
"protected boolean isLock() {\r\n return Lock.isLock(this.getBlock());\r\n }",
"public Long getLock_latency() {\n return lock_latency;\n }",
"@ReturnsLock(\"RW\")\n public ReadWriteLock getLock() {\n return rwLock;\n }",
"public boolean getDoorIsLocked()\n {\n return isLocked;\n }",
"public void setLockStatus(long lockStatus) {\r\n this.lockStatus = lockStatus;\r\n }",
"public Boolean getLocked() throws NotLoadedException {\n return locked.getValue();\n }",
"public Boolean getSyncFlag() {\n return syncFlag;\n }",
"public Boolean getSyncFlag() {\n return syncFlag;\n }",
"public int getLockAddress() {\n\t\treturn 0;\n\t}",
"public Byte getModFlag() {\n return modFlag;\n }",
"public boolean getFlag() {\n\t\treturn flag;\n\t}",
"boolean isValueLocked();",
"public String getReadonlyFlag() {\n return readonlyFlag;\n }",
"PLock getLock() {\n return getTextBuffer().getLock();\n }",
"int getFlag();",
"LockLevel level();",
"Lock getLock(String lockName);",
"@Override\n public boolean isLocked(Object o) {\n return false;\n }",
"public java.lang.String getXlock () {\n\t\treturn xlock;\n\t}",
"void lock();",
"public boolean isLockerEnable(){\n return getBooleanValue(KEY_LOCKER_ENABLE);\n }",
"void getLock(QName lockQName, String lockToken, long timeToLive);",
"public final OpLockDetails getOpLock() {\n\t\treturn m_oplock;\n\t}",
"public void setLocked(boolean locked)\n\t{\n\t\tthis.locked = locked;\n\t}",
"@Override\r\n\tpublic void onLock(boolean lock) {\n\t\tthis.lock = lock;\r\n\t}",
"@GUARD\r\n\tboolean notLocked() {\r\n\t\treturn !locked;\r\n\t}",
"void setUserLocked(boolean b);",
"public java.lang.String getLocalLock() {\r\n return localLock;\r\n }",
"public ReentrantReadWriteLock getStateLock() {\n return stateLock;\n }",
"final long internalShortLock() {\n return byteBase.shortLockPointer();\n }",
"@NonNull\r\n public final Object getSeaLock() {\r\n return f_seaLock;\r\n }",
"public interface PreemptiveLock {\n\n /**\n * 尝试获得锁\n * @return 是否成功获得锁\n * @param lock\n */\n boolean getLock(String lock);\n\n /**\n * 释放锁\n * @param lock\n */\n void releaseLock(String lock);\n}",
"public abstract boolean isLocked(String oid);"
] | [
"0.7516615",
"0.7516615",
"0.7516615",
"0.7176856",
"0.711824",
"0.70147014",
"0.6980605",
"0.6948886",
"0.68920654",
"0.6846797",
"0.6838122",
"0.68128365",
"0.68127614",
"0.6782189",
"0.6777991",
"0.6767545",
"0.6729084",
"0.67289096",
"0.6670418",
"0.666866",
"0.66494",
"0.65927017",
"0.6589917",
"0.65564716",
"0.65564716",
"0.65490055",
"0.6522798",
"0.6490402",
"0.64615405",
"0.64615405",
"0.6451185",
"0.6443576",
"0.6434154",
"0.6414499",
"0.6412372",
"0.63681626",
"0.6360057",
"0.6355269",
"0.6336076",
"0.6313484",
"0.62841713",
"0.62455314",
"0.6242715",
"0.6187359",
"0.6178683",
"0.6162266",
"0.61503977",
"0.61332804",
"0.609924",
"0.6091055",
"0.6088062",
"0.60831034",
"0.6077233",
"0.60754716",
"0.6071835",
"0.6068373",
"0.6066426",
"0.60656595",
"0.6059274",
"0.60529244",
"0.60363376",
"0.6034594",
"0.6028476",
"0.6023447",
"0.60210294",
"0.6015207",
"0.6003777",
"0.59990805",
"0.59913063",
"0.59872735",
"0.59842837",
"0.59798557",
"0.59798557",
"0.59692407",
"0.5940573",
"0.59372956",
"0.5934294",
"0.59165066",
"0.5888932",
"0.5875386",
"0.5870367",
"0.5860351",
"0.58569396",
"0.5853984",
"0.58513474",
"0.5839265",
"0.58215404",
"0.57887703",
"0.57828504",
"0.5755583",
"0.5747261",
"0.5743929",
"0.57379097",
"0.57327473",
"0.5721801",
"0.5716034",
"0.5710196",
"0.5699178"
] | 0.8453918 | 2 |
Sets the value of the lockFlag property. | public void setLockFlag(Integer aLockFlag) {
lockFlag = aLockFlag;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void SetIsLock(boolean isLock)\n {\n this._lock = isLock;\n }",
"public void set(int flag)\n {\n setWaitFlags( waitFlags | flag );\n }",
"public void setLockStatus(long lockStatus) {\r\n this.lockStatus = lockStatus;\r\n }",
"public void setLocked(boolean value) {\n\t\tisLocked = value;\n\t}",
"public void lock() {\n\t\tlocked = true;\n\t}",
"protected void setFlag() {\n flag = flagVal;\n }",
"protected void setFlag() {\n flag = flagVal;\n }",
"@Override\r\n\tpublic void onLock(boolean lock) {\n\t\tthis.lock = lock;\r\n\t}",
"public Integer getLockFlag() {\n return lockFlag;\n }",
"public Integer getLockFlag() {\n return lockFlag;\n }",
"public Integer getLockFlag() {\n return lockFlag;\n }",
"public void setLockEnabled(boolean lockEnabled) {\r\n\t\tthis.lockEnabled = lockEnabled;\r\n\t}",
"public void setFlag( KerberosFlag flag )\n {\n value |= 1 << flag.getOrdinal();\n setBit( flag.getOrdinal() );\n }",
"public void setFlag( KerberosFlag flag )\n {\n int pos = MAX_SIZE - 1 - flag.getOrdinal();\n value |= 1 << pos;\n }",
"void setFlag(long flag, boolean val) {\n\t\tif (val)\r\n\t\t\tflags = flags | flag;\r\n\t\telse\r\n\t\t\tflags = flags & ~flag;\r\n\t}",
"public void setLockNum(Long lockNum) {\n this.lockNum = lockNum;\n }",
"public void setIsLocked(\r\n\t\t\t@Bool Boolean locked);",
"public void setLocked(boolean locked)\n\t{\n\t\tthis.locked = locked;\n\t}",
"void setValueLocked(boolean valueLocked);",
"public final void setLocked(final boolean lockedNew) {\n this.locked = lockedNew;\n }",
"public void setFlag( int flag )\n {\n value |= 1 << flag;\n setBit( flag );\n }",
"public void setLockKey( Long lockKey ) {\n this.lockKey = lockKey;\n }",
"public void setFlag(int flag) throws IOException\n\t{\n\t\tif ((__io__pointersize == 8)) {\n\t\t\t__io__block.writeInt(__io__address + 4, flag);\n\t\t} else {\n\t\t\t__io__block.writeInt(__io__address + 4, flag);\n\t\t}\n\t}",
"public void setFlag(int flag) throws IOException\n\t{\n\t\tif ((__io__pointersize == 8)) {\n\t\t\t__io__block.writeInt(__io__address + 20, flag);\n\t\t} else {\n\t\t\t__io__block.writeInt(__io__address + 12, flag);\n\t\t}\n\t}",
"public void setFlag(boolean bol){\n\t\tflag = bol;\n\t}",
"public void setFlag(Boolean flag) {\n this.flag = flag;\n }",
"public void setTmpLock(boolean tmpLock) {\n \t\tthis.tmpLock = tmpLock;\n \t}",
"public void setFlag(Integer flag) { this.flag = flag; }",
"void setUserLocked(boolean b);",
"public void setLockOnChangeMode(LockOnChange lockOnChangeMode){\r\n this.lockOnChangeMode = lockOnChangeMode;\r\n }",
"public void setLocksInDb(String value)\n\t{\n\t\tm_locksInDb = new Boolean(value).booleanValue();\n\t}",
"public void setPoolLocked(boolean lockingState){poolLocked=lockingState;}",
"public void setLocked(boolean aValue)\n{\n if(aValue==isLocked()) return; // If value already set, just return\n Object oldValue = put(\"Locked\", aValue); // Cache old value\n firePropertyChange(\"Locked\", oldValue, aValue, -1); // Set new value and fire PropertyChange\n}",
"public void lockGarage()\n {\n m_bGarageLock = true;\n }",
"public void lock() {\n islandLocked = true;\n }",
"public void setLockSchemaCache(boolean aBoolean) {\n\t\tcat.debug(\"Setting lockSchemaCache to: \" + aBoolean);\n\n\t\tif (aBoolean) {\n\t\t\tgrammarPool.lockPool();\n\t\t}\n\t\telse {\n\t\t\tgrammarPool.unlockPool();\n\t\t}\n\t}",
"void setWaitFlags(int value)\n {\n waitFlags = value;\n synchronized (QUEUE_LOCK)\n {\n QUEUE_LOCK.notifyAll();\n }\n }",
"public void setLock_latency(Long lock_latency) {\n this.lock_latency = lock_latency;\n }",
"protected final void lock(boolean writeLock) {\n Lock lock = writeLock ? m_lock.writeLock() : m_lock.readLock();\n lock.lock();\n }",
"public void setBusy(boolean flag) {\n isBusy = flag;\n }",
"@Test\r\n\tpublic final void testSetLock() {\r\n\t\tlistener.setLock();\r\n\t\tassertFalse(\"Listener should be locked\",listener.isLocked());\r\n\t}",
"public void setExportLock(java.lang.Boolean value);",
"public void lock() {\n\n }",
"public static void setFlags(int flag){\r\n flags |= flag;\r\n }",
"public void setFlag( int flag )\n {\n value |= 1 << ( MAX_SIZE - 1 - flag );\n }",
"public void setFlag(short flag) throws IOException\n\t{\n\t\tif ((__io__pointersize == 8)) {\n\t\t\t__io__block.writeShort(__io__address + 6, flag);\n\t\t} else {\n\t\t\t__io__block.writeShort(__io__address + 6, flag);\n\t\t}\n\t}",
"public void setSyncFlag(Boolean syncFlag) {\n this.syncFlag = syncFlag;\n }",
"public void setSyncFlag(Boolean syncFlag) {\n this.syncFlag = syncFlag;\n }",
"public void setEnabled(final boolean theFlag) {\n myEnabled = theFlag;\n }",
"public void lock() {\r\n super.lock();\r\n }",
"public void setSynchronized(boolean on) {\n if (on)\n setAccessFlags(getAccessFlags() | Constants.ACCESS_SYNCHRONIZED);\n else\n setAccessFlags(getAccessFlags() & ~Constants.ACCESS_SYNCHRONIZED);\n }",
"void lock(Connection con, EnterpriseObject eo, boolean lock)\n throws DataModifiedException {\n try {\n if ((!lock) || (eo == null) || (con.getAutoCommit())) {\n return; // no locking, no revision update\n\n }\n SBR sbr = eo.getSBR();\n String euid = eo.getEUID();\n Integer revisionNumber = sbr.getRevisionNumber();\n lockSBR(con, euid, revisionNumber);\n sbr.setRevisionNumber(sbr.getRevisionNumber().intValue() + 1);\n } catch (ObjectException ex) {\n throw new DataModifiedException(mLocalizer.t(\"OPS523: Could not lock \" +\n \"EnterpriseObject: {0}\", ex));\n } catch (SQLException se) {\n throw new DataModifiedException(mLocalizer.t(\"OPS524: Could not lock \" +\n \"EnterpriseObject: {0}\", se));\n }\n }",
"protected final synchronized void setFlag(int flag, boolean sts) {\n\t\tboolean state = (m_flags & flag) != 0 ? true : false;\n\t\tif ( state && sts == false)\n\t\t\tm_flags -= flag;\n\t\telse if ( state == false && sts == true)\n\t\t\tm_flags += flag;\n\t}",
"public void giveFlag(Flag f)\r\n\t{\r\n\t\thasFlag = true;\r\n\t\tflag = f;\r\n\t}",
"public void lock() {\n super.lock();\n }",
"public void lock() {\n super.lock();\n }",
"public void lock() {\n super.lock();\n }",
"void lock(Connection con, EnterpriseObject eo, String revisionNumber,\n boolean lock) throws DataModifiedException {\n try {\n if ((!lock) || (eo == null) || (con.getAutoCommit())) {\n return; // no locking, no revision update\n\n }\n SBR sbr = eo.getSBR();\n String euid = eo.getEUID();\n if (revisionNumber != null) {\n lockSBR(con, euid, revisionNumber);\n } else {\n Integer curRevisionNumber = sbr.getRevisionNumber();\n lockSBR(con, euid, curRevisionNumber);\n }\n sbr.setRevisionNumber(sbr.getRevisionNumber().intValue() + 1);\n } catch (ObjectException ex) {\n throw new DataModifiedException(mLocalizer.t(\"OPS525: Could not lock \" +\n \"EnterpriseObject: {0}\", ex));\n } catch (SQLException se) {\n throw new DataModifiedException(mLocalizer.t(\"OPS526: Could not lock \" +\n \"EnterpriseObject: {0}\", se));\n }\n }",
"public final long lock() {\n explicitlyLocked = true;\n return byteBase.longLockPointer();\n }",
"public void setSynchronized(boolean fSynchronized)\n {\n ensureLoaded();\n m_flags.setSynchronized(fSynchronized);\n setModified(true);\n }",
"void lockInode(Inode inode, LockMode mode);",
"public void setModifierFlag(int flag) {\n\t\tthis.modifier = flag;\n\t}",
"public void setUpdateLock()\n {\n _updateLock = Thread.currentThread();\n }",
"@Override\n public void setLockOwner(Object lockOwner) {\n }",
"public void setFlag(int which) {\n setFlag(which, true);\n }",
"public void setLockTime(Date lockTime) {\n\t\tthis.lockTime = lockTime;\n\t}",
"private void setDirty(boolean flag) {\n\tmain.getState().dirty = flag;\n\tif (main.bSave != null)\n\t main.bSave.setEnabled(flag);\n }",
"public void lock(int key);",
"public void setLockId(String lockId) {\n this.lockId = lockId;\n }",
"public void setGlobLock(java.lang.String globLock) {\r\n this.globLock = globLock;\r\n }",
"void indicateRunning()\n {\n try {\n runningLock = lockChannel.lock(STARTING, RUNNING - STARTING, false);\n notYetRunningLock.release();\n }\n catch (IOException e) {\n throw new RuntimeException(\"Cannot lock pid file: \" + e);\n }\n\n notYetRunningLock = null;\n }",
"public void \nsetFlag( int pFlagNumber, boolean pYesNo ) {\n if (pYesNo)\n fFlagBox = fFlagBox | (1 << pFlagNumber); \n else\n fFlagBox = fFlagBox & (~(1 << pFlagNumber));\n}",
"private void setDirty(boolean flag) {\n\tdirty = flag;\n\tmain.bSave.setEnabled(dirty);\n }",
"public void setOtherLockNum(Long otherLockNum) {\n this.otherLockNum = otherLockNum;\n }",
"public void openLock(){\n /*Code to send an unlocking signal to the physical device Gate*/\n }",
"public void setFlag(int which, boolean value) {\n if (value) {\n flags |= (1 << which); // set flag\n } else {\n flags &= ~(1 << which); // clear flag\n }\n }",
"public void reset(){\n\t\topen[0]=false;\n\t\topen[1]=false;\n\t\topen[2]=false;\n\t\tcount = 0;\n\t\t//System.out.println(\"The lock has been reset.\");\n\t}",
"public void setShifterLocked(boolean isLocked) {\n isShifterLocked = isLocked;\n }",
"private void setLock(int tid, int varIndex, Lock.Type type) {\n List<Lock> lockList = null;\n if (_lockTable.containsKey(varIndex)) {\n lockList = _lockTable.get(varIndex);\n lockList.add(new Lock(tid, type));\n } else {\n lockList = new ArrayList<Lock>();\n lockList.add(new Lock(tid, type));\n _lockTable.put(varIndex, lockList);\n }\n }",
"public void setFLAG(Integer FLAG) {\n this.FLAG = FLAG;\n }",
"protected void lock() {\n semaphore = new Semaphore(0);\n try {\n semaphore.acquire();\n }\n catch(InterruptedException e) {\n System.out.println(\"Trouble for request of semaphore acquirement\");\n e.printStackTrace();\n }\n }",
"public void setIsFileLocked(boolean isFileLocked) {\n this.isFileLocked = isFileLocked;\n }",
"default void setNeedToBeUpdated(boolean flag)\n {\n getUpdateState().update(flag);\n }",
"@Override\n\tpublic void lock(Object entity, LockModeType lockMode) {\n\t\t\n\t}",
"public void lockGame() {\n this.isLocked = true;\n btnLockGame.setEnabled(false);\n }",
"public void setDefaultLocked(boolean systemLocked)\n\t{\n\t\tthis.defaultLocked = systemLocked;\n\t}",
"public static void setLockManagerActorRef(ActorRef lockManager) {\n\t\tglobalLockManagerActorRef = lockManager;\n\t}",
"void lock();",
"public LockSync(Lock sharedLock) {\n lock = Objects.requireNonNull(sharedLock);\n }",
"public abstract void Lock(long offset, long len)\n\t\tthrows IOException, SMBException;",
"public long getLockStatus() {\r\n return lockStatus;\r\n }",
"public void lock(String stateName) throws ProcessManagerException {\r\n try {\r\n State state = processModel.getState(stateName);\r\n ((UpdatableProcessInstanceManager) Workflow.getProcessInstanceManager())\r\n .lock(currentProcessInstance, state, currentUser);\r\n } catch (WorkflowException e) {\r\n throw new ProcessManagerException(\"SessionController\",\r\n \"processManager.ERR_LOCK_FAILED\", e);\r\n }\r\n }",
"protected synchronized void setBooleanValue(String tag, boolean flag) {\n if (actualProperties != null) {\n if (flag) {\n actualProperties.put(tag, QVCSConstants.QVCS_YES);\n } else {\n actualProperties.put(tag, QVCSConstants.QVCS_NO);\n }\n }\n }",
"public void setFlags(short flag) {\n\tflags = flag;\n }",
"void lockGranted(LockHandle lockHandle);",
"private static void j_lock() {\r\n\t\tdo {\r\n\t\t\tLOCK_FILES_DIR.mkdirs();\r\n\t\t\ttry {\r\n\t\t\t\tRandomAccessFile raf = new RandomAccessFile(GLOBAL_LOCK_FILE,\r\n\t\t\t\t\t\t\"rw\");\r\n\t\t\t\tFileChannel channel = raf.getChannel();\r\n\t\t\t\tFileLock lock = channel.lock();\r\n\t\t\t\tglobalFileChannel = channel;\r\n\t\t\t\tglobalFileLock = lock;\r\n\t\t\t\tbreak;\r\n\t\t\t} catch (Throwable t) {\r\n\t\t\t\t;\r\n\t\t\t}\r\n\t\t} while (true);\r\n\t}",
"public void lockFront()\n {\n m_bFrontLock = true;\n }",
"public void setLockUser(String lockUser) {\n this.lockUser = lockUser == null ? null : lockUser.trim();\n }"
] | [
"0.7333631",
"0.67976457",
"0.6771066",
"0.6715769",
"0.67071646",
"0.6696542",
"0.6696542",
"0.6687558",
"0.6672267",
"0.6672267",
"0.6672267",
"0.6651718",
"0.66029245",
"0.6563471",
"0.6557844",
"0.6508111",
"0.6456588",
"0.64473337",
"0.64124256",
"0.62608355",
"0.62496096",
"0.62284994",
"0.6211979",
"0.62090164",
"0.6127379",
"0.6123451",
"0.6045672",
"0.60106766",
"0.5984857",
"0.5969627",
"0.5949098",
"0.58874536",
"0.58821756",
"0.58622444",
"0.585362",
"0.5845321",
"0.58178365",
"0.58046323",
"0.58012116",
"0.5798475",
"0.5796855",
"0.57866764",
"0.57634133",
"0.5749945",
"0.5716638",
"0.5714568",
"0.5713813",
"0.5713813",
"0.5705579",
"0.5682045",
"0.56659764",
"0.56447184",
"0.5625837",
"0.56231135",
"0.56180227",
"0.56180227",
"0.56180227",
"0.56122375",
"0.5588816",
"0.5584594",
"0.55787945",
"0.557167",
"0.556515",
"0.55607736",
"0.55578935",
"0.5545416",
"0.5534229",
"0.55260354",
"0.551248",
"0.5505831",
"0.54982316",
"0.54918104",
"0.5482163",
"0.54556876",
"0.54373336",
"0.5424875",
"0.5417427",
"0.5403238",
"0.5397504",
"0.53943276",
"0.53901684",
"0.5384745",
"0.5382621",
"0.5377489",
"0.5372988",
"0.533377",
"0.5330139",
"0.5318825",
"0.5315329",
"0.5313991",
"0.5311723",
"0.5311596",
"0.53104216",
"0.52931887",
"0.5282492",
"0.52794266",
"0.5271332",
"0.5266841"
] | 0.8870401 | 2 |
Access method for idacquirente. | public int getIdacquirente() {
return idacquirente;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setIdacquirente(int aIdacquirente) {\n idacquirente = aIdacquirente;\n }",
"public synchronized void acquire(int id) throws InterruptedException\r\n\t{\r\n\t\twhile (avail2 == 0) {\r\n\t\t\tSystem.out.println(\"+Process_\" + id + \" is waiting for SR2.\");\r\n\t\t\twait();\r\n\t\t}\r\n\t\tSystem.out.println(\"Process_\" + id + \" acquired SR2.\");\r\n\t\t//assigns one of the available instances\r\n\t\tavail2--;\r\n\t}",
"@Override\n public int acquire() {\n final long stamp = allocatorLock.writeLock();\n try {\n return acquire0();\n } finally {\n allocatorLock.unlockWrite(stamp);\n }\n }",
"public synchronized void acquire(int id) throws InterruptedException\r\n\t{\r\n\t\twhile (avail1 == 0) {\r\n\t\t\tSystem.out.println(\"+Process_\" + id + \" is waiting for SR1\");\r\n\t\t\twait();\r\n\t\t}\r\n\t\tSystem.out.println(\"Process_\" + id + \" acquired SR1.\");\r\n\t\t//assigns one of the available instances\r\n\t\tavail1--;\r\n\t}",
"public void acquire() {\r\n return;\r\n }",
"protected synchronized Lock acquireLock() {\n\t\tacquireReadLock();\n\t\treturn new Lock();\n\t}",
"public boolean isAcquired() {\r\n return false;\r\n }",
"void acquireReadLock(E key);",
"default void acquirePermit() {\n acquirePermits(1);\n }",
"@Override\n public String toString() {\n StringBuffer sb = new StringBuffer(\"[Acquirente |\");\n sb.append(\" idacquirente=\").append(getIdacquirente());\n sb.append(\"]\");\n return sb.toString();\n }",
"public boolean tryAcquire(String key, String owner, long timeout, TimeUnit timeUnit);",
"private long acquireActiveLease() throws InterruptedException, ExecutionException {\n long leaseId = leaseClient.grant(leaseTTL).get().getID();\n logger.debug(\"LeaderSelector get leaseId:[{}] and ttl:[{}]\", leaseId, leaseTTL);\n this.leaseCloser = leaseClient.keepAlive(leaseId, new StreamObserver<LeaseKeepAliveResponse>() {\n @Override\n public void onNext(LeaseKeepAliveResponse value) {\n logger.debug(\"LeaderSelector lease keeps alive for [{}]s:\", value.getTTL());\n }\n\n @Override\n public void onError(Throwable t) {\n logger.debug(\"LeaderSelector lease renewal Exception!\", t.fillInStackTrace());\n cancelTask();\n }\n\n @Override\n public void onCompleted() {\n logger.info(\"LeaderSelector lease renewal completed! start canceling task.\");\n cancelTask();\n }\n });\n return leaseId;\n }",
"private void AutoID() {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }",
"public void acquireLock() throws LockException {\n\t\tlong[] err = new long[1];\n\t\tDpsHelper dps = null;\n\t\t\n\t\ttry {\n\t\t\tdps = DpsHelperHolder.getDpsHelper();\n\t\t\tdps.dlAcquireLock(id, err);\n\t\t} catch(Exception e) {\n\t\t\t// Either dps cannot be initialized or acquireLock went wrong.\n\t\t\t// An error code of 65534 indicates that this error occurred inside\n\t\t\t// the dps JNI glue layer and not inside the actual lock functions.\n\t\t\tthrow new LockException(65534, e.getMessage());\n\t\t}\n\t\t\n\t\tif (err[0] != 0) {\n\t\t\tthrow new LockException(dps.dlGetLastDistributedLockErrorCode(), \n\t\t\t\t\tdps.dlGetLastDistributedLockErrorString());\n\t\t}\n\t\t\n\t\treturn;\t\n\t}",
"Lock getComponentAccessTokenLock();",
"public boolean acquire(String key, String owner);",
"ManagementLockObject create();",
"private Locks() {\n\t\tlockId = ObjectId.get().toString();\n\t}",
"int getAid();",
"private AcquiredAccount acquire(int index, Op op) {\n /*\n * This method must loop trying to replace accounts[index] with an instance of\n * new AcquiredAccount(<old-amount>, op) until that successfully happens and return the\n * instance of AcquiredAccount in this case.\n *\n * If current account is already \"Acquired\" by another operation, then this method must help that\n * other operation by invoking \"invokeOperation\" and continue trying.\n *\n * Because accounts[index] does not have an ABA problem, there is no need to implement full-blown\n * DCSS operation with descriptors for DCSS operation as explained in Harris CASN work. A simple\n * lock-free compareAndSet loop suffices here if op.completed is checked after the accounts[index]\n * is read.\n */\n\n while (true) {\n Account account = accounts.get(index);\n if (op.completed) {\n return null;\n }\n\n if (account instanceof AcquiredAccount) {\n AcquiredAccount acquiredAccount = (AcquiredAccount) account;\n if ((acquiredAccount).op == op) {\n return acquiredAccount;\n }\n acquiredAccount.invokeOperation();\n } else {\n AcquiredAccount acquiredAccount = new AcquiredAccount(account.amount, op);\n if (accounts.compareAndSet(index, account, acquiredAccount)) {\n return acquiredAccount;\n }\n }\n }\n }",
"public abstract java.lang.Long getAcma_id();",
"protected void lock() {\n semaphore = new Semaphore(0);\n try {\n semaphore.acquire();\n }\n catch(InterruptedException e) {\n System.out.println(\"Trouble for request of semaphore acquirement\");\n e.printStackTrace();\n }\n }",
"public void acquireDeferredLock() {\r\n return;\r\n }",
"public abstract String lock(String oid) throws OIDDoesNotExistException, LockNotAvailableException;",
"@Override\n protected int tryAcquireShared(int ignored) {\n if (isSignalled()) {\n return 1;\n }\n\n return -1;// check in AbstractQueuedSynchronizer.doAcquireSharedInterruptibly() why -1 returned here.\n }",
"protected synchronized void acquire(long delta) {\n if (delta <= 0) {\n throw new IllegalArgumentException(\"resource counter delta must be > 0\");\n }\n long prev = count;\n count -= delta;\n if (prev > 0 && count <= 0 ) {\n turnOff();\n }\n }",
"public void acquireReadLock() {\r\n return;\r\n }",
"public interface Lock {\n\n boolean acquire();\n\n boolean release();\n}",
"public Locks acquire() throws Exception {\n\t\t\n\t\tif( DB.getConf().getBoolean(\"locks.disabled\")) return this;\n\t\tSemaphore waitHere = new Semaphore(0);\n\t\tthreadPark.put( lockId, waitHere);\t\n\t\ttry {\n\t\t\tproxy.tell( new RequestLock( this), ActorRef.noSender());\n\t\t\twaitHere.acquire();\n\t\t\tthis.acquired = new Date();\n\t\t} catch(Exception e){\n\t\t\tlog.info( \"Exception while waiting for lock\", e );\n\t\t\tthrow new Exception( \"Failed to get the lock!!\");\n\t\t} finally {\n\t\t\t// thread not parked any more\n\t\t\tthreadPark.remove(lockId);\n\t\t}\n\t\treturn this;\n\t}",
"private UniqueIdentifier(){\n\t\t\n\t}",
"public synchronized short getID () {\n return this.id;\n }",
"private void basicReleaseLock() {\n if (logger.isTraceEnabled(LogMarker.DLS_VERBOSE)) {\n logger.trace(LogMarker.DLS_VERBOSE, \"[DLockToken.basicReleaseLock] releasing ownership: {}\",\n this);\n }\n\n leaseId = -1;\n lesseeThread = null;\n leaseExpireTime = -1;\n thread = null;\n recursion = 0;\n ignoreForRecovery = false;\n\n decUsage();\n }",
"protected void acquirePrimaryOperationPermit(\n final IndexShard primary,\n final Request request,\n final ActionListener<Releasable> onAcquired\n ) {\n primary.acquirePrimaryOperationPermit(onAcquired, executor, request, forceExecutionOnPrimary);\n }",
"public static void acquireLock(String id) throws AlreadyLockedException {\r\n\t\tacquireLock(id, null);\r\n\t}",
"void acquireReadLock() throws InterruptedException;",
"String allocateId() throws SessionStorageException;",
"public int getAid() {\n return instance.getAid();\n }",
"void lockGranted(LockHandle lockHandle);",
"public Locks acquire(int millis ) throws Exception {\n\t\tSemaphore waitHere = new Semaphore(0);\n\t\tthreadPark.put( lockId, waitHere);\t\n\t\ttry {\n\t\t\tproxy.tell( new RequestLock( this), ActorRef.noSender());\n\t\t\tboolean success = waitHere.tryAcquire(millis, TimeUnit.MILLISECONDS );\n\t\t\tif( !success) throw new Exception();\n\t\t\tthis.acquired = new Date();\n\t\t} catch(Exception e){\n\t\t\t// I don't hold the lock ...\n\t\t\t// it could happen that there is a second release send for this lock, this should not \n\t\t\t// be a problem\n\t\t\tproxy.tell( new ReleaseLock(lockId), ActorRef.noSender());\n\t\t\t\n\t\t\tlog.info( \"Exception while waiting for lock\", e );\n\t\t\tthrow new Exception( \"Failed to get the lock!!\");\n\t\t\t\n\t\t} finally {\n\t\t\t// thread not parked any more\n\t\t\t\tthreadPark.remove(lockId);\t\t\n\t\t}\n\t\treturn this;\n\t}",
"public boolean acquireLock() {\n ValueOperations<String, String> valueOps = redisTemplate.opsForValue();\n boolean result = valueOps.setIfAbsent(lockKey, \"1\");\n // assume that : result == true means fetch the lock.else other server fetch the lock\n if (result == true) {\n long lockLiveTime = Utils.lockKeyLivetimeInMillisecond.get();\n valueOps.set(lockKey, \"2\", lockLiveTime, TimeUnit.MILLISECONDS);\n LOGGER.info(\"fetch redis distribution_lock [{}] suceess,set lock live [{}]ms \", lockKey, lockLiveTime);\n fetch = true;\n }\n return result;\n }",
"public int getAccessid() throws java.rmi.RemoteException, javax.ejb.CreateException, javax.ejb.FinderException, javax.naming.NamingException {\n return (((Integer) __getCache(\"accessid\")).intValue());\n }",
"public void obtenerID();",
"public interface IDistributedLock {\n public String getLock(String itemId) throws KeeperException, InterruptedException;\n\n public void releaseLock(String itemId) throws KeeperException, InterruptedException;\n}",
"public Lock getLock();",
"void acquireDataverseReadLock(LockList locks, DataverseName dataverseName) throws AlgebricksException;",
"Acquest getAcquest(int Acquest_id);",
"private synchronized long nextId() {\n\t\treturn ++curID;\n\t}",
"public com.google.android.gms.ads.identifier.AdvertisingIdClient.Info getInfo() throws java.io.IOException {\n /*\n r4 = this;\n java.lang.String r0 = \"Calling this from your main thread can lead to deadlock\"\n com.google.android.gms.common.internal.zzbo.zzcG(r0)\n monitor-enter(r4)\n boolean r0 = r4.zzsB // Catch:{ all -> 0x0066 }\n if (r0 != 0) goto L_0x003d\n java.lang.Object r0 = r4.zzsC // Catch:{ all -> 0x0066 }\n monitor-enter(r0) // Catch:{ all -> 0x0066 }\n com.google.android.gms.ads.identifier.AdvertisingIdClient$zza r1 = r4.zzsD // Catch:{ all -> 0x003a }\n if (r1 == 0) goto L_0x0032\n com.google.android.gms.ads.identifier.AdvertisingIdClient$zza r1 = r4.zzsD // Catch:{ all -> 0x003a }\n boolean r1 = r1.zzsJ // Catch:{ all -> 0x003a }\n if (r1 == 0) goto L_0x0032\n monitor-exit(r0) // Catch:{ all -> 0x003a }\n r0 = 0\n r4.start(r0) // Catch:{ Exception -> 0x0029 }\n boolean r0 = r4.zzsB // Catch:{ all -> 0x0066 }\n if (r0 == 0) goto L_0x0021\n goto L_0x003d\n L_0x0021:\n java.io.IOException r0 = new java.io.IOException // Catch:{ all -> 0x0066 }\n java.lang.String r1 = \"AdvertisingIdClient cannot reconnect.\"\n r0.<init>(r1) // Catch:{ all -> 0x0066 }\n throw r0 // Catch:{ all -> 0x0066 }\n L_0x0029:\n r0 = move-exception\n java.io.IOException r1 = new java.io.IOException // Catch:{ all -> 0x0066 }\n java.lang.String r2 = \"AdvertisingIdClient cannot reconnect.\"\n r1.<init>(r2, r0) // Catch:{ all -> 0x0066 }\n throw r1 // Catch:{ all -> 0x0066 }\n L_0x0032:\n java.io.IOException r1 = new java.io.IOException // Catch:{ all -> 0x003a }\n java.lang.String r2 = \"AdvertisingIdClient is not connected.\"\n r1.<init>(r2) // Catch:{ all -> 0x003a }\n throw r1 // Catch:{ all -> 0x003a }\n L_0x003a:\n r1 = move-exception\n monitor-exit(r0) // Catch:{ all -> 0x003a }\n throw r1 // Catch:{ all -> 0x0066 }\n L_0x003d:\n com.google.android.gms.common.zza r0 = r4.zzsz // Catch:{ all -> 0x0066 }\n com.google.android.gms.common.internal.zzbo.zzu(r0) // Catch:{ all -> 0x0066 }\n com.google.android.gms.internal.zzfd r0 = r4.zzsA // Catch:{ all -> 0x0066 }\n com.google.android.gms.common.internal.zzbo.zzu(r0) // Catch:{ all -> 0x0066 }\n com.google.android.gms.ads.identifier.AdvertisingIdClient$Info r0 = new com.google.android.gms.ads.identifier.AdvertisingIdClient$Info // Catch:{ RemoteException -> 0x005e }\n com.google.android.gms.internal.zzfd r1 = r4.zzsA // Catch:{ RemoteException -> 0x005e }\n java.lang.String r1 = r1.getId() // Catch:{ RemoteException -> 0x005e }\n com.google.android.gms.internal.zzfd r2 = r4.zzsA // Catch:{ RemoteException -> 0x005e }\n r3 = 1\n boolean r2 = r2.zzb(r3) // Catch:{ RemoteException -> 0x005e }\n r0.<init>(r1, r2) // Catch:{ RemoteException -> 0x005e }\n monitor-exit(r4) // Catch:{ all -> 0x0066 }\n r4.zzaj()\n return r0\n L_0x005e:\n java.io.IOException r0 = new java.io.IOException // Catch:{ all -> 0x0066 }\n java.lang.String r1 = \"Remote exception\"\n r0.<init>(r1) // Catch:{ all -> 0x0066 }\n throw r0 // Catch:{ all -> 0x0066 }\n L_0x0066:\n r0 = move-exception\n monitor-exit(r4) // Catch:{ all -> 0x0066 }\n throw r0\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.android.gms.ads.identifier.AdvertisingIdClient.getInfo():com.google.android.gms.ads.identifier.AdvertisingIdClient$Info\");\n }",
"void incrementRefCount(Long id) throws RemoteException;",
"@Override\n protected boolean tryAcquire(long value) {\n return counter.longValue() > value;\n }",
"public Long getAc() {\n return ac;\n }",
"private void acc(int ticket) throws InterruptedException {\n trackStatus[ticket].acquire();\n if (DEBUG) System.err.printf(\"Train: %d\\tAcquired: %d\\n\", this.id, ticket);\n }",
"public int getAtomicNumber() {\n }",
"public abstract ReentrantLock getLock();",
"public AtomicInteger getAtomicId() { return this.atomicId; }",
"private void RecordStoreLockFactory() {\n }",
"public int getAid() {\n\t\treturn aid;\n\t}",
"public int getAId() {\n return instance.getAId();\n }",
"@Override\n public String getIdentifier() {\n return myIdentity.getIdentifier();\n }",
"public LockImpl(long id) {\n\t\tthis.id = id;\n\t}",
"public Integer getAid() {\n return aid;\n }",
"static synchronized int nextID() {\n\t\treturn g_nID++;\n\t}",
"synchronized boolean isLeaseHeld() {\n return leaseId > -1;\n }",
"public int getaID() {\r\n return aID;\r\n }",
"@Override\n public CardAccessNumber call() throws Exception {\n return queue.take();\n }",
"public java.lang.String getID() { throw new RuntimeException(\"Stub!\"); }",
"Qtl fetch(long internalID) throws AdaptorException ;",
"public interface JedisLockSupport {\r\n\t\r\n\t/**\r\n\t * Acquire the lock on passed key and set its owner\r\n\t * It will try once and will return immediately\r\n\t * @param key the key to set lock against\r\n\t * @param owner lock owner\r\n\t * @return true if lock is acquired\r\n\t */\r\n\tpublic boolean acquire(String key, String owner);\r\n\t\r\n\t\r\n\t/**\r\n\t * Acquire the lock on passed key\r\n\t * It will try to get lock for timeout passed\r\n\t * @param key\r\n\t * @param owner\r\n\t * @param timeout\r\n\t * @param timeUnit\r\n\t * @return true if lock is acquired\r\n\t */\r\n\tpublic boolean tryAcquire(String key, String owner, long timeout, TimeUnit timeUnit);\r\n\t\r\n\t/**\r\n\t * Releases the lock\r\n\t * @param key\r\n\t * @param owner\r\n\t */\r\n\tpublic void release(String key, String owner);\r\n\t\r\n\t/**\r\n\t * Interning the string key. Used internally.\r\n\t * String str1 = new String(\"abc\");\r\n\t * String str2 = new String(\"abc\");\r\n\t * str1 and str2 are two different objects \r\n\t * and we synchronized based on the passed key\r\n\t * \r\n\t * @param key to normalize\r\n\t * @return the normalized key\r\n\t */\r\n\tdefault String normalizeKey(String key) {\r\n\t\treturn key.intern();\r\n\t}\r\n}",
"void incrementAccessCounter();",
"public CacheKey acquireDeferredLock(Vector primaryKey) {\n //check if the key is already in the hashtable\n CacheKey key = null;\n\n //cache key should not be changed in other threads during the lock acquire operation\n synchronized (this) {\n // bug 3094912 get must be synchronized as well\n key = getCacheKey(primaryKey);\n if (key == null) {\n //create a chachKey and lock the object\n CacheKey cacheKey = createCacheKey(primaryKey, null, null);\n cacheKey.acquireDeferredLock();\n put(cacheKey);\n return cacheKey;\n }\n }\n\n // code removed as key will never be null here, either one will be found or one created\n key.acquireDeferredLock();\n\n return key;\n }",
"protected abstract long getNextID(long ID);",
"public abstract ID nextId();",
"int getLeaseId() {\n return leaseId;\n }",
"public abstract long getSdiId();",
"public Object getLock() {\n return dataLock;\n }",
"public IIID getAccessIID()\n throws ORIOException;",
"public int getAid() {\n return aid_;\n }",
"void acquireActiveEntityReadLock(LockList locks, DataverseName dataverseName, String entityName)\n throws AlgebricksException;",
"public void init(String id, Accessor accessItem) throws ThingsException;",
"protected String generateLockId() {\n return AkkaUtils.nextId();\n }",
"private interface ActiveWakeLock {\n void acquire();\n void release();\n boolean isHeld();\n }",
"int getAId();",
"public boolean hasBeenAcquired(){\r\n\t\treturn !(acquiredBy == null);\r\n\t}",
"public int getAId() {\n return aId_;\n }",
"public Lock() {\r\n }",
"ManagementLockObject create(Context context);",
"static synchronized com.mopub.common.privacy.AdvertisingId readIdFromStorage(android.content.Context r11) {\n /*\n java.lang.Class<com.mopub.common.privacy.MoPubIdentifier> r0 = com.mopub.common.privacy.MoPubIdentifier.class\n monitor-enter(r0)\n com.mopub.common.Preconditions.checkNotNull(r11) // Catch:{ all -> 0x0054 }\n java.util.Calendar r1 = java.util.Calendar.getInstance() // Catch:{ all -> 0x0054 }\n r2 = 0\n java.lang.String r3 = \"com.mopub.settings.identifier\"\n android.content.SharedPreferences r11 = com.mopub.common.SharedPreferencesHelper.getSharedPreferences(r11, r3) // Catch:{ ClassCastException -> 0x0045 }\n java.lang.String r3 = \"privacy.identifier.ifa\"\n java.lang.String r4 = \"\"\n java.lang.String r6 = r11.getString(r3, r4) // Catch:{ ClassCastException -> 0x0045 }\n java.lang.String r3 = \"privacy.identifier.mopub\"\n java.lang.String r4 = \"\"\n java.lang.String r7 = r11.getString(r3, r4) // Catch:{ ClassCastException -> 0x0045 }\n java.lang.String r3 = \"privacy.identifier.time\"\n long r4 = r1.getTimeInMillis() // Catch:{ ClassCastException -> 0x0045 }\n long r9 = r11.getLong(r3, r4) // Catch:{ ClassCastException -> 0x0045 }\n java.lang.String r1 = \"privacy.limit.ad.tracking\"\n boolean r8 = r11.getBoolean(r1, r2) // Catch:{ ClassCastException -> 0x0045 }\n boolean r11 = android.text.TextUtils.isEmpty(r6) // Catch:{ ClassCastException -> 0x0045 }\n if (r11 != 0) goto L_0x0051\n boolean r11 = android.text.TextUtils.isEmpty(r7) // Catch:{ ClassCastException -> 0x0045 }\n if (r11 != 0) goto L_0x0051\n com.mopub.common.privacy.AdvertisingId r11 = new com.mopub.common.privacy.AdvertisingId // Catch:{ ClassCastException -> 0x0045 }\n r5 = r11\n r5.<init>(r6, r7, r8, r9) // Catch:{ ClassCastException -> 0x0045 }\n monitor-exit(r0)\n return r11\n L_0x0045:\n com.mopub.common.logging.MoPubLog$SdkLogEvent r11 = com.mopub.common.logging.MoPubLog.SdkLogEvent.CUSTOM // Catch:{ all -> 0x0054 }\n r1 = 1\n java.lang.Object[] r1 = new java.lang.Object[r1] // Catch:{ all -> 0x0054 }\n java.lang.String r3 = \"Cannot read identifier from shared preferences\"\n r1[r2] = r3 // Catch:{ all -> 0x0054 }\n com.mopub.common.logging.MoPubLog.log(r11, r1) // Catch:{ all -> 0x0054 }\n L_0x0051:\n r11 = 0\n monitor-exit(r0)\n return r11\n L_0x0054:\n r11 = move-exception\n monitor-exit(r0)\n throw r11\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.mopub.common.privacy.MoPubIdentifier.readIdFromStorage(android.content.Context):com.mopub.common.privacy.AdvertisingId\");\n }",
"static Lock createLock() {\n return new /*Prio*/Lock();\n }",
"public interface LockDAO\n{\n /**\n * Aquire a given exclusive lock, assigning it (and any implicitly shared locks) a\n * timeout. All shared locks are implicitly taken as well.\n * <p>\n * A lock can be re-taken if it has expired and if the lock token has not changed\n * \n * @param lockQName the unique name of the lock to acquire\n * @param lockToken the potential lock token (max 36 chars)\n * @param timeToLive the time (in milliseconds) that the lock must remain \n * @return Returns <tt>true</tt> if the lock was taken, \n * otherwise <tt>false</tt>\n * @throws LockAcquisitionException on failure\n */\n void getLock(QName lockQName, String lockToken, long timeToLive);\n\n /**\n * Refresh a held lock. This is successful if the lock in question still exists\n * and if the lock token has not changed. Lock expiry does not prevent the lock\n * from being refreshed.\n * \n * @param lockQName the unique name of the lock to update\n * @param lockToken the lock token for the lock held\n * @param timeToLive the new time to live (in milliseconds)\n * @return Returns <tt>true</tt> if the lock was updated,\n * otherwise <tt>false</tt>\n * @throws LockAcquisitionException on failure\n */\n void refreshLock(QName lockQName, String lockToken, long timeToLive);\n \n /**\n * Release a lock. The lock token must still apply and all the shared and exclusive\n * locks need to still be present. Lock expiration does not prevent this operation\n * from succeeding.\n * <p>\n * Note: Failure to release a lock due to a exception condition is dealt with by\n * passing the exception out.\n * \n * @param lockQName the unique name of the lock to release\n * @param lockToken the current lock token\n * @return Returns <tt>true</tt> if all the required locks were\n * (still) held under the lock token and were\n * valid at the time of release, otherwise <tt>false</tt>\n */\n void releaseLock(QName lockQName, String lockToken);\n}",
"private static int nextInstanceID()\n {\n return baseID.incrementAndGet();\n }",
"private int insertObjectFromClsid (Guid clsid, int hWnd, License license) {\n int result;\n String licenseKey;\n\n message(AX_MORE_DETAIL, \"Inside non-synchronized method. Guid = \" + clsid);\n if (!clsid.isNullGuid()) {\n if (license == null)\n licenseKey = null;\n else \n {\n licenseKey = license.getLicenseKey();\n }\n result = insert_object_from_clsid_with_license(clsid, hWnd, licenseKey);\n message(AX_MORE_DETAIL, \"Got result: \" + result);\n return result;\n } else {\n return AX_NO_CLIENT_SITE;\n }\n }",
"@Override\n public int hashCode() {\n int i;\n int result = 17;\n i = getIdacquirente();\n result = 37*result + i;\n return result;\n }",
"protected abstract String getIdentifier();",
"public int getId(){\r\n return localId;\r\n }",
"@Override\n\tpublic void enable(String id) throws Exception {\n\t\t\n\t}",
"public Object getIdentifier() {\n return identifier;\n }",
"void acquireAdapterReadLock(LockList locks, DataverseName dataverseName, String adapterName)\n throws AlgebricksException;",
"public Long getEventID()\n/* */ {\n/* 111 */ return this.eventID;\n/* */ }",
"public void acquire(Book book)\r\n\t {\r\n\t \tbooks.put(book.getCallNumber(), book);\r\n\t }",
"public interface PreemptiveLock {\n\n /**\n * 尝试获得锁\n * @return 是否成功获得锁\n * @param lock\n */\n boolean getLock(String lock);\n\n /**\n * 释放锁\n * @param lock\n */\n void releaseLock(String lock);\n}"
] | [
"0.6995045",
"0.6138521",
"0.61275357",
"0.60716885",
"0.60160613",
"0.5862816",
"0.572856",
"0.57031137",
"0.5703016",
"0.5682236",
"0.5623721",
"0.5611927",
"0.55901724",
"0.5553036",
"0.5544009",
"0.55348843",
"0.550649",
"0.5455563",
"0.5443957",
"0.5420822",
"0.53775877",
"0.5374358",
"0.5369753",
"0.5358559",
"0.53445464",
"0.5344265",
"0.53416204",
"0.5295369",
"0.5291807",
"0.5291209",
"0.5290811",
"0.526878",
"0.5265438",
"0.5260201",
"0.52570945",
"0.5236286",
"0.52317804",
"0.522802",
"0.522709",
"0.52154964",
"0.52133006",
"0.521243",
"0.519447",
"0.51938945",
"0.5187742",
"0.5161625",
"0.5161141",
"0.5160598",
"0.51585704",
"0.5156796",
"0.51538014",
"0.5149372",
"0.51492494",
"0.5148806",
"0.514433",
"0.5142135",
"0.51408374",
"0.513337",
"0.5107387",
"0.510297",
"0.51014185",
"0.5097118",
"0.5094973",
"0.5091065",
"0.50899345",
"0.5085879",
"0.5079383",
"0.5075886",
"0.5072952",
"0.50726366",
"0.50720394",
"0.5064681",
"0.5063284",
"0.5060933",
"0.5060718",
"0.50520974",
"0.5042581",
"0.5038231",
"0.503722",
"0.50209886",
"0.50187266",
"0.5014516",
"0.5011594",
"0.50040895",
"0.5002545",
"0.50024736",
"0.5001031",
"0.49999982",
"0.49980065",
"0.498291",
"0.49773365",
"0.49703985",
"0.49689662",
"0.49608776",
"0.49584353",
"0.49569267",
"0.49562916",
"0.49560463",
"0.49538568",
"0.49517962"
] | 0.73141456 | 0 |
Setter method for idacquirente. | public void setIdacquirente(int aIdacquirente) {
idacquirente = aIdacquirente;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int getIdacquirente() {\n return idacquirente;\n }",
"private void setAId(int value) {\n \n aId_ = value;\n }",
"private void setAid(int value) {\n \n aid_ = value;\n }",
"public abstract void setAcma_id(java.lang.Long newAcma_id);",
"public void setArtId(DBSequence value) {\n setAttributeInternal(ARTID, value);\n }",
"public void setAtomicId(AtomicInteger atomicId) { this.atomicId = atomicId; }",
"private void setId(int ida2) {\n\t\tthis.id=ida;\r\n\t}",
"public synchronized void acquire(int id) throws InterruptedException\r\n\t{\r\n\t\twhile (avail1 == 0) {\r\n\t\t\tSystem.out.println(\"+Process_\" + id + \" is waiting for SR1\");\r\n\t\t\twait();\r\n\t\t}\r\n\t\tSystem.out.println(\"Process_\" + id + \" acquired SR1.\");\r\n\t\t//assigns one of the available instances\r\n\t\tavail1--;\r\n\t}",
"public synchronized void acquire(int id) throws InterruptedException\r\n\t{\r\n\t\twhile (avail2 == 0) {\r\n\t\t\tSystem.out.println(\"+Process_\" + id + \" is waiting for SR2.\");\r\n\t\t\twait();\r\n\t\t}\r\n\t\tSystem.out.println(\"Process_\" + id + \" acquired SR2.\");\r\n\t\t//assigns one of the available instances\r\n\t\tavail2--;\r\n\t}",
"public LockImpl(long id) {\n\t\tthis.id = id;\n\t}",
"public void setAid(Integer aid) {\n this.aid = aid;\n }",
"public abstract void setCntPrepaid(int cntPrepaid);",
"public void setClientId(DBSequence value) {\n setAttributeInternal(CLIENTID, value);\n }",
"protected void setIdentity(long identity)\n\t{\n\t\tthis.identity=new Long(identity);\n\t}",
"@Override\n public String toString() {\n StringBuffer sb = new StringBuffer(\"[Acquirente |\");\n sb.append(\" idacquirente=\").append(getIdacquirente());\n sb.append(\"]\");\n return sb.toString();\n }",
"public void setCdtAwdPriId(ULong value) {\n set(1, value);\n }",
"private void setObjId(int value) {\n \n objId_ = value;\n }",
"private void setObjId(int value) {\n \n objId_ = value;\n }",
"private void setObjId(int value) {\n \n objId_ = value;\n }",
"private void setObjId(int value) {\n \n objId_ = value;\n }",
"private void setObjId(int value) {\n \n objId_ = value;\n }",
"private void setObjId(int value) {\n \n objId_ = value;\n }",
"private void AutoID() {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }",
"public Object setID(int iD)\r\n/* */ {\r\n\t\t\t\tlogger.info(count++ + \" About to setId : \" + \"Agent\");\r\n/* 51 */ \tthis.myID = iD;\r\n/* 52 */ \treturn this;\r\n/* */ }",
"private void setId(int value) {\n \n id_ = value;\n }",
"public void setID(String idIn) {this.id = idIn;}",
"public void setIdAutorizacionDocumentoPuntoDeVentaAutoimpresorSRI(int idAutorizacionDocumentoPuntoDeVentaAutoimpresorSRI)\r\n/* 85: */ {\r\n/* 86:118 */ this.idAutorizacionDocumentoPuntoDeVentaAutoimpresorSRI = idAutorizacionDocumentoPuntoDeVentaAutoimpresorSRI;\r\n/* 87: */ }",
"private void setId() {\n id = count++;\n }",
"@Test\n public void testSetLibroId() {\n System.out.println(\"setLibroId\");\n long libroId = 0L;\n Reserva instance = new Reserva();\n instance.setLibroId(libroId);\n \n }",
"private void setID(gw.pl.persistence.core.Key value) {\n __getInternalInterface().setFieldValue(ID_PROP.get(), value);\n }",
"private void setID(gw.pl.persistence.core.Key value) {\n __getInternalInterface().setFieldValue(ID_PROP.get(), value);\n }",
"private void setID(gw.pl.persistence.core.Key value) {\n __getInternalInterface().setFieldValue(ID_PROP.get(), value);\n }",
"@Override\r\n\tpublic void setAddNewObjectIdentifier(String arg0, Long arg1)\r\n\t{\n\r\n\t}",
"@Override\n\tpublic void setId(long value) {\n super.setId(value);\n }",
"public void setOid(int oid) {\n this.tid = oid;\n }",
"public void setApId(long value) {\n this.apId = value;\n }",
"public void setID(String value) {\r\n \t\t_id = value;\r\n \r\n \t}",
"@Override\n\tpublic void set(int id, Generator generator) {\n\t}",
"void setID(int val)\n throws RemoteException;",
"protected void assignTransmissionId(AeB4PQueueObject aQueueObject,\r\n IAeTransmission aTransmission) throws AeBusinessProcessException\r\n {\r\n long transmissionId = removeInvokeTransmittedEntry(aQueueObject.getLocationId());\r\n if (transmissionId != IAeTransmissionTracker.NULL_TRANSREC_ID)\r\n {\r\n // Restore the invoke's transmission.\r\n aTransmission.setTransmissionId(transmissionId);\r\n }\r\n }",
"public void setIdAutorizacionEmpresaSRI(int idAutorizacionEmpresaSRI)\r\n/* 79: */ {\r\n/* 80:122 */ this.idAutorizacionEmpresaSRI = idAutorizacionEmpresaSRI;\r\n/* 81: */ }",
"protected String generateLockId() {\n return AkkaUtils.nextId();\n }",
"public void setAuthId(java.lang.String param){\r\n \r\n if (param != null){\r\n //update the setting tracker\r\n localAuthIdTracker = true;\r\n } else {\r\n localAuthIdTracker = false;\r\n \r\n }\r\n \r\n this.localAuthId=param;\r\n \r\n\r\n }",
"private void setOtherId(int value) {\n \n otherId_ = value;\n }",
"public void setId(String anId) {\n _theId = anId;\n }",
"@Override\n public final void setItsId(final Long pId) {\n //stub\n }",
"public TransactionID(){\r\nthis.id = transCount++;\r\n\r\n}",
"public final void setNetId( String id) //final doesn't allow new rules or ways in door\r\n {\r\n netId = id; //only place I can do it in set methods\r\n }",
"public void assignId(int id);",
"@Generated(hash = 1943213675)\npublic void setTarefaExecutada(TarefasExecutadas tarefaExecutada) {\n synchronized (this) {\n this.tarefaExecutada = tarefaExecutada;\n tarefaExecutadaId = tarefaExecutada == null ? null : tarefaExecutada.getId();\n tarefaExecutada__resolvedKey = tarefaExecutadaId;\n }\n}",
"private void setId(int value) {\n \n id_ = value;\n }",
"public void setID() throws IOException;",
"public void setID(String newID)\r\n {\r\n id=newID;\r\n }",
"@Test\n void testGetAndSetId() {\n isLockedRequest2.setId(3);\n assertEquals(3, isLockedRequest2.getId());\n }",
"public void setIdade(int idade) {\r\n\t\t// QUALIFICADOR = THIS\r\n\t\tthis.idade = idade;\r\n\t}",
"public native void setIdentifier (String identifier);",
"public void setAsicIdentifier(au.gov.asic.types.DocumentIdentifierType asicIdentifier)\n {\n synchronized (monitor())\n {\n check_orphaned();\n au.gov.asic.types.DocumentIdentifierType target = null;\n target = (au.gov.asic.types.DocumentIdentifierType)get_store().find_element_user(ASICIDENTIFIER$0, 0);\n if (target == null)\n {\n target = (au.gov.asic.types.DocumentIdentifierType)get_store().add_element_user(ASICIDENTIFIER$0);\n }\n target.set(asicIdentifier);\n }\n }",
"public void setIdentifier(String value) {\n/* 214 */ setValue(\"identifier\", value);\n/* */ }",
"protected void NewIdentity()\n\t{\n\t\tthis.identity=0L;\n\t\tNodeReference nodeRef = getNodeReference();\n\t\tnodeRef.appendSubscript(0L);\n\t\tnodeRef.appendSubscript(\"id\");\n\t\tthis.identity=nodeRef.increment(1);\n\t}",
"public abstract void setEspe_id(java.lang.Integer newEspe_id);",
"public void setReservationId(int i) { reservationId = i; }",
"public void setC_Invoice_ID (int C_Invoice_ID);",
"public abstract void setCompteId(Integer pCompteId);",
"public static void acquireLock(String id) throws AlreadyLockedException {\r\n\t\tacquireLock(id, null);\r\n\t}",
"@Override\r\n\tpublic void setID(String id) {\n\t\tsuper.id=id;\r\n\t}",
"final public void setId(int idp) {\n\t\tid = idp;\n\t\tidSet = true;\n\t}",
"public void setId(byte value) {\r\n this.id = value;\r\n }",
"public void setSeqNo (int SeqNo);",
"public void setSeqNo (int SeqNo);",
"public void setId(Uuid uuid) {\n\t\t this.id = uuid;;\n\t}",
"public void setAcquireTimeoutMillis(Integer aquireTimeoutMillis) {\n pool.setAcquireTimeoutMillis(aquireTimeoutMillis);\n }",
"public Integer getAid() {\n return aid;\n }",
"void incrementRefCount(Long id) throws RemoteException;",
"protected void lock() {\n semaphore = new Semaphore(0);\n try {\n semaphore.acquire();\n }\n catch(InterruptedException e) {\n System.out.println(\"Trouble for request of semaphore acquirement\");\n e.printStackTrace();\n }\n }",
"public void setTransactionID(int tid) {\n m_TransactionID = tid;\n // setChanged(true);\n }",
"private Locks() {\n\t\tlockId = ObjectId.get().toString();\n\t}",
"private void setId(int value) {\n \n id_ = value;\n }",
"private void setId(int value) {\n \n id_ = value;\n }",
"private void setId(int value) {\n \n id_ = value;\n }",
"private void setId(int value) {\n \n id_ = value;\n }",
"private void setId(int value) {\n \n id_ = value;\n }",
"private void setId(int value) {\n \n id_ = value;\n }",
"private void setId(int value) {\n \n id_ = value;\n }",
"public void setIdentifier(FactIdentifier param) {\r\n localIdentifierTracker = true;\r\n\r\n this.localIdentifier = param;\r\n\r\n\r\n }",
"public int getAid() {\n\t\treturn aid;\n\t}",
"synchronized void setExpiration(long newExpiration) {\n \texpiration = newExpiration;\n }",
"public void setID(long id);",
"public String getAssignid() {\n return assignid;\n }",
"protected void setUniqueID(int newUniqueID) {\n\t\tuniqueID = newUniqueID;\n\t}",
"public void setIdentifierValue(java.lang.String param) {\r\n localIdentifierValueTracker = true;\r\n\r\n this.localIdentifierValue = param;\r\n\r\n\r\n }",
"@Test\n public void testSetId() {\n System.out.println(\"setId\");\n Long id = null;\n Reserva instance = new Reserva();\n instance.setId(id);\n \n }",
"public void setId(long id) {\n id_ = id;\n }",
"@Override\n\t\tpublic void setId(final String identifier) {\n\t\t}",
"public void setID(Number numID);",
"protected static void setIdentityAsserter(com.tangosol.net.security.IdentityAsserter asserter)\n {\n __s_IdentityAsserter = asserter;\n }",
"public ImagingStudy setAccessionNo(IdentifierDt theValue) {\n\t\tmyAccessionNo = theValue;\n\t\treturn this;\n\t}",
"@Override\n public void setAtomicNumber(int atomicNumber) {\n }",
"public void setIdAutenticacao(String idAutenticacao) {\n\t\tthis.idAutenticacao = idAutenticacao;\n\t}",
"private void setSrcId(int value) {\n \n srcId_ = value;\n }",
"@IcalProperty(pindex = PropertyInfoIndex.SEQUENCE,\n eventProperty = true,\n todoProperty = true,\n journalProperty = true\n )\n public void setSequence(final int val) {\n sequence = val;\n }"
] | [
"0.73160535",
"0.6326793",
"0.6227328",
"0.6022876",
"0.54541415",
"0.54467916",
"0.54376125",
"0.54235816",
"0.54084104",
"0.5377567",
"0.53572285",
"0.5346754",
"0.53366846",
"0.53171766",
"0.531194",
"0.5308276",
"0.5297463",
"0.5297463",
"0.5297463",
"0.5297463",
"0.5297463",
"0.5297463",
"0.527823",
"0.5273986",
"0.5225294",
"0.5184903",
"0.5184648",
"0.5178817",
"0.5178688",
"0.51772964",
"0.51772964",
"0.51772964",
"0.5151473",
"0.5150221",
"0.51354146",
"0.51306206",
"0.51205206",
"0.5114978",
"0.5112592",
"0.5103129",
"0.51000893",
"0.5096863",
"0.50912416",
"0.50849247",
"0.50743085",
"0.5072235",
"0.50653833",
"0.50617665",
"0.5058649",
"0.5057572",
"0.5057403",
"0.5051055",
"0.5041897",
"0.5038801",
"0.5037844",
"0.50314695",
"0.5027054",
"0.50268805",
"0.5026684",
"0.50244415",
"0.501158",
"0.5010544",
"0.5008349",
"0.5006775",
"0.50023043",
"0.4998865",
"0.49973807",
"0.49966422",
"0.49966422",
"0.49964115",
"0.49908793",
"0.49902278",
"0.49831566",
"0.49817377",
"0.49767685",
"0.4975411",
"0.49720222",
"0.49720222",
"0.49720222",
"0.49720222",
"0.49720222",
"0.49720222",
"0.49720222",
"0.49700296",
"0.49695447",
"0.496785",
"0.4967666",
"0.49675143",
"0.4962644",
"0.4961715",
"0.49585897",
"0.49582157",
"0.49579638",
"0.49517176",
"0.49505624",
"0.49480504",
"0.49449065",
"0.49400577",
"0.49391803",
"0.49358633"
] | 0.8336727 | 0 |
Access method for telefono. | public String getTelefono() {
return telefono;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String getTelefono()\r\n {\r\n return telefono;\r\n }",
"public String getTelefono() {\r\n\t\treturn telefono;\r\n\t}",
"public String getTelefono(){\n return telefono;\n }",
"public void setTelefono(String telefono) {\n this.telefono = telefono;\n }",
"@AutoEscape\n\tpublic String getTelefono();",
"public void setTelefono(String telefono)\r\n {\r\n this.telefono = telefono;\r\n }",
"public void setTelefono(String aTelefono) {\n telefono = aTelefono;\n }",
"public String getTelefono() {\r\n\treturn telefono;\r\n}",
"public long getTelefono() {\r\n return telefono;\r\n }",
"public void setTelefono(String telefono) {\r\n\t\tthis.telefono = telefono;\r\n\t}",
"java.lang.String getTelefon();",
"public void setTelefono(String telefono);",
"public void tocarTelefone() {\n System.out.println(\"Telefone \" + getNumero() + \" está tocando!\");\n notificarTodos();\n }",
"public String getTelefonoTI() {\n return this.telefonoTI;\n }",
"public void setTelefono(Integer telefono) {\r\n this.telefono = telefono;\r\n }",
"public List<Telefono> getTelefonos(String dni);",
"public String getTelephone() {\n return telephone;\n }",
"public String getTelephone() {\n return telephone;\n }",
"public java.lang.String getNumeroTelefono() {\n\t\treturn _telefonoSolicitudProducto.getNumeroTelefono();\n\t}",
"public void setTelefono(String telefono) {\r\n\tthis.telefono = telefono;\r\n}",
"public telefono(){\n this.telefono =\"00000000\";\n this.saldo = 0.0;\n this.marca= \"Sin Marca\";\n }",
"public String getTelphone() {\n return telphone;\n }",
"public String getTelphone() {\n return telphone;\n }",
"public String getTelphone() {\n return telphone;\n }",
"public String getTel() {\r\n return tel;\r\n }",
"public String getTel() {\n return tel;\n }",
"public String getTel() {\n return tel;\n }",
"public String getTel() {\n return tel;\n }",
"public String getTel() {\n return tel;\n }",
"public String getTel() {\n return tel;\n }",
"public String getTel() {\n return tel;\n }",
"public String getTel() {\n return tel;\n }",
"public String getTel() {\n return tel;\n }",
"public String getTel() {\n return tel;\n }",
"public Integer getTel() {\n return tel;\n }",
"public String getTelephoneNumber(){\n return telephoneNumber;\n }",
"public void setTelefonoTI(String telefonoTI) {\n this.telefonoTI = telefonoTI;\n }",
"public void atenderTelefone() {\n System.out.println(\"Telefone \" + getNumero() + \" atendido!\");\n notificarTodos();\n }",
"public String getTelNo() {\n return telNo;\n }",
"@Override\n\tpublic TelefonoDAO getTelefonoDAO() {\n\t\treturn new JPATelefonoDAO();\n\t}",
"public void setTelefono(String telefono) {\r\n\t\tif(telefono.length() == 9){\r\n\t\tthis.telefono = telefono;\r\n\t\t}else{\r\n\t\t\tSystem.out.println(\"Error telefono\");\r\n\t\t}\r\n\t}",
"public void setTelefono(String telefono) {\n\t\tthis.telefono.set(telefono);\n\t}",
"public String getTelefonnummer() {\n return telefonnummer;\n }",
"public String getTelNo() {\n return telNo;\n }",
"public String getTelephoneNumber() {\n return telephoneNumber;\n }",
"public void setTelefono(long value) {\r\n this.telefono = value;\r\n }",
"public String getTelefone() {\n return telefone;\n }",
"public String getTelNo()\r\n\t{\r\n\t\treturn this.telNo;\r\n\t}",
"public String getAnserTelphone() {\r\n return anserTelphone;\r\n }",
"public String getTelephone() {\n return (String) get(\"telephone\");\n }",
"int getPhone();",
"public synchronized String getTelephoneNumber()\r\n {\r\n return telephoneNumber;\r\n }",
"cb.Careerbuilder.Company.PhoneNumber getPhone(int index);",
"public void consultaDinero(){\r\n System.out.println(this.getMonto());\r\n }",
"@Override\n\tpublic TelefonoDAO getTelefonoDAO() {\n\t\treturn new JDBCTelefonoDAO();\n\t}",
"public String getaPhone() {\n return aPhone;\n }",
"public java.lang.String getTelePhone() {\r\n return telePhone;\r\n }",
"@Override\n public String provideCustomerMobilePhone( )\n {\n return _signaleur.getIdTelephone( );\n }",
"public String getTelefone() {\n\t\treturn telefone;\n\t}",
"public java.lang.String getTelphone () {\r\n\t\treturn telphone;\r\n\t}",
"public java.lang.String getIDTipoTelefono() {\n\t\treturn IDTipoTelefono;\n\t}",
"private void teletransportar(Personaje p, Celda destino) {\n // TODO implement here\n }",
"public abstract String getPhone2();",
"java.lang.String getPhone();",
"@Override\r\n\tpublic String getPhone() {\n\t\treturn phone;\r\n\t}",
"public String getPhone(){\n return phone;\n }",
"public String getPhone(){\n return phone;\n }",
"public abstract String getPhone1();",
"public String getContactTel() {\n return contactTel;\n }",
"public abstract String getPhone3();",
"public String getPhone() {\r\n return phone;\r\n }",
"public String getPhone() {\r\n return phone;\r\n }",
"public String getPhone() {\r\n return phone;\r\n }",
"public String getPhone() {\r\n return phone;\r\n }",
"public String getPhone() {\r\n return phone;\r\n }",
"public String getPhone() {\r\n return phone;\r\n }",
"public String Phone() throws Exception {\r\n\t\t\ttry {\r\n\t\t\t\telement = driver.findElement(phone);\r\n\t\t\t\tStr_phoneno = element.getText();\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tthrow new Exception(\"Phone Number NOT FOUND:: \"+e.getLocalizedMessage());\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn Str_phoneno;\r\n\t\t\t\r\n\t\t}",
"public String getPhone() {\n return phone;\n }",
"public String getPhone() {\n return _phone;\n }",
"private Long modificarTelefono(Telefono telefono) {\n\t\ttry {\n\t\t\tgTelefono.modify(telefono);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn telefono.getIdTelefono();\n\t}",
"public String getPhone() {\n return phone;\n }",
"public String getPhone() {\n return phone;\n }",
"public String getPhone() {\n return phone;\n }",
"public String getPhone() {\n return phone;\n }",
"public String getPhone() {\n return phone;\n }",
"public String getPhone() {\n return phone;\n }",
"public String getPhone() {\n return phone;\n }",
"public String getPhone() {\n return phone;\n }",
"public String getPhone() {\n return phone;\n }",
"public String getPhone() {\n return phone;\n }",
"public String getPhone() {\n return phone;\n }",
"public String getPhone() {\n return phone;\n }",
"public String getPhone() {\n return phone;\n }",
"public String getPhone() {\n return phone;\n }",
"public String getPhone() {\n return phone;\n }",
"public String getPhone() {\n return phone;\n }",
"public String getUserTelephone() {\n return userTelephone;\n }",
"public java.lang.String getTel() {\r\n return localTel;\r\n }",
"public String getPhoneNumber(){\n return phone_number;\n }"
] | [
"0.75085187",
"0.7410024",
"0.7132251",
"0.7122056",
"0.7120618",
"0.7114074",
"0.7083386",
"0.7020289",
"0.6991805",
"0.69245344",
"0.68313813",
"0.6824384",
"0.6773596",
"0.67727125",
"0.6720139",
"0.65162814",
"0.6479845",
"0.6479845",
"0.6474486",
"0.6468346",
"0.6358072",
"0.6338417",
"0.6338417",
"0.6338417",
"0.6301417",
"0.6273639",
"0.6273639",
"0.6273639",
"0.6273639",
"0.6273639",
"0.6273639",
"0.6273639",
"0.6273639",
"0.6273639",
"0.6271523",
"0.62259936",
"0.62174004",
"0.6181353",
"0.6173361",
"0.61700547",
"0.6151781",
"0.6147479",
"0.6137743",
"0.6080921",
"0.60802567",
"0.60584164",
"0.60410184",
"0.6020354",
"0.6015539",
"0.6001696",
"0.5961706",
"0.59501106",
"0.59482515",
"0.5943754",
"0.5931439",
"0.5931433",
"0.59282446",
"0.59166116",
"0.5889121",
"0.58783597",
"0.58750457",
"0.5840536",
"0.58349985",
"0.58287454",
"0.58232874",
"0.580335",
"0.580335",
"0.5802267",
"0.5795387",
"0.5764928",
"0.57544464",
"0.57544464",
"0.57544464",
"0.57544464",
"0.57544464",
"0.57544464",
"0.5743317",
"0.57356626",
"0.57255244",
"0.57228154",
"0.572077",
"0.572077",
"0.572077",
"0.572077",
"0.572077",
"0.572077",
"0.572077",
"0.572077",
"0.572077",
"0.572077",
"0.572077",
"0.572077",
"0.572077",
"0.572077",
"0.572077",
"0.572077",
"0.5717347",
"0.57107264",
"0.57099926"
] | 0.7413122 | 2 |
Setter method for telefono. | public void setTelefono(String aTelefono) {
telefono = aTelefono;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setTelefono(String telefono);",
"public void setTelefono(String telefono)\r\n {\r\n this.telefono = telefono;\r\n }",
"public void setTelefono(String telefono) {\n this.telefono = telefono;\n }",
"public void setTelefono(String telefono) {\r\n\t\tthis.telefono = telefono;\r\n\t}",
"public void setTelefono(String telefono) {\r\n\t\tif(telefono.length() == 9){\r\n\t\tthis.telefono = telefono;\r\n\t\t}else{\r\n\t\t\tSystem.out.println(\"Error telefono\");\r\n\t\t}\r\n\t}",
"public void setTelefono(Integer telefono) {\r\n this.telefono = telefono;\r\n }",
"public void setTelefono(String telefono) {\n\t\tthis.telefono.set(telefono);\n\t}",
"public void setTelefono(long value) {\r\n this.telefono = value;\r\n }",
"public String getTelefono() {\r\n\t\treturn telefono;\r\n\t}",
"public String getTelefono() {\n return telefono;\n }",
"public String getTelefono() {\n return telefono;\n }",
"public void setTelefono(String telefono) {\r\n\tthis.telefono = telefono;\r\n}",
"public String getTelefono()\r\n {\r\n return telefono;\r\n }",
"public void setTelefonoTI(String telefonoTI) {\n this.telefonoTI = telefonoTI;\n }",
"public Builder setTelefon(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n\n telefon_ = value;\n onChanged();\n return this;\n }",
"@AutoEscape\n\tpublic String getTelefono();",
"public long getTelefono() {\r\n return telefono;\r\n }",
"public telefono(){\n this.telefono =\"00000000\";\n this.saldo = 0.0;\n this.marca= \"Sin Marca\";\n }",
"public String getTelefono(){\n return telefono;\n }",
"public void setTel(Integer tel) {\n this.tel = tel;\n }",
"public String getTelefono() {\r\n\treturn telefono;\r\n}",
"public String getTelefonoTI() {\n return this.telefonoTI;\n }",
"public void tocarTelefone() {\n System.out.println(\"Telefone \" + getNumero() + \" está tocando!\");\n notificarTodos();\n }",
"public void setTelefone(String telefone) {\n Consistencia.consisteNaoNuloNaoVazio(telefone, \"telefone\");\n\n this.telefone = telefone;\n }",
"public void setTel(String tel) {\n this.tel = tel;\n }",
"public void setTel(String tel) {\n this.tel = tel;\n }",
"public void setTel(String tel) {\n this.tel = tel;\n }",
"public void setTel(String tel) {\n this.tel = tel;\n }",
"public void setTelefone(String telefone) {\n String oldTelefone = this.telefone;\n this.telefone = telefone;\n propertyChangeSupport.firePropertyChange(PROP_TELEFONE, oldTelefone, telefone);\n }",
"public void setTelphone(String telphone) {\n this.telphone = telphone;\n }",
"public void setTelphone(String telphone) {\n this.telphone = telphone;\n }",
"public void setTelephone(String telephone) {\n\t\tthis.telephone = telephone;\n\t}",
"public void setTelNo(String telNo) {\n this.telNo = telNo;\n }",
"public String getTelephone() {\n return telephone;\n }",
"public String getTelephone() {\n return telephone;\n }",
"public String getTelphone() {\n return telphone;\n }",
"public String getTelphone() {\n return telphone;\n }",
"public String getTelphone() {\n return telphone;\n }",
"public void setPhone(String phone);",
"public void setTelNo(String telNo) {\n this.telNo = telNo;\n }",
"public String getTelefonnummer() {\n return telefonnummer;\n }",
"public void setTEL_NUMBER(java.lang.String value)\n {\n if ((__TEL_NUMBER == null) != (value == null) || (value != null && ! value.equals(__TEL_NUMBER)))\n {\n _isDirty = true;\n }\n __TEL_NUMBER = value;\n }",
"public String getTel() {\r\n return tel;\r\n }",
"void setPhone(int phone);",
"public void setNumero(int numero) { this.numero = numero; }",
"public String getTel() {\n return tel;\n }",
"public String getTel() {\n return tel;\n }",
"public String getTel() {\n return tel;\n }",
"public String getTel() {\n return tel;\n }",
"public String getTel() {\n return tel;\n }",
"public String getTel() {\n return tel;\n }",
"public String getTel() {\n return tel;\n }",
"public String getTel() {\n return tel;\n }",
"public String getTel() {\n return tel;\n }",
"public void atenderTelefone() {\n System.out.println(\"Telefone \" + getNumero() + \" atendido!\");\n notificarTodos();\n }",
"@Test\r\n public void testSetTelefoneCelular() {\r\n System.out.println(\"setTelefoneCelular\");\r\n String telefoneCelular = \"\";\r\n Integrante instance = new Integrante();\r\n instance.setTelefoneCelular(telefoneCelular);\r\n // TODO review the generated test code and remove the default call to fail.\r\n fail(\"The test case is a prototype.\");\r\n }",
"public java.lang.String getNumeroTelefono() {\n\t\treturn _telefonoSolicitudProducto.getNumeroTelefono();\n\t}",
"public String getTelNo() {\n return telNo;\n }",
"public void setTelePhone(java.lang.String telePhone) {\r\n this.telePhone = telePhone;\r\n }",
"public void setTel(java.lang.String param) {\r\n localTelTracker = param != null;\r\n\r\n this.localTel = param;\r\n }",
"public void setTelephone(String telephone) {\n this.telephone = telephone == null ? null : telephone.trim();\n }",
"public void setTelephone(String telephone) {\n this.telephone = telephone == null ? null : telephone.trim();\n }",
"public String getTelNo() {\n return telNo;\n }",
"public java.lang.String getIDTipoTelefono() {\n\t\treturn IDTipoTelefono;\n\t}",
"public String getTelephoneNumber() {\n return telephoneNumber;\n }",
"public Integer getTel() {\n return tel;\n }",
"public void setTelNo(String telNo)\r\n\t{\r\n\t\tthis.telNo = telNo;\r\n\t}",
"public String getTelefone() {\n return telefone;\n }",
"public String getTelephoneNumber(){\n return telephoneNumber;\n }",
"public void set_phone(String Phone)\n {\n phone =Phone;\n }",
"@Test (expected = IllegalArgumentException.class)\n\tpublic void testSetTelephone() {\n\t\tUser user = new User();\n\t\tuser.setTelephone(\"\");\n\t\t//user.setTelephone(\"3393937210\");\n\t\t//assertEquals(\"3393937210\", user.getTelephone());\n\t\t}",
"public void setTel(String tel) {\r\n this.tel = tel == null ? null : tel.trim();\r\n }",
"public void setTel(String tel) {\n this.tel = tel == null ? null : tel.trim();\n }",
"public void setTel(String tel) {\n this.tel = tel == null ? null : tel.trim();\n }",
"public void setTel(String tel) {\n this.tel = tel == null ? null : tel.trim();\n }",
"public void setTel(String tel) {\n this.tel = tel == null ? null : tel.trim();\n }",
"public void setTel(String tel) {\n this.tel = tel == null ? null : tel.trim();\n }",
"public void setPhone(String phone)\r\n/* 46: */ {\r\n/* 47:58 */ this.phone = phone;\r\n/* 48: */ }",
"@Test\r\n public void testSetTelefoneComercial() {\r\n System.out.println(\"setTelefoneComercial\");\r\n String telefoneComercial = \"\";\r\n Integrante instance = new Integrante();\r\n instance.setTelefoneComercial(telefoneComercial);\r\n // TODO review the generated test code and remove the default call to fail.\r\n fail(\"The test case is a prototype.\");\r\n }",
"public void setUserTel(String userTel) {\n this.userTel = userTel;\n }",
"public void setUserTel(String userTel) {\n this.userTel = userTel;\n }",
"public String getTelefone() {\n\t\treturn telefone;\n\t}",
"public String getTelNo()\r\n\t{\r\n\t\treturn this.telNo;\r\n\t}",
"public void setPhone(String phone)\n {\n this.phone = phone;\n }",
"public String getTelephone() {\n return (String) get(\"telephone\");\n }",
"private Long modificarTelefono(Telefono telefono) {\n\t\ttry {\n\t\t\tgTelefono.modify(telefono);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn telefono.getIdTelefono();\n\t}",
"public java.lang.String getTelePhone() {\r\n return telePhone;\r\n }",
"public void setPhone(String phone) {\n this.mPhone = phone;\n }",
"public com.politrons.avro.AvroPerson.Builder setPhoneNumber(java.lang.CharSequence value) {\n validate(fields()[3], value);\n this.phone_number = value;\n fieldSetFlags()[3] = true;\n return this; \n }",
"public String getTelephoneNumber() {\n\t\treturn telephoneNumber;\n\t}",
"public void setComentario (String val) {\n this.comentario = val;\n }",
"public void setIDTipoTelefono(java.lang.String iDTipoTelefono) {\n\t\tIDTipoTelefono = iDTipoTelefono;\n\t}",
"public void setTelphone(String telphone) {\n this.telphone = telphone == null ? null : telphone.trim();\n }",
"@Override\n public void setPhone(java.lang.String phone) {\n _entityCustomer.setPhone(phone);\n }",
"public String getPhone() {\n return phone;\n }",
"public Builder setPhoneNumber(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n phoneNumber_ = value;\n onChanged();\n return this;\n }",
"public void setPhone(String phone) {\r\n this.phone = phone;\r\n }",
"java.lang.String getTelefon();",
"public void setTelphone (java.lang.String telphone) {\r\n\t\tthis.telphone = telphone;\r\n\t}",
"public String getaPhone() {\n return aPhone;\n }"
] | [
"0.835018",
"0.8261006",
"0.81965846",
"0.8005473",
"0.7942225",
"0.7895386",
"0.78072596",
"0.7730229",
"0.7635855",
"0.74571705",
"0.74571705",
"0.7444439",
"0.73657113",
"0.7133341",
"0.71305895",
"0.7128382",
"0.71181273",
"0.70529836",
"0.7023606",
"0.67482436",
"0.6718373",
"0.66958946",
"0.66118866",
"0.66026443",
"0.65451646",
"0.65451646",
"0.65451646",
"0.65451646",
"0.651909",
"0.6493243",
"0.6493243",
"0.64667434",
"0.6464249",
"0.6457427",
"0.6457427",
"0.6442005",
"0.6442005",
"0.6442005",
"0.64051086",
"0.6382204",
"0.6314544",
"0.6311486",
"0.6309658",
"0.6296987",
"0.62896276",
"0.62882274",
"0.62882274",
"0.62882274",
"0.62882274",
"0.62882274",
"0.62882274",
"0.62882274",
"0.62882274",
"0.62882274",
"0.628746",
"0.6282812",
"0.6276643",
"0.6261497",
"0.62570685",
"0.6252726",
"0.6251579",
"0.6251579",
"0.6217506",
"0.6211237",
"0.617223",
"0.61720484",
"0.61671126",
"0.6116323",
"0.61013025",
"0.6094379",
"0.60933256",
"0.6087644",
"0.60827005",
"0.60827005",
"0.60827005",
"0.60827005",
"0.60827005",
"0.6029641",
"0.59992385",
"0.5998082",
"0.5998082",
"0.5965069",
"0.5959206",
"0.59587353",
"0.5950569",
"0.59485215",
"0.5946821",
"0.5931369",
"0.592451",
"0.59019977",
"0.58957267",
"0.5890329",
"0.58889085",
"0.5877284",
"0.5876582",
"0.58740455",
"0.5870276",
"0.5867141",
"0.5866668",
"0.58647877"
] | 0.8282772 | 1 |
Access method for indirizzo. | public String getIndirizzo() {
return indirizzo;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"String getIndirizzo();",
"public IndirizzoBean getIndirizzo() {\n\t\t\treturn indirizzo;\n\t\t}",
"void setIndirizzo(String indirizzo);",
"public void setIndirizzo(String aIndirizzo) {\n indirizzo = aIndirizzo;\n }",
"public void setIndirizzo(IndirizzoBean indirizzo) {\n\t\t\tthis.indirizzo = indirizzo;\n\t\t}",
"public interface IpLocator {\r\n\r\n\t/**\r\n\t * Other than the getters & setters, this is the only method visible to the\r\n\t * outside world\r\n\t * \r\n\t * @param ip\r\n\t * The ip address to be located\r\n\t * @return IPLocator instance\r\n\t * @throws IOException\r\n\t * in case of any error/exception\r\n\t */\r\n\tpublic IpLocation locate(String ip) throws IOException;\r\n\r\n}",
"public interface GoEuroClient {\n List<Position> getPostionsFromGoEuro(String city);\n}",
"@Override\n public Iterator<Location> iterator() {\n return new NeighborhoodIterator(this, new Location(0, 0));\n }",
"public interface IWeatherDataProvider {\n\n\tpublic WeatherData getWeatherData(Location location);\n\t\n}",
"com.example.grpc.SimpleServiceOuterClass.Aois getAois(int index);",
"private IpAddress() {\n\t\tInputStream iis = IpAddress.class.getResourceAsStream(\"/QQWry.dat\");\n\t\tif (iis == null) {\n\t\t\tlog.warn(\"IP地址信息文件没有找到,IP显示功能将无法使用\");\n\t\t\treturn;\n\t\t}\n\n\t\tfinal File dataFile;\n\t\ttry (InputStream is = iis) {\n\t\t\tPath tmp = Files.createTempFile(\"QQWry.dat\", null);\n\t\t\ttmp.toFile().deleteOnExit();\n\n\t\t\ttry (OutputStream out = Files.newOutputStream(tmp, StandardOpenOption.WRITE)) {\n\t\t\t\tbyte[] buf = new byte[8192];\n\t\t\t\tint n;\n\t\t\t\twhile ((n = is.read(buf)) > 0) {\n\t\t\t\t\tout.write(buf, 0, n);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tdataFile = tmp.toFile();\n\t\t} catch (IOException e1) {\n\t\t\tlog.warn(\"读取IP地址信息文件失败,IP显示功能将无法使用\");\n\t\t\tthrow new RuntimeException(e1);\n\t\t}\n\n\t\ttry (RandomAccessFile ipFile = new RandomAccessFile(dataFile, \"r\")) {\n\t\t\tthis.ipBegin = byteArrayToLong(readBytes(ipFile, 0L, 4));\n\t\t\tthis.ipEnd = byteArrayToLong(readBytes(ipFile, 4L, 4));\n\t\t\tif (this.ipBegin != -1L && this.ipEnd != -1L) {\n\t\t\t\tcachedIpFile = new RandomAccessFile(dataFile, \"r\");\n\t\t\t}\n\n\t\t} catch (FileNotFoundException e) {\n\t\t\tlog.warn(\"IP地址信息文件没有找到,IP显示功能将无法使用\", e);\n\t\t} catch (IOException e) {\n\t\t\tlog.warn(\"IP地址信息文件格式有错误,IP显示功能将无法使用\", e);\n\t\t}\n\n\t\tthis.ipSum = (this.ipEnd - this.ipBegin) / 7L + 1L;\n\t}",
"@Override\r\n\t\tpublic boolean getDI(int address) throws IOServiceException {\n\t\t\treturn false;\r\n\t\t}",
"public IAirport getOrigin();",
"protected OpinionFinding() {/* intentionally empty block */}",
"public interface ILocator {\n\n\tpublic void addName(IName name);\n\tpublic void removeName(IName name);\n\tpublic Iterator<IName> getAllNames();\n\t\n}",
"public IEndPointData getLocalEndPoint();",
"public abstract ModuleIps ips();",
"Proxy getProxy();",
"public Iterator<IPessoa> getAtores();",
"public IterI(){\n }",
"private URIs() {\r\n throw new IllegalAccessError();\r\n }",
"InetAddress getInetAddress()\n {\n return inetAddress;\n }",
"@Local\npublic interface IndirizzoFacadeLocal {\n\n void create(Indirizzo indirizzo);\n\n void edit(Indirizzo indirizzo);\n\n void remove(Indirizzo indirizzo);\n\n Indirizzo find(Object id);\n\n List<Indirizzo> findAll();\n\n /** Restituisce tutte le stringe \"citta\" che iniziano con il parametro\n * @param subCitta la stringa da cercare\n * @return una lista di stringhe che rappresentano i nomi delle citta presenti su db\n */\n public List<String> getCitta(String subCitta);\n\n /** carica tutti i nomi della città presenti nel database\n * @return la lista dei nomi delle città sotto forma di String\n */\n public java.util.List<java.lang.String> getCitta();\n\n}",
"private FlyWithWings(){\n\t\t\n\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"public interface AirportInformationConnector {\r\n\r\n /**\r\n * Will return a new object that now contains latitude and longitude.\r\n */\r\n public AirportStub getAirportData(AirportStub airportIn);\r\n\r\n /**\r\n * Will return new objects that now contain latitude and longitude.\r\n */\r\n public List<AirportStub> getAirportData(List<AirportStub> airportIn);\r\n}",
"private static void init() {\n\t\ttry {\n\t\t\tlocalAddr = InetAddress.getLocalHost();\n\t\t\tlogger.info(\"local IP:\" + localAddr.getHostAddress());\n\t\t} catch (UnknownHostException e) {\n\t\t\tlogger.info(\"try again\\n\");\n\t\t}\n\t\tif (localAddr != null) {\n\t\t\treturn;\n\t\t}\n\t\t// other way to get local IP\n\t\tEnumeration<InetAddress> localAddrs;\n\t\ttry {\n\t\t\t// modify your network interface name\n\t\t\tNetworkInterface ni = NetworkInterface.getByName(networkInterface);\n\t\t\tif (ni == null) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tlocalAddrs = ni.getInetAddresses();\n\t\t\tif (localAddrs == null || !localAddrs.hasMoreElements()) {\n\t\t\t\tlogger.error(\"choose NetworkInterface\\n\" + getNetworkInterface());\n\t\t\t\treturn;\n\t\t\t}\n\t\t\twhile (localAddrs.hasMoreElements()) {\n\t\t\t\tInetAddress tmp = localAddrs.nextElement();\n\t\t\t\tif (!tmp.isLoopbackAddress() && !tmp.isLinkLocalAddress() && !(tmp instanceof Inet6Address)) {\n\t\t\t\t\tlocalAddr = tmp;\n\t\t\t\t\tlogger.info(\"local IP:\" + localAddr.getHostAddress());\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tlogger.error(\"Failure when init ProxyUtil\", e);\n\t\t\tlogger.error(\"choose NetworkInterface\\n\" + getNetworkInterface());\n\t\t}\n\t}",
"@Override\r\n\tprotected void verificaUtentePrivilegiato() {\n\r\n\t}",
"public interface CitiesService {\n\n /**\n * @param origin original city\n * @param destination destination city\n * @return true if success, else false\n */\n boolean addConnection(String origin, String destination);\n\n /**\n * @param origin original city\n * @param destination destination city\n * @return true if connected, else false\n */\n boolean isConnected(String origin, String destination);\n\n}",
"@Override\n public ArrayList<ICatLocDetail> getLocalities() {\n return localities;\n }",
"public void setDiretor(IPessoa diretor);",
"@DSSource({DSSourceKind.NETWORK})\n @DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2013-12-30 12:36:07.243 -0500\", hash_original_method = \"E608923787A6482FF0ABAB03074C01F6\", hash_generated_method = \"7955BA736BD8AD783B98FFDED7E574D5\")\n \npublic LocalSocketAddress getLocalSocketAddress()\n {\n return localAddress;\n }",
"public GeoOrigin getGeoOrigin();",
"private void getLocation() {\n\n }",
"private QuadradoPerfeito() {\n }",
"AddressI getAddress();",
"@Override\n public Iterator<T> inOrden(){\n return (super.inOrden());\n }",
"@Override\n public InputStream openStream() throws IOException\n {\n return new FileInputStream(temp);\n }",
"@Override\n\tpublic Iterator<UserInfo> iterator() {\n\t\treturn new WebInfoIterator();\n\t}",
"@Override\n public boolean isPrivate() {\n return true;\n }",
"int getInIp();",
"int getInIp();",
"@RemoteServiceRelativePath(\"getAddress\")\npublic interface AddressService extends RemoteService {\n\tpublic String[] getAddress() throws IOException;\n}",
"public InetAddress getIPAddress ( ) { return _IPAddress; }",
"public ChannelLocator getChannelLocator();",
"public OpIterator iterator() {\n // some code goes here\n // throw new\n // UnsupportedOperationException(\"please implement me for lab2\");\n return new InterAggrIterator();\n }",
"public int getIndirizzoStudiId() {\r\n return this.indirizzoStudiId;\r\n }",
"@Override\n public Iterator<Restaurant> iterator () {\n return this.restaurantList.iterator();\n }",
"public Sommet origine() {\n return origine;\n }",
"public AnotacaoPessoaServico localizarAnotacaoPessoaServico() {\n\n\t\treturn (AnotacaoPessoaServico) localizar(\"locator.capes.AnotacaoPessoaServico\");\n\t}",
"@RemoteServiceRelativePath(\"dataService\")\npublic interface DataService extends RemoteService {\n ArrayList<Point> getPoints(int width, int height, int i, int j) throws IllegalArgumentException,\n IOException;\n}",
"public DataIterator getDefinedData(Address addr, boolean forward);",
"int getExpose();",
"abstract String getRemoteAddress();",
"public AccessPoint() {\n }",
"public interface FeedService {\n\n /**\n * Returns the users that the user specified in the request is following. Uses information in\n * the request object to limit the number of followees returned and to return the next set of\n * followees after any that were returned in a previous request. Uses the {@link } to\n * get the followees from the server.\n *\n * @param request contains the data required to fulfill the request.\n * @return the followees.\n */\n public FeedResponse getFeeds(FeedRequest request);\n\n\n}",
"@Override\n\tWeatherProvider getWeatherProvider(String arg)\n\t{\n\t\treturn new WebxmlWeatherProvider(arg);\n\t}",
"public IndirectionsmeasuringpointFactoryImpl() {\n super();\n }",
"java.util.List<com.example.grpc.SimpleServiceOuterClass.Aois> \n getAoisList();",
"public InvitationListService(Double latitude, Double longitude) {\n this.origin = new LocationDO(latitude, longitude);\n }",
"public DataIterator getData(Address addr, boolean forward);",
"private FeedReaderContract() {}",
"public void getLocation(){\n }",
"Origin getOrigin();",
"public LocatorIF getBase() {\n return base_address;\n }",
"InetAddress getAddress() { return this.address; }",
"public org.davic.net.Locator getServiceLocator();",
"public Boolean getOrigineClient() {\r\n return origineClient;\r\n }",
"public int getInIp() {\n return instance.getInIp();\n }",
"public int getInIp() {\n return instance.getInIp();\n }",
"public interface Locateable extends GeoElementND {\n\t/**\n\t * @param p\n\t * start point\n\t * @throws CircularDefinitionException\n\t * in case the start point depends on this object\n\t */\n\tpublic void setStartPoint(GeoPointND p) throws CircularDefinitionException;\n\n\t/**\n\t * Unregisters start point\n\t * \n\t * @param p\n\t * start point to remove\n\t */\n\tdefault void removeStartPoint(GeoPointND p) {\n\t\tif (p == getStartPoint()) {\n\t\t\tinitStartPoint(p.copy(), 0);\n\t\t}\n\t}\n\n\t/**\n\t * Returns (first) start point\n\t * \n\t * @return start point\n\t */\n\tpublic GeoPointND getStartPoint();\n\n\t/**\n\t * @param p\n\t * start point\n\t * @param number\n\t * index (GeoImage has three startPoints (i.e. corners))\n\t * @throws CircularDefinitionException\n\t * in case the start point depends on this object\n\t */\n\tpublic void setStartPoint(GeoPointND p, int number)\n\t\t\tthrows CircularDefinitionException;\n\n\tdefault int getStartPointCount() {\n\t\treturn 1;\n\t}\n\n\tdefault GeoElementND getStartPoint(int idx) {\n\t\treturn getStartPoint();\n\t}\n\n\t/**\n\t * Sets the startpoint without performing any checks. This is needed for\n\t * macros.\n\t * \n\t * @param p\n\t * start point\n\t * @param number\n\t * index\n\t */\n\tpublic void initStartPoint(GeoPointND p, int number);\n\n\t/**\n\t * @return true iff the location is absolute\n\t */\n\tpublic boolean hasStaticLocation();\n\n\t/**\n\t * @return true iff object is always fixed\n\t */\n\tpublic boolean isAlwaysFixed();\n\n\t/**\n\t * Use this method to tell the locateable that its startpoint will be set\n\t * soon. (This is needed during XML parsing, as startpoints are processed at\n\t * the end of a construction, @see geogebra.io.MyXMLHandler)\n\t */\n\tdefault void setWaitForStartPoint() {\n\t\t// only relevant for vectors\n\t}\n\n\t/**\n\t * Update that does not change value, but only location\n\t */\n\tpublic void updateLocation();\n\n}",
"public OpticalHopAccessBean () {\n super();\n }",
"public interface OperationServiceService extends javax.xml.rpc.Service {\n public java.lang.String getOperationServiceAddress();\n\n public fr.uphf.service.OperationService getOperationService() throws javax.xml.rpc.ServiceException;\n\n public fr.uphf.service.OperationService getOperationService(java.net.URL portAddress) throws javax.xml.rpc.ServiceException;\n}",
"private ServiceLocator() {\r\n\t\t\r\n\t}",
"@Override\n public InetSocketAddress getICELocalReflexiveAddress(String streamName)\n {\n return null;\n }",
"@Override\n\tpublic int whereAmI() {\n\t\treturn 0;\n\t}",
"public InetSocketAddress getOrigin () {\n\t\treturn origin;\n\t}",
"public org.davic.net.Locator getStreamLocator()\n\t{return null;\n\t}",
"public java.lang.String getIp(){\r\n return localIp;\r\n }",
"public java.lang.String getIp(){\r\n return localIp;\r\n }",
"public interface MapsInteractor {\n\n LatLng getCurrentPosition();\n LatLng getDestinyMarker();\n void getDistance();\n void setDestinyMarker(LatLng poLastPosition);\n void removeDestinyMarker();\n void getLastKnowPosition();\n ServiceConnection getLocationConnection();\n void setActivityLive(boolean poActivityLive);\n\n}",
"public interface IUpnpService {\n /**\n * Discover boolean.\n *\n * @param milliseconds the milliseconds\n * @return the boolean\n * @throws NotDiscoverUpnpGatewayException the not discover upnp gateway exception\n */\n boolean discover(int milliseconds) throws NotDiscoverUpnpGatewayException;\n\n /**\n * Discover boolean.\n *\n * @return the boolean\n * @throws NotDiscoverUpnpGatewayException the not discover upnp gateway exception\n */\n boolean discover() throws NotDiscoverUpnpGatewayException;\n\n /**\n * Is discovered boolean.\n *\n * @return the boolean\n */\n boolean isDiscovered();\n\n /**\n * Gets port mapping info.\n *\n * @param externalPort the external port\n * @param protocol the protocol\n * @return the port mapping info\n * @throws NotDiscoverUpnpGatewayException the not discover upnp gateway exception\n * @throws UpnpException the upnp exception\n */\n PortMappingInfo getPortMappingInfo(int externalPort, ProtocolEnum protocol) throws NotDiscoverUpnpGatewayException, UpnpException;\n\n /**\n * Gets port mapping count.\n *\n * @return the port mapping count\n * @throws NotDiscoverUpnpGatewayException the not discover upnp gateway exception\n * @throws UpnpException the upnp exception\n */\n Integer getPortMappingCount() throws NotDiscoverUpnpGatewayException, UpnpException;\n\n /**\n * Gets port mapping info by index.\n *\n * @param index the index\n * @return the port mapping info by index\n * @throws NotDiscoverUpnpGatewayException the not discover upnp gateway exception\n * @throws UpnpException the upnp exception\n */\n PortMappingInfo getPortMappingInfoByIndex(int index) throws NotDiscoverUpnpGatewayException, UpnpException;\n\n /**\n * Gets all mapping infos.\n *\n * @return the all mapping infos\n * @throws NotDiscoverUpnpGatewayException the not discover upnp gateway exception\n * @throws UpnpException the upnp exception\n */\n List<PortMappingInfo> getAllMappingInfos() throws NotDiscoverUpnpGatewayException, UpnpException;\n\n /**\n * Gets internal host address.\n *\n * @return the internal host address\n * @throws NotDiscoverUpnpGatewayException the not discover upnp gateway exception\n */\n String getInternalHostAddress() throws NotDiscoverUpnpGatewayException;\n\n /**\n * Gets external ip address.\n *\n * @return the external ip address\n * @throws NotDiscoverUpnpGatewayException the not discover upnp gateway exception\n * @throws UpnpException the upnp exception\n */\n String getExternalIPAddress() throws NotDiscoverUpnpGatewayException, UpnpException;\n\n /**\n * Add port mapping boolean.\n *\n * @param portMappingInfo the port mapping info\n * @return the boolean\n * @throws NotDiscoverUpnpGatewayException the not discover upnp gateway exception\n * @throws UpnpException the upnp exception\n */\n boolean addPortMapping(PortMappingInfo portMappingInfo) throws NotDiscoverUpnpGatewayException, UpnpException;\n\n /**\n * Delete port mapping boolean.\n *\n * @param externalPort the external port\n * @param protocol the protocol\n * @return the boolean\n * @throws NotDiscoverUpnpGatewayException the not discover upnp gateway exception\n * @throws UpnpException the upnp exception\n */\n boolean deletePortMapping(int externalPort, ProtocolEnum protocol) throws NotDiscoverUpnpGatewayException, UpnpException;\n}",
"private LocationContract() {}",
"public List<Location> neighbors (Location pos);",
"public final Iterable getChainingIterator() {\n\t// TODO: Implemente the chaining iterator and add generic type to Iterable. I suppose it is this class.\n\tthrow new IllegalAccessError(\"Not implemented yet\");\n }",
"public interface LocalHandle {\n\n /**\n * 获取城市名称\n *\n * @param city\n */\n public void getCity(String city);\n}",
"public void referToSpecialist(){\r\n\t\t//here is some code that we do not have access to\r\n\t}",
"public static void main(String[] args) {\n\t\tOfficeInternetAccess access = new ProxyInternetAccess(\"Sohan Chougule\"); \n access.grantInternetAccess(); \n\t}",
"@Override\r\n public Iterator iterator(){\n return new MyIterator(this);\r\n }",
"public boolean setupOwnAddress() {\n\t\tboolean success = false;\n\t\ttry {\n\t\t\tthis.ownAddress = NetworkLayer.getOwnAddress(); // TODO replace by discover?\n\t\t\tthis.showNamedMessage(\"Client listing on: \" + this.ownAddress);\n\t\t\tthis.showNamedMessage(\"NOTE: depending on detection method,\"\n\t\t\t\t\t+ \" this may NOT be the actual interface used\");\n\t\t\tthis.showNamedMessage(\"Discovered preferred local address: \" \n\t\t\t\t\t+ NetworkLayer.discoverLocalAddress());\n\t\t\tsuccess = true;\n\t\t} catch (UnknownHostException e) {\n\t\t\tthis.showNamedMessage(\"Could not determine own address: \" + e.getLocalizedMessage());\n\t\t} \n\t\treturn success;\n\t}",
"public static ListIterator iterator() {\r\n\t\treturn getIterator(Direction.class);\r\n\t}",
"int getAddr();",
"public PublicNetworkAccess publicNetworkAccess() {\n return this.publicNetworkAccess;\n }",
"public PublicNetworkAccess publicNetworkAccess() {\n return this.publicNetworkAccess;\n }",
"@Override\n public Iterator<T> iterator() {\n return new MyArrayList.MyIterator();\n }",
"@Override\n public ListIterator<T> listIterator() {\n throw new UnsupportedOperationException();\n }",
"@Override\n\tpublic void credite() {\n\t\t\n\t}",
"public FlightIterator createIterator() {\r\n\t\treturn new FlightIterator(flights);\r\n\t}",
"LocService getService() {\n return LocService.this;\n }",
"private FeatureIterator<SimpleFeature> getFeatureIterator() throws IOException {\n ILayer editLayer = parameters.handler.getEditLayer();\n FeatureStore<SimpleFeatureType, SimpleFeature> store = getResource(editLayer);\n \n // transforms the bbox to the layer crs \n ReferencedEnvelope bbox = handler.getContext().getBoundingBox(event.getPoint(), SEARCH_SIZE);\n try {\n \tbbox = bbox.transform(parameters.handler.getEditLayer().getCRS(), true);\n } catch (TransformException e) {\n \tlogTransformationWarning(e);\n } catch (FactoryException e) {\n \tlogTransformationWarning(e);\n }\n // creates a bbox filter using the bbox in the layer crs and grabs the features present in this bbox\n Filter createBBoxFilter = createBBoxFilter(bbox, editLayer, filterType);\n FeatureCollection<SimpleFeatureType, SimpleFeature> collection = store.getFeatures(createBBoxFilter);\n \n FeatureIterator<SimpleFeature> reader = new IntersectTestingIterator(bbox, collection.features());\n \n return reader;\n }"
] | [
"0.679553",
"0.63065135",
"0.6237541",
"0.60712075",
"0.5776213",
"0.55290323",
"0.524647",
"0.5246253",
"0.5115533",
"0.50389886",
"0.50343275",
"0.50206304",
"0.5007074",
"0.5001481",
"0.49975973",
"0.4987007",
"0.49588308",
"0.49333736",
"0.49280632",
"0.49096033",
"0.48976088",
"0.48965496",
"0.48861116",
"0.48717925",
"0.48688003",
"0.4866919",
"0.48354936",
"0.48348793",
"0.48215848",
"0.47797176",
"0.47681734",
"0.4755371",
"0.47516376",
"0.47497958",
"0.47400784",
"0.4737326",
"0.47300023",
"0.4729188",
"0.47177505",
"0.47105435",
"0.47099772",
"0.47099772",
"0.47096592",
"0.47093835",
"0.47034025",
"0.47027123",
"0.4693898",
"0.46809125",
"0.46712044",
"0.4670177",
"0.46643248",
"0.4660611",
"0.46574596",
"0.46482915",
"0.46456024",
"0.46441624",
"0.46426874",
"0.46396837",
"0.46356645",
"0.46353093",
"0.46311957",
"0.46284327",
"0.46281713",
"0.4622329",
"0.462231",
"0.4621835",
"0.4619559",
"0.46146125",
"0.46121842",
"0.46121842",
"0.4607415",
"0.46044978",
"0.4599105",
"0.45963842",
"0.45938215",
"0.45911852",
"0.45893946",
"0.45869228",
"0.45853695",
"0.45853695",
"0.4584122",
"0.45811343",
"0.45798746",
"0.45773178",
"0.4577106",
"0.45732692",
"0.45678335",
"0.45625007",
"0.45612618",
"0.45549574",
"0.45542523",
"0.45534015",
"0.45440274",
"0.45440274",
"0.45436203",
"0.45355967",
"0.45329696",
"0.45286366",
"0.45219615",
"0.45140842"
] | 0.6679646 | 1 |
Setter method for indirizzo. | public void setIndirizzo(String aIndirizzo) {
indirizzo = aIndirizzo;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void setIndirizzo(String indirizzo);",
"public void setIndirizzo(IndirizzoBean indirizzo) {\n\t\t\tthis.indirizzo = indirizzo;\n\t\t}",
"public String getIndirizzo() {\n return indirizzo;\n }",
"public void setDiretor(IPessoa diretor);",
"public IndirizzoBean getIndirizzo() {\n\t\t\treturn indirizzo;\n\t\t}",
"private void setInIp(int value) {\n \n inIp_ = value;\n }",
"private void setInIp(int value) {\n \n inIp_ = value;\n }",
"public void setOrigin (InetSocketAddress o) {\n\t\torigin = o;\n\t}",
"public void setOrigen(java.lang.String param){\n \n this.localOrigen=param;\n \n\n }",
"@Override\n\tpublic void setDiretorDoFilme(int idFilme, IPessoa diretor) throws SQLException {\n\t\tIFilme filme = this.buscarFilmePorId(idFilme);\n\t\tif(filme!=null)\n\t\t\tfilme.setDiretor(diretor);\n\t}",
"public QueryLociSetter() {\n super(\"org.tair.db.locusdetail\", 2147483647);\n }",
"public void setDirezione(boolean direzione) {\n\r\n }",
"public void setDireccion(String direccion);",
"public ReadLociSetter() {\n super(\"org.tair.db.locusdetail\", 2147483647);\n }",
"@Override\n \tpublic void setOutboundInterface(InetSocketAddress arg0) {\n \t\t\n \t}",
"private void setIp(int value) {\n \n ip_ = value;\n }",
"private void setIp(int value) {\n \n ip_ = value;\n }",
"@Test\r\n public void testSetEndereco() {\r\n System.out.println(\"setEndereco\");\r\n String endereco = \"\";\r\n Integrante instance = new Integrante();\r\n instance.setEndereco(endereco);\r\n // TODO review the generated test code and remove the default call to fail.\r\n fail(\"The test case is a prototype.\");\r\n }",
"String getIndirizzo();",
"public Builder setInIp(int value) {\n copyOnWrite();\n instance.setInIp(value);\n return this;\n }",
"public Builder setInIp(int value) {\n copyOnWrite();\n instance.setInIp(value);\n return this;\n }",
"public void setIp(java.lang.String param){\r\n localIpTracker = true;\r\n \r\n this.localIp=param;\r\n \r\n\r\n }",
"public void setIp(java.lang.String param){\r\n localIpTracker = true;\r\n \r\n this.localIp=param;\r\n \r\n\r\n }",
"public void setdat()\n {\n }",
"@Override\r\n\tpublic void setIzena(String izena) {\n\t\tsuper.setIzena(izena);\r\n\t}",
"public void setIniter(Initializer initer)\r\n\t{\r\n\t\tif (parent != null)\r\n\t\t\t((ParamComputeUnit) parent).initer = initer;\r\n\t}",
"public void setCodigo(java.lang.String param){\n \n this.localCodigo=param;\n \n\n }",
"public abstract void setInChI(String inchi);",
"public QueryLocusLocusSetter() {\n super(\"org.tair.db.locusdetail\", 2147483647);\n }",
"public void setOnline(int pos){\n }",
"public void setIndirizzoEnte(Optional<String> indirizzoEnte) {\n\t\tthis.indirizzoEnte = indirizzoEnte;\n\t}",
"private void setInPort(int value) {\n \n inPort_ = value;\n }",
"private void setInPort(int value) {\n \n inPort_ = value;\n }",
"void setNome(String nome);",
"public void setObservacion(java.lang.String param){\n \n this.localObservacion=param;\n \n\n }",
"@Override\n\tpublic void setRestaurant(RestaurantChung restaurant) {\n\t\t\n\t}",
"public void setCity(String city);",
"@Test\n public void testSetInterfaceIp() throws Exception {\n isisNeighbor.setInterfaceIp(interfaceIp);\n result2 = isisNeighbor.interfaceIp();\n assertThat(result2, is(interfaceIp));\n }",
"public void setEnderecoImovel(String enderecoImovel) {\r\n this.enderecoImovel = enderecoImovel;\r\n }",
"void setOrigination(Locations origination);",
"@Override\n public void setCity(String a) {\n this.city = a;\n }",
"public void setLocacion(String locacion);",
"public void setOffline(int pos){\n }",
"@IcalProperty(pindex = PropertyInfoIndex.ORIGINATOR,\n eventProperty = true,\n todoProperty = true,\n journalProperty = true,\n freeBusyProperty = true,\n timezoneProperty = true)\n public void setOriginator(final String val) {\n originator = val;\n }",
"@Override\n public void setAdress(Adress adress) {\n this.adress = adress;\n }",
"@Override\n\tpublic void set(SocketAddress v) {\n\t\tsuper.set(Objects.requireNonNull(v));\n\t}",
"@Override\r\n\t\tpublic void setAO(int address, int value) throws IOServiceException {\n\r\n\t\t}",
"@Override\n protected void set(org.tair.db.locusdetail.ILocusDetail dto) {\n locusLocus = dto;\n }",
"public void setIndirizzoStudiId(int indirizzoStudiId) {\r\n this.indirizzoStudiId = indirizzoStudiId;\r\n }",
"public AbstractEstProxy(Est dto) {\n super(dto);\n\n // Setter arrays\n readObjectSetters = new java.util.concurrent.CopyOnWriteArrayList<com.poesys.db.dto.ISet>();\n }",
"protected static void setProxyLocation(URI proxyLocation) {\n Program.proxyLocation = proxyLocation;\n Program.proxyLocationSet = true;\n }",
"@Override\n \tpublic void setOutboundInterface(InetAddress arg0) {\n \t}",
"@Override\r\n public void setIPAddress(String address) {\r\n this.address = address;\r\n }",
"public void setInicio(String inicio) {\n this.inicio = inicio;\n }",
"Origins(String origin){\n\t\tthis.origin = origin;\n\t}",
"public void setOrigin(java.lang.String origin)\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(ORIGIN$16, 0);\n if (target == null)\n {\n target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(ORIGIN$16);\n }\n target.setStringValue(origin);\n }\n }",
"void setMonto(double monto);",
"void setMonto(double monto);",
"public void setAdresse(String adresse)\n {\n this.adresse = adresse;\n }",
"public void setNome(String pNome){\n this.nome = pNome;\n }",
"protected void setCities(Vector<Site> cities){\n this.cities=cities;\n }",
"public void setNumeroInicial(int numeroInicial)\r\n/* 185: */ {\r\n/* 186:198 */ this.numeroInicial = numeroInicial;\r\n/* 187: */ }",
"public void setBase(LocatorIF base_address) {\n this.base_address = base_address;\n }",
"private void set(int x, int i) {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }",
"public void setDestination (InetSocketAddress o) {\n\t\torigin = o;\n\t}",
"public void setMontoEstimado(double param){\n \n this.localMontoEstimado=param;\n \n\n }",
"Restaurant setRestaurantAddress(Address address);",
"protected void setProxiedClient(URL paramURL, String paramString, int paramInt, boolean paramBoolean) throws IOException {\n/* 143 */ this.delegate.setProxiedClient(paramURL, paramString, paramInt, paramBoolean);\n/* */ }",
"public void setEmpresa(Empresa empresa)\r\n/* 89: */ {\r\n/* 90:141 */ this.empresa = empresa;\r\n/* 91: */ }",
"public int getIndirizzoStudiId() {\r\n return this.indirizzoStudiId;\r\n }",
"public void setPort(int param){\r\n \r\n // setting primitive attribute tracker to true\r\n localPortTracker =\r\n param != java.lang.Integer.MIN_VALUE;\r\n \r\n this.localPort=param;\r\n \r\n\r\n }",
"public void setPort(int param){\r\n \r\n // setting primitive attribute tracker to true\r\n localPortTracker =\r\n param != java.lang.Integer.MIN_VALUE;\r\n \r\n this.localPort=param;\r\n \r\n\r\n }",
"public abstract void setAtis(java.lang.Long newAtis);",
"@Override\n\t\tpublic void set(E arg0) {\n\t\t\t\n\t\t}",
"public abstract void setCity(String sValue);",
"public void setOrigin(int source) {\r\n\t\tthis.origin = source;\r\n\t}",
"public void setAddress(String address);",
"public void setAddress(String address);",
"public void setAddress(String address);",
"public void setAddress(String address);",
"public void setAtores(Iterator<IPessoa> atores);",
"public void setMyCidade(Location myCidade)\n {\n this.myCidade = myCidade;\n }",
"public void setServicioSRI(ServicioSRI servicioSRI)\r\n/* 106: */ {\r\n/* 107:125 */ this.servicioSRI = servicioSRI;\r\n/* 108: */ }",
"public void setNome(String nome){\r\n this.nome = nome;\r\n }",
"public void setDireccion(Direccion direccion) {\n this.direccion = direccion;\n }",
"public void setAddress(int address)\n {\n this.address = address;\n }",
"@Setteri\n public void asetaLiite(Tiedosto liite){\n this.liite = liite;\n }",
"public void setAdress(Adress adr) {\r\n // Bouml preserved body begin 00040F82\r\n\t this.adress = adr;\r\n // Bouml preserved body end 00040F82\r\n }",
"private void setMyLatLong() {\n }",
"@Test\r\n public void testSetProxy() {\r\n // Not required\r\n }",
"public void setItuRegion(int param) {\n if (param == java.lang.Integer.MIN_VALUE) {\n localItuRegionTracker = false;\n } else {\n localItuRegionTracker = true;\n }\n this.localItuRegion = param;\n }",
"public void setServicioFacturaProveedorSRI(ServicioFacturaProveedorSRI servicioFacturaProveedorSRI)\r\n/* 116: */ {\r\n/* 117:133 */ this.servicioFacturaProveedorSRI = servicioFacturaProveedorSRI;\r\n/* 118: */ }",
"public QueryPolymorphismSiteSetter() {\n super(\"org.tair.db.locusdetail\", 2147483647);\n }",
"public static void setPedido(Pedido pPedido){\n\t\tmiPedido = pPedido;\n\t}",
"public void setAnio(int p) { this.anio = p; }",
"public void setI(boolean i) {\n\tthis.i = i;\n }",
"public abstract void setUsuario(\n\t\tco.com.telefonica.atiempo.ejb.eb.UsuarioLocal anUsuario);",
"public Builder setIp(int value) {\n copyOnWrite();\n instance.setIp(value);\n return this;\n }",
"public Builder setIp(int value) {\n copyOnWrite();\n instance.setIp(value);\n return this;\n }",
"public void setMontoSolicitado(double param){\n \n this.localMontoSolicitado=param;\n \n\n }"
] | [
"0.7910704",
"0.6523797",
"0.6286844",
"0.61611694",
"0.5869526",
"0.5706212",
"0.5706212",
"0.54950005",
"0.53249365",
"0.530119",
"0.52870214",
"0.5285053",
"0.52740127",
"0.52488536",
"0.5247482",
"0.5225386",
"0.5225386",
"0.5215256",
"0.5203262",
"0.51871884",
"0.51871884",
"0.51824915",
"0.51824915",
"0.51673263",
"0.5166115",
"0.514527",
"0.51169753",
"0.5109172",
"0.5106521",
"0.5097559",
"0.50967526",
"0.50897235",
"0.50897235",
"0.5083569",
"0.5080818",
"0.50622624",
"0.50608945",
"0.5056379",
"0.50527966",
"0.50509477",
"0.50419295",
"0.5040149",
"0.50367075",
"0.50301105",
"0.5026682",
"0.49918604",
"0.49903533",
"0.4989882",
"0.49877933",
"0.49843562",
"0.49743783",
"0.49732238",
"0.49566305",
"0.49528924",
"0.49486038",
"0.49443302",
"0.49423626",
"0.49423626",
"0.49378803",
"0.49370074",
"0.49262303",
"0.4920957",
"0.491987",
"0.49181122",
"0.491605",
"0.49127147",
"0.49044147",
"0.49002355",
"0.48991826",
"0.4898052",
"0.4895551",
"0.4895551",
"0.4894181",
"0.48931482",
"0.48926076",
"0.4889103",
"0.48881993",
"0.48881993",
"0.48881993",
"0.48881993",
"0.48812744",
"0.48803225",
"0.4875565",
"0.48679352",
"0.48658445",
"0.48542202",
"0.4844208",
"0.4840678",
"0.48399842",
"0.48384264",
"0.48354352",
"0.4831767",
"0.48317134",
"0.48264185",
"0.48235896",
"0.481658",
"0.4815497",
"0.4815185",
"0.4815185",
"0.48121515"
] | 0.7103657 | 1 |
Access method for citta. | public String getCitta() {
return citta;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public Citation getAuthority() {\n return SimpleCitation.NETCDF;\n }",
"public void setCitta(String aCitta) {\n citta = aCitta;\n }",
"public void Citation() {\n\t}",
"public String getCitation();",
"private ISciIntInstituicaoCTA obterInstituicaoCTA(Integer idInstituicao) throws BancoobException {\n\t\tISciIntInstituicaoCTA instituicaoCTA = null;\n\t\ttry{\n\t\t\tInteger numeroCooperativa = obterNumeroCooperativa(idInstituicao);\n\t\t\tSciIntHierarquiaInstituicaoCTADelegate hierarquiaInstituicaoCTADelegate = SciIntFabricaDelegate.getInstance().criarSciIntHierarquiaInstituicaoCTADelegate();\n\t\t\tinstituicaoCTA = hierarquiaInstituicaoCTADelegate.recuperarInstituicao(numeroCooperativa);\n\t\t} catch (SciIntInstituicaoInativaException ie) {\n\t\t\tthrow new SciIntInstituicaoInativaException(ie.getMessage());\n\t\t} catch (BancoobException e) {\n\t\t\tthis.getLogger().erro(e, e.getMessage());\n\t\t\tthrow new IntegracaoInstituicaoException(e);\n\t\t}\n\t\treturn instituicaoCTA;\n\t}",
"public interface InformationSource {\n\n /**\n * Returns a string suitable for citing this source.\n *\n * @return a string suitable for citing this source.\n */\n String getCitationString();\n\n /**\n *\n * @return the CycL term representing this source.\n */\n DenotationalTerm getCycL();\n\n /**\n * Returns a graphical representation of this source.\n *\n * @return a graphical representation of this source.\n */\n /*\n public Image getIcon() {\n return icon;\n }\n */\n URL getIconURL();\n \n public interface CitationGenerator {\n /**\n * Ask Cyc for an image for the citation string to use for the specified source.\n *\n * @param source\n * @param cycAccess\n * @return the citation string\n */\n public String getCitationStringForSource(DenotationalTerm source,\n CycAccess cycAccess) throws CycConnectionException;\n }\n \n}",
"public CuentaContable getCuentaContable()\r\n/* 299: */ {\r\n/* 300:367 */ return this.cuentaContable;\r\n/* 301: */ }",
"public abstract java.lang.String getAcma_descripcion();",
"public abstract co\n\t\t.com\n\t\t.telefonica\n\t\t.atiempo\n\t\t.ejb\n\t\t.eb\n\t\t.Catalogo_causalLocal getCatalogo_causal();",
"public String getCocAtcn() {\n\t\treturn cocAtcn;\n\t}",
"public abstract String getCvAccession();",
"public abstract IAccessor getAccessor(IContext context);",
"public double getAuthority() {\n \treturn this.CTCAuthority;\n }",
"public CuentaContable getCuentaContable()\r\n/* 78: */ {\r\n/* 79: 99 */ return this.cuentaContable;\r\n/* 80: */ }",
"com.soa.SolicitarCreditoDocument.SolicitarCredito getSolicitarCredito();",
"public List<SermCit> getCits(){\n return citations;\n }",
"java.lang.String getCit();",
"public abstract java.lang.String getTica_id();",
"public abstract Annotations mo30682c();",
"private TableAccessET() {\n\n }",
"public interface XcdlAccess {\n /**\n * @return Possibly nested lists of properties, extracted from the XCDL file and wrapped into a CharacterizeResult\n * (which can be used with the {@link CompareProperties} interface). Note that this only returns a\n * restricted part of the XCDL. For complete access to the XCDL, use {@link XcdlParser}.\n */\n CharacteriseResult getCharacteriseResult();\n}",
"public interface AbstractC14725a {\n void lookCertificate();\n }",
"public CuentaContable getCuentaContableCierre()\r\n/* 98: */ {\r\n/* 99:115 */ return this.cuentaContableCierre;\r\n/* 100: */ }",
"AcctgTrans getAcctgTrans();",
"public CmsCISimple getToCi() {\n return toCi;\n }",
"protected abstract void retrievedata();",
"ConjuntoTDA claves();",
"public abstract int forca();",
"@Override\n\tpublic void coba() {\n\t\t\n\t}",
"public String getName ( ) {\r\n\t\treturn \"MSX Infrared Astrometric Catalog\";\r\n\t}",
"public java.lang.String getATC() {\n return ATC;\n }",
"String getCADENA_TRAMA();",
"public ACommunity getCisInformation(String client, String cisId);",
"Object getXtrc();",
"Object getXtrc();",
"Information getInfo();",
"String getAccess();",
"String getAccess();",
"@Override\n\tpublic void readCpteCourant(CompteCourant cpt) {\n\t\t\n\t}",
"public abstract String getTextToPrint(JCas aJCas);",
"private void getAI(){\n\n }",
"abstract public T getInfo();",
"public X509Certificate getAikCa() {\n log.debug(\"target: {}\", getTarget().getUri().toString());\n X509Certificate aik = getTarget()\n .path(\"/aik/ca\")\n .request()\n .accept(CryptoMediaType.APPLICATION_PKIX_CERT)\n .get(X509Certificate.class);\n return aik;\n }",
"public contrustor(){\r\n\t}",
"public Catalog getCatalog();",
"public interface CRAccess {\n\n\t/**\n\t * Returns the node for the given path - The path must be a simple canonical path.\n\t * (No filters, relative paths, etc.)\n\t */\n\tNode getNode(String path);\n\n\t/**\n\t * Returns all nodes in the given path (e.g. /cmsblog/articles/ will return\n\t * { Node(/cmsblog), Node(/articles) }\n\t */\n\tNode[] getNodesInPath(String path);\n\t\n\tNodeType getNodeType(String path);\n\n\tNode getParentNode(Node node);\n\n\tNode resolveNode(Node currentNodeContext, String ref);\n\t\n\t/**\n\t * Returns all direct children of the current node.\n\t */\n\tNode[] getChildren(Node node);\n\t\n\t/* Node[] filterNode() */\n\t\n\t/**\n\t * close the repository/transaction, if the repository is writable this will also commit the changes\n\t */\n\tvoid close();\n\t\n\t/**\n\t * @return <code>true</code> if the repository supports transactions, otherwhise return <code>false</code>.\n\t */\n\tboolean supportsTransaction();\n\t\n\tpublic <T extends CRAdapter> T getAdapter(Class<T> adapterInterface);\n}",
"public abstract String getAuthor();",
"public Causa getCausa() {\n return causa.get();\n }",
"public Punto getCentro() {\r\n\treturn centro;\r\n}",
"public String getAccess();",
"public interface C1361a {\n /* renamed from: ix */\n Info mo7564ix();\n }",
"public COSDictionary getCOSDictionary() {\n/* 62 */ return this.dictionary;\n/* */ }",
"void setCit(java.lang.String cit);",
"public abstract java.lang.String getIdpcTV();",
"public String getattribut() \n\t{\n\t\treturn attribut;\n\t}",
"public interface CompanyIndexed {\n\n String getCompanyName();\n\n long getCIK();\n\n}",
"abstract public Assoc getAssoc();",
"@Override\n\tpublic void credite() {\n\t\t\n\t}",
"private ApiInfo metadata() {\n\t\treturn new ApiInfoBuilder().title(\"# Online Home Decor Store #\")\n\t\t\t\t.description(\"Suppliers and Categories operations are present\").build();\t\n\t}",
"public abstract String tiposervicio();",
"private HardCodedCitations() {\n }",
"CurrentAccess getca(final BwEvent ev) {\n return get(ev.getId());\n }",
"@Override\r\n\t\tpublic String nazivLika() {\r\n\t\t\treturn \"ELIPSA\";\r\n\t\t}",
"public CianetoClass() {\r\n this.cianetoMethods = new Hashtable<String, Object>();\r\n this.cianetoAttributes = new Hashtable<String, Object>();\r\n }",
"@Accessor(qualifier = \"certificateData\", type = Accessor.Type.GETTER)\n\tpublic String getCertificateData()\n\t{\n\t\treturn getPersistenceContext().getPropertyValue(CERTIFICATEDATA);\n\t}",
"public StructuredData getStructuredDataAttribute();",
"String getArcrole();",
"Context mo1490b();",
"public abstract List<String> getAdditionalAccessions();",
"void printtCFT(tCFT iTCFT)\n {\n System.out.println(iTCFT.getElementValue());\n }",
"@Override\r\n\tpublic Category getElementAt(int index) {\n\t\treturn cs.get(index);\r\n\t}",
"public CourseMemberGet() {\n\t\tsuper();\n\t}",
"protected MetadataUGWD() {/* intentionally empty block */}",
"public IFuture<ItemInfo[]> getCatalog()\n\t{\n\t\tfinal Future<ItemInfo[]> ret = new Future<ItemInfo[]>();\n\t\tShopCapa shop = (ShopCapa)capa.getPojoCapability();\n\t\tret.setResult(shop.getCatalog().toArray(new ItemInfo[shop.getCatalog().size()]));\n\t\treturn ret;\n\t}",
"TetrisObject getCurrentTetrisObject();",
"@Override\n\tprotected void getDataFromUCF() {\n\n\t}",
"public Boolean isAvisCourtier() {\r\n return avisCourtier;\r\n }",
"public String getEtiqueta()\n/* 27: */ {\n/* 28:41 */ return this.etiqueta;\n/* 29: */ }",
"private static void cajas() {\n\t\t\n\t}",
"public java.lang.String getCA() {\n return CA;\n }",
"public List<LicenseAttribution> getAttribution() {\r\n return attribution;\r\n }",
"void toca();",
"private void cargartabla() {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }",
"public IVA getIva() {\n return iva;\n }",
"public void CobroCiatCasaCiat() throws GWorkException {\r\n\t\tListarVehiculosCiatCasaCiat();\r\n\t}",
"@Override // Métodos que fazem a anulação\n\tpublic void getBonificação() {\n\t\t\n\t}",
"private CalciteKuduTable getTable() {\n return (CalciteKuduTable) table;\n }",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"void printClassAcft(ClassAcft iClassAcft)\n {\n System.out.println(iClassAcft.getElementValue());\n }",
"public void asetaTeksti(){\n }",
"amdocs.iam.pd.pdwebservices.GetQuoteDocument.GetQuote getGetQuote();",
"com.soa.SolicitarServicioDocument.SolicitarServicio getSolicitarServicio();",
"public void cocinar(){\n\n }",
"public ISalesTax getTaxObject();",
"public COSDictionary getCOSObject() {\n/* 60 */ return this.actions;\n/* */ }",
"public interface Contributor\n extends Keyed\n{\n Collection<Attribute> createAttributesFor( Key key, Content content, Record cr );\n}",
"private DittaAutonoleggio(){\n \n }",
"public CompoundInfo getCompoundInfo() {\r\n\treturn formalCompound.getCompoundInfo();\r\n}",
"public java.lang.String getCodigo(){\n return localCodigo;\n }",
"public boolean isAuthorityIndex() {\n return \"metadataAuthority\".equals(displayType);\n }"
] | [
"0.5982671",
"0.5778872",
"0.5732458",
"0.5590885",
"0.55776113",
"0.55254024",
"0.5482353",
"0.5477882",
"0.5439687",
"0.5439338",
"0.54152125",
"0.5382306",
"0.53792644",
"0.5362916",
"0.5355756",
"0.53519255",
"0.53501785",
"0.5349878",
"0.532165",
"0.5279278",
"0.52340275",
"0.52337915",
"0.5205578",
"0.5201212",
"0.51927286",
"0.5191287",
"0.51881427",
"0.51804215",
"0.5170553",
"0.51581675",
"0.51579887",
"0.5153889",
"0.5142214",
"0.5140666",
"0.5140666",
"0.5113998",
"0.5103129",
"0.5103129",
"0.50916994",
"0.50887316",
"0.5083717",
"0.50834775",
"0.50595933",
"0.5051917",
"0.5051057",
"0.50486225",
"0.50468373",
"0.50455815",
"0.5040574",
"0.5031528",
"0.50244856",
"0.5022855",
"0.5021822",
"0.5012284",
"0.5002749",
"0.5001147",
"0.5000287",
"0.49970728",
"0.49939778",
"0.4989801",
"0.4987544",
"0.49851552",
"0.49775705",
"0.4972873",
"0.49704596",
"0.49679765",
"0.4967728",
"0.49653286",
"0.49620646",
"0.49541563",
"0.4948798",
"0.49469137",
"0.4945268",
"0.49444142",
"0.49427864",
"0.4942441",
"0.49417323",
"0.49390605",
"0.49337056",
"0.49279687",
"0.49267235",
"0.4926418",
"0.4926086",
"0.49260762",
"0.49255475",
"0.49251565",
"0.492138",
"0.49199492",
"0.49187624",
"0.4911285",
"0.4911142",
"0.49111181",
"0.49091962",
"0.49076822",
"0.49036106",
"0.48935595",
"0.48912603",
"0.4887046",
"0.48864675",
"0.48844147"
] | 0.6670764 | 0 |
Setter method for citta. | public void setCitta(String aCitta) {
citta = aCitta;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void setCit(java.lang.String cit);",
"public String getCitta() {\n return citta;\n }",
"public void setITALoc(int ITAIndex, int loc){\r\n\t\tif(ITAIndex < 0 || ITAIndex > Model.getITACount())\r\n\t\t\t;\r\n\t\telse\r\n\t\t\tthis.locVec[ITAIndex] = loc;\r\n\t}",
"public void setCuentaContable(CuentaContable cuentaContable)\r\n/* 83: */ {\r\n/* 84:103 */ this.cuentaContable = cuentaContable;\r\n/* 85: */ }",
"public void setCuentaContable(CuentaContable cuentaContable)\r\n/* 304: */ {\r\n/* 305:371 */ this.cuentaContable = cuentaContable;\r\n/* 306: */ }",
"public abstract void setTica_id(java.lang.String newTica_id);",
"public abstract void setInChI(String inchi);",
"public abstract void setAcma_valor(java.lang.String newAcma_valor);",
"public void setATC(java.lang.String ATC) {\n this.ATC = ATC;\n }",
"public ChainingMethods setTraccia(String traccia) {\n this.traccia = traccia;\n\n return this;\n }",
"public void setCitation(String citation);",
"public void setTrangthaiChiTiet(int trangthaiChiTiet);",
"public abstract void setCod_tecnico(java.lang.String newCod_tecnico);",
"public void setCidade(String cidade) {// Altera o nome da cidade.\r\n\t\tthis.cidade = cidade;\r\n\t}",
"public void setCijena(double value) {\r\n this.cijena = value;\r\n }",
"@Accessor(qualifier = \"certificateData\", type = Accessor.Type.SETTER)\n\tpublic void setCertificateData(final String value)\n\t{\n\t\tgetPersistenceContext().setPropertyValue(CERTIFICATEDATA, value);\n\t}",
"public void setAltura(int newAlt){\n this._altura=newAlt;\n }",
"private void setCitations(int rowIndex, String value) {\n\t\ttable.setString(rowIndex, CITATIONS_COLUMN_NAME, value);\n\t}",
"@Override\n public void setCity(String a) {\n this.city = a;\n }",
"public void setCena(double cena) {\r\n\t\tthis.cena = cena;\r\n\t}",
"@Override\r\n\tpublic void setIzena(String izena) {\n\t\tsuper.setIzena(izena);\r\n\t}",
"public void setCuentaContableCierre(CuentaContable cuentaContableCierre)\r\n/* 103: */ {\r\n/* 104:119 */ this.cuentaContableCierre = cuentaContableCierre;\r\n/* 105: */ }",
"void setIVA(float iva);",
"public void setAccidentCircumstance(typekey.AccidentCircumstancePEL value);",
"@Setteri\n public void asetaLiite(Tiedosto liite){\n this.liite = liite;\n }",
"public abstract void setAtis(java.lang.Long newAtis);",
"public abstract void setAcma_cierre(java.lang.String newAcma_cierre);",
"public void setToCi(CmsCISimple toCi) {\n this.toCi = toCi;\n }",
"public void setCodigo(java.lang.String param){\n \n this.localCodigo=param;\n \n\n }",
"void setTitolo(String titolo);",
"public void setIraT(IRAT iraT) {\n\t\tthis.iraT = iraT;\n\t}",
"public void setAttrib(gov.nih.nlm.ncbi.www.soap.eutils.efetch_pmc.Attrib attrib) {\r\n this.attrib = attrib;\r\n }",
"public void setAutorizacion(String autorizacion)\r\n/* 139: */ {\r\n/* 140:236 */ this.autorizacion = autorizacion;\r\n/* 141: */ }",
"public void setCuenta(String cuenta) {\r\n this.cuenta = cuenta;\r\n }",
"public void setCity( EAIMMCtxtIfc theCtxt, java.lang.String theCity) throws EAIException;",
"void setDatty(Datty newDatty);",
"@Override\n public void set(C content) {\n this.content = content;\n }",
"void setInternal(ATTRIBUTES attribute, Object iValue);",
"public void setdat()\n {\n }",
"String setValue();",
"@RdfProperty(\"http://www.coadunation.net/schema/rdf/1.0/base#IdValue\")\n public abstract void setValue(String value);",
"public void setCodProd(IProduto codigo);",
"public void setC(CCode c) {\n \t\tthis.c = c;\n \t}",
"private static void setCoor(String text, Annotation anotacion) {\r\n\t\tString[] trozo = text.split(\"\\\\|\");\r\n\r\n\t\tint puntero = -1;\r\n\r\n\t\tif (trozo[0].indexOf(\"subrayado\") > 0) {\r\n\t\t\tanotacion.setTipo(Annotation.SUB);\r\n\t\t} else if (text.indexOf(\"nota\") > 0) {\r\n\t\t\tanotacion.setTipo(Annotation.NOT);\r\n\t\t} else if (trozo[0].indexOf(\"marcador\") > 0) {\r\n\t\t\tanotacion.setTipo(Annotation.MAR);\r\n\t\t}\r\n\r\n\t\tif ((puntero = trozo[0].indexOf(\"página\")) > 0) {\r\n\t\t\tanotacion.setPaginaIni(Integer.parseInt(trozo[0].substring(puntero + 7, trozo[0].length()).trim()));\r\n\t\t}\r\n\r\n\t\tif ((puntero = trozo[1].indexOf(\"posición\")) > 0) {\r\n\t\t\tString[] coor = trozo[1].substring(puntero + 9, trozo[1].length()).trim().split(\"-\");\r\n\t\t\tanotacion.setPosIni(Integer.parseInt(coor[0]));\r\n\t\t\tif (coor.length > 1) {\r\n\t\t\t\tanotacion.setPosFin(Integer.parseInt(coor[1]));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tString fecha = trozo[trozo.length - 1];\r\n\t\tanotacion.setFecha(getDate(fecha));\r\n\t}",
"public void setAuthority(double authority) {\n \tthis.CTCAuthority = authority;\n }",
"public void setEntidad(T entidad) {\r\n this.entidad = entidad;\r\n fillData(entidad);\r\n }",
"public abstract void setApellido(java.lang.String newApellido);",
"void xsetCit(org.apache.xmlbeans.XmlString cit);",
"public void setAccidentDetail(typekey.AccidentDetailPEL value);",
"public void setCrust(){\n this.crust = \"Thin\";\n }",
"public abstract void setCntCod(int cntCod);",
"public void setDtCuentaContable(DataTable dtCuentaContable)\r\n/* 314: */ {\r\n/* 315:379 */ this.dtCuentaContable = dtCuentaContable;\r\n/* 316: */ }",
"public void setAttVCA(int att){\n\t\t\n\t\tsuper.setAttVCA((att == 0)? 1 : att );\n\t}",
"public void setIT(java.lang.String IT) {\n this.IT = IT;\n }",
"@Override\n\tprotected void setValue(String name, TipiValue tv) {\n\t}",
"public void setATA_CD( String aTA_CD ) {\n ATA_CD = aTA_CD;\n }",
"public void setCValue(V value);",
"public void setEtiqueta(String etiqueta)\n/* 32: */ {\n/* 33:48 */ this.etiqueta = etiqueta;\n/* 34: */ }",
"public abstract void setCity(String sValue);",
"@Override\r\n public <T extends Serializable> void setResource(Class<T> c, T markovChain)\r\n {\n \r\n }",
"public void setEmpresa(Empresa empresa)\r\n/* 89: */ {\r\n/* 90:141 */ this.empresa = empresa;\r\n/* 91: */ }",
"public void settInn(T element);",
"@Override\n public void set(T value) throws Exception {\n _curator.setData().forPath(_zkPath, toZkBytes(value));\n }",
"public void setAnio(int anio){\r\n \r\n \r\n this.anio = anio;\r\n \r\n }",
"public void setTarjeta(Payment cuenta){\n this.cuenta = cuenta;\n }",
"@JsonSetter(\"countryCodeA3\")\r\n public void setCountryCodeA3 (String value) { \r\n this.countryCodeA3 = value;\r\n }",
"public void setCodigo_agencia(java.lang.String newCodigo_agencia);",
"public void setKontaktai(String kontaktai) {\r\n\t\tthis.kontaktai = kontaktai;\r\n\t}",
"public Value.Builder setAktif(boolean value) {\n validate(fields()[6], value);\n this.aktif = value;\n fieldSetFlags()[6] = true;\n return this;\n }",
"public void setForua(boolean newValue);",
"public void Citation() {\n\t}",
"@Override\n protected void set(org.tair.db.locusdetail.ILocusDetail dto) {\n locusLocus = dto;\n }",
"@Override\n\tpublic void setValue(final int attIndex, final String value) {\n\n\t}",
"public abstract void setCntFtc(int cntFtc);",
"public void setCuenta(Cuenta cuenta) {\r\n this.cuenta = cuenta;\r\n fireTableDataChanged();\r\n }",
"public void setUtente(Utente aUtente) {\n utente = aUtente;\n }",
"void setValue(T value)\n\t\t{\n\t\t\tthis.value = value;\n\t\t}",
"void setCognome(String cognome);",
"public void setAvisCourtier(Boolean avisCourtier) {\r\n this.avisCourtier = avisCourtier;\r\n }",
"public abstract void setCatalogo_causal(\n\t\tco.com.telefonica.atiempo.ejb.eb.Catalogo_causalLocal aCatalogo_causal);",
"public QueryLociSetter() {\n super(\"org.tair.db.locusdetail\", 2147483647);\n }",
"public void setMoTa(String moTa);",
"public abstract void setValue(Context c, Object v) throws PropertyException;",
"public void setAttributes(EncodingAlgorithmAttributes atts) {\n _length = atts.getLength();\n if (_length > 0) {\n \n if (_length >= _algorithmData.length) {\n resizeNoCopy();\n }\n \n int index = 0;\n for (int i = 0; i < _length; i++) {\n _data[index++] = atts.getURI(i);\n _data[index++] = atts.getLocalName(i);\n _data[index++] = atts.getQName(i);\n _data[index++] = atts.getType(i);\n _data[index++] = atts.getValue(i);\n _data[index++] = atts.getAlgorithmURI(i);\n _algorithmIds[i] = atts.getAlgorithmIndex(i);\n _algorithmData[i] = atts.getAlgorithmData(i);\n _toIndex[i] = false;\n _alphabets[i] = null;\n }\n }\n }",
"public YearToCentury(int year) // defining method YearToCentury with int value year\r\n\t{\r\n\t\tthis.year = year; // value of year = this.year\r\n\t}",
"public void setSettlement(Settlement set);",
"public void setIdentificacion(String identificacion)\r\n/* 128: */ {\r\n/* 129:233 */ this.identificacion = identificacion;\r\n/* 130: */ }",
"@IcalProperties({\n @IcalProperty(pindex = PropertyInfoIndex.CTOKEN,\n required = true,\n eventProperty = true,\n todoProperty = true,\n journalProperty = true,\n freeBusyProperty = true\n ),\n @IcalProperty(pindex = PropertyInfoIndex.ETAG,\n jname = \"etag\",\n eventProperty = true,\n todoProperty = true,\n journalProperty = true,\n freeBusyProperty = true\n ),\n @IcalProperty(pindex = PropertyInfoIndex.LASTMODSEQ,\n jname = \"lastModifiedSeq\",\n eventProperty = true,\n todoProperty = true,\n journalProperty = true,\n freeBusyProperty = true\n )}\n )\n public void setCtoken(final String val) {\n ctoken = val;\n }",
"public void set(Term t) {\n \t\ttry {\n \t\t\tsetFunctor(t.functor);\n \t\t\tterms = t.getDeepCopyOfTerms();\n \t\t} catch (Exception e) {\n \t\t\tSystem.err.println(\"Error setting value for term \");\n \t\t\te.printStackTrace();\n \t\t}\n \t}",
"public void setTorihikisakicd(String torihikisakicd) {\r\n this.torihikisakicd = torihikisakicd;\r\n }",
"public abstract void setCod_localidad(java.lang.String newCod_localidad);",
"public void setStateTrac(Long stateTrac) {\n this.stateTrac = stateTrac;\n }",
"public void setCastraveti(int castraveti) {\n\t\tthis.castraveti = castraveti;\n\t}",
"protected void\nsetTranspTypeElt( int type) \n\n{\n coinstate.transptype = type;\n}",
"public void setSatellite( Satellite sat ) {\r\n /*========================================================================*/ \r\n this.sat = sat;\r\n }",
"public AdesaoPacoteTarifaUpdate idPacoteTarifa(Long idPacoteTarifa) {\n this.idPacoteTarifa = idPacoteTarifa;\n return this;\n }",
"public abstract void setAcma_id(java.lang.Long newAcma_id);",
"public void setEstablecimiento(String establecimiento)\r\n/* 119: */ {\r\n/* 120:198 */ this.establecimiento = establecimiento;\r\n/* 121: */ }",
"public void setTav(char newTav)\r\n\t{\r\n\t this.tav=newTav;\r\n\t}",
"@Override\n public void setValueAt( Object aValue, Object node, int column )\n {\n }"
] | [
"0.67936385",
"0.66113067",
"0.5744853",
"0.57074016",
"0.56736743",
"0.5630993",
"0.55941486",
"0.5593436",
"0.55178607",
"0.5495644",
"0.5480809",
"0.54614556",
"0.54583037",
"0.54396874",
"0.53865",
"0.5376045",
"0.5363448",
"0.53620255",
"0.5360074",
"0.5353734",
"0.53476787",
"0.5346144",
"0.5336816",
"0.53115916",
"0.53070986",
"0.5300332",
"0.5296734",
"0.52812773",
"0.5271724",
"0.52671343",
"0.5244242",
"0.5236392",
"0.5217925",
"0.52126133",
"0.51977664",
"0.51912475",
"0.5188562",
"0.5187572",
"0.5181048",
"0.5173203",
"0.5171958",
"0.5161985",
"0.51511264",
"0.5146027",
"0.51415735",
"0.5132288",
"0.51295626",
"0.51227117",
"0.51193035",
"0.51029277",
"0.508923",
"0.5087982",
"0.50776607",
"0.507698",
"0.50722057",
"0.5059426",
"0.5056128",
"0.50489646",
"0.504063",
"0.503704",
"0.50316256",
"0.5027721",
"0.50260806",
"0.50206876",
"0.5017504",
"0.50145435",
"0.501383",
"0.500418",
"0.5003881",
"0.49943742",
"0.4993721",
"0.49898252",
"0.49893183",
"0.498619",
"0.4984203",
"0.49830002",
"0.4982825",
"0.49795052",
"0.49737126",
"0.49730545",
"0.49718422",
"0.49667528",
"0.49640074",
"0.49614987",
"0.49574977",
"0.49571234",
"0.49568993",
"0.49470383",
"0.4946828",
"0.494232",
"0.4941919",
"0.49415803",
"0.4940404",
"0.49390933",
"0.49389303",
"0.49358356",
"0.49341798",
"0.49336654",
"0.49294993",
"0.49269834"
] | 0.7081813 | 0 |
Access method for cap. | public String getCap() {
return cap;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void cap();",
"EReqOrCap getReq_cap();",
"public final CapabilityBlock getCapability() {\n return cap;\n }",
"int getCap();",
"public Crate(int cap){\r\n capacity = cap;\r\n }",
"public String getCapStatus() {\n return capStatus;\n }",
"public String getCapCode() {\n return capCode;\n }",
"public void setCap(String aCap) {\n cap = aCap;\n }",
"void setCap(int cap);",
"public interface IResourceCapacitor\n{\n\t\n\t/**\n\t * extract resource from this capacitor\n\t * @param type\n\t * @param amount\n\t * @return resource\n\t */\n\tpublic Resource takeResource( Resource.Type type, int amount );\n\t\n\t/**\n\t * store this resource in the capacitor\n\t * @param r\n\t * @return may return leftover if capacitor cannot/will not hold the entire resource\n\t */\n\tpublic Resource storeResource( Resource r );\n\t\n\t/**\n\t * how much can this capacitor hold of this resource type?\n\t * @param type\n\t * @return\n\t */\n\tpublic int getCapacity( Resource.Type type );\n\t\n\t/**\n\t * set how much of resource this capacitor may hold.\n\t * @param type\n\t * @param capacity\n\t */\n\tpublic void setCapacity( Resource.Type type, int capacity );\n\t\n\t/**\n\t * how much of the resource type does this capacitor hold?\n\t * @param type\n\t * @return amount between 0 and capacity\n\t */\n\tpublic int getContents( Resource.Type type );\n}",
"@Override\n\tpublic int getCapacite() {\n\t\t// TODO Auto-generated method stub\n\t\treturn capacite;\n\t}",
"public Capability getCapability() {\n\t\treturn _capability;\n\t}",
"public LineCapEnum getLineCap(\n )\n {return lineCap;}",
"public int getCapacity() {\n\t\treturn mCapcity;\n\t}",
"int calculateCap();",
"public String getCapPwd() {\n return capPwd;\n }",
"public int getCapacity( )\n {\n // Implemented by student.\n }",
"public int getMobCap()\r\n/* 24: */ {\r\n/* 25:41 */ return this.f;\r\n/* 26: */ }",
"public Trace<T> copyWithCapacity(int cap) {\n Trace<T> trace = new Trace<>(cap);\n for (int i = Math.min(cap, size()) - 1; i >= 0; i--) {\n trace.push(get(i));\n }\n return trace;\n }",
"abstract protected int getCapacity();",
"public abstract String getCvAccession();",
"public ArrayList getCapabilities() {\n\treturn _capabilities;\n }",
"com.cantor.drop.aggregator.model.CFTrade.Capacity getCapacity();",
"void getCapabilties(Browser browser, DesiredCapabilities caps);",
"public double getCapHeight() {\n return capHeight;\n }",
"public com.cantor.drop.aggregator.model.CFTrade.Capacity getCapacity() {\n com.cantor.drop.aggregator.model.CFTrade.Capacity result = com.cantor.drop.aggregator.model.CFTrade.Capacity.valueOf(capacity_);\n return result == null ? com.cantor.drop.aggregator.model.CFTrade.Capacity.AGENT : result;\n }",
"public double getPCapacity() {\n\t\treturn pCapacity;\n }",
"protected String initCap(final String name) {\n return Srl.initCap(name);\n }",
"private Capability getCapFromElement(Element el) {\n String capId = el.getElementsByTagName(\"Id\").item(0).getTextContent();\n NodeList nodeList = el.getElementsByTagName(\"Names\").item(0).getChildNodes();\n Map<Locale, String> actNames = new HashMap<>();\n\n for (int i = 0; i < nodeList.getLength(); i++) {\n NodeList nameNodes = nodeList.item(i).getChildNodes();\n String locale = nameNodes.item(0).getTextContent();\n String name = nameNodes.item(1).getTextContent();\n actNames.put(new Locale(locale.split(\"_\")[0], locale.split(\"_\")[1]), name);\n }\n String testCmd = el.getElementsByTagName(\"TestCommand\").item(0).getTextContent();\n String exeCmd = el.getElementsByTagName(\"ExeCommand\").item(0).getTextContent();\n String stopCmd = el.getElementsByTagName(\"StopCommand\").item(0).getTextContent();\n\n String compType = el.getElementsByTagName(\"Comparator\").item(0).getTextContent();\n String resp = el.getElementsByTagName(\"Response\").item(0).getTextContent();\n String refVal = el.getElementsByTagName(\"Reference\").item(0).getTextContent();\n\n String type = el.getElementsByTagName(\"Type\").item(0).getTextContent();\n String image = el.getElementsByTagName(\"Image\").item(0).getTextContent();\n boolean hasTestButton = Boolean.parseBoolean(el.getElementsByTagName(\"HasTestButton\").item(0).getTextContent());\n Capability cap = new Capability(capId, actNames, null, type, testCmd, exeCmd, stopCmd, compType, resp, refVal, image, hasTestButton);\n\n return cap;\n }",
"public void setCapAmount(int capAmount){\r\n\t\t//saves the variable in capAmount\r\n\t\tthis.capAmount=capAmount;\r\n\t}",
"public com.cantor.drop.aggregator.model.CFTrade.Capacity getCapacity() {\n com.cantor.drop.aggregator.model.CFTrade.Capacity result = com.cantor.drop.aggregator.model.CFTrade.Capacity.valueOf(capacity_);\n return result == null ? com.cantor.drop.aggregator.model.CFTrade.Capacity.AGENT : result;\n }",
"public int capLevel() {\n\t\treturn 500 * this.niveau;\n\t}",
"public int getCapacity() {\r\n return this.capacity;\r\n }",
"public Capability negotiate(Capability agentCap) {\n if (!(agentCap instanceof CDMAcceleratorCap))\n return null;\n\n CDMAcceleratorCap host = (CDMAcceleratorCap) agentCap;\n return new CDMAcceleratorCap(host.supportMask & this.supportMask, DEF_MAXREADAHEADK);\n }",
"public final Capture getCapture()\n\t{\n\t\tif (_curindex < 0 || _curindex >= _rcc.size())\n\t\t{\n\t\t\tthrow new UnsupportedOperationException(SR.GetString(SR.EnumNotStarted));\n\t\t}\n\n\t\treturn _rcc.getItem(_curindex);\n\t}",
"public void setDrawingCap(CAP cap);",
"ResourceSkuCapacity capacity();",
"public int getCapacity()\n {\n return capacity;\n }",
"public double getCapacity() {\n\t\treturn capacity;\n\t}",
"@Override\n public int Capacity() {\n return current_capacity;\n }",
"public int size() {\n return CAPABILITY_LENGTH;\n }",
"public int GetCaps();",
"public com.upslogisticstech.www.UPSLT.TransportationSuite.TransportationWebService.Quantities getCapacities() {\n return capacities;\n }",
"@Override\n\tpublic RacingBike get() {\n\t\tSystem.out.println(\"Inside get method of provider class!!!\");\n\t\treturn new ApacheRR310();\n\t}",
"public String getCapabilities() {\n return this.capabilities;\n }",
"public int getCapacity() {\n\n\t\treturn this.capacity;\n\t}",
"public void setCapStatus(String capStatus) {\n this.capStatus = capStatus == null ? null : capStatus.trim();\n }",
"public void setCapacity(String eventID, int cap) {\n Event event = getEvent(eventID);\n event.setCapacity(cap);\n }",
"public int getCapacity() {\r\n return capacity;\r\n }",
"public int getCapacity() {\r\n return capacity;\r\n }",
"public int getCapacity() {\r\n return capacity;\r\n }",
"public int getCapacity() {\n return capacity;\n }",
"public int getCapacity() {\n return capacity;\n }",
"public int getCapacity() {\n return capacity;\n }",
"public int getCapacity() {\n return capacity;\n }",
"public ScGridColumn<AcUspsInternationalSkeletonRouteOffer> newCapacityColumn()\n {\n return newCapacityColumn(\"Capacity\");\n }",
"public int getCapacity() {\r\n\r\n return capacity;\r\n }",
"public Integer getCapacity() {\n return capacity;\n }",
"public final int getCapacity() {\n\t\treturn capacity;\n\t}",
"public static int getCapacity() {\n\t\treturn capacity ;\n\t}",
"public double getECapacity() {\n return eCapacity;\n }",
"public double getOCapacity() {\n return oCapacity;\n }",
"@java.lang.Override\n public int getAvailableCapacity() {\n return availableCapacity_;\n }",
"String getCapability_name();",
"public abstract void expose(Card c);",
"public Getter reqGetTankCapacity() {\n\t\t\taddProperty(EPC_TANK_CAPACITY);\n\t\t\treturn this;\n\t\t}",
"public String getAccess();",
"String getAccess();",
"String getAccess();",
"Capabilities getCapabilities();",
"public void setCap(EditableSceneObjectCollection cap) {\n\t\tremoveSceneObject(this.cap);\n\t\t\n\t\t// ... and add the new one\n\t\tthis.cap = cap;\n\t\taddSceneObject(cap);\n\t}",
"public float getCapacity();",
"public Long getCapacity() {\n return capacity;\n }",
"public abstract int capacity();",
"@Override\n public void capture() {\n }",
"public double getRemainingCapacity() {\r\n return capacity;\r\n }",
"public Double dailyCap() {\n return this.dailyCap;\n }",
"public int getCapacity() {\n\n\t\treturn capacity;\n\t}",
"@java.lang.Override\n public int getAllowedCredit() {\n return allowedCredit_;\n }",
"public int getCapacity();",
"public int characteristics() {\n/* 1680 */ return this.characteristics;\n/* */ }",
"ICapability getCapabilityById( String id );",
"public int getCargoCapacity() { // get the cargo capacity\n\t\treturn cargoCapacity;\n\t}",
"OrderCapacity getOrderCapacity();",
"public ByteBuf capacity(int newCapacity)\r\n/* 745: */ {\r\n/* 746:754 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 747:755 */ return super.capacity(newCapacity);\r\n/* 748: */ }",
"public int capacity()\r\n/* 81: */ {\r\n/* 82:116 */ ensureAccessible();\r\n/* 83:117 */ return this.array.length;\r\n/* 84: */ }",
"@java.lang.Override\n public int getAllowedCredit() {\n return allowedCredit_;\n }",
"@java.lang.Override\n public int getAvailableCapacity() {\n return availableCapacity_;\n }",
"public int capacity() {\n\t\treturn this.capacity;\n\t}",
"public abstract List<AbstractCapability> getCapabilities();",
"public interface ICapabilityProvider {\n\n /**\n * Unique ID for this Provider\n *\n * @return\n */\n String getId();\n\n /**\n * Get a list of Capability IDs found by the provider\n *\n * @return\n */\n Set<String> listCapabilities();\n\n /**\n * Get a Capability by ID\n *\n * @param id\n * @return\n */\n ICapability getCapabilityById( String id );\n\n\n /**\n * Returns true if capability exists, if not return false\n *\n * @param id\n * @return\n */\n boolean capabilityExist( String id );\n\n /**\n * Get a set containing all ICapabilities\n *\n * @return\n */\n Set<ICapability> getAllCapabilities();\n}",
"public String getGetter() {\n return \"get\" + getCapName();\n }",
"protected abstract MethodDescription accessorMethod();",
"public void setCaption(String cap) {\n\t\tcaption = cap;\n\t}",
"public int capacity() {\r\n\t\treturn this.capacity;\r\n\t}",
"public String getCacheControl()\r\n/* 157: */ {\r\n/* 158:236 */ return getFirst(\"Cache-Control\");\r\n/* 159: */ }",
"public int capacity() {\n return this.capacity;\n }",
"public Capabilities() {\n super();\n this.caps = new HashSet<ICapability>();\n }",
"public interface Capability\n{\n String BUNDLE = \"bundle\";\n String FRAGMENT = \"fragment\";\n String PACKAGE = \"package\";\n String SERVICE = \"service\";\n String EXECUTIONENVIRONMENT = \"ee\";\n\n /**\n * Return the name of the capability.\n *\n */\n String getName();\n\n /**\n * Return the properties of this capability\n *\n * @return\n */\n Property[] getProperties();\n\n /**\n * Return the map of properties.\n *\n * @return a Map<String,Object>\n */\n Map<String, Object> getPropertiesAsMap();\n\n /**\n * Return the directives of this capability. The returned map\n * can not be modified.\n *\n * @return a Map of directives or an empty map there are no directives.\n */\n Map<String, String> getDirectives();\n}",
"public int capacity()\n {\n return capacity;\n }"
] | [
"0.6841637",
"0.66172296",
"0.65992844",
"0.6572151",
"0.63085794",
"0.62536144",
"0.6135379",
"0.61161125",
"0.60964936",
"0.59778154",
"0.5913632",
"0.58407223",
"0.57946026",
"0.57725567",
"0.5739151",
"0.57170075",
"0.5710852",
"0.57061696",
"0.5644023",
"0.5553772",
"0.5494662",
"0.5490105",
"0.5479205",
"0.5468144",
"0.54671156",
"0.5464289",
"0.54569817",
"0.54451483",
"0.5442167",
"0.5441432",
"0.5438669",
"0.5409139",
"0.538801",
"0.53844965",
"0.53618526",
"0.5359528",
"0.535653",
"0.53462714",
"0.5319499",
"0.53131044",
"0.5307159",
"0.52946436",
"0.52835166",
"0.5250814",
"0.5227606",
"0.52138007",
"0.5210782",
"0.520453",
"0.51949704",
"0.51949704",
"0.51949704",
"0.5179624",
"0.5179624",
"0.5179624",
"0.5179624",
"0.51535904",
"0.51300085",
"0.5127102",
"0.509919",
"0.50951374",
"0.50893795",
"0.5086966",
"0.5086007",
"0.5083969",
"0.50817025",
"0.5080981",
"0.5078894",
"0.50777256",
"0.50777256",
"0.5069302",
"0.50652593",
"0.5063524",
"0.50621235",
"0.50570035",
"0.5055623",
"0.5050805",
"0.5035167",
"0.5033202",
"0.502402",
"0.50212777",
"0.5020519",
"0.5018954",
"0.5018123",
"0.50124305",
"0.5012339",
"0.5000881",
"0.49988028",
"0.498096",
"0.4970895",
"0.4970457",
"0.4960485",
"0.49345726",
"0.49302086",
"0.49291426",
"0.49290365",
"0.49181303",
"0.491589",
"0.49134636",
"0.4912663",
"0.49037236"
] | 0.66779816 | 1 |
Setter method for cap. | public void setCap(String aCap) {
cap = aCap;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void setCap(int cap);",
"public String getCap() {\n return cap;\n }",
"public void setCapAmount(int capAmount){\r\n\t\t//saves the variable in capAmount\r\n\t\tthis.capAmount=capAmount;\r\n\t}",
"public Crate(int cap){\r\n capacity = cap;\r\n }",
"public void setCap(EditableSceneObjectCollection cap) {\n\t\tremoveSceneObject(this.cap);\n\t\t\n\t\t// ... and add the new one\n\t\tthis.cap = cap;\n\t\taddSceneObject(cap);\n\t}",
"public void setDrawingCap(CAP cap);",
"int getCap();",
"public void setCapacity(String eventID, int cap) {\n Event event = getEvent(eventID);\n event.setCapacity(cap);\n }",
"public void setCapacity(int value) {\n this.capacity = value;\n }",
"public void setCapCode(String capCode) {\n this.capCode = capCode == null ? null : capCode.trim();\n }",
"public void setCapPwd(String capPwd) {\n this.capPwd = capPwd == null ? null : capPwd.trim();\n }",
"public void setCapStatus(String capStatus) {\n this.capStatus = capStatus == null ? null : capStatus.trim();\n }",
"public void setCapacity(int capacity)\n {\n Validate.isTrue(capacity > 0, \"Capacity must be > 0\");\n capacity_ = capacity; \n }",
"public void setCapacity(double capacity) {\n\t\tthis.capacity = capacity;\n\t}",
"public void setCapacity(int capacity) \n {\n this.capacity = capacity;\n }",
"public void setCapacity(String capacity) {\n\t\tthis.capacity = capacity;\n\t}",
"public String getCapCode() {\n return capCode;\n }",
"public String getCapStatus() {\n return capStatus;\n }",
"public void setCapacity(int capacity) {\r\n this.capacity = capacity;\r\n }",
"public void setCapacity(int capacity) {\r\n\r\n this.capacity = capacity;\r\n }",
"public LineCapEnum getLineCap(\n )\n {return lineCap;}",
"public void setCapacity(int capacity)\n {\n if(capacity >= 0)\n {\n this.capacity = capacity;\n }\n else\n {\n System.out.println(\"Cannot be negative.\");\n }\n }",
"public Builder setCapacity(com.cantor.drop.aggregator.model.CFTrade.Capacity value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000040;\n capacity_ = value.getNumber();\n onChanged();\n return this;\n }",
"public void setCapacity(int capacity) {\n this.capacity = capacity;\n }",
"public InputBox setTextCap(int textCap) {\n\t\tthis.textCap = textCap;\n\t\t\n\t\treturn this;\n\t}",
"public void setCapacity(final int theCapacity) {\n\t\tif (theCapacity < 1) {\n\t\t\tthrow new IllegalArgumentException(\"Please supply a valid capacity.\");\n\t\t}\n\t\tthis.mCapcity = theCapacity;\n\t}",
"public void setCapacity(Integer capacity) {\n this.capacity = capacity;\n }",
"public double getCapHeight() {\n return capHeight;\n }",
"public void setCapacity(int capacity) {\n\n\t\tthis.capacity = capacity;\n\t}",
"public Volume capacity(Long capacity) {\n this.capacity = capacity;\n return this;\n }",
"public void setCapital(int capital) {\n\n this.capital = capital;\n }",
"void cap();",
"@JsProperty\n public void setLineCap(String lineCap);",
"public Builder setOverallPartiesCap(int value) {\n \n overallPartiesCap_ = value;\n onChanged();\n return this;\n }",
"public void setCapacity(final int capacity) {\n this.capacity = capacity;\n }",
"public CoffeeMug(String w, int cap, boolean full) {\n owner = w;\n capacity = cap;\n this.full = full;\n }",
"public void setCapacidad(Integer capacidad) {\n this.capacidad = capacidad;\n }",
"public void setCaption(String cap) {\n\t\tcaption = cap;\n\t}",
"public void setCapacity(Long capacity) {\n this.capacity = capacity;\n }",
"void setOrderCapacity(OrderCapacity inOrderCapacity);",
"public String getCapPwd() {\n return capPwd;\n }",
"public int capLevel() {\n\t\treturn 500 * this.niveau;\n\t}",
"public void grow(int cap) {}",
"public void setCapacity(int newCapacity) {\n\n\t\tif (newCapacity < 1) {\n\t\t\tsendWarning(\n\t\t\t\t\t\"The capacity of a transporter should be changed to zero or \"\n\t\t\t\t\t\t\t+ \"a negative value. The capacity will remain unchanged!\",\n\t\t\t\t\t\"Transporter : \" + getName()\n\t\t\t\t\t\t\t+ \" Method: void setCapacity(int newCapacity)\",\n\t\t\t\t\t\"A capacity which is zero or negative does not make sense.\",\n\t\t\t\t\t\"Make sure to provide a valid positive capacity \"\n\t\t\t\t\t\t\t+ \"when changing this attribute.\");\n\n\t\t\treturn; // forget that rubbish\n\t\t}\n\n\t\tthis.capacity = newCapacity;\n\t}",
"public void setPCapacity(double argPCapacity) {\n pCapacity = argPCapacity;\n }",
"public void setCargoCapacity(int cargoCapacity) { // set the cargo capacity\n\t\tthis.cargoCapacity = cargoCapacity;\n\t}",
"public void setCapability(Capability value) {\n\t\tthis._capability = value;\n\t}",
"public int getCapacity() {\n\t\treturn mCapcity;\n\t}",
"public void setCapacity( Resource.Type type, int capacity );",
"public void setCAPITAL_AMT_LIMIT(BigDecimal CAPITAL_AMT_LIMIT) {\r\n this.CAPITAL_AMT_LIMIT = CAPITAL_AMT_LIMIT;\r\n }",
"@JsonSetter(\"capacityGroupId\")\r\n public void setCapacityGroupId (int value) { \r\n this.capacityGroupId = value;\r\n }",
"public final CapabilityBlock getCapability() {\n return cap;\n }",
"public ScGridColumn<AcUspsInternationalSkeletonRouteOffer> newCapacityColumn()\n {\n return newCapacityColumn(\"Capacity\");\n }",
"public void setCapacity(int newCapacity) {\r\n Validate.positive(newCapacity, \"new capacity\");\r\n\r\n capacity = newCapacity;\r\n cull(capacity);\r\n }",
"public Trace<T> copyWithCapacity(int cap) {\n Trace<T> trace = new Trace<>(cap);\n for (int i = Math.min(cap, size()) - 1; i >= 0; i--) {\n trace.push(get(i));\n }\n return trace;\n }",
"public void setCapacities(com.upslogisticstech.www.UPSLT.TransportationSuite.TransportationWebService.Quantities capacities) {\n this.capacities = capacities;\n }",
"@Override\n\tpublic int getCapacite() {\n\t\t// TODO Auto-generated method stub\n\t\treturn capacite;\n\t}",
"@Override\n\tpublic StructureTownHallConfigRecord setResourceCapacity(Integer value) {\n\t\tsetValue(10, value);\n\t\treturn this;\n\t}",
"@SuppressWarnings(\"unchecked\")\n public PropertyValue<String> getLineCap() {\n return (PropertyValue<String>) new PropertyValue(nativeGetLineCap());\n }",
"public void setUpper(int value) {\n this.upper = value;\n }",
"int calculateCap();",
"void setQuantizerScale(int value)\n {\n quantizerScale = value;\n }",
"EReqOrCap getReq_cap();",
"void setCapital(ch.crif_online.www.webservices.crifsoapservice.v1_00.Amount capital);",
"public BigDecimal getCAPITAL_AMT_LIMIT() {\r\n return CAPITAL_AMT_LIMIT;\r\n }",
"public Builder setAvailableCapacity(int value) {\n \n availableCapacity_ = value;\n onChanged();\n return this;\n }",
"private void resize(int cap) {\n Item[] temp = (Item[]) new Object[cap];\n for(int i = 0; i < size; i++)\n temp[i] = rqArrays[i];\n rqArrays = temp;\n }",
"public Battery(double initialCapacity) {\r\n capacity = initialCapacity;\r\n originalCapacity = initialCapacity;\r\n }",
"public Double dailyCap() {\n return this.dailyCap;\n }",
"@Test\n\tpublic void overrideDefaultCapacity() {\n\t\tcst = new Airport(2, weatherMock);\n\t\tassertEquals(2, cst.capacity);\n\t}",
"public void setEdgeCapacity(double capacity) {\n\t\tthis.capacity = capacity;\r\n\r\n\t}",
"protected String initCap(final String name) {\n return Srl.initCap(name);\n }",
"public MinPriorityQueue(int cap)\r\n {\r\n heap = (Item[]) new Comparable[cap+1]; // reservamos un espacio adicional\r\n // para el dummy en la posicion 0\r\n size = 0;\r\n }",
"public com.upslogisticstech.www.UPSLT.TransportationSuite.TransportationWebService.Quantities getCapacities() {\n return capacities;\n }",
"public void setCost(int c) {\r\n this.cost = c;\r\n }",
"public Builder setMaximumCapacity(int value) {\n \n maximumCapacity_ = value;\n onChanged();\n return this;\n }",
"public int getMobCap()\r\n/* 24: */ {\r\n/* 25:41 */ return this.f;\r\n/* 26: */ }",
"public void setLimit_Base (String Limit_Base);",
"public void setOCapacity(double argOCapacity) {\n\t\toCapacity = argOCapacity;\n\t}",
"public void charge() {\r\n capacity = Math.min(capacity += originalCapacity, originalCapacity);\r\n }",
"public void setLen_cable(java.math.BigDecimal newLen_cable)\n\t\tthrows java.rmi.RemoteException;",
"public void setCrust(){\n this.crust = \"Thin\";\n }",
"public com.cantor.drop.aggregator.model.CFTrade.Capacity getCapacity() {\n com.cantor.drop.aggregator.model.CFTrade.Capacity result = com.cantor.drop.aggregator.model.CFTrade.Capacity.valueOf(capacity_);\n return result == null ? com.cantor.drop.aggregator.model.CFTrade.Capacity.AGENT : result;\n }",
"ResourceSkuCapacity capacity();",
"public com.cantor.drop.aggregator.model.CFTrade.Capacity getCapacity() {\n com.cantor.drop.aggregator.model.CFTrade.Capacity result = com.cantor.drop.aggregator.model.CFTrade.Capacity.valueOf(capacity_);\n return result == null ? com.cantor.drop.aggregator.model.CFTrade.Capacity.AGENT : result;\n }",
"public void setQuantity(int quant){\n\t\t// store into the instance variable quantity the value of the parameter quant\n\t\tquantity = quant;\n\t}",
"public StuList(int cap) {\r\n\t\t// todo\r\n\t}",
"public void setECapacity(double argECapacity) {\n eCapacity = argECapacity;\n }",
"public double getCapacity() {\n\t\treturn capacity;\n\t}",
"public void ensureCapacity(int minCap){\n if(minCap > data.length){\n int newCapa = (data.length * 3)/ 2 +1;\n if(newCapa < minCap){\n newCapa = minCap;\n }\n data = Arrays.copyOf(data, newCapa);\n }\n }",
"private void setHighCard(int highCard) {\r\n this.highCard = highCard;\r\n }",
"@Override\r\n public void ingresarCapacidad(){\r\n double capacidad = Math.pow(alto, 3);\r\n int capacidadInt = Double.valueOf(capacidad).intValue();\r\n super.capacidad = capacidadInt;\r\n super.cantidadRestante = capacidadInt;\r\n System.out.println(capacidadInt);\r\n }",
"public String getSetter() {\n return \"set\" + getCapName();\n }",
"public void setCtr(Double ctr) {\r\n this.ctr = ctr;\r\n }",
"void setMaxScale(int value);",
"@SuppressWarnings( \"unchecked\" )\n ArrayStack( int cap ) {\n this.storage = ( E[] ) new Object[ cap ];\n }",
"public Capital() {\n\t\tthis.nation = \"korea\";\n\t\tthis.capital = \"seoul\";\n\t}",
"public VkSurfacePresentScalingCapabilitiesEXT set(VkSurfacePresentScalingCapabilitiesEXT src) {\n memCopy(src.address(), address(), SIZEOF);\n return this;\n }",
"public void upgradeCapacity()\r\n\t{\r\n\t\tcapacity++;\r\n\t}",
"public void setConsumedCapacity(ConsumedCapacity consumedCapacity) {\n this.consumedCapacity = consumedCapacity;\n }"
] | [
"0.8221553",
"0.7526149",
"0.7468143",
"0.7179069",
"0.70007086",
"0.6647745",
"0.64713776",
"0.64140654",
"0.638985",
"0.6381572",
"0.637124",
"0.63443285",
"0.62213624",
"0.62143755",
"0.6182567",
"0.61567044",
"0.6134234",
"0.61270374",
"0.6118561",
"0.61102706",
"0.6093996",
"0.60672593",
"0.6052071",
"0.6048711",
"0.6044788",
"0.6018056",
"0.5991181",
"0.5987975",
"0.5970342",
"0.5928264",
"0.59267676",
"0.5898425",
"0.58925915",
"0.58866906",
"0.5881764",
"0.58405817",
"0.5834365",
"0.58225393",
"0.57216024",
"0.5712247",
"0.5702029",
"0.56266725",
"0.5577119",
"0.55256706",
"0.5525035",
"0.5520729",
"0.55073345",
"0.5485423",
"0.5479255",
"0.5450849",
"0.54485714",
"0.54338187",
"0.53953534",
"0.53667134",
"0.5348663",
"0.53437126",
"0.53309256",
"0.5312458",
"0.5311448",
"0.5290017",
"0.5280243",
"0.52543336",
"0.52541804",
"0.52509725",
"0.5239912",
"0.52332014",
"0.52190596",
"0.5206358",
"0.51821375",
"0.5178729",
"0.5160354",
"0.5160129",
"0.5159502",
"0.5135504",
"0.51301765",
"0.51193666",
"0.51059943",
"0.51019454",
"0.5101374",
"0.5097947",
"0.50936425",
"0.50878954",
"0.5072806",
"0.5066648",
"0.50631356",
"0.5062133",
"0.50559527",
"0.50524837",
"0.5050369",
"0.50441873",
"0.5034647",
"0.5031203",
"0.501741",
"0.50069183",
"0.5006616",
"0.5005939",
"0.5001537",
"0.4997041",
"0.4994574",
"0.498771"
] | 0.79532087 | 1 |
Access method for prenotazione. | public Set<Prenotazione> getPrenotazione() {
return prenotazione;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void remplirPrestaraireData() {\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"private List<PreDocumentoEntrata> getPreDocumentiEntrata() {\t\n\t\tif(req.getRicercaSinteticaPreDocumentoEntrata()!=null){\n\t\t\treturn ricercaSinteticaPreDocumentoEntrata();\n\t\t}\n\t\t\n\t\treturn req.getPreDocumentiEntrata();\n\t\t\n\t\t\n\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override // Métodos que fazem a anulação\n\tpublic void getBonificação() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\n public void perish() {\n \n }",
"public final void nonRedefinissableParEnfant(){\n\n }",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"public ListaPrecios() {\n initComponents();\n listaListaPrecio();\n }",
"@Override\n\tpublic void pausaParaComer() {\n\n\t}",
"public void Ordenamiento() {\n\n\t}",
"public abstract String tiposervicio();",
"private DittaAutonoleggio(){\n \n }",
"public void iniciarNovaPartida(Integer posicao);",
"@Override\n\tpublic void iniciar() {\n\t\t\n\t}",
"PRE createPRE();",
"public int getIdPrestatario() {\n return idPrestatario;\n }",
"public void inizializza() {\n\n /* invoca il metodo sovrascritto della superclasse */\n super.inizializza();\n\n }",
"public void trenneVerbindung();",
"@Override\n\tpublic void anular() {\n\n\t}",
"public contrustor(){\r\n\t}",
"public void asetaTeksti(){\n }",
"private ControleurAcceuil(){ }",
"public void setPrenotazione(Set<Prenotazione> aPrenotazione) {\n prenotazione = aPrenotazione;\n }",
"protected FanisamBato(){\n\t}",
"@Override\r\n\tprotected void doPre() {\n\t\t\r\n\t}",
"@Override\n public String cualquierMetodo2() {\n return \"Método implementado en la clase hija viaje de incentivo\";\n }",
"@Override\n public void memoria() {\n \n }",
"public void MieiOrdini()\r\n {\r\n getOrdini();\r\n\r\n }",
"void usada() {\n mazo.habilitarCartaEspecial(this);\n }",
"public TipoPrestamo() {\n\t\tsuper();\n\t}",
"@Override\r\n\tprotected void initVentajas() {\n\r\n\t}",
"public void finePartita() {\n\r\n }",
"Petunia() {\r\n\t\t}",
"protected PreDocumentoEntrata getDettaglioPreDocumentoEntrata(PreDocumentoEntrata preDoc) {\n\t\tRicercaDettaglioPreDocumentoEntrata req = new RicercaDettaglioPreDocumentoEntrata();\n\t\treq.setDataOra(new Date());\n\t\treq.setPreDocumentoEntrata(preDoc);\n\t\treq.setRichiedente(this.req.getRichiedente());\n\t\tRicercaDettaglioPreDocumentoEntrataResponse res = executeExternalServiceSuccess(ricercaDettaglioPreDocumentoEntrataService,req);\n\t\treturn res.getPreDocumentoEntrata();\n\t}",
"@Override\r\n\tprotected void onPreLoadData() throws Exception {\n\r\n\t\tList<Linea> listaLinee = new LineaAPI().lista(getEmfShared(), getCurrentUser());\r\n\t\tlinee = SelectItemConverter.convert(listaLinee);\r\n\r\n\t\tlong idRinnovo = getParamObjectAsLong(\"idRinnovo\");\r\n\t\tif (idRinnovo > 0) {\r\n\t\t\telemento = new ContrattoAPI().rinnovoPrepara(getEmfShared(), getCurrentUser(), idRinnovo);\r\n\t\t} else {\r\n\t\t\taddErrorMessage(\"Impossibile trovare il contratto da rinnovare.\");\r\n\t\t}\r\n\r\n\t}",
"@Override\n\tpublic void pre()\n\t{\n\n\t}",
"public AntrianPasien() {\r\n\r\n }",
"@Override\n protected void prot() {\n }",
"public double getPreco();",
"public double getPreco();",
"public Notifica(){}",
"public void operacao();",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"public void pretraziPoslovneKorisnike() throws BazaPodatakaException {\r\n\t\tString naziv = nazivTF.getText().toLowerCase();\r\n\t\tString web = webTF.getText().toLowerCase();\r\n\t\tString email = emailTF.getText().toLowerCase();\r\n\t\tString telefon = telefonTF.getText();\r\n\r\n\t\tList<PoslovniKorisnik> listaKorisnika = BazaPodataka.dohvatiPoslovnogKorisnikaPremaKriterijima(email, telefon,\r\n\t\t\t\tnaziv, web);\r\n\t\ttablicaPoslovnihKorisnika.setItems(FXCollections.observableArrayList(listaKorisnika));\r\n\r\n\t}",
"public Punto getCentro() {\r\n\treturn centro;\r\n}",
"private void reposicionarPersonajes() {\n // TODO implement here\n }",
"private stendhal() {\n\t}",
"private UsineJoueur() {}",
"public PrestamoAuto(int noCliente, String nombre, int noCuenta, double capPrestado, int plazoInversion) {\r\n this.noCliente = noCliente;\r\n this.nombre = nombre;\r\n this.noCuenta = noCuenta;\r\n this.capPrestado = capPrestado;\r\n this.plazoInversion = plazoInversion;\r\n }",
"@Override\r\n\tpublic void insertPrestito(Prestito p) {\n\t\t\r\n\t}",
"private List<PreDocumentoEntrata> ricercaSinteticaPreDocumentoEntrata() {\n\t\tRicercaSinteticaPreDocumentoEntrataResponse resRSPD = ricercaSinteticaPreDocumentoEntrata(0);\t\t\n\t\tList<PreDocumentoEntrata> result = resRSPD.getPreDocumenti();\n\t\t\n\t\tfor(int i = 1; i < resRSPD.getTotalePagine(); i++) {\t\t\t\n\t\t\tresRSPD = ricercaSinteticaPreDocumentoEntrata(i);\n\t\t\tresult.addAll(resRSPD.getPreDocumenti());\t\t\t\n\t\t}\n\t\treturn result;\n\t}",
"public void setPrecioc(int p){\n this.precioc=p;\n \n }",
"public interface Prenotazione<T extends Model> {\n\n\t/**\n\t * consente di prenotare un volo\n\t * @param listToAdd lista di elementi da prenotare\n\t * @param idVolo id del volo da prenotare\n\t * @return id gruppo / id pallet prenotati\n\t * @throws FlightNotFoundException volo non trovato\n\t * @throws SeatsSoldOutException volo pieno\n\t */\n\tpublic abstract ObjectId[] prenota(List<T> listToAdd, ObjectId idVolo) throws FlightNotFoundException, SeatsSoldOutException;\n}",
"@Override\n\tpublic Map<String, Object> preProccess() {\n\t\treturn null;\n\t}",
"protected Approche() {\n }",
"protected String getAbreviaturaProceso(Constantes.PROCESOS proc) throws Exception{\n\t\treturn getParametro(proc.getCodValor());\r\n\t}",
"public PrnPrivitakVo() {\r\n\t\tsuper();\r\n\t}",
"public void realiserAcahatProduit() {\n\t\t\n\t}",
"public void estiloAcierto() {\r\n\t\t /**Bea y Jose**/\t\t\r\n \r\n\t}",
"Nodo_B getPrimero(){\n return this.primero;\n }",
"String getAnnoPubblicazione();",
"@Override\n\tpublic void acomodaVista() {\n\n\t}",
"private void procedureBasePrDessin(){\n if(courante == null){\n reset();\n courante = new Tortue(simpleLogo.getFeuille(), true);\n simpleLogo.setBarreOutilsVisible(true);\n }\n }",
"@Override\n public void alRechazarOperacion() {\n }",
"@Override\r\n\tprotected void func03() {\n\t\t\r\n\t}",
"protected abstract void iniciarModo();",
"@Override\r\n\tprotected void verificaUtentePrivilegiato() {\n\r\n\t}",
"@Override\n\tpublic void recreo() {\n\n\t}",
"public Dipendente() {\r\n\t\tsetnMat();\r\n\t}",
"public double getPreco(){\n return pagamento.getPreco();\n }",
"protected void agregarUbicacion(){\n\n\n\n }",
"void preProcess();",
"@Override\r\n\tpublic void NroAccount() {\n\t\t\r\n\t}",
"public ConsultaMassivaCapitoloEntrataPrevisioneModel() {\n\t\tsuper();\n\t\tsetTitolo(\"Consulta Capitolo Entrata Previsione (Massivo)\");\n\t}",
"private void inizia() throws Exception {\n this.setClasse((new ArrayList<Boolean>()).getClass());\n this.setValoreVuoto(null);\n }",
"public abstract String dohvatiKontakt();",
"protected abstract void before();",
"@Override\n\tpublic String getInformeVendedor() {\n\t\treturn \"Informe trimestre 3\";\n\t}",
"public void datos_elegidos(){\n\n\n }",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"private void habilitar() {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }",
"@Override\n\tpublic void getPrix() {\n\t\t\n\t}",
"@Override\n public String getModu() {\n return null;\n }",
"private Rekenhulp()\n\t{\n\t}",
"@Override\n\tpublic void preparar() {\n\t\tSystem.out.println(\"massa, presunto, queijo, calabreza e cebola\");\n\t\t\n\t}",
"@Override\r\n\tpublic void horario() {\n\t\t\r\n\t}",
"public abstract double getPreis();",
"protected RespostaFormularioPreenchido() {\n // for ORM\n }",
"@Override\r\n public String AggiungiQualcosa() {\r\n// ritorna una stringa\r\n// perché qui ho informazioni in più\r\n return \"\\ne capace di cuocere il pollo\";\r\n }",
"public void Ingresar() {\nTipoCliente();\n\t\t\t\t\t\t\t\t\t\n}",
"@Override\n public void preRun() {\n super.preRun();\n }",
"private RateoRisconto getRateoRiscontoPrecedente() {\n\t\tfor(RateoRisconto rateoRisconto : primaNota.getListaRateoRisconto()){\n\t\t\tif(req.getRateo().getUid() == rateoRisconto.getUid()){\n\t\t\t\treturn rateoRisconto;\n\t\t\t}\n\t\t}\n\t\t\n\t\tthrow new IllegalStateException(\"Impossibile trovare il Rateo con uid: \"+req.getRateo().getUid());\n\t}"
] | [
"0.6253601",
"0.6233916",
"0.6208144",
"0.61608684",
"0.6148479",
"0.6130363",
"0.60243905",
"0.5917538",
"0.58986133",
"0.5892964",
"0.5882817",
"0.58698404",
"0.5869323",
"0.5859694",
"0.58387953",
"0.5800782",
"0.57496256",
"0.5749392",
"0.57103884",
"0.569856",
"0.56637067",
"0.56497246",
"0.5640626",
"0.5636163",
"0.5631043",
"0.5626319",
"0.5625557",
"0.56246465",
"0.56223994",
"0.5596025",
"0.558472",
"0.55828017",
"0.5579479",
"0.5571623",
"0.55672365",
"0.55606437",
"0.55600333",
"0.55430174",
"0.55347276",
"0.5527556",
"0.5526908",
"0.5518615",
"0.55153173",
"0.5510046",
"0.55012846",
"0.55012846",
"0.54983115",
"0.5495945",
"0.54895157",
"0.5487422",
"0.54663026",
"0.54649186",
"0.5453938",
"0.54418594",
"0.5434384",
"0.54326737",
"0.5429114",
"0.54204446",
"0.5411512",
"0.5408478",
"0.540558",
"0.5404768",
"0.5402921",
"0.53989166",
"0.53896666",
"0.5386819",
"0.53860027",
"0.53826255",
"0.5381537",
"0.5378364",
"0.5377654",
"0.53749317",
"0.53725165",
"0.5371642",
"0.53701895",
"0.5367064",
"0.536229",
"0.5358061",
"0.5357532",
"0.5347916",
"0.534017",
"0.53396815",
"0.5339158",
"0.53353405",
"0.53297013",
"0.5327771",
"0.5327771",
"0.5324924",
"0.5322764",
"0.53184646",
"0.531748",
"0.5316219",
"0.53088254",
"0.53056467",
"0.53054214",
"0.5304738",
"0.5303829",
"0.53003144",
"0.52966636",
"0.52964556"
] | 0.5601427 | 29 |
Setter method for prenotazione. | public void setPrenotazione(Set<Prenotazione> aPrenotazione) {
prenotazione = aPrenotazione;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setPrecioc(int p){\n this.precioc=p;\n \n }",
"public void setPreco(double preco) {\n\t\tthis.preco = preco;\n\t}",
"public void setPreco(Double preco);",
"public void setPreco(Float preco) { this.preco = preco; }",
"public void setPredeterminado(boolean predeterminado)\r\n/* 159: */ {\r\n/* 160:274 */ this.predeterminado = predeterminado;\r\n/* 161: */ }",
"public Set<Prenotazione> getPrenotazione() {\n return prenotazione;\n }",
"public void setPrecoProduto(String precoProduto) {\r\n\t\tthis.precoProduto = precoProduto;\r\n\t}",
"private void actualizaPremio(){\n\t\tif(botonAp1.isSelected()){\n\t\t\ttipo = 1;\n\t\t\tcoef = modelo.getPartidoApuesta().getCoefLocal();\n\t\t\tpremio.set(apostado.get()*coef);\n\t\t\tpremioLabel.setText(String.format(\"%.2f\", premio.get()));\n\t\t}else{\n\t\t\tif(botonApX.isSelected()){\n\t\t\t\ttipo = 0;\n\t\t\t\tcoef = modelo.getPartidoApuesta().getCoefEmpate();\n\t\t\t\tpremio.set(apostado.get()*coef);\n\t\t\t\tpremioLabel.setText(String.format(\"%.2f\", premio.get()));\n\t\t\t}else{\n\t\t\t\tif(botonAp2.isSelected()){\n\t\t\t\t\ttipo = 2;\n\t\t\t\t\tcoef = modelo.getPartidoApuesta().getCoefVisitante();\n\t\t\t\t\tpremio.set(apostado.get()*coef);\n\t\t\t\t\tpremioLabel.setText(String.format(\"%.2f\", premio.get()));\n\t\t\t\t}else{\n\t\t\t\t\ttipo = -1;\n\t\t\t\t\tcoef = 0.0;\n\t\t\t\t\tpremio.set(0.0);\n\t\t\t\t\tpremioLabel.setText(String.format(\"%.2f\", premio.get()));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public abstract void setCntPoa(int cntPoa);",
"public void setPuntoDeVenta(PuntoDeVenta puntoDeVenta)\r\n/* 145: */ {\r\n/* 146:166 */ this.puntoDeVenta = puntoDeVenta;\r\n/* 147: */ }",
"public void setPriInicio (String val) {\n this.PriInicio = val;\n }",
"public void setPrenom(String prenom) {\r\n this.prenom = prenom;\r\n }",
"public abstract void setCod_tecnico(java.lang.String newCod_tecnico);",
"public void setCodigo(int pCodigo){\n this.codigo = pCodigo;\n }",
"public void setCodProd(IProduto codigo);",
"public void setAnio(int p) { this.anio = p; }",
"public void setX(int nuovo_rettangoloX)\n {\n \tboolean bo = informaPreUpdate();\n rettangoloX = nuovo_rettangoloX;\n\t\tinformaPostUpdate(bo);\n }",
"protected void obrisiPoljePretraga() {\n\t\ttfPretraga.setText(\"\");\r\n\t}",
"public void setDatossolicitudBfmarcaPreaprobado(int value) {\n this.datossolicitudBfmarcaPreaprobado = value;\n }",
"public void setPrezzo (float prezzo) {\r\n\t\tthis.prezzo=prezzo;\r\n\t}",
"public void setParentezco(Parentezco parentezco)\r\n/* 158: */ {\r\n/* 159:290 */ this.parentezco = parentezco;\r\n/* 160: */ }",
"public void setNumero(int numero) { this.numero = numero; }",
"public void setValor(String valor)\n/* 22: */ {\n/* 23:34 */ this.valor = valor;\n/* 24: */ }",
"public void asignarAutomovilPersona(){\r\n persona.setAutomovil(automovil);\r\n }",
"public void setPosicion(int posicion){\n _posicion = posicion;\n }",
"public int getIdPrestatario() {\n return idPrestatario;\n }",
"private void aktualisierePreisanzeige(Set<Platz> plaetze)\r\n\t{\r\n\r\n\t\tif (istVerkaufenMoeglich(plaetze))\r\n\t\t{\r\n\t\t\tGeldbetrag preis = _vorstellung.getPreisFuerPlaetze(plaetze);\r\n\t\t\t_ui.getPreisLabel().setText(\"Gesamtpreis: \" + preis.toString() + \" €\");\r\n\t\t\t_preisFuerAuswahl = preis;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t_ui.getPreisLabel().setText(\"Gesamtpreis:\");\r\n\t\t}\r\n\t}",
"public void setNumero(int numero)\r\n/* 195: */ {\r\n/* 196:206 */ this.numero = numero;\r\n/* 197: */ }",
"public void setCodigo(java.lang.String param){\n \n this.localCodigo=param;\n \n\n }",
"public void setCodigo(Integer codigo) { this.codigo = codigo; }",
"public void setNom(String p_onom);",
"@Override\n public void setPrimeraEntrada(Componente entrada) {\n if(Name.equals(\"NOT\")){\n Entrada1=entrada;\n Entrada2=entrada;\n }else {\n this.Entrada1 = entrada;\n }\n }",
"public void setCodigo_produto(int pCodigoProduto){\n this.codigoProduto = pCodigoProduto;\n }",
"public void setC_Decoris_PreSalesLine_ID (int C_Decoris_PreSalesLine_ID);",
"public void setPreOperation(OperationConf oc) {\n preOperation = oc;\n }",
"public abstract void setFecha_inicio(java.lang.String newFecha_inicio);",
"public void setProposition(String string);",
"public void setAnio(int anio){\r\n \r\n \r\n this.anio = anio;\r\n \r\n }",
"@Test\n public void testSetPrenom() {\n String prenom = \"Pablo\";\n Beneficiaire instance = ben1;\n instance.setPrenom(prenom);\n assertTrue(prenom.equals(instance.getPrenom()));\n\n prenom = \"Nino\";\n instance = ben3;\n instance.setPrenom(prenom);\n assertTrue(prenom.equals(instance.getPrenom()));\n\n prenom = \"Lulu\";\n assertFalse(prenom.equals(instance.getPrenom()));\n }",
"public void setAutorizacion(String autorizacion)\r\n/* 139: */ {\r\n/* 140:236 */ this.autorizacion = autorizacion;\r\n/* 141: */ }",
"public void setPrenom(final String prenom) {\n\t\tthis.prenom = prenom;\n\t}",
"public void setPrixDeVente() { \t\n\t\tfor (Produit p : this.getProduits()) {\n\t\t\tthis.setPrixDeVente(p);\n\t\t}\t\t\n\t}",
"public void setNombre(String nombre){\n this.nombre =nombre;\n }",
"public void setcurrentPara(int p){\r\n currentPara= p;\r\n \r\n }",
"public abstract void setCntPrepaid(int cntPrepaid);",
"@Override\r\n\tpublic void setIzena(String izena) {\n\t\tsuper.setIzena(izena);\r\n\t}",
"@Override\n public void set(Voluntario a) {\n if (a==null) a=new Voluntario();\n \n txtNome.setText(a.getNome());\n DateFormat df = new SimpleDateFormat(\"dd/mm/yyyy\");\n txtDataN.setText(df.format(a.getDataNascimento().getTime()));\n txtNacionalidade.setText(a.getNacionalidadeIndiv());\n txtProfissao.setText(a.getProfissao());\n txtMorada.setText(a.getMorada());\n txtCodPostal.setText(a.getCodigoPostal());\n txtLocalidade.setText(a.getLocalidade());\n txtTelefone.setText(a.getTelefone());\n txtTelemovel.setText(a.getTelemovel());\n txtEmail.setText(a.getEmail());\n txtNif.setText(a.getNif()+\"\");\n txtHabilit.setText(a.getHabilitacoes());\n txtConhecimentosL.setText(a.getConhecimentosLing());\n txtFormComp.setText(a.getFormacaoComp());\n txtExpV.setText(a.getExperienciaVolunt());\n txtConhecimentosC.setText(a.getConhecimentosConstr());\n txtDispon.setText(a.getDisponibilidade());\n txtComoConheceu.setText(a.getComoConheceu());\n checkReceberInfo.setSelected(a.getReceberInfo());\n checkIsParceiro.setSelected(a.isParceiro()); \n \n voluntario = a;\n }",
"public double getPreco() {\n\t\treturn preco;\n\t}",
"public void setContrasena(String contrasena) {this.contrasena = contrasena;}",
"public void setNama() {\n nama.postValue(\"Hello, Riyanto!\");\n }",
"public void setCodigo_pcom(java.lang.String newCodigo_pcom);",
"public void setNumeroAnterior(int numeroAnterior)\r\n/* 205: */ {\r\n/* 206:214 */ this.numeroAnterior = numeroAnterior;\r\n/* 207: */ }",
"void setPrestitoCollection(Collection<Prestito> prestitoCollection);",
"public void setNumeroInicial(int numeroInicial)\r\n/* 185: */ {\r\n/* 186:198 */ this.numeroInicial = numeroInicial;\r\n/* 187: */ }",
"public void Nodo(){\r\n this.valor = \"\";\r\n this.siguiente = null;\r\n }",
"private void remplirPrestaraireData() {\n\t}",
"public void setProprietaire(SystemeAmendesInt.Personne proprietaire) {\n this.proprietaire = proprietaire;\n }",
"@Override\n protected void elaboraParametri() {\n super.elaboraParametri();\n titoloPagina = TITOLO_PAGINA;\n }",
"public void setPri(Integer pri) {\n this.pri = pri;\n }",
"@Override\r\n\tpublic void setRedondez(int redondez) {\n\r\n\t}",
"public synchronized void ProvjeriPreuzimanje() {\n dopustenoPreuzimanje = true;\n if (dopustenoPreuzimanje) {\n SveFunkcijeDretve();\n } else {\n //sleep\n }\n }",
"public void setPrecio(float precio) {\r\n this.precio = precio;\r\n }",
"public void setCodigo(int codigo) {\n this.codigo = codigo;\n }",
"public void setEmpresa(Empresa empresa)\r\n/* 89: */ {\r\n/* 90:141 */ this.empresa = empresa;\r\n/* 91: */ }",
"public void setModeloPrecios(ModeloTablaPrecioAcciones modeloPrecios) {\n\t\tthis.modeloPrecios = modeloPrecios;\n\t}",
"public void setIndicadorNuevo(boolean indicadorNuevo)\r\n/* 215: */ {\r\n/* 216:222 */ this.indicadorNuevo = indicadorNuevo;\r\n/* 217: */ }",
"public void setComuneResidenzaCod(int value) {\r\n this.comuneResidenzaCod = value;\r\n }",
"public void setNOficina (Integer pNOficina)\r\n {\r\n this.nOficina=pNOficina;\r\n }",
"public abstract void setCod_dpto(java.lang.String newCod_dpto);",
"public abstract void setAcma_cierre(java.lang.String newAcma_cierre);",
"void setRecensione(String recensione);",
"public void setCodigo( String codigo ) {\n this.codigo = codigo;\n }",
"@Test\r\n public void testSetFuncaoPrimaria() {\r\n System.out.println(\"setFuncaoPrimaria\");\r\n FuncaoIntegrante funcaoPrimaria = null;\r\n Integrante instance = new Integrante();\r\n instance.setFuncaoPrimaria(funcaoPrimaria);\r\n // TODO review the generated test code and remove the default call to fail.\r\n fail(\"The test case is a prototype.\");\r\n }",
"public void setBunga(int tipeBunga){\n }",
"public void setCodigo(String codigo) {\n this.codigo = codigo;\n }",
"public void setPuntoEmision(String puntoEmision)\r\n/* 129: */ {\r\n/* 130:217 */ this.puntoEmision = puntoEmision;\r\n/* 131: */ }",
"@Test\r\n public void testSetAnalizar() {\r\n System.out.println(\"setAnalizar\");\r\n String analizar = \"3+(\";\r\n RevisorParentesis instance = null;\r\n instance.setAnalizar(analizar);\r\n // TODO review the generated test code and remove the default call to fail.\r\n fail(\"The test case is a prototype.\");\r\n }",
"public void setOrigen(java.lang.String param){\n \n this.localOrigen=param;\n \n\n }",
"public void setPrenom(String prenom) {\n\t\tthis.prenom = prenom;\n\t}",
"void setAnnoPubblicazione(String annoPubblicazione);",
"@Override\n\tpublic void pausaParaComer() {\n\n\t}",
"public void setEnqueteur(Enqueteur enqueteur)\r\n/* */ {\r\n/* 65 */ this.enqueteur = enqueteur;\r\n/* */ }",
"public void setPrixDeVente(Produit p){\n\t\tif (p.getNomProduit() == \"50%\") {\n\t\t\tthis.prixDeVente.set(0, this.getPrixDeVenteParProduit(p));\n\t\t}\n\t\telse {\n\t\t\tif (p.getNomProduit() == \"60%\") {\n\t\t\t\tthis.prixDeVente.set(1, this.getPrixDeVenteParProduit(p));\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis.prixDeVente.set(2, this.getPrixDeVenteParProduit(p));\n\t\t\t}\n\t\t}\n\t}",
"public void setNombre(String nombre) {this.nombre = nombre;}",
"public void setTelefono(String telefono) {\r\n\tthis.telefono = telefono;\r\n}",
"public void setInicio(String inicio) {\n this.inicio = inicio;\n }",
"public Float getPreco() { return this.preco; }",
"public void setEstablecimiento(String establecimiento)\r\n/* 119: */ {\r\n/* 120:198 */ this.establecimiento = establecimiento;\r\n/* 121: */ }",
"public void pone_posicion(int x){\n this.x = x;\n }",
"public double getPreco() {\n\t\treturn this.preco;\n\t}",
"public float getPreis() {\r\n\t\treturn preis;\r\n\t}",
"public void setLBR_ProtestCode (String LBR_ProtestCode);",
"public void setRemarkPro(Integer remarkPro) {\n this.remarkPro = remarkPro;\n }",
"public abstract void setAcma_valor(java.lang.String newAcma_valor);",
"@Test\n public void testSetTipoSangre() {\n System.out.println(\"setTipoSangre\");\n String tipoSangre = \"\";\n Paciente instance = new Paciente();\n instance.setTipoSangre(tipoSangre);\n \n }",
"public void setPrecio(int precio) {\r\n\t\tthis.precio = precio;\r\n\t}",
"public void setPrecio(double precio) {\n\t\tthis.precio = precio;\n\t}",
"public void setMotivoLlamadoAtencion(MotivoLlamadoAtencion motivoLlamadoAtencion)\r\n/* 119: */ {\r\n/* 120:127 */ this.motivoLlamadoAtencion = motivoLlamadoAtencion;\r\n/* 121: */ }",
"public abstract void setFecha_termino(java.lang.String newFecha_termino);",
"public void setAutorizacionAutoimpresorSRI(AutorizacionAutoimpresorSRI autorizacionAutoimpresorSRI)\r\n/* 125: */ {\r\n/* 126:150 */ this.autorizacionAutoimpresorSRI = autorizacionAutoimpresorSRI;\r\n/* 127: */ }"
] | [
"0.7294719",
"0.6754306",
"0.6625232",
"0.65476",
"0.6373678",
"0.6243953",
"0.60947275",
"0.60400236",
"0.60071254",
"0.5981845",
"0.5965597",
"0.5955359",
"0.5943919",
"0.59131986",
"0.5906059",
"0.59008485",
"0.58891016",
"0.5878856",
"0.58760786",
"0.5867386",
"0.5864684",
"0.5800029",
"0.5793114",
"0.57472354",
"0.5739479",
"0.5731493",
"0.57164294",
"0.5711632",
"0.5696077",
"0.5695473",
"0.568216",
"0.5667928",
"0.56600904",
"0.5650397",
"0.56451476",
"0.5638026",
"0.5615598",
"0.5613288",
"0.5604027",
"0.5601897",
"0.5600897",
"0.5589833",
"0.5589193",
"0.5587086",
"0.55840683",
"0.55792665",
"0.5572143",
"0.55621505",
"0.55558103",
"0.55541855",
"0.5552614",
"0.55518883",
"0.55511045",
"0.5542336",
"0.5534616",
"0.55287427",
"0.552693",
"0.5519301",
"0.5515917",
"0.5515518",
"0.5515241",
"0.5511116",
"0.5508669",
"0.5507241",
"0.5506392",
"0.5506051",
"0.5502203",
"0.5500975",
"0.5497094",
"0.5496019",
"0.54959",
"0.54922175",
"0.54914826",
"0.5490701",
"0.54872686",
"0.5482961",
"0.5481616",
"0.5481027",
"0.5479324",
"0.5475711",
"0.5469901",
"0.546892",
"0.5466704",
"0.5465342",
"0.54629517",
"0.54609334",
"0.5453557",
"0.5450465",
"0.5447632",
"0.54439867",
"0.5439866",
"0.5437151",
"0.5423348",
"0.54203486",
"0.54203296",
"0.5419795",
"0.5417791",
"0.5411663",
"0.5407846",
"0.5404958"
] | 0.6926168 | 1 |
Access method for commento. | public Set<Commento> getCommento() {
return commento;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String getComment();",
"public String getComment();",
"public String getComment();",
"public String getComment();",
"public String getComment();",
"public String getComment();",
"String getComment();",
"String getComment();",
"Comment getBase_Comment();",
"@Override\n\tpublic void comment() {\n\t\t\n\t}",
"public String getComment(){\n return this.comment;\n }",
"public String getComment(){\n return comment;\n }",
"public CommentElements getCommentAccess() {\n\t\treturn (pComment != null) ? pComment : (pComment = new CommentElements());\n\t}",
"public String getComment()\n {\n return comment;\n }",
"public String getComment() {\n\t LogWriter.logMessage(LogWriter.TRACE_DEBUG,\"getComment() \" );\n Via via=(Via)sipHeader;\n return via.getComment();\n }",
"@Override\n public void comment(String comment)\n {\n }",
"public String getComment() {\n return comment ;\n }",
"String getComment() {\n//\t\t\tm1();\n\t\t\treturn \"small\";\n\t\t}",
"public void handleComment(HtmlObjects.Comment t)\n {\n }",
"public String getComment() {\n \t\t\t\t\t\t\t\t\treturn null;\n \t\t\t\t\t\t\t\t}",
"@Override\n\t/**\n\t * returns nothing because comments are disabled for classes\n\t * \n\t * @return nothing\n\t */\n\tpublic String getComment() {\n\t\treturn \"\";\n\t}",
"public String getComment() {\n return this.comment;\n }",
"public String getComment() {\n return comment;\n }",
"public String getComment() {\n return comment;\n }",
"public String getComment() {\n return comment;\n }",
"public String getComment() {\n return comment;\n }",
"public String getComment() {\n return comment;\n }",
"public String getComment() {\n return comment;\n }",
"public String getComment() {\n return comment;\n }",
"@Override\n\tpublic String getComment() {\n\t\treturn model.getComment();\n\t}",
"public final String getComment() {\n return comment;\n }",
"public java.lang.String getComment() {\r\n return comment;\r\n }",
"public int getCommentId();",
"@Override\n\t/**\n\t * does nothing because comments are disabled for classes \n\t * \n\t * @param c\n\t */\n\tpublic void setComment(String c) {\n\t}",
"public String getComment() {\n return description;\n }",
"public String get_comment() throws Exception {\n\t\treturn this.comment;\n\t}",
"public String getComment() {\r\n\t\treturn comment;\r\n\t}",
"public java.lang.String getComment() {\n return comment;\n }",
"public java.lang.String getComment() {\n return comment;\n }",
"public java.lang.String getComment() {\n return comment;\n }",
"String getCommentaire();",
"public String getComment() {\n\t\treturn comment;\n\t}",
"public String getComment() {\n\t\treturn comment;\n\t}",
"public String getComment(int commentType, Address address);",
"@Override\n\t/**\n\t * returns nothing because comments are disabled for classes\n\t * \n\t * @return nothing \n\t */\n\tpublic String getOriginalCommentName() {\n\t\treturn \"\";\n\t}",
"public List<Comment> showComment() {\n\t\treturn cdi.showComment();\n\t}",
"public String getCommentContent() {\n return commentContent;\n }",
"java.lang.String getComments();",
"public interface StoryCommentView extends BaseTiView{\n\n void displayComment(Comment comment);\n\n void removeDeletedComment(Comment comment);\n\n}",
"public String toString () {\n if (this.comment != null) {\n return this.comment;\n }\n return super.toString ();\n }",
"public String getCommentText() {\n\t return this.commentText;\n\t}",
"public ST getComment() { \r\n\t\tST retVal = this.getTypedField(48, 0);\r\n\t\treturn retVal;\r\n }",
"@Override\r\n\tpublic void comment(String uname, String content) {\n\t\tSystem.out.println(uname + \"发表评论:\" + content);\r\n\t}",
"public String getCommentOp() {\n return commentOp;\n }",
"public String getComments() {\r\n return this.comments;\r\n }",
"public interface ICommentOrderView extends IBaseVIew {\n//\n// \"token\":\"UkrBfMhbDggL1YA1LPO5Sl1A7pw63waJ\",\n// \"order_id\":\"6804\",\n// \"score\":\"4\",\n// \"is_anonymous\":\"0\",\n// \"content\":\"很实惠,很超值,值得推荐!!!\",\n// \"images\":\"139544,139548,7586\"\n\n void onCommentResult(BaseBean bean);\n String getOrderId();\n String getScore();\n String getAnonymous();\n String getContent();\n}",
"public void handleCfComment(HtmlObjects.CfComment c)\n {\n }",
"@Override\n public void onCommentsReceived(String comment, String URL) {\n\n }",
"public void comment(String data);",
"public void setComment(String comment){\n this.comment = comment;\n }",
"public void setComment(String comment) {\n this.comment = comment;\n }",
"@Override\n public String visit(JavadocComment n, Object arg) {\n return null;\n }",
"public String getCommentText() {\r\n\r\n\t\treturn commentText;\r\n\t}",
"public String getComments() {\n return _comments;\n }",
"public Comment () {\n init();\n }",
"@Override\n\tprotected CloudBaseAdapter getAdapter() {\n\t\treturn new CommentsAdapter(ca(), mListData, mLoadingImages);\n\t}",
"public String getComments() {\n return this.comments;\n }",
"public List<CommentInfo> getComments() {\n \treturn this.comments;\n }",
"public void setComment(String comment);",
"public void setComment(String comment);",
"@Override\n\tpublic String createComment_request() {\n\t\treturn null;\n\t}",
"public abstract char getCommentChar();",
"Comment createComment();",
"@Override\n\t/**\n\t * does nothing because comments are disabled for classes \n\t */\n\tpublic void setItemHavingComment() {\n\t}",
"public String getSampleComment();",
"@Override\n public java.lang.String getComments() {\n return _entityCustomer.getComments();\n }",
"public Comment getDisplayComment() {\n return this;\n }",
"public ContactedUsComments() {\r\n }",
"public void insert(Comment com){\n //@todo implement method\n }",
"String getMovementComments();",
"@Test\n public void commentGetContent() {\n comment.match(\"//irgendein Kommentar\\n\");\n Token t = comment.getToken();\n assertEquals(\"//irgendein Kommentar\\n\", t.getContent());\n }",
"public String getComment() {\n\t\tif (comment != null)\n\t\t\treturn ProteomeXchangeFilev2_1.COM + TAB\n\t\t\t// + \"comment\" + TAB\n\t\t\t\t\t+ comment;\n\t\treturn null;\n\t}",
"public void setComment(String comment)\n {\n this.comment = comment;\n }",
"public Long getCommentId() {\n return commentId;\n }",
"public void setComment(String c) {\n comment = c ;\n }",
"@PropertyGetter(role = COMMENT)\n\tList<CtComment> getComments();",
"public String getComments() \n{\nreturn (String)get_Value(\"Comments\");\n}",
"@Override\n\t\tpublic Object getItem(int arg0) {\n\t\t\t// TODO Auto-generated method stub\n\t\t\treturn comments.get(arg0);\n\t\t}",
"public LazyCommentDataModel getCommentModel() {\r\n return commentModel;\r\n }",
"@Override\n public String visit(LineComment n, Object arg) {\n return null;\n }",
"public int getComments() {\n return comments;\n }",
"public int getComments() {\n return comments;\n }",
"public Integer getCommentId() {\n return commentId;\n }",
"public Integer getCommentId() {\n return commentId;\n }",
"public void setComment(String comment) {\n this.comment = comment;\n }",
"public String getComments() {\n return comments;\n }",
"public Date getCommentTime() {\n return commentTime;\n }",
"int getCommentsMode();",
"public void setComment(String comment) {\n this.comment = comment;\n }",
"public void setComment(String comment) {\n this.comment = comment;\n }",
"@Override\n public String visit(BlockComment n, Object arg) {\n return null;\n }"
] | [
"0.7057371",
"0.7057371",
"0.7057371",
"0.7057371",
"0.7057371",
"0.7057371",
"0.6859363",
"0.6859363",
"0.6824514",
"0.6793092",
"0.6735165",
"0.6697368",
"0.65918475",
"0.6578509",
"0.654674",
"0.6519194",
"0.64879626",
"0.64703244",
"0.64441866",
"0.6442325",
"0.64400154",
"0.64340323",
"0.63862294",
"0.63862294",
"0.63862294",
"0.63862294",
"0.63862294",
"0.63862294",
"0.63862294",
"0.63368046",
"0.630535",
"0.629297",
"0.62668526",
"0.6261917",
"0.6253977",
"0.6234617",
"0.6231399",
"0.61773187",
"0.61773187",
"0.61773187",
"0.61707073",
"0.614426",
"0.614426",
"0.61291057",
"0.6101951",
"0.6070259",
"0.6062228",
"0.6054982",
"0.6030671",
"0.6025569",
"0.6025362",
"0.5978723",
"0.5947471",
"0.59459984",
"0.5945096",
"0.59351045",
"0.5932282",
"0.5913844",
"0.59077865",
"0.5904146",
"0.58840245",
"0.58816576",
"0.58678764",
"0.5850015",
"0.5845046",
"0.58444345",
"0.58386",
"0.582768",
"0.5807779",
"0.5807779",
"0.58053964",
"0.580202",
"0.5792891",
"0.5787121",
"0.5765146",
"0.5748923",
"0.5727978",
"0.572446",
"0.5716176",
"0.57160413",
"0.5715356",
"0.5713016",
"0.57128763",
"0.57081604",
"0.5706846",
"0.5697729",
"0.569644",
"0.56890494",
"0.5681541",
"0.5671653",
"0.5653465",
"0.5653465",
"0.5645595",
"0.5645595",
"0.5640098",
"0.56383437",
"0.563589",
"0.5630489",
"0.5625487",
"0.5625487",
"0.5612542"
] | 0.0 | -1 |
Setter method for commento. | public void setCommento(Set<Commento> aCommento) {
commento = aCommento;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setComment(String comment);",
"public void setComment(String comment);",
"@Override\n\t/**\n\t * does nothing because comments are disabled for classes \n\t * \n\t * @param c\n\t */\n\tpublic void setComment(String c) {\n\t}",
"public void setComments(java.lang.String value);",
"public void setComment(String new_comment){\n this.comment=new_comment;\n }",
"public void setComments( org.ontoware.rdf2go.model.node.Node value) {\r\n\t\tBase.set(this.model, this.getResource(), COMMENTS, value);\r\n\t}",
"public void setComments(String newValue);",
"public void setComment(String c) {\n comment = c ;\n }",
"public void setComment(String comment) {\n this.comment = comment;\n }",
"public void setComment(Address address, int commentType, String comment);",
"public Builder setComment(\n String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000020;\n comment_ = value;\n onChanged();\n return this;\n }",
"public void setComments(java.lang.String value) {\r\n\t\tBase.set(this.model, this.getResource(), COMMENTS, value);\r\n\t}",
"@Override\n @IcalProperty(pindex = PropertyInfoIndex.COMMENT,\n adderName = \"comment\",\n analyzed = true,\n eventProperty = true,\n todoProperty = true,\n journalProperty = true,\n freeBusyProperty = true,\n timezoneProperty = true)\n public void setComments(final Set<BwString> val) {\n comments = val;\n }",
"public void setComment(String comment){\n this.comment = comment;\n }",
"public void setComment(String comment)\n {\n this.comment = comment;\n }",
"@Override\n\tpublic void setComment(String comment) {\n\t\tmodel.setComment(comment);\n\t}",
"public final void setComment(final String comment) {\n this.comment = comment;\n }",
"public void setComment(String comment) throws IllegalArgumentException,\n SipParseException {\n\tLogWriter.logMessage(LogWriter.TRACE_DEBUG,\"setComment() \" + comment );\n Via via=(Via)sipHeader;\n \n if (comment==null) \n throw new IllegalArgumentException\n (\"JAIN-EXCEPTION: null comment\" );\n else if (comment.length() == 0) \n throw new IllegalArgumentException\n (\"JAIN-EXCEPTION: 0 length comment\" );\n else via.setComment(comment);\n }",
"@Override\n public void comment(String comment)\n {\n }",
"private void setDisableComment(int value) {\n \n disableComment_ = value;\n }",
"public Comment(String data) {\n value = data;\n }",
"public void setComment(java.lang.String comment) {\r\n this.comment = comment;\r\n }",
"public void setComment(String comment) {\n this.comment = comment;\n }",
"@PropertySetter(role = COMMENT)\n\t<E extends CtElement> E addComment(CtComment comment);",
"@Test\r\n public void testSetValue() {\r\n CIFComment comment = new CIFComment(COMMENT);\r\n String s = comment.toCIFString();\r\n Assert.assertEquals(\"cif comment\", \"#\"+COMMENT+\"\\n\", s);\r\n comment.setValue(COMMENT1);\r\n s = comment.toCIFString();\r\n Assert.assertEquals(\"cif comment\", \"#\"+COMMENT1+\"\\n\", s);\r\n \r\n comment = new CIFComment(COMMENTS);\r\n s = comment.toCIFString();\r\n Assert.assertEquals(\"cif comment\", \r\n \"#comment 1\\n\" +\r\n \"#comment 2\\n\" +\r\n \"#comment 3\\n\" +\r\n \"\", s);\r\n comment.setValue(COMMENT1);\r\n s = comment.toCIFString();\r\n Assert.assertEquals(\"cif comment\", \"#\"+COMMENT1+\"\\n\", s);\r\n }",
"public void set_comment(String comment) throws Exception{\n\t\tthis.comment = comment;\n\t}",
"public static void setComments( Model model, org.ontoware.rdf2go.model.node.Resource instanceResource, org.ontoware.rdf2go.model.node.Node value) {\r\n\t\tBase.set(model, instanceResource, COMMENTS, value);\r\n\t}",
"public void setCommentId(int commentId);",
"@PropertySetter(role = COMMENT)\n\t<E extends CtElement> E setComments(List<CtComment> comments);",
"public void setComment(String comment) {\n this.comment = comment;\n }",
"public void setComment(String comment) {\n this.comment = comment;\n }",
"public String getComment(){\n return this.comment;\n }",
"public void setComment(java.lang.String comment) {\n this.comment = comment;\n }",
"public void setComment(java.lang.String comment) {\n this.comment = comment;\n }",
"public void setComment(java.lang.String comment) {\n this.comment = comment;\n }",
"@SuppressWarnings(\"unused\")\n public Comment() {\n edited = false;\n }",
"public String getComment(){\n return comment;\n }",
"public void setComments(String value) {\n setAttributeInternal(COMMENTS, value);\n }",
"@Override\n\tpublic void comment() {\n\t\t\n\t}",
"public void setComment(String p_comment) throws RuntimeException\n {\n setTitle(p_comment);\n }",
"public void setComments (String Comments)\n{\nif (Comments != null && Comments.length() > 255)\n{\nlog.warning(\"Length > 255 - truncated\");\nComments = Comments.substring(0,255);\n}\nset_Value (\"Comments\", Comments);\n}",
"public Builder setComments(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000001;\n comments_ = value;\n onChanged();\n return this;\n }",
"public void setComment(String comment) {\r\n\t\tthis.comment = comment == null ? null : comment.trim();\r\n\t}",
"public void setComment(String comment, int rating);",
"@Accessor(qualifier = \"commentCharacter\", type = Accessor.Type.SETTER)\n\tpublic void setCommentCharacter(final Character value)\n\t{\n\t\tgetPersistenceContext().setPropertyValue(COMMENTCHARACTER, value);\n\t}",
"@Override\r\n\tpublic void setWholeComment(String currentComment) {\n\t\t\r\n\t}",
"Builder addComment(Comment value);",
"public void setComment(String comment) {\n this.comment = comment == null ? null : comment.trim();\n }",
"public void setComment(String comment) {\n this.comment = comment == null ? null : comment.trim();\n }",
"public void setComment(String comment) {\n this.comment = comment == null ? null : comment.trim();\n }",
"public void setComment(String comment) {\n this.comment = comment == null ? null : comment.trim();\n }",
"public static void setComments(Model model, org.ontoware.rdf2go.model.node.Resource instanceResource, java.lang.String value) {\r\n\t\tBase.set(model, instanceResource, COMMENTS, value);\r\n\t}",
"public void setComment(String comment) {\n\t\tthis.comment = comment;\n\t}",
"public void setComment(String comment) {\n\t\tthis.comment = comment;\n\t}",
"public DataModelDescriptorBuilder comment(String string) {\n this.comment = string;\n return this;\n }",
"public void setZCOMMENTS(java.lang.String value)\n {\n if ((__ZCOMMENTS == null) != (value == null) || (value != null && ! value.equals(__ZCOMMENTS)))\n {\n _isDirty = true;\n }\n __ZCOMMENTS = value;\n }",
"@Override\n public void setComments(java.lang.String comments) {\n _entityCustomer.setComments(comments);\n }",
"public void toCommentAnnotation() {\n if (ir != null) { // can't process if attahced ir is missing.\n List<Annotation> notes = this.ir.getAnnotations();\n int index = notes.indexOf(this);\n if (index >= 0) {\n CommentAnnotation comment =\n new CommentAnnotation(this.toString());\n notes.remove(this);\n comment.ir = ir;\n comment.setOneLiner(true);\n notes.add(index, comment);\n }\n }\n }",
"public void setComment(final String newComment) {\n this.comment = newComment;\n }",
"public String getComment() {\n return comment ;\n }",
"public void setComments(String comments) {\n _comments = comments;\n }",
"public String getComment()\n {\n return comment;\n }",
"public String getComment() {\n return this.comment;\n }",
"public String getComment() {\n return comment;\n }",
"public String getComment() {\n return comment;\n }",
"public String getComment() {\n return comment;\n }",
"public String getComment() {\n return comment;\n }",
"public String getComment() {\n return comment;\n }",
"public String getComment() {\n return comment;\n }",
"public String getComment() {\n return comment;\n }",
"public void setComment(String path, String comment) {\n if (comment == null)\n configComments.remove(path);\n else\n configComments.put(path, comment);\n }",
"void setCheckinComment(String comment);",
"public Builder setCommentBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000020;\n comment_ = value;\n onChanged();\n return this;\n }",
"public void handleComment(HtmlObjects.Comment t)\n {\n }",
"@Test\n public void testSetComments_1()\n throws Exception {\n Project fixture = new Project();\n fixture.setWorkloadNames(\"\");\n fixture.setName(\"\");\n fixture.setScriptDriver(ScriptDriver.SilkPerformer);\n fixture.setWorkloads(new LinkedList());\n fixture.setComments(\"\");\n fixture.setProductName(\"\");\n String comments = \"\";\n\n fixture.setComments(comments);\n\n }",
"private void setCommentsCount(int value) {\n \n commentsCount_ = value;\n }",
"public abstract void setContent(Object o);",
"public void comment(String data);",
"Builder addComment(String value);",
"public String getComment() {\r\n\t\treturn comment;\r\n\t}",
"public void setComments (java.lang.String comments) {\r\n\t\tthis.comments = comments;\r\n\t}",
"public void setComments(String comments) {\r\n this.comments = comments;\r\n }",
"public ElementDefinitionDt setComments( String theString) {\n\t\tmyComments = new StringDt(theString); \n\t\treturn this; \n\t}",
"public void setComments(String comment) {\n\t\tthis.comments = comment;\n\t}",
"public void setHopscomment( java.lang.String newValue ) {\n __setCache(\"hopscomment\", newValue);\n }",
"public String getComment();",
"public String getComment();",
"public String getComment();",
"public String getComment();",
"public String getComment();",
"public String getComment();",
"String getComment() {\n//\t\t\tm1();\n\t\t\treturn \"small\";\n\t\t}",
"void setComments(org.hl7.fhir.String comments);",
"public Set<Commento> getCommento() {\n return commento;\n }",
"public String getComment() {\n\t\treturn comment;\n\t}",
"public String getComment() {\n\t\treturn comment;\n\t}",
"private void setFileComment(String fileComment){\n put(SlackParamsConstants.FILE_COMMENT, fileComment);\n }",
"public Comment () {\n init();\n }",
"public final String getComment() {\n return comment;\n }",
"private void applyComment()\n {\n Map<String, GWikiArtefakt<?>> map = new HashMap<String, GWikiArtefakt<?>>();\n page.collectParts(map);\n GWikiArtefakt<?> artefakt = map.get(\"ChangeComment\");\n if (artefakt instanceof GWikiChangeCommentArtefakt == false) {\n return;\n }\n\n GWikiChangeCommentArtefakt commentArtefakt = (GWikiChangeCommentArtefakt) artefakt;\n String oldText = commentArtefakt.getStorageData();\n String ntext;\n String uname = wikiContext.getWikiWeb().getAuthorization().getCurrentUserName(wikiContext);\n int prevVersion = page.getElementInfo().getProps().getIntValue(GWikiPropKeys.VERSION, 0);\n if (StringUtils.isNotBlank(comment) == true) {\n Date now = new Date();\n ntext = \"{changecomment:modifiedBy=\"\n + uname\n + \"|modifiedAt=\"\n + GWikiProps.date2string(now)\n + \"|version=\"\n + (prevVersion + 1)\n + \"}\\n\"\n + comment\n + \"\\n{changecomment}\\n\"\n + StringUtils.defaultString(oldText);\n } else {\n ntext = oldText;\n }\n ntext = StringUtils.trimToNull(ntext);\n commentArtefakt.setStorageData(ntext);\n }"
] | [
"0.7620584",
"0.7620584",
"0.7200046",
"0.7181964",
"0.71713454",
"0.71098757",
"0.7069955",
"0.7066696",
"0.7024237",
"0.6960615",
"0.6952038",
"0.68463534",
"0.6841788",
"0.6824086",
"0.67402446",
"0.6715614",
"0.6714495",
"0.6701013",
"0.6677571",
"0.6668508",
"0.66231966",
"0.66183436",
"0.66124785",
"0.66088736",
"0.6597669",
"0.657109",
"0.65552044",
"0.6516123",
"0.65137225",
"0.65124923",
"0.65124923",
"0.6499932",
"0.64917076",
"0.64917076",
"0.64917076",
"0.6487243",
"0.6446133",
"0.6446031",
"0.6444307",
"0.6432951",
"0.64216566",
"0.6407844",
"0.64073604",
"0.64058846",
"0.6388187",
"0.63876045",
"0.6349238",
"0.6330023",
"0.6330023",
"0.6330023",
"0.6330023",
"0.6324211",
"0.63202184",
"0.63202184",
"0.6315227",
"0.63035583",
"0.6294702",
"0.62635124",
"0.62413836",
"0.6237035",
"0.6221078",
"0.62145394",
"0.62037456",
"0.61781156",
"0.61781156",
"0.61781156",
"0.61781156",
"0.61781156",
"0.61781156",
"0.61781156",
"0.61672527",
"0.6166123",
"0.61299825",
"0.6124324",
"0.6115996",
"0.6101076",
"0.6095429",
"0.60947543",
"0.6089257",
"0.60838324",
"0.6079309",
"0.6071296",
"0.60372114",
"0.6032199",
"0.60298574",
"0.6029408",
"0.6029408",
"0.6029408",
"0.6029408",
"0.6029408",
"0.6029408",
"0.60194945",
"0.6002768",
"0.5992486",
"0.5986248",
"0.5986248",
"0.59778666",
"0.597664",
"0.59632736",
"0.5957391"
] | 0.67708117 | 14 |
Access method for utente. | public Utente getUtente() {
return utente;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Utente getUtente() {\n\t\treturn utente;\n\t}",
"public void setUtente(Utente aUtente) {\n utente = aUtente;\n }",
"public String getNomeUtente()\r\n\t{\r\n\t\treturn nomeUtente;\r\n\t}",
"@Override\r\n\tprotected void verificaUtentePrivilegiato() {\n\r\n\t}",
"protected void accionUsuario() {\n\t\t\r\n\t}",
"public void setNomeUtente(String nomeUtente)\r\n\t{\r\n\t\tthis.nomeUtente = nomeUtente; \r\n\t}",
"public java.lang.String getUsuario();",
"public String getUtterance();",
"protected String getUsuario() {\n return this.usuario;\n }",
"String getUnidade();",
"public String getEtiqueta()\n/* 27: */ {\n/* 28:41 */ return this.etiqueta;\n/* 29: */ }",
"public abstract co.com.telefonica.atiempo.ejb.eb.UsuarioLocal getUsuario();",
"public List<Utente> retriveAllUtenti()\n\t{\n\t\tTypedQuery<Utente> query = em.createNamedQuery(Utente.FIND_ALL, Utente.class);\n return query.getResultList();\n\t}",
"@Override\n\tpublic UtenteBase getUtente(String username) {\n\t\tDB db = getDB();\n\t\tMap<Long, UtenteBase> users = db.getTreeMap(\"users\");\n\t\tlong hashCode = (long) username.hashCode();\n\t\tif(users.containsKey(hashCode))\n\t\t\treturn users.get(hashCode);\n\t\telse\n\t\t\treturn null; \n\t}",
"public void Usuarios() {\n\t\r\n}",
"public String getCfUtente() {\n\t\treturn cfUtente;\n\t}",
"public static UsuarioEntidad getUsuarioEntidad(){\n return getUsuarioTemporal().convertirAUsuarioEntidad();\n }",
"String getAuteur();",
"public void altaUsuario();",
"@Override\n\tpublic Utente get(Long id) throws Exception {\n\t\treturn null;\n\t}",
"public void delUtente(Utente u);",
"public String getEdificio ()\r\n {\r\n return this.edificio;\r\n }",
"@Override\n public long getUserId() {\n return _partido.getUserId();\n }",
"public void asetaTeksti(){\n }",
"@Override\n public String getUsername(){\n return getEmail();\n }",
"String getIdentifiant();",
"public Utilizador getUtilizador() {\n return utilizador;\n }",
"public String getUtenteOperazione() {\n\t\treturn utenteOperazione;\n\t}",
"public abstract String getUsername(T itemVO);",
"public java.lang.String getUser(){\r\n return localUser;\r\n }",
"public java.lang.String getUser(){\r\n return localUser;\r\n }",
"public java.lang.String getUser(){\r\n return localUser;\r\n }",
"public Enqueteur getEnqueteur()\r\n/* */ {\r\n/* 57 */ return this.enqueteur;\r\n/* */ }",
"public static List<Utente> getUtenti(int profiloUtente) throws Exception {\r\n\t\tList<Utente> utenti = null;\r\n\t\tUtente user = null;\r\n\t\ttry {\r\n\t\t\tbegin();\r\n\t\t\tQuery q = getSession().createQuery(\r\n\t\t\t\t\t\"from Utente u where u.ruolo = \" + profiloUtente);\r\n\t\t\tutenti = q.list();\r\n\t\t\tcommit();\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\r\n\t\treturn utenti;\r\n\r\n\t}",
"String getEtiqueta();",
"public abstract EUT eut();",
"java.lang.String getUa();",
"public String getUsuario() {\r\n return usuario;\r\n }",
"public String getUsuario() {\r\n return usuario;\r\n }",
"public biz.belcorp.www.canonico.ffvv.vender.TEstadoPedido getEstado(){\n return localEstado;\n }",
"public static List<Utente> lista_utenti(){\r\n\t\tArrayList<Utente> lista=null;\r\n\t\ttry {\r\n\t\t\tDatabase.connect();\r\n\t\t\tResultSet rs = Database.selectRecord(\"utente\", \"utente.username\");\r\n \t\tlista = new ArrayList<Utente>();\r\n \t\twhile(rs.next()) {\r\n \t\t\tint id = rs.getInt(\"id\");\r\n \t\t\tint ruolo = rs.getInt(\"ruolo\");\r\n \t\t\tString username = rs.getString(\"username\");\r\n \t\t\tString email = rs.getString(\"email\");\r\n \t\t\tDate dataSignup = rs.getDate(\"dataSignup\");\r\n \t\t\t\r\n \t\t\tUtente elemento = new Utente(id,ruolo,username,email,dataSignup);\r\n \t\t\tlista.add(elemento);\t\r\n \t\t}\r\n\t\t\tDatabase.close();\t\t\t\r\n\t\t}catch(NamingException e) {\r\n\t\t\tSystem.out.println(\"NamingException\"+e);\r\n\t }catch (SQLException e) {\r\n\t \tSystem.out.println(\"SQLException\"+e);\r\n\t }catch (Exception e) {\r\n\t \tSystem.out.println(\"Exception\"+e); \r\n\t }\r\n\t\treturn lista;\r\n\t}",
"Reserva Obtener();",
"public String getTuserId() {\n return tuserId;\n }",
"public String getUsuario() {\r\n return Usuario;\r\n }",
"public String getUsername()\r\n/* 11: */ {\r\n/* 12:30 */ return this.username;\r\n/* 13: */ }",
"public TransactionOutput getUtxo()\n {\n return utxo;\n }",
"public Vector<Usuario> getUsuario() {\n\t\treturn usuario;\n\t}",
"public User getEditUser()\r\n/* */ {\r\n/* 172 */ return this.editUser;\r\n/* */ }",
"public abstract String getUser();",
"public String chaveSecundaria(){\r\n return this.email;\r\n }",
"public abstract String tiposervicio();",
"public String getPuntoEmision()\r\n/* 124: */ {\r\n/* 125:207 */ return this.puntoEmision;\r\n/* 126: */ }",
"public Usuario getAutor() {\n return autor;\n }",
"@Override\n public java.lang.String getUserUuid()\n throws com.liferay.portal.kernel.exception.SystemException {\n return _partido.getUserUuid();\n }",
"String getTitolo();",
"public String getAutorizacion()\r\n/* 134: */ {\r\n/* 135:226 */ return this.autorizacion;\r\n/* 136: */ }",
"public String getUsername(){\r\n return this.username;\r\n }",
"public String getIdentificacion()\r\n/* 123: */ {\r\n/* 124:223 */ return this.identificacion;\r\n/* 125: */ }",
"public String getAccess();",
"public PuntoDeVenta getPuntoDeVenta()\r\n/* 140: */ {\r\n/* 141:162 */ return this.puntoDeVenta;\r\n/* 142: */ }",
"public HTMLElement getElementUsuarioModificacionEd() { return this.$element_UsuarioModificacionEd; }",
"public String getNickName(){\n return nombreUsuario;\n }",
"public String getEntity()\n\t\t{\n\t\t\treturn userElement.getAttribute(ENTITY_ATTR_NAME);\n\t\t}",
"public String getAuteur() {\n return auteur;\n }",
"String getAccess();",
"String getAccess();",
"public abstract String getUser() throws DataServiceException;",
"public String getNome () { return this.nome; }",
"protected Ente getEnteTest()\n\t{\t\t\n\t\ttry{\n\t\t\tEnte ente = new Ente();\n\t\t\tente.setUid(uidEnte);\n\t\t\treturn ente;\n\t\t} catch(NullPointerException npe){\n\t\t\treturn null;\n\t\t}\t\t\n\t}",
"public String getNome(){\r\n return this.nome;\r\n }",
"public String getTarjetaCredito(){\n return tarjetaCredito;\n }",
"com.soa.SolicitarCreditoDocument.SolicitarCredito getSolicitarCredito();",
"String getNome();",
"protected Text getTextUsername() {\n return textUsername;\n }",
"public String geteUname() {\n return eUname;\n }",
"@Override\npublic String getUsername() {\n\treturn email;\n}",
"public Fruitore(String nomeUtente)\r\n\t{\r\n\t\tthis.nomeUtente = nomeUtente;\r\n\t}",
"public String getUsername() {\n\treturn username;\r\n}",
"Uom getUom();",
"public String returnUsername(){\n return username;\n }",
"public Usuario getUsuario() {\n return usuario;\n }",
"public Usuario getUsuario() {\n return usuario;\n }",
"@Override\r\n\tpublic void NroAccount() {\n\t\t\r\n\t}",
"public int getOwnUserId()\n {\n return this.ownUserId;\n }",
"String getUsername();",
"String getUsername();",
"String getUsername();",
"String getUsername();",
"String getUsername();",
"String getUsername();",
"@Override\n\tpublic void GetServerUser() {\n\n\t}",
"public HTMLElement getElementUsuarioInsercionEd() { return this.$element_UsuarioInsercionEd; }",
"public abstract java.lang.String getNombre();",
"@Override\r\n\tpublic void AddUtente(Utente u) throws RemoteException {\n\t\tthis.utentes.add(u);\r\n\t}",
"public java.lang.String getOrigen(){\n return localOrigen;\n }",
"public String getEstablecimiento()\r\n/* 114: */ {\r\n/* 115:188 */ return this.establecimiento;\r\n/* 116: */ }",
"public String getUsername(){return mUsername;}",
"public String getUsername(){\n return this.username;\n }",
"public String getUsername(){\n return this.username;\n }",
"public String getUsername(){\n return this.username;\n }"
] | [
"0.7298522",
"0.68283385",
"0.66351414",
"0.653824",
"0.62163866",
"0.6185724",
"0.61116636",
"0.60570264",
"0.60194725",
"0.5966441",
"0.59529674",
"0.59297687",
"0.59132314",
"0.5886142",
"0.58578146",
"0.584205",
"0.58370423",
"0.58302176",
"0.5812355",
"0.57884926",
"0.5744671",
"0.57223624",
"0.57072806",
"0.5695499",
"0.5694395",
"0.56900686",
"0.5675545",
"0.566667",
"0.56381255",
"0.56378394",
"0.56378394",
"0.56378394",
"0.56223106",
"0.561393",
"0.56081283",
"0.56052434",
"0.5601211",
"0.559612",
"0.559612",
"0.5588778",
"0.5587897",
"0.5581486",
"0.55727637",
"0.5570265",
"0.5561826",
"0.55363214",
"0.55331117",
"0.55321515",
"0.55258805",
"0.5516169",
"0.55057865",
"0.5503456",
"0.5496507",
"0.5489463",
"0.54838884",
"0.5475684",
"0.54714143",
"0.5468046",
"0.54622644",
"0.5457228",
"0.5456582",
"0.5454525",
"0.5452682",
"0.54498446",
"0.5448853",
"0.5448853",
"0.54455566",
"0.54446846",
"0.5444557",
"0.5444245",
"0.54282695",
"0.5424828",
"0.542237",
"0.54216224",
"0.54194415",
"0.5418567",
"0.54172844",
"0.54156923",
"0.5410564",
"0.5409947",
"0.5407822",
"0.5407822",
"0.5405981",
"0.54046977",
"0.54045635",
"0.54045635",
"0.54045635",
"0.54045635",
"0.54045635",
"0.54045635",
"0.540116",
"0.5400251",
"0.5399958",
"0.539721",
"0.53970003",
"0.53952754",
"0.5394344",
"0.5389351",
"0.53854537",
"0.53854537"
] | 0.7512497 | 0 |
Setter method for utente. | public void setUtente(Utente aUtente) {
utente = aUtente;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Utente getUtente() {\n return utente;\n }",
"public void setNomeUtente(String nomeUtente)\r\n\t{\r\n\t\tthis.nomeUtente = nomeUtente; \r\n\t}",
"public Utente getUtente() {\n\t\treturn utente;\n\t}",
"public void setUsuario(java.lang.String newUsuario);",
"void setTitolo(String titolo);",
"public void setEtiqueta(String etiqueta)\n/* 32: */ {\n/* 33:48 */ this.etiqueta = etiqueta;\n/* 34: */ }",
"public abstract void setUsuario(\n\t\tco.com.telefonica.atiempo.ejb.eb.UsuarioLocal anUsuario);",
"protected void setUsuario(String usuario) {\n this.usuario = usuario;\n }",
"public void setEnqueteur(Enqueteur enqueteur)\r\n/* */ {\r\n/* 65 */ this.enqueteur = enqueteur;\r\n/* */ }",
"public void setUsuario(String usuario) {\r\n this.usuario = usuario;\r\n \r\n }",
"public String getNomeUtente()\r\n\t{\r\n\t\treturn nomeUtente;\r\n\t}",
"public void setTitolo(String titolo) {\n if (titolo == null) {\n System.out.println(\"Hai inserito un titolo errato!!\");\n } else {\n this.titolo = titolo;\n }\n }",
"public void setEtat(String etat) {\r\n\t\tthis.etat = etat;\r\n\t}",
"public void setUtterance(String utterance);",
"public void setUsuario(String usuario) {\r\n this.usuario = usuario;\r\n }",
"public void setUsuario(String usuario) {\r\n this.usuario = usuario;\r\n }",
"public void setEntidade(final E entidade) {\n\n\t\tthis.entidade = entidade;\n\t}",
"void setNome(String nome);",
"public void setUsuario(Usuario usuario) {\n this.usuario = usuario;\n }",
"public void setUsuario(Usuario usuario) {\n this.usuario = usuario;\n }",
"public void setSenha(String senha) {\r\n this.senha = senha;\r\n }",
"public void setEdificio (String pEdificio)\r\n {\r\n this.edificio = pEdificio;\r\n }",
"public void setEntity(String entity)\n\t\t{\n\t\t\tif (entity == null || entity.equals(\"\"))\n\t\t\t\tuserElement.removeAttribute(ENTITY_ATTR_NAME);\n\t\t\telse\n\t\t\t\tuserElement.setAttribute(ENTITY_ATTR_NAME, entity);\n\t\t}",
"public void setCuenta(String cuenta) {\r\n this.cuenta = cuenta;\r\n }",
"public void setValor(String valor)\n/* 22: */ {\n/* 23:34 */ this.valor = valor;\n/* 24: */ }",
"public void setEstablecimiento(String establecimiento)\r\n/* 119: */ {\r\n/* 120:198 */ this.establecimiento = establecimiento;\r\n/* 121: */ }",
"public void setPuntoDeVenta(PuntoDeVenta puntoDeVenta)\r\n/* 145: */ {\r\n/* 146:166 */ this.puntoDeVenta = puntoDeVenta;\r\n/* 147: */ }",
"public void setValor(java.lang.String valor);",
"public void setPuntoEmision(String puntoEmision)\r\n/* 129: */ {\r\n/* 130:217 */ this.puntoEmision = puntoEmision;\r\n/* 131: */ }",
"public void setCfUtente(String cfUtente) {\n\t\tthis.cfUtente = cfUtente;\n\t}",
"public void setEntidad(T entidad) {\r\n this.entidad = entidad;\r\n fillData(entidad);\r\n }",
"public void setUsuarioInsercion(String p) { this.usuarioInsercion = p; }",
"public void setUsuarioInsercion(String p) { this.usuarioInsercion = p; }",
"public void delUtente(Utente u);",
"public void setTipo(String tipo);",
"public void setEstado(biz.belcorp.www.canonico.ffvv.vender.TEstadoPedido param){\n \n this.localEstado=param;\n \n\n }",
"@Test\n public void testSetEtnia() {\n System.out.println(\"setEtnia\");\n String etnia = \"\";\n Paciente instance = new Paciente();\n instance.setEtnia(etnia);\n\n }",
"public final void setValor(final T valorN) {\r\n valor = valorN;\r\n }",
"public void setNome(String nome){\r\n this.nome = nome;\r\n }",
"public void setOtorgante(java.lang.String otorgante) {\n this.otorgante = otorgante;\n }",
"@Override\r\n\tpublic void update(Usuario t) {\n\t\t\r\n\t}",
"@Setteri\n public void asetaLiite(Tiedosto liite){\n this.liite = liite;\n }",
"public void setTech(User tec) {\n\t\tthis.tech = tec;\n\t}",
"public void setEnteDonatore(String enteDonatore) {\n\t\tthis.enteDonatore = enteDonatore;\n\t}",
"public void setEditUser(User editUser)\r\n/* */ {\r\n/* 179 */ this.editUser = editUser;\r\n/* */ }",
"public void setTelefono(String telefono);",
"public void setTipo(String x){\r\n tipo = x;\r\n }",
"private void setUsuario(Element element) {\r\n\t\tUsuario user = (Usuario)Contexts.getSessionContext().get(\"user\");\r\n\t\t\r\n\t\tElement usuario = new Element(\"N_UsuarioAlta\");\r\n\t\tElement uniqueKey = new Element(\"uniqueKey\");\r\n\t\tuniqueKey.setAttribute(\"login_name\", user.getUsername());\r\n\t\tuniqueKey.setAttribute(\"campoCQ\", \"login_name\");\r\n\t\tuniqueKey.setAttribute(\"entidadCQ\", \"users\");\r\n\t\tusuario.addContent(uniqueKey);\r\n\t\telement.addContent(usuario);\r\n\t}",
"public void setOrigen(java.lang.String param){\n \n this.localOrigen=param;\n \n\n }",
"public void setAutorizacion(String autorizacion)\r\n/* 139: */ {\r\n/* 140:236 */ this.autorizacion = autorizacion;\r\n/* 141: */ }",
"@Test\r\n public void testSetContrasenia() {\r\n System.out.println(\"setContrasenia\");\r\n String contrasenia = \"\";\r\n Usuario instance = new Usuario();\r\n instance.setContrasenia(contrasenia);\r\n // TODO review the generated test code and remove the default call to fail.\r\n }",
"public void setNguoiThamDu(String nguoiThamDu);",
"protected void setManusia(T Manusia){\r\n this.Manusia = Manusia;\r\n }",
"@Test\r\n public void testSetUsuario() {\r\n System.out.println(\"setUsuario\");\r\n String usuario = \"\";\r\n Usuario instance = new Usuario();\r\n instance.setUsuario(usuario);\r\n // TODO review the generated test code and remove the default call to fail.\r\n }",
"public void setU(String f){\n u = f;\n}",
"@Override\n\tpublic void AlterarSenha(EntidadeDominio entidade) throws SQLException {\n\t\t\n\t}",
"public void setUsuario(Usuario usuario) {\r\n\t\tthis.usuario = usuario;\r\n\t}",
"public void setUsuarioTxt(JTextField usuarioTxt) {\n this.usuarioTxt = usuarioTxt;\n }",
"public void setUsuario(java.lang.String usuario) {\n this.usuario = usuario;\n }",
"public void setEmpresa(Empresa empresa)\r\n/* 89: */ {\r\n/* 90:141 */ this.empresa = empresa;\r\n/* 91: */ }",
"@Override public void setEntorno(String nombre, String valor) {\r\n TRAZADOR.info(nombre + \" = \" + valor);\r\n this.sesion.setEntorno(nombre, valor);\r\n }",
"public void setEntidad(java.lang.String entidad) {\n this.entidad = entidad;\n }",
"public abstract void setCod_tecnico(java.lang.String newCod_tecnico);",
"public void setTexto(String t)\r\n {\r\n texto = t;\r\n }",
"public void setSenha(int senha){\n\t\tthis.senha = senha;\n\t}",
"public abstract void setApellido(java.lang.String newApellido);",
"public void setEmpleado(Empleado empleado)\r\n/* 188: */ {\r\n/* 189:347 */ this.empleado = empleado;\r\n/* 190: */ }",
"protected String getUsuario() {\n return this.usuario;\n }",
"@Override\n public void setUserId(long userId) {\n _partido.setUserId(userId);\n }",
"public void setTextUsuarioInsercionEd(String text) { doSetText(this.$element_UsuarioInsercionEd, text); }",
"public abstract Setusuario buscarUsuario(String nomUsuario);",
"public void setORM_TUtu(orm.TU value) {\r\n\t\tthis.TUtu = value;\r\n\t}",
"@Override\r\n\tpublic void AddUtente(Utente u) throws RemoteException {\n\t\tthis.utentes.add(u);\r\n\t}",
"public final void setSiguiente(final Celda siguienteN) {\r\n siguiente = siguienteN;\r\n\r\n }",
"@Test\r\n public void testSetApellido() {\r\n System.out.println(\"setApellido\");\r\n String apellido = \"\";\r\n Usuario instance = new Usuario();\r\n instance.setApellido(apellido);\r\n // TODO review the generated test code and remove the default call to fail.\r\n }",
"@Override\n\tpublic void setTipo() {\n\t\ttipo = TipoPessoa.SUSPEITO;\n\t}",
"@Override\n public void setUuid(java.lang.String uuid) {\n _partido.setUuid(uuid);\n }",
"public void setTid(int tid);",
"public Fruitore(String nomeUtente)\r\n\t{\r\n\t\tthis.nomeUtente = nomeUtente;\r\n\t}",
"public void setUsuarioID(int usuarioID) {\r\n this.usuarioID = usuarioID;\r\n }",
"public void setEnteRichiedente(Optional<String> enteRichiedente) {\n\t\tthis.enteRichiedente = enteRichiedente;\n\t}",
"public void setTitulo(String titulo)\r\n {\r\n if(titulo!= null)\r\n { this.titulo=titulo; }\r\n }",
"public void setTiempo(String tiempo) {\r\n this.tiempo = tiempo;\r\n }",
"public void setTei( String tei )\n {\n this.trackedEntity = tei;\n }",
"@Override\n\tpublic void set(T e) {\n\t\t\n\t}",
"@Override\n\tpublic void setVcampo(java.lang.String Vcampo) {\n\t\t_esfShooterAffiliationChrono.setVcampo(Vcampo);\n\t}",
"public void setEtat(EnumEtatOperation etat) {\r\n this.etat = etat;\r\n }",
"public String chaveSecundaria(){\r\n return this.email;\r\n }",
"public void setRua(String rua) {this.rua = rua;}",
"public String getCfUtente() {\n\t\treturn cfUtente;\n\t}",
"public void setNombre(String nombre){\n this.nombre =nombre;\n }",
"public void setSoggettoEmittente(it.gov.agenziaentrate.ivaservizi.docs.xsd.fatture.v12.SoggettoEmittenteType.Enum soggettoEmittente)\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n org.apache.xmlbeans.SimpleValue target = null;\r\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(SOGGETTOEMITTENTE$10, 0);\r\n if (target == null)\r\n {\r\n target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(SOGGETTOEMITTENTE$10);\r\n }\r\n target.setEnumValue(soggettoEmittente);\r\n }\r\n }",
"public void setNome(String pNome){\n this.nome = pNome;\n }",
"public final void setId_etudiant(final Long id_etudiant) {\n this.id_etudiant = id_etudiant;\n }",
"private void setTitulo(String titulo) {\n\t\tthis.titulo = titulo;\n\t}",
"public void setNivelAuditoria(String nivelAuditoria) {\n\t\tif (logger.isDebugEnabled()) {\n\t\t\tlogger.debug(\"setNivelAuditoria(String) - start\");\n\t\t}\n\n\t\tthis.nivelAuditoria = nivelAuditoria;\n\n\t\tif (logger.isDebugEnabled()) {\n\t\t\tlogger.debug(\"setNivelAuditoria(String) - end\");\n\t\t}\n\t}",
"public void setEmpleado(String empleado) {\n this.empleado = empleado;\n }",
"public void setTelefono(String telefono) {\r\n\tthis.telefono = telefono;\r\n}",
"public void setEstado(String estado) {\n this.estado.set(estado);\n }",
"public void setLongitud(String longitud);"
] | [
"0.69065934",
"0.6761687",
"0.6743237",
"0.670568",
"0.6597261",
"0.6409378",
"0.62286425",
"0.6148598",
"0.6115593",
"0.61039156",
"0.6034544",
"0.5982265",
"0.597453",
"0.59597576",
"0.59494823",
"0.59494823",
"0.59422547",
"0.5930165",
"0.5908909",
"0.5908909",
"0.5882499",
"0.58643156",
"0.5861522",
"0.58279175",
"0.58017766",
"0.5801247",
"0.5795002",
"0.57801014",
"0.57748353",
"0.5768698",
"0.5754556",
"0.57363117",
"0.57363117",
"0.57354057",
"0.57187337",
"0.5717184",
"0.57012093",
"0.57004344",
"0.5683749",
"0.56831276",
"0.56797034",
"0.5678062",
"0.5657748",
"0.5643008",
"0.56215936",
"0.56125253",
"0.56054157",
"0.5599849",
"0.55995905",
"0.55939037",
"0.5590445",
"0.558985",
"0.55861545",
"0.55813104",
"0.55740243",
"0.55734223",
"0.5568484",
"0.55666745",
"0.5565271",
"0.55516636",
"0.55435586",
"0.5539557",
"0.5538386",
"0.55364543",
"0.552843",
"0.552805",
"0.5523214",
"0.5521297",
"0.55189586",
"0.5514488",
"0.5508547",
"0.55034524",
"0.55032414",
"0.5500997",
"0.5500719",
"0.54998595",
"0.5498916",
"0.54946804",
"0.5493642",
"0.54783267",
"0.546381",
"0.5463627",
"0.54630077",
"0.54575056",
"0.5457291",
"0.54557914",
"0.5454423",
"0.54507643",
"0.5446631",
"0.5446619",
"0.54453313",
"0.54386425",
"0.54383177",
"0.5437792",
"0.54373854",
"0.543622",
"0.54334325",
"0.5427781",
"0.5418656",
"0.5417193"
] | 0.8354593 | 0 |
Access method for pagamento. | public Set<Pagamento> getPagamento() {
return pagamento;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tprotected Paginador<UnidadFuncional_VO> getPaginador() {\n\t\treturn null;\r\n\t}",
"private static void pagarEmpleado(int cod) {\n throw new UnsupportedOperationException(\"Not yet implemented\");\n }",
"@Override // Métodos que fazem a anulação\n\tpublic void pagaIR() {\n\t\t// TODO Auto-generated method stub\n\t\t\n\t}",
"public Long getPagoContado() {\n return pagoContado;\n }",
"@Override\n\tpublic void realizarPago() {\n\t}",
"public int getTipoPago() {\n return this.tipoPago;\n }",
"@Override\r\n\tprotected JSON_Paginador getJson_paginador() {\n\t\treturn null;\r\n\t}",
"@Override\n\tprotected String getPaginaMantenimiento() throws Exception {\n\t\treturn null;\n\t}",
"@Override\n protected void elaboraParametri() {\n super.elaboraParametri();\n titoloPagina = TITOLO_PAGINA;\n }",
"public FacturaCompra pagoPSE(String userName,TipoMoneda tipoMoneda);",
"Pages getPages();",
"long getAmountPage();",
"public void proximo(){//executa metodo que passa para proxima pagina de registro de funcioanrios\r\n\t\tdao.proximo();\r\n\t}",
"protected PagingInfo getPagingInfo() {\n\t\treturn paging;\n\t}",
"@GetMapping(\"/produtos\")\n @Timed\n public ResponseEntity<List<Produto>> getAllProdutos(@ApiParam Pageable pageable) {\n log.debug(\"REST request to get a page of Produtos\");\n\n//////////////////////////////////REQUER PRIVILEGIOS\n if (!PrivilegioService.podeVer(cargoRepository, ENTITY_NAME)) {\n log.error(\"TENTATIVA DE VISUALIZAR SEM PERMISSÃO BLOQUEADA! \" + ENTITY_NAME);\n return null;\n }\n\n//////////////////////////////////REQUER PRIVILEGIOS\n Page<Produto> page = produtoRepository.findAll(pageable);\n HttpHeaders headers = PaginationUtil.generatePaginationHttpHeaders(page, \"/api/produtos\");\n return new ResponseEntity<>(page.getContent(), headers, HttpStatus.OK);\n }",
"public java.lang.String getMontoPagado() {\n return montoPagado;\n }",
"public String getConsultaPaginada() {\r\n\t\treturn consultaPaginada;\r\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 }",
"protected void elaboraPagina() {\n testoPagina = VUOTA;\n\n //header\n testoPagina += this.elaboraHead();\n\n //body\n testoPagina += this.elaboraBody();\n\n //footer\n //di fila nella stessa riga, senza ritorno a capo (se inizia con <include>)\n testoPagina += this.elaboraFooter();\n\n //--registra la pagina principale\n if (dimensioniValide()) {\n testoPagina = testoPagina.trim();\n\n if (pref.isBool(FlowCost.USA_DEBUG)) {\n testoPagina = titoloPagina + A_CAPO + testoPagina;\n titoloPagina = PAGINA_PROVA;\n }// end of if cycle\n\n //--nelle sottopagine non eseguo il controllo e le registro sempre (per adesso)\n if (checkPossoRegistrare(titoloPagina, testoPagina) || pref.isBool(FlowCost.USA_DEBUG)) {\n appContext.getBean(AQueryWrite.class, titoloPagina, testoPagina, summary);\n logger.info(\"Registrata la pagina: \" + titoloPagina);\n } else {\n logger.info(\"Non modificata la pagina: \" + titoloPagina);\n }// end of if/else cycle\n\n //--registra eventuali sottopagine\n if (usaBodySottopagine) {\n uploadSottoPagine();\n }// end of if cycle\n }// end of if cycle\n\n }",
"public int getPages(){\n return pages;\n }",
"public String getPageno() {\r\n return pageno;\r\n }",
"public Page getPage() {return page;}",
"private void parametrizarPagingControl() throws Exception {\r\n\t\tlog.info(\"Ejecutando metodo [parametrizarPagingControl()]...\");\r\n\r\n\t\tidMCRZPGCTRLMaestro.setComponenteReferencia(idMCRZLbxlista);\r\n\t\tidMCRZPGCTRLMaestro.setStatementConsultaPaginada(getConsultaPaginada());\r\n\t\tidMCRZPGCTRLMaestro.setPageSize(5);\r\n\t\tidMCRZPGCTRLMaestro.setConsultaDinamica(isDinamic());\r\n\t\tidMCRZPGCTRLMaestro.setSqlConsultaDinamica(getConsultaDinamica());\r\n\t\tidMCRZPGCTRLMaestro.setTipoClase(objetoClase);\r\n\t\tidMCRZPGCTRLMaestro.setTablaPadreFrom(tablaPadreFrom);\r\n\t\tidMCRZLhdNombre.setVisible(usaColumnaNombre);\r\n\t\t// idAUTZCTRLControl.setMold(\"os\");\r\n\r\n\t\tidMCRZPGCTRLMaestro.setPagingControlFilas(new PagingControlFilas() {\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void render(Component component,\r\n\t\t\t\t\tIBeanAbstracto iBeanAbstracto) {\r\n\r\n\t\t\t\t// final Listitem fila = getAssemblerStandard()\r\n\t\t\t\t// .crearListitemDesdeDto((Listitem) component,\r\n\t\t\t\t// iBeanAbstracto);\r\n\r\n\t\t\t\tfinal Listitem fila = getAssemblerStandard()\r\n\t\t\t\t\t\t.crearListitemDinamico(null, iBeanAbstracto.getMD5(),\r\n\t\t\t\t\t\t\t\t(Listitem) component,\r\n\t\t\t\t\t\t\t\tiBeanAbstracto.getCodigo(),\r\n\t\t\t\t\t\t\t\tiBeanAbstracto.getNombre());\r\n\t\t\t\tfinal BandboxFindPaging padre = BandboxFindPaging.this;\r\n\t\t\t\tfinal IBeanAbstracto object = iBeanAbstracto;\r\n\t\t\t\tfila.addEventListener(Events.ON_CLICK,\r\n\t\t\t\t\t\tnew EventListener<Event>() {\r\n\r\n\t\t\t\t\t\t\tpublic void onEvent(Event arg0) throws Exception {\r\n\t\t\t\t\t\t\t\tonSeleccionarMaestro(object, padre);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\t\t\t\tif (interfaz != null) {\r\n\t\t\t\t\tfila.addEventListener(Events.ON_CLICK,\r\n\t\t\t\t\t\t\tnew EventListener<Event>() {\r\n\t\t\t\t\t\t\t\tpublic void onEvent(Event arg0)\r\n\t\t\t\t\t\t\t\t\t\tthrows Exception {\r\n\t\t\t\t\t\t\t\t\tif (ids != null)\r\n\t\t\t\t\t\t\t\t\t\tfila.setAttribute(\"ID\", ids);\r\n\t\t\t\t\t\t\t\t\tinterfaz.onValidateSeleccion(fila, object);\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}\r\n\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tidMCRZPGCTRLMaestro\r\n\t\t\t\t.agregarAtributosColumnas(new ArrayList<PagingControlColumnas>());\r\n\t\tidMCRZPGCTRLMaestro.setComponenteContenedor(idMCRZLftPaging);\r\n\r\n\t\tif (usaColumnaCodigo && usaColumnaNombre) {\r\n\t\t\tlog.info(\"@parametrizarPagingControl ===> usaColumnaCodigo=\"\r\n\t\t\t\t\t+ usaColumnaCodigo + \";usaColumnaNombre=\"\r\n\t\t\t\t\t+ usaColumnaNombre);\r\n\t\t\t((Listfooter) idMCRZLftPaging.getChildren().get(0)).setSpan(2);\r\n\t\t\t((Listfooter) idMCRZLftPaging.getChildren().get(0))\r\n\t\t\t\t\t.appendChild(idMCRZPGCTRLMaestro);\r\n\t\t\t((Listfooter) idMCRZLftPaging.getChildren().get(1))\r\n\t\t\t\t\t.setVisible(false);\r\n\t\t} else if (!usaColumnaCodigo && usaColumnaNombre) {\r\n\t\t\tlog.info(\"@parametrizarPagingControl ===> usaColumnaCodigo=\"\r\n\t\t\t\t\t+ usaColumnaCodigo + \";usaColumnaNombre=\"\r\n\t\t\t\t\t+ usaColumnaNombre);\r\n\t\t\t((Listfooter) idMCRZLftPaging.getChildren().get(0))\r\n\t\t\t\t\t.setVisible(false);\r\n\t\t\t((Listfooter) idMCRZLftPaging.getChildren().get(1))\r\n\t\t\t\t\t.setVisible(true);\r\n\t\t\t((Listfooter) idMCRZLftPaging.getChildren().get(1))\r\n\t\t\t\t\t.appendChild(idMCRZPGCTRLMaestro);\r\n\t\t} else if (usaColumnaCodigo && !usaColumnaNombre) {\r\n\t\t\tlog.info(\"@parametrizarPagingControl ===> usaColumnaCodigo=\"\r\n\t\t\t\t\t+ usaColumnaCodigo + \";usaColumnaNombre=\"\r\n\t\t\t\t\t+ usaColumnaNombre);\r\n\t\t\t((Listfooter) idMCRZLftPaging.getChildren().get(0)).setSpan(1);\r\n\t\t\t((Listfooter) idMCRZLftPaging.getChildren().get(0))\r\n\t\t\t\t\t.appendChild(idMCRZPGCTRLMaestro);\r\n\t\t\t((Listfooter) idMCRZLftPaging.getChildren().get(1))\r\n\t\t\t\t\t.setVisible(false);\r\n\t\t\t((Listhead) this.getFellow(\"idMCRZListHead\"))\r\n\t\t\t\t\t.removeChild(idMCRZLhdNombre);\r\n\t\t\tidMCRZLhdNombre.setStyle(\"visibility: hidden\");\r\n\t\t}\r\n\r\n\t}",
"@Override\n public void mostrar(){\n super.mostrar(); //Para evitar que este metodo se prefiera antes que el de padre(por que tienen el mismo nombre)\n //lo llamamos con super\n System.out.println(\"Nro de Paginas: \" + this.nroPag);\n }",
"Pagina getDestino();",
"public String getPagenumber() {\n return pagenumber;\n }",
"public void setMontoPagado(java.lang.String montoPagado) {\n this.montoPagado = montoPagado;\n }",
"protected String getTitoloPaginaMadre() {\n return VUOTA;\n }",
"List<ProductView> getAllByPage(PageableAndSortable pageableAndSortable) throws ProductException;",
"public void setPagamento(Set<Pagamento> aPagamento) {\n pagamento = aPagamento;\n }",
"@Override\n public int numberOfPages() {\n // TODO Auto-generated method stub\n throw new UnsupportedOperationException(\"Unsupported operation\");\n }",
"public interface PagedResult<T> {\r\n\r\n\t/*\r\n\t * Result code\r\n\t */\r\n\t\r\n\tpublic static final int RESULT_CODE_OK = 0;\r\n\t\r\n\tpublic static final int RESULT_CODE_KO = -1;\r\n\t\r\n\tpublic static final int FIRST_PAGE_INDEX = 1;\r\n\t\r\n\t/**\r\n\t * The method getElementCount() returns this value if the element count is unavalable\r\n\t */\r\n\tpublic final static Integer ELEMENT_COUNT_UNAVAILABLE = -1;\r\n\t\r\n\t/**\r\n\t * <p>The position of the first element of the current pages ( (currentPage-1) * perPage )</p> \r\n\t * \r\n\t * @return\toffset of the first element in this page\r\n\t */\r\n\tpublic Integer getOffset();\r\n\t\r\n\t/**\r\n\t * <p>Maximum number of elements in a page</p>\r\n\t * \r\n\t * @return\tmaximum number of elements in a page\r\n\t */\r\n\tpublic Integer getPerPage();\r\n\r\n\t/**\r\n\t * <p>Total number of elements in all pages</p>\r\n\t * \r\n\t * @return\ttotal number of elements in all pages\r\n\t */\r\n\tpublic Long getElementCount();\r\n\t\r\n\t/**\r\n\t * <p>Position of current page ( in the range 1 - n )</p>\r\n\t * \r\n\t * @return\tposition of current page\r\n\t */\r\n\tpublic Integer getCurrentPage();\t\r\n\t\r\n\t/**\r\n\t * <p>Total number of pages</p>\r\n\t * \r\n\t * @return\ttotal number of pages\r\n\t */\r\n\tpublic Integer getPageCount();\t\r\n\t\r\n\t/**\r\n\t * <p>Number of elements in current page</p>\r\n\t * \r\n\t * @return\tthe size of the current page\r\n\t */\r\n\tpublic Integer getCurrentPageSize();\r\n\t\r\n\t/**\r\n\t * <p>Elements in the current page</p>\r\n\t * \r\n\t * @return\telements in the current page\r\n\t */\r\n\tpublic Iterator<T> getPageElements();\r\n\r\n\t/**\r\n\t * <p>Elements in the current page</p>\r\n\t * \r\n\t * @return\telements in the current page\r\n\t */\r\n\tpublic List<T> getPageElementsList();\r\n\t\r\n\t/**\r\n\t * <p>Iterator over page numbers ( 1 - n )</p>\r\n\t * \r\n\t * @return\titerator over page numbers ( 1 - n )\r\n\t */\r\n\tpublic Iterator<Integer> getPageCountIterator();\r\n\t\r\n\t/**\r\n\t * Result code for this page\r\n\t * \r\n\t * @return\r\n\t */\r\n\tpublic int getResultCode();\r\n\t\r\n\t/**\r\n\t * Additional info of this page.\r\n\t * \r\n\t * @return\r\n\t */\r\n\tpublic Map<String, Object> getInfo();\r\n\t\r\n\t\r\n\t/** \r\n\t * <code>true</code> if this is the last page.\r\n\t * \r\n\t * @return\r\n\t */\r\n\tpublic boolean isLastPage();\r\n\t\r\n\t/** \r\n\t * <code>true</code> if this is the last page.\r\n\t * \r\n\t * @return\r\n\t */\r\n\tpublic boolean isFirstPage();\t\r\n\t\r\n\t\r\n\t// ******* additiona method for virtual paging *******\r\n\t\r\n\t// *******************************************************************************************\r\n\t// *******************************************************************************************\r\n\t// * VIRTUAL PAGING IS A METHOD WHERE A VIRTUAL PAGE IS MAPPED INTO A BIGGER PAGE *\r\n\t// *******************************************************************************************\r\n\t// *******************************************************************************************\r\n\t\r\n\t/**\r\n\t * Virtual search key\r\n\t * \r\n\t * @return\r\n\t */\r\n\tpublic String getVirtualSearchKey();\r\n\t\r\n\tpublic Integer getRealPerPage();\r\n\t\r\n\tpublic Integer getRealCurrentPage();\r\n\t\r\n\tpublic PagedResult<T> getVirtualPage( int currentPage );\r\n\t\r\n\tpublic boolean isSupportVirtualPaging();\r\n\t\r\n\t\r\n\t// ******* additiona method for full result *******\r\n\t\r\n\t// *******************************************************************************************\r\n\t// *******************************************************************************************\r\n\t// * FULL RESULT IS A METHOD OF ACCESS PAGE WHERE ALL ELEMENTS ARE ACCESSIBLE ONLY ITERATING *\r\n\t// *******************************************************************************************\r\n\t// *******************************************************************************************\r\n\t\r\n\t/**\r\n\t * <code>true</code> if the the page contains the full result\r\n\t * \r\n\t * @return\r\n\t */\r\n\tpublic boolean isFullResult();\r\n\r\n}",
"public void pagar(int precio){\r\n this.dinero -=precio;\r\n }",
"@Command\n\t@NotifyChange(\"*\")\n\tpublic void paginarLista(){\n\t\tint page=pagAnalistas.getActivePage();\n\t\tcambiarAnalistas(page, null, null);\n\t}",
"public Integer getPerPage();",
"public interface AlreadyGetTaskView extends BaseView {\n\n String getPage();\n\n String getPerpage();\n\n /**\n * 查询类型 1未完成 2审核中 3已完成\n *\n * @return\n */\n String getTab();\n\n /**\n * 获得已完成的数据\n */\n void getUnCompleteSuccess(AlreadyGetTaskListInfo mAlreadyGetTaskListInfo,int maxpage);\n /**\n * 刷新\n */\n void doRefresh();\n\n /**\n * 获得审核中的数据\n */\n void getAuditSuccess();\n\n /**\n * 获得已完成的数据\n */\n void getCompleteSuccess();\n}",
"private void abreContasPagas() {\n FiltroDataListaFornecedor dataListaFornecedor\n = new FiltroDataListaFornecedor(\n new String[]{\n \"/br/rel/caixa/ContasPagas.jasper\",\n \"MES\",\n \"0\"});\n dataListaFornecedor.setVisible(true);\n }",
"@GetMapping(\"/pagina\")\t\n\tpublic ResponseEntity<?> listar(Pageable pageable) {\n\t\tPageable pageableEnv = PageRequest.of(pageable.getPageNumber() - 1, pageable.getPageSize());\n\t\treturn ResponseEntity.ok().body(service.findAll(pageableEnv));\n\t}",
"public DElementPagosPago() {\n super(\"pago10:Pago\");\n\n moAttFechaPago = new DAttributeDatetime(\"FechaPago\", true);\n moAttFormaDePagoP = new DAttributeString(\"FormaDePagoP\", true, 2, 2); // c_FormaPago catalog codes of 2 fixed digits\n moAttMonedaP = new DAttributeString(\"MonedaP\", true, 3, 3); // c_Moneda catalog codes of 3 fixed digits\n moAttTipoCambioP = new DAttributeTipoCambio(\"TipoCambioP\", false);\n moAttMonto = new DAttributeTypeImporte(\"Monto\", true);\n moAttNumOperacion = new DAttributeString(\"NumOperacion\", false, 1, 100);\n moAttRfcEmisorCtaOrd = new DAttributeString(\"RfcEmisorCtaOrd\", false, 12, 13);\n moAttNomBancoOrdExt = new DAttributeString(\"NomBancoOrdExt\", false, 1, 300);\n moAttCtaOrdenante = new DAttributeString(\"CtaOrdenante\", false, 10, 50);\n moAttRfcEmisorCtaBen = new DAttributeString(\"RfcEmisorCtaBen\", false, 12, 12);\n moAttCtaBeneficiario = new DAttributeString(\"CtaBeneficiario\", false, 10, 50);\n moAttTipoCadPago = new DAttributeString(\"TipoCadPago\", false, 2, 2);\n moAttCertPago = new DAttributeString(\"CertPago\", false, 1); // xs:base64Binary\n moAttCadPago = new DAttributeString(\"CadPago\", false, 1, 8192);\n moAttSelloPago = new DAttributeString(\"SelloPago\", false, 1); // xs:base64Binary\n\n mvAttributes.add(moAttFechaPago);\n mvAttributes.add(moAttFormaDePagoP);\n mvAttributes.add(moAttMonedaP);\n mvAttributes.add(moAttTipoCambioP);\n mvAttributes.add(moAttMonto);\n mvAttributes.add(moAttNumOperacion);\n mvAttributes.add(moAttRfcEmisorCtaOrd);\n mvAttributes.add(moAttNomBancoOrdExt);\n mvAttributes.add(moAttCtaOrdenante);\n mvAttributes.add(moAttRfcEmisorCtaBen);\n mvAttributes.add(moAttCtaBeneficiario);\n mvAttributes.add(moAttTipoCadPago);\n mvAttributes.add(moAttCertPago);\n mvAttributes.add(moAttCadPago);\n mvAttributes.add(moAttSelloPago);\n \n maEltDoctoRelacionados = new ArrayList<>();\n }",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"private boolean pagarMedico(PersMedico medico) throws Exception {\n CuenBancaria cuenta = obtenerCuentaMedico(medico);\n //Obtener atenciones de este mes\n ArrayList<AtencionAgen> atencionesDelMes = obtenerAtencionesDelMes(medico);\n //Obtener pagos de atenciones no devueltas\n ArrayList<Pago> pagos = obtenerPagosNoDevueltos(atencionesDelMes);\n int honorarios = calcularHonorarios(medico, pagos);\n if(honorarios == 0){\n throw new Exception(\"Los honorarios no pueden ser 0\");\n }\n try {\n //aqui deberia ir la llamada a la api del banco\n registrarPagoHonorarios(cuenta, honorarios);\n return true;\n } catch (Exception e) {\n return false;\n }\n }",
"@Override\n\tpublic Page<?> pagination(Integer pagenumber, Integer rows, String sortdireccion, String sortcolumn,\n\t\t\tObject filter) {\n\t\treturn null;\n\t}",
"Page getPage();",
"public void getWantedPageFromPagination()throws Exception{\r\n SearchPageFactory pageFactory = new SearchPageFactory(driver);\r\n List<WebElement> pageOrderList = pageFactory.searchPagePaginationList;\r\n WebElement wantedPageOrder = pageOrderList.get(1);\r\n clickElement(wantedPageOrder, Constant.explicitTime);\r\n }",
"@Override\n public List<Produto> filtrarProdutos() {\n\n Query query = em.createQuery(\"SELECT p FROM Produto p ORDER BY p.id DESC\");\n\n// query.setFirstResult(pageRequest.getPageNumber() * pageRequest.getPageSize());\n// query.setMaxResults(pageRequest.getPageSize());\n return query.getResultList();\n }",
"public void setTipoPago(int tipoPago) {\n this.tipoPago = tipoPago;\n }",
"Documento getDocumento();",
"@Override\n\tpublic MedioPago grabar(MedioPago entidad) {\n\t\treturn null;\n\t}",
"PageAgent getPage();",
"public Payment getTarjeta(){\n return cuenta;\n }",
"public void PagarConsulta() {\n\t\tSystem.out.println(\"el patronato es gratiuto y no necesita pagar \");\r\n\t}",
"int getPagesAmount();",
"public interface AjaxPaginationService {\n /**\n *\n * @param pageNow 当前页\n * @param data 传入数据\n * @return List<String> [0]放入分页内容[1]放入分页页码列表\n */\n public List<String> getPagination(Integer pageNow, Object data);\n}",
"public int getPages()\n {\n return pages;\n }",
"public ViewDetallesPagos () {\r\n\r\n }",
"public void setPagoContado(Long pagoContado) {\n this.pagoContado = pagoContado;\n }",
"@Test\n public void testGetPagamentos() {\n }",
"public ObservableList<Pagadores> carregaPagadores() {\n\t\tcon = Conexao.conectar();\n\t\tObservableList<Pagadores> resultadoPagadores = FXCollections.observableArrayList();\n\t\ttry {\n\t\t\tString query = \"SELECT * FROM pagadores WHERE estpagador = ? ORDER BY agente\";\n\t\t\tprepStmt = con.prepareStatement(query); // create a statement\n\t\t\tprepStmt.setString(1, \"A\");\n\t\t\trs = prepStmt.executeQuery();\n\t\t\t\t\t\t // extract data from the ResultSet\n\t\t\twhile(rs.next()) {\n\t\t\t\tPagadores temp = new Pagadores();\n\t\t\t\ttemp.setCodPagador(rs.getInt(\"codpagador\"));\n\t\t\t\ttemp.setEstPagador(rs.getString(\"estpagador\"));\n\t\t\t\ttemp.setRecDescr(rs.getString(\"recdescr\"));\n\t\t\t\t\n\t\t\t\ttemp.setValContrato(rs.getDouble(\"valcontrato\"));\n\t\t\t\ttemp.setContratoInic(DateUtils.asLocalDate(rs.getDate(\"contratoinic\")));\n\t\t\t\ttemp.setContratoFim(DateUtils.asLocalDate(rs.getDate(\"contratofim\")));\n\t\t\t\t\n\t\t\t\ttemp.setNomeContrato(rs.getString(\"nomecontrato\"));\n\t\t\t\ttemp.setContaVinc(rs.getInt(\"contavinc\"));\n\t\t\t\ttemp.setCentroReceb(rs.getInt(\"centroreceb\"));\n\t\t\t\t\n\t\t\t\ttemp.setSubCentroRec(rs.getInt(\"subcentrorec\"));\n\t\t\t\ttemp.setDataLanc(DateUtils.asLocalDate(rs.getDate(\"datalanc\")));\n\t\t\t\ttemp.setDiaVenc(rs.getInt(\"diavenc\"));\n\t\t\t\ttemp.setAgente(rs.getString(\"agente\"));\n\t\t\t\t\n\t\t\t\tresultadoPagadores.add(temp);\n\t\t\t}\n\t\t\treturn resultadoPagadores;\n\t\t} catch(Exception e) {\n\t\t\tMessageBox.show(\"Erro ao ler pagadores 59\", e.getMessage());\n\t\t\treturn null;\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\trs.close();\n\t\t\t\tprepStmt.close();\n\t\t\t\t//conn.close();\n\t\t\t} catch (SQLException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}",
"IPager createPager(PagedList.Config config);",
"LiveData<PagedList<Response>> pagedList();",
"private void imprimirPago() throws Exception {\n\t\tthis.pagoDto = (ReciboDTO) this.getDTOById(Recibo.class.getName(), this.selectedItem.getId(), new AssemblerRecibo());\n\t\t\n\t\tString source = ReportesViewModel.SOURCE_RECIBO;\n\t\tMap<String, Object> params = new HashMap<String, Object>();\n\t\tJRDataSource dataSource = new ReciboDataSource();\n\t\tparams.put(\"title\", this.pagoDto.getTipoMovimiento().getPos1());\n\t\tparams.put(\"fieldRazonSocial\", this.pagoDto.isCobro() ? \"Recibí de:\" : \"A la Orden de:\");\n\t\tparams.put(\"RazonSocial\", this.pagoDto.getRazonSocial());\n\t\tparams.put(\"Ruc\", this.pagoDto.getRuc());\n\t\tparams.put(\"NroRecibo\", this.pagoDto.getNumero());\n\t\tparams.put(\"Moneda\", this.pagoDto.isMonedaLocal() ? \"Guaraníes:\" : \"Dólares:\");\n\t\tparams.put(\"Moneda_\", this.pagoDto.isMonedaLocal() ? \"Gs.\" : \"U$D\");\n\t\tparams.put(\"ImporteEnLetra\", this.pagoDto.isMonedaLocal() ? this.pagoDto.getImporteEnLetras() : this.pagoDto.getImporteEnLetrasDs());\n\t\tparams.put(\"TotalImporteGs\",\n\t\t\t\tthis.pagoDto.isMonedaLocal() ? Utiles.getNumberFormat(this.pagoDto.getTotalImporteGs())\n\t\t\t\t\t\t: Utiles.getNumberFormatDs(this.pagoDto.getTotalImporteDs()));\n\t\tparams.put(\"Usuario\", this.getUs().getNombre());\n\t\tthis.imprimirComprobante(source, params, dataSource, this.selectedFormato);\n\t}",
"@Test\n public void testSetPagamentos() {\n }",
"public TransmitirResponse transmitirPago(TransmitirPagoRequest tramitePagoRequest) {\r\n\t\ttry {\r\n\t\t\tSystem.out.println(\"======================\");\r\n\t\t\tSystem.out.println(\"Inicio: transmitirPago\");\r\n\r\n\t\t\t//1: Se recupera el CDA pagado\r\n\t\t\tBeanTasa tasa = new BeanTasa(); \r\n\t\t\ttasa.setCda(tramitePagoRequest.getCda());\r\n\t\t\ttasa.setMontoPago(tramitePagoRequest.getMonto());\r\n\t\t\ttasa.setFechaPago(tramitePagoRequest.getFechaPago());\r\n\r\n\t\t\t//2: Se actualiza el pago de la Tasa\r\n\t\t\tServicioTasa servicioTasa = new ServicioTasa();\r\n\t\t\tservicioTasa.pagarTasa(tasa);\r\n\r\n\t\t\t//3: Según el CDA pagado, se obtiene la orden y otros datos importantes\r\n\t\t\tBeanFormato formato = new BeanFormato();\r\n\t\t\tServicioOrden servicioOrden = new ServicioOrden();\r\n\t\t\tBeanOrden orden = servicioOrden.buscarOrdenPorCda(tasa.getCda());\r\n\t\t\torden = servicioOrden.buscarOrdenPorOrdenId(orden.getOrdenId(), formato);\r\n\t\t\tBeanTce tce = servicioOrden.buscarTcePorOrdenId(orden.getOrdenId());\r\n\t\t\tBeanMto mto = servicioOrden.buscarMtoVigentePorOrdenId(orden.getOrdenId());\r\n\t\t\tBeanFormatoEntidad formatoEntidad = servicioOrden.buscarFormatoEntidadPorFormato(formato.getFormato(), mto);\r\n\t\t\tBeanAdjunto adjunto = servicioOrden.buscarAdjuntoPorMto(mto);\r\n\t\t\tBeanUsuario usuarioSolicitante = servicioOrden.buscarUsuarioSolicitantePorMto(mto);\r\n\r\n\t\t\t// 2.1: Registrar estado traza 4: Pago Recibido\r\n\t\t\tBeanTraza traza = new BeanTraza();\r\n\t\t\ttraza.setEstadoTraza(4);\r\n\t\t\ttraza.setDe(4);\r\n\t\t\ttraza.setPara(3);\r\n\t\t\tservicioOrden.registrarTraza(tce, mto, null, null, traza);\r\n\r\n\t\t\t//5: Genera la SUCE\r\n\t\t\tServicioSuce servicioSuce = new ServicioSuce();\r\n\t\t\tBeanSuce suce = servicioSuce.generarSuce(orden);\r\n\r\n\t\t\t//6: Se genera el nuevo MTO\r\n\t\t\t//TODO generar nuevo mto, incluye registrar otra vez la orden\r\n\r\n\t\t\t//7: Se transmite la SUCE\r\n\t\t\tservicioSuce.transmitirSuceHaciaEntidad(formato, orden, suce, formatoEntidad, adjunto, usuarioSolicitante.getRuc());\r\n\r\n\t\t\t// 2.1: Registrar estado traza 5: Suce generada\r\n\t\t\ttraza = new BeanTraza();\r\n\t\t\ttraza.setEstadoTraza(5);\r\n\t\t\ttraza.setDe(3);\r\n\t\t\ttraza.setPara(2);\r\n\t\t\tservicioOrden.registrarTraza(tce, mto, null, null, traza);\r\n\r\n\t\t\t//8: Transmitir SUCE a Usuario\r\n\t\t\t//TODO Transmitir SUCE a Usuario\r\n\r\n\t\t\tSystem.out.println(\"Fin\");\r\n\t\t\tSystem.out.println(\"======================\");\r\n\r\n\t\t\tTransmitirResponse res = new TransmitirResponse();\r\n\t\t\tres.setCodigo(suce.getSuce()+\"\");\r\n\t\t\tres.setTexto(\"Exito\");\r\n\t\t\treturn res;\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\r\n\t\t\tTransmitirResponse res = new TransmitirResponse();\r\n\t\t\tres.setCodigo(\"ERR\");\r\n\t\t\tres.setTexto(\"Error\");\r\n\t\t\treturn res;\r\n\t\t}\r\n\t}",
"public <TPDVPagamentos extends br.lry.process.AUTPDVPagamentoPedido> TPDVPagamentos autPDVPagamentos() {\r\n\t\tif(pdvPagamentos==null) {\r\n\t\t\tpdvPagamentos = new AUTPDVPagamentoPedido();\r\n\t\t\tpdvPagamentos.AUT_AGENT_SILK4J = new com.borland.silktest.jtf.Desktop();\r\n\t\t\tpdvPagamentos.AUT_AGENT_SILK4J_CONFIGURATION = new BaseState(\"pdv.settings\");\r\n\t\t\tpdvPagamentos.AUT_AGENT_SILK4J.executeBaseState(pdvPagamentos.AUT_AGENT_SILK4J_CONFIGURATION);\r\n\t\t\t\r\n\t\t\treturn (TPDVPagamentos)pdvPagamentos;\r\n\t\t}\r\n\t\telse {\t\r\n\t\t\treturn (TPDVPagamentos)pdvPagamentos;\t\t\t\r\n\t\t}\r\n\t}",
"public int getTipoDocumento();",
"protected abstract DataPage getDataPage(PageId pageId);",
"void setPagination(Pagination pagination);",
"@PreAuthorize(\"hasAnyRole('ADMIN')\")\n\t@RequestMapping(value=\"/page\",method=RequestMethod.GET) \n\tpublic ResponseEntity<Page<ClienteDTO>> findPage(\n\t\t\t@RequestParam(value=\"page\", defaultValue=\"0\") Integer page, \n\t\t\t@RequestParam(value=\"linesPerPage\", defaultValue=\"24\") Integer linesPerPage, //24 pq eh multiplo de 1, 2 3 e 4\n\t\t\t@RequestParam(value=\"orderBy\", defaultValue=\"nome\") String orderBy, \n\t\t\t@RequestParam(value=\"direction\", defaultValue=\"ASC\") String directionOrder) { //asc eh ascendente \n\t\t\n\t\tPage<Cliente> list = service.findPage(page,linesPerPage,orderBy,directionOrder);\n\t\t\n\t\tPage<ClienteDTO> listDTO = list.map(obj->new ClienteDTO(obj));\n\t\t\n\t\treturn ResponseEntity.ok().body(listDTO); \n\t\t\n\t}",
"@Override\r\n\tprotected String go() throws Exception {\n\t\tif(userSize==0)\r\n\t\t{\r\n\t\t\tuserSize=3;\r\n\t\t}\r\n\t\ttry{\r\n\t\t\tint userid=(Integer)this.get(\"currentUserid\");\r\n\t\t\tProDiaryService proDiaryService=(ProDiaryService)this.getBean(\"proDiaryService\");\r\n\t\t\t\r\n\t\t\tpage=proDiaryService.getCurrProDiaryListByUserID(userid,userSize,pageNo);\r\n\t\t\tPagefoot pagefoot = new Pagefoot();\r\n\t\t\tpageString = pagefoot.packString(page, pageNo,\"getPage\",userSize);\r\n\t\t\t \r\n\t\t\t}catch(Exception e){\r\n\t\t\t\tSystem.out.println(e.getMessage());\r\n\t\t\t}\r\n\t return \"success\";\r\n\t}",
"public ArrayList<Pagamento> pagamentosRealizados(int associacao, int associado, int vigencia) {\r\n\t\tArrayList<Pagamento> pagamentos = new ArrayList<Pagamento>();\r\n\t\t\r\n\t\ttry {\r\n\t\t\tConnection conexao = Conexao.getConexao();\r\n\t\t\tStatement statement = conexao.createStatement();\r\n\t\t\t\r\n\t\t\tString comando = \"select * from pagamento where associacao = \" + associacao\r\n\t\t\t\t\t+ \" and associado = \" + associado + \" and vigencia = \" + vigencia;\r\n\t\t\tSystem.out.println(comando);\r\n\t\t\tResultSet rs = statement.executeQuery(comando);\r\n\t\t\t\r\n\t\t\twhile(rs.next()) {\r\n\t\t\t\tlong data = rs.getLong(\"data\");\r\n\t\t\t\tdouble valor = rs.getInt(\"valor\");\r\n\t\t\t\tString taxa = rs.getString(\"nome\");\r\n\t\t\t\t\r\n\t\t\t\tPagamento pagamento = new Pagamento(data, valor, taxa, vigencia);\r\n\t\t\t\tpagamentos.add(pagamento);\r\n\t\t\t}\r\n\t\t\tstatement.close();\r\n\t\t}\r\n\t\tcatch(Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t\treturn pagamentos;\r\n\t}",
"@Override\n public ArrayList<Propiedad> getPrecioAgente(double pMenor, double pMayor, String pId) throws SQLException {\n ArrayList<Propiedad> resultado = new ArrayList<Propiedad>();\n resultado = (ArrayList<Propiedad>) bdPropiedad.selectQuery(\"SELECT * FROM PROPIEDAD WHERE ID_AGENTE = '\" + pId + \"' AND \"\n + \"PRECIO >= \" + pMenor + \" AND PRECIO <= \" + pMayor);\n return resultado;\n }",
"public int getFaltaPagar() {\n\t\treturn this.contaPagar;\n\t}",
"default Integer getPageSize() {\n return 10;\n }",
"@Override\n\tpublic void apagar() {\n\t\tSystem.out.println(\"Apagando Computadora\");\n\t}",
"public interface PagableResult {\n Integer getTotal();\n Integer getResults();\n}",
"public int getPages() {\n return pages;\n }",
"@Override\n\tpublic void setPaging(PagingInterface paging) {\n\t\t\n\t}",
"@Override\n\tpublic void setPaging(PagingInterface paging) {\n\t\t\n\t}",
"public interface PaginatedResult<T> {\n\n\t/**\n\t * Get the contents as an array of component type\n\t */\n\tpublic T[] items();\n\n\t/**\n\t * Obtain params required to perform the given relative query\n\t */\n\tpublic abstract PaginatedResult<T> first() throws AblyException;\n\tpublic abstract PaginatedResult<T> current() throws AblyException;\n\tpublic abstract PaginatedResult<T> next() throws AblyException;\n\n\tpublic abstract boolean hasFirst();\n\tpublic abstract boolean hasCurrent();\n\tpublic abstract boolean hasNext();\n}",
"public void MieiOrdini()\r\n {\r\n getOrdini();\r\n\r\n }",
"public int getRowsPerPage();",
"public Punto getCentro() {\r\n\treturn centro;\r\n}",
"@Override\n\tpublic MemberDTO getMyPage(MemberDTO mdto) {\n\t\treturn mdao.getMember(mdto);\n\t}",
"@RequestMapping(\"/pagfacturasnue\")\r\n\tpublic String paginacionFacturasNue(Model modelo, @RequestParam(value = \"numPag\", required = false) String numPag,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t @RequestParam(value = \"tpoAccion\", required = false) String tpoAccion,\r\n\t\t \t\t\t\t\t\t\t\t\t\t\t @RequestParam(value = \"numPos\", required = false) String numPos,\r\n\t\t \t\t\t\t\t\t\t\t\t\t\t @RequestParam(value = \"numBloquePag\", required = false) Integer numBloquePag )\r\n\t\t{\n\t\t\tint numPagInt = 0;\r\n\t\t\tint numPosInt = 0;\r\n\t\t\tHashMap<String, Integer> paramBotonera = null;\r\n\t\t\tCrearBotoneraPag botoneraPag = null;\r\n\t\t\t\r\n\t\t\tif (numBloquePag == null)\r\n\t\t\t\t{\r\n\t\t\t\tnumBloquePag = 0;\r\n\t\t\t\t}\r\n\r\n\t\t\t// La primera vez que entra\r\n\t\t\tif (numPag == null && tpoAccion == null)\r\n\t\t\t\t{\r\n\t\t\t\tnumPagInt = 0;\r\n\t\t\t\t}\r\n\t\t\t else\r\n\t\t\t\t//No es la primera vez que entra\r\n\t\t\t \t{\r\n\t\t\t\t// Ha pinchado o avance o retroceso serguro\r\n\t\t\t\tif (tpoAccion != null)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif (tpoAccion.equals(\"avan\")) {\r\n\t\t\t\t\t\t\tnumPagInt = Integer.parseInt(numPag) + 1;\r\n\t\t\t\t\t\t\t} \r\n\t\t\t\t\t\telse \r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tnumPagInt = Integer.parseInt(numPag) - 1;\r\n\t\t\t\t\t\t\t}\t\r\n\t\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t// Ha pinchado el numero de pagina\r\n\t\t\t\t\tnumPagInt = Integer.parseInt(numPag);\r\n\t\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tPage<Factura> pagFactura= servJPAFactura.paginacionFacturas(new Integer(numPagInt), ConstantesAplicacion.REG_POR_PAGINA);\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tmodelo.addAttribute(\"pagGenerica\", pagFactura);\r\n\t\t\tmodelo.addAttribute(\"numPag\", String.valueOf(numPagInt));\r\n\t\t\tmodelo.addAttribute(\"numRegPag\", pagFactura.getContent().size());\r\n\t\t\t\r\n\t\t// \tmodelo.addAttribute(\"numTotalReg\", pagCliente.getTotalElements());\r\n\t\t\r\n\t\t\ttry\r\n\t\t\t {\r\n\t\t\t botoneraPag = new CrearBotoneraPag();\r\n\t\t\t paramBotonera = CrearBotoneraPag.calculaNumPagBotoneraNue(numPagInt, tpoAccion, numPos, pagFactura.getTotalElements(), new Double(numBloquePag.intValue()) );\r\n\t\t\t }\r\n\t\t\tcatch (Exception exp)\r\n\t\t\t {\r\n\t\t\t\texp.printStackTrace();\r\n\t\t\t }\r\n\t\t\t\r\n\t\t\tmodelo.addAttribute(\"numPagVisibles\", paramBotonera.get(\"numPagVisibles\") );\r\n\t\t\t\r\n\t\t\tmodelo.addAttribute(\"numPagWeb1\", paramBotonera.get(\"numPagWeb1\") );\r\n\t\t\tmodelo.addAttribute(\"numPagWeb2\", paramBotonera.get(\"numPagWeb2\") );\r\n\t\t\tmodelo.addAttribute(\"numPagWeb3\", paramBotonera.get(\"numPagWeb3\") );\r\n\t\t\tmodelo.addAttribute(\"numPagWeb4\", paramBotonera.get(\"numPagWeb4\") );\r\n\t\t\tmodelo.addAttribute(\"numPagWeb5\", paramBotonera.get(\"numPagWeb5\") );\r\n\r\n\t\t\tmodelo.addAttribute(\"linkBotonAnt\", \"/gestionWeb/facturas/pagfacturasnue?numPag=\" + numPagInt + \"&tpoAccion=ant\" + \"&numBloquePag=\" + paramBotonera.get(\"numBloquePag\"));\r\n\t\t\tmodelo.addAttribute(\"linkBoton1\", \"/gestionWeb/facturas/pagfacturasnue?numPag=\" + paramBotonera.get(\"numPaginaReal1\") + \"&numPos=1\" + \"&numBloquePag=\" + paramBotonera.get(\"numBloquePag\"));\r\n\t\t\tmodelo.addAttribute(\"linkBoton2\", \"/gestionWeb/facturas/pagfacturasnue?numPag=\" + paramBotonera.get(\"numPaginaReal2\") + \"&numPos=2\" + \"&numBloquePag=\" + paramBotonera.get(\"numBloquePag\"));\r\n\t\t\tmodelo.addAttribute(\"linkBoton3\", \t \"/gestionWeb/facturas/pagfacturasnue?numPag=\" + paramBotonera.get(\"numPaginaReal3\") + \"&numPos=3\" + \"&numBloquePag=\" + paramBotonera.get(\"numBloquePag\"));\r\n\t\t\tmodelo.addAttribute(\"linkBoton4\", \t \"/gestionWeb/facturas/pagfacturasnue?numPag=\" + paramBotonera.get(\"numPaginaReal4\") + \"&numPos=4\" + \"&numBloquePag=\" + paramBotonera.get(\"numBloquePag\"));\r\n\t\t\tmodelo.addAttribute(\"linkBoton5\", \t \"/gestionWeb/facturas/pagfacturasnue?numPag=\" + paramBotonera.get(\"numPaginaReal5\") + \"&numPos=5\" + \"&numBloquePag=\" + paramBotonera.get(\"numBloquePag\"));\r\n\t\t\tmodelo.addAttribute(\"linkBotonAvan\", \"/gestionWeb/facturas/pagfacturasnue?numPag=\" + numPagInt + \"&tpoAccion=avan\" + \"&numBloquePag=\" + paramBotonera.get(\"numBloquePag\"));\r\n\t\t\t\r\n\t\t // Si ha pinchado avance o retroceso de pagina.\r\n\t\t\tif (tpoAccion != null)\r\n\t\t\t\t{\r\n\t\t\t\t// Detectamoos cambio de bloque ponerlo\r\n\t\t\t\tif (paramBotonera.get(\"numBloquePag\").intValue() != numBloquePag.intValue() )\r\n\t\t\t\t\t{\r\n\t\t\t\t\tif (tpoAccion.equals(\"avan\")) {\r\n\t\t\t\t\t\tnumPosInt = 1;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\tnumPosInt = 5;\t \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// Si es el mismo bloque la paginacion\r\n\t\t\t\t\t\tif (paramBotonera.get(\"numBloquePag\").intValue() == 0)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\tnumPosInt = numPagInt + 1;\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\tnumPosInt = numPagInt - 5 ;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t else\r\n\t\t\t\t{\r\n\t\t\t\t // Si es primera vez que entra\r\n\t\t\t\t if (numPos == null)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t numPosInt = 1;\r\n\t\t\t\t\t}\r\n\t\t\t\t else\r\n\t\t\t\t\t{\t\r\n\t\t\t\t\t // Si ha pinchado boton pagina\r\n\t \t\t\t numPosInt = Integer.parseInt(numPos);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t\tswitch (numPosInt) {\r\n\t\t\tcase 1:\r\n\t\t\t\tmodelo.addAttribute(\"numPagAct1\", \"S\" );\r\n\t\t\t\tbreak;\r\n\t\t\tcase 2:\r\n\t\t\t\tmodelo.addAttribute(\"numPagAct2\", \"S\" );\r\n\t\t\t\tbreak;\r\n\t\t\tcase 3:\r\n\t\t\t\tmodelo.addAttribute(\"numPagAct3\", \"S\" );\r\n\t\t\t\tbreak;\r\n\t\t\tcase 4:\r\n\t\t\t\tmodelo.addAttribute(\"numPagAct4\", \"S\" );\r\n\t\t\t\tbreak;\r\n\t\t\tcase 5:\r\n\t\t\t\tmodelo.addAttribute(\"numPagAct5\", \"S\" );\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif ( pagFactura.isLast() )\r\n\t\t\t\t{\r\n\t\t\t\tmodelo.addAttribute(\"indUltPag\", \"S\");\r\n\t\t\t\t}\r\n\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\tmodelo.addAttribute(\"indUltPag\", \"N\");\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t\tmodelo.addAttribute(\"opcionesMenuUsuario\", beanUsuarioSession.getListBeanMenuUsuarioSession());\r\n\t\t\t\r\n\t\t\treturn \"gestionWeb/facturas/PagFacturas\";\r\n\t\t}",
"public PuntoDeVenta getPuntoDeVenta()\r\n/* 140: */ {\r\n/* 141:162 */ return this.puntoDeVenta;\r\n/* 142: */ }",
"protected Page<V> getVO (Page<T> page, Pageable pageRequest) {\n List<V> contentVO = getVO(page.getContent());\n Page<V> pageResult = new PageImpl<>(contentVO, pageRequest, page.getTotalElements());\n return pageResult;\n }",
"public int getPage() {\n return page;\n }",
"public int getPage() {\n return page;\n }",
"public int getPage() {\n return page;\n }",
"public int getPage() {\n return page;\n }",
"public Page<Account> getAccPage(Pageable page);",
"PartitionDetailsPage getDetailsPage();",
"int getPage();",
"Page<Lancamento> buscarPorFuncionarioId(Long funcionarioId, PageRequest pageRequest);",
"public int getPages() {\n return pages;\n }",
"public int getPages() {\n return pages;\n }",
"public Paging() {\n }",
"public java.lang.Double getClavePaginacion() {\r\n return clavePaginacion;\r\n }",
"public List<Object> retrievePagingList(PageBean pageBean) ;",
"@Override\n\tpublic Page<?> paginationParmsExtra(Integer pagenumber, Integer rows, String sortdireccion, String sortcolumn,\n\t\t\tObject filter, Object paramsExtra) {\n\t\treturn null;\n\t}"
] | [
"0.67537904",
"0.6732023",
"0.6591611",
"0.6361069",
"0.631361",
"0.62446016",
"0.62026757",
"0.6182163",
"0.6155658",
"0.6109454",
"0.6100604",
"0.6078689",
"0.59790045",
"0.59331477",
"0.5926167",
"0.5886896",
"0.58696383",
"0.5862104",
"0.5858358",
"0.5846104",
"0.5826006",
"0.5825067",
"0.5816393",
"0.5815311",
"0.57995415",
"0.57495326",
"0.5739652",
"0.5737941",
"0.5716962",
"0.57039034",
"0.5702926",
"0.5695157",
"0.5683934",
"0.567261",
"0.5651934",
"0.56507814",
"0.5647608",
"0.56345963",
"0.5621621",
"0.5616082",
"0.55996066",
"0.55984205",
"0.55833197",
"0.5579811",
"0.55741805",
"0.55732554",
"0.5571199",
"0.5566379",
"0.5559163",
"0.5555366",
"0.55508727",
"0.5550351",
"0.55470294",
"0.554492",
"0.55364734",
"0.55335087",
"0.55323756",
"0.5530917",
"0.5530644",
"0.55262184",
"0.55211145",
"0.55168974",
"0.5514741",
"0.5513656",
"0.54892576",
"0.5486702",
"0.54638064",
"0.5462336",
"0.5457865",
"0.54561085",
"0.5450749",
"0.54426193",
"0.54364824",
"0.54315734",
"0.5430319",
"0.54278815",
"0.54165477",
"0.54165477",
"0.541083",
"0.540606",
"0.5392782",
"0.5383127",
"0.5380735",
"0.5372799",
"0.5371653",
"0.53647244",
"0.53502136",
"0.53502136",
"0.53502136",
"0.53502136",
"0.53408986",
"0.5335631",
"0.53299874",
"0.5329523",
"0.53235054",
"0.53235054",
"0.53231454",
"0.53208303",
"0.53207165",
"0.5319682"
] | 0.61575544 | 8 |
Setter method for pagamento. | public void setPagamento(Set<Pagamento> aPagamento) {
pagamento = aPagamento;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n protected void elaboraParametri() {\n super.elaboraParametri();\n titoloPagina = TITOLO_PAGINA;\n }",
"public Set<Pagamento> getPagamento() {\n return pagamento;\n }",
"public void setMontoPagado(java.lang.String montoPagado) {\n this.montoPagado = montoPagado;\n }",
"void setPagination(Pagination pagination);",
"@Test\n public void testSetPagamentos() {\n }",
"public void setTipoPago(int tipoPago) {\n this.tipoPago = tipoPago;\n }",
"public void setPagoContado(Long pagoContado) {\n this.pagoContado = pagoContado;\n }",
"public void setValor(int valor) {\n this.valor = valor;\n }",
"@Override\n\tpublic void realizarPago() {\n\t}",
"public void setPage(Page page) {this.page = page;}",
"public int getTipoPago() {\n return this.tipoPago;\n }",
"public void setTipoDocumento(int tipoDocumento);",
"@Override\n\tpublic void setPaging(PagingInterface paging) {\n\t\t\n\t}",
"@Override\n\tpublic void setPaging(PagingInterface paging) {\n\t\t\n\t}",
"public void setCodigo(int pCodigo){\n this.codigo = pCodigo;\n }",
"public void setPerfil(int perfil){\n this.perfil = perfil;\n }",
"public void setCodigo(Integer codigo) { this.codigo = codigo; }",
"public void pagar(int precio){\r\n this.dinero -=precio;\r\n }",
"public Long getPagoContado() {\n return pagoContado;\n }",
"public void setNumero(int numero) { this.numero = numero; }",
"public void setPage(int value) {\n this.page = value;\n }",
"public void setCodigo(int codigo) {\n this.codigo = codigo;\n }",
"public java.lang.String getMontoPagado() {\n return montoPagado;\n }",
"public void setPage(Page page) {\n this.page=page;\n }",
"public void setPage(Page page) {\n this.page=page;\n }",
"@Override\r\n\tprotected Paginador<UnidadFuncional_VO> getPaginador() {\n\t\treturn null;\r\n\t}",
"public void resetPagina()\r\n {\r\n this.pagina = null;\r\n }",
"public void setPuntoDeVenta(PuntoDeVenta puntoDeVenta)\r\n/* 145: */ {\r\n/* 146:166 */ this.puntoDeVenta = puntoDeVenta;\r\n/* 147: */ }",
"public void setEstado(biz.belcorp.www.canonico.ffvv.vender.TEstadoPedido param){\n \n this.localEstado=param;\n \n\n }",
"public void setValor(String valor)\n/* 22: */ {\n/* 23:34 */ this.valor = valor;\n/* 24: */ }",
"protected void elaboraPagina() {\n testoPagina = VUOTA;\n\n //header\n testoPagina += this.elaboraHead();\n\n //body\n testoPagina += this.elaboraBody();\n\n //footer\n //di fila nella stessa riga, senza ritorno a capo (se inizia con <include>)\n testoPagina += this.elaboraFooter();\n\n //--registra la pagina principale\n if (dimensioniValide()) {\n testoPagina = testoPagina.trim();\n\n if (pref.isBool(FlowCost.USA_DEBUG)) {\n testoPagina = titoloPagina + A_CAPO + testoPagina;\n titoloPagina = PAGINA_PROVA;\n }// end of if cycle\n\n //--nelle sottopagine non eseguo il controllo e le registro sempre (per adesso)\n if (checkPossoRegistrare(titoloPagina, testoPagina) || pref.isBool(FlowCost.USA_DEBUG)) {\n appContext.getBean(AQueryWrite.class, titoloPagina, testoPagina, summary);\n logger.info(\"Registrata la pagina: \" + titoloPagina);\n } else {\n logger.info(\"Non modificata la pagina: \" + titoloPagina);\n }// end of if/else cycle\n\n //--registra eventuali sottopagine\n if (usaBodySottopagine) {\n uploadSottoPagine();\n }// end of if cycle\n }// end of if cycle\n\n }",
"public String getPagenumber() {\n return pagenumber;\n }",
"private static void pagarEmpleado(int cod) {\n throw new UnsupportedOperationException(\"Not yet implemented\");\n }",
"public String getPageno() {\r\n return pageno;\r\n }",
"public void setPagenumber(String pagenumber) {\n this.pagenumber = pagenumber;\n }",
"void setTitolo(String titolo);",
"public void setAnio(int p) { this.anio = p; }",
"public void setCodDepartamento(String codDepartamento);",
"@Override // Métodos que fazem a anulação\n\tpublic void pagaIR() {\n\t\t// TODO Auto-generated method stub\n\t\t\n\t}",
"public BoletoListarResponse idEventoPagamento(Integer idEventoPagamento) {\n this.idEventoPagamento = idEventoPagamento;\n return this;\n }",
"public void preencherPagamentoComBoleto(PagamentoComBoleto pagto, Date instantePedido) {\n\t\t\n\t\tCalendar cal = Calendar.getInstance();\n\t\tcal.setTime(instantePedido);\n\t\tcal.add(Calendar.DAY_OF_MONTH, 7); // adiciona 7 dias de vencimento para o boleto\n\t\tpagto.setDataVencimento(cal.getTime()); // envia a nova data de pagamento\n\t}",
"public void setEmpresa(Empresa empresa)\r\n/* 89: */ {\r\n/* 90:141 */ this.empresa = empresa;\r\n/* 91: */ }",
"public void setTarjeta(Payment cuenta){\n this.cuenta = cuenta;\n }",
"public void setValor(java.lang.String valor);",
"public void setPeso(int peso) {\r\n this.peso = peso;\r\n }",
"public void setPageno(String pageno) {\r\n this.pageno = pageno == null ? null : pageno.trim();\r\n }",
"public void setMotivoRechazo(biz.belcorp.www.canonico.ffvv.vender.TMotivoRechazo param){\n \n this.localMotivoRechazo=param;\n \n\n }",
"@Override\n public void mostrar(){\n super.mostrar(); //Para evitar que este metodo se prefiera antes que el de padre(por que tienen el mismo nombre)\n //lo llamamos con super\n System.out.println(\"Nro de Paginas: \" + this.nroPag);\n }",
"public static void setPedido(Pedido pPedido){\n\t\tmiPedido = pPedido;\n\t}",
"public void setPage(Integer page) {\n this.page = page;\n }",
"public void setTotalPagar(Long totalPagar) {\n this.totalPagar = totalPagar;\n }",
"public void setPageableParams(Page pageObj) {\n\n if(pageObj ==null){\n\n return;\n\n }\n // Set the current page number\n setPageNumber(pageObj.getNumber());\n\n // Set the total pages\n setTotalPages(pageObj.getTotalPages());\n\n // Set the total elements in all pages\n setTotalElements(pageObj.getTotalElements());\n\n }",
"public void setPage(int page) {\n this.page = page;\n }",
"public void setCodigo(java.lang.String param){\n \n this.localCodigo=param;\n \n\n }",
"public void setValor(int Valor) {\n this.Valor = Valor;\n }",
"public Set getPages () {\n return pages;\n }",
"public void setTelefono(String telefono) {\r\n\tthis.telefono = telefono;\r\n}",
"public void setCodProd(IProduto codigo);",
"public void setTipoDocumento(TipoDocumento tipoDocumento) {\n this.tipoDocumento = tipoDocumento;\n }",
"public void setNumeroAnterior(int numeroAnterior)\r\n/* 205: */ {\r\n/* 206:214 */ this.numeroAnterior = numeroAnterior;\r\n/* 207: */ }",
"public void setValor(Integer valor) {\n\t\tif (valor!=null && valor < this.getCantElementos()) {\n\t\t\tthis.valor = valor;\n\t\t\tthis.entidadGrafica.actualizarImagen(this.valor);\n\t\t}else {\n\t\t\tthis.valor = null;\n\t\t}\n\t}",
"public void setPageSize(int value) {\n this.pageSize = value;\n }",
"public void setCodigo( String codigo ) {\n this.codigo = codigo;\n }",
"public void setTipo(int value) {\n this.tipo = value;\n }",
"public void setEntidad(int entidad) {\n this.entidad = entidad;\n }",
"public void setInicio(String inicio) {\n this.inicio = inicio;\n }",
"public void setObservacion(java.lang.String param){\n \n this.localObservacion=param;\n \n\n }",
"public void setTelefono(Integer telefono) {\r\n this.telefono = telefono;\r\n }",
"public void setCodigo(String codigo) {\n this.codigo = codigo;\n }",
"public void setCodigo(java.lang.Integer codigo) {\r\n this.codigo = codigo;\r\n }",
"public DElementPagosPago() {\n super(\"pago10:Pago\");\n\n moAttFechaPago = new DAttributeDatetime(\"FechaPago\", true);\n moAttFormaDePagoP = new DAttributeString(\"FormaDePagoP\", true, 2, 2); // c_FormaPago catalog codes of 2 fixed digits\n moAttMonedaP = new DAttributeString(\"MonedaP\", true, 3, 3); // c_Moneda catalog codes of 3 fixed digits\n moAttTipoCambioP = new DAttributeTipoCambio(\"TipoCambioP\", false);\n moAttMonto = new DAttributeTypeImporte(\"Monto\", true);\n moAttNumOperacion = new DAttributeString(\"NumOperacion\", false, 1, 100);\n moAttRfcEmisorCtaOrd = new DAttributeString(\"RfcEmisorCtaOrd\", false, 12, 13);\n moAttNomBancoOrdExt = new DAttributeString(\"NomBancoOrdExt\", false, 1, 300);\n moAttCtaOrdenante = new DAttributeString(\"CtaOrdenante\", false, 10, 50);\n moAttRfcEmisorCtaBen = new DAttributeString(\"RfcEmisorCtaBen\", false, 12, 12);\n moAttCtaBeneficiario = new DAttributeString(\"CtaBeneficiario\", false, 10, 50);\n moAttTipoCadPago = new DAttributeString(\"TipoCadPago\", false, 2, 2);\n moAttCertPago = new DAttributeString(\"CertPago\", false, 1); // xs:base64Binary\n moAttCadPago = new DAttributeString(\"CadPago\", false, 1, 8192);\n moAttSelloPago = new DAttributeString(\"SelloPago\", false, 1); // xs:base64Binary\n\n mvAttributes.add(moAttFechaPago);\n mvAttributes.add(moAttFormaDePagoP);\n mvAttributes.add(moAttMonedaP);\n mvAttributes.add(moAttTipoCambioP);\n mvAttributes.add(moAttMonto);\n mvAttributes.add(moAttNumOperacion);\n mvAttributes.add(moAttRfcEmisorCtaOrd);\n mvAttributes.add(moAttNomBancoOrdExt);\n mvAttributes.add(moAttCtaOrdenante);\n mvAttributes.add(moAttRfcEmisorCtaBen);\n mvAttributes.add(moAttCtaBeneficiario);\n mvAttributes.add(moAttTipoCadPago);\n mvAttributes.add(moAttCertPago);\n mvAttributes.add(moAttCadPago);\n mvAttributes.add(moAttSelloPago);\n \n maEltDoctoRelacionados = new ArrayList<>();\n }",
"public void setPosicion(int posicion){\n _posicion = posicion;\n }",
"public void setMontoPedidoRechazado(double param){\n \n this.localMontoPedidoRechazado=param;\n \n\n }",
"public void setServicioCreditoTributario(ServicioCreditoTributario servicioCreditoTributario)\r\n/* 96: */ {\r\n/* 97:117 */ this.servicioCreditoTributario = servicioCreditoTributario;\r\n/* 98: */ }",
"public void setCantidadFaltanteAnunciado(java.math.BigInteger param){\n \n this.localCantidadFaltanteAnunciado=param;\n \n\n }",
"@Command\n\t@NotifyChange(\"*\")\n\tpublic void paginarLista(){\n\t\tint page=pagAnalistas.getActivePage();\n\t\tcambiarAnalistas(page, null, null);\n\t}",
"protected String getTitoloPaginaMadre() {\n return VUOTA;\n }",
"public void setPagination(Number value) {\n setAttributeInternal(PAGINATION, value);\n }",
"public abstract void setCntPoa(int cntPoa);",
"public void setQuantidade(int quantos);",
"public void setIdproducto(int idproducto) {\r\n\t\tthis.idproducto = idproducto;\r\n\t}",
"public void setPageSize(int pageSize) {\n this.pageSize = pageSize;\n }",
"public void setIteracion(int iteracion) {\n this.iteracion = iteracion;\n }",
"private void parametrizarPagingControl() throws Exception {\r\n\t\tlog.info(\"Ejecutando metodo [parametrizarPagingControl()]...\");\r\n\r\n\t\tidMCRZPGCTRLMaestro.setComponenteReferencia(idMCRZLbxlista);\r\n\t\tidMCRZPGCTRLMaestro.setStatementConsultaPaginada(getConsultaPaginada());\r\n\t\tidMCRZPGCTRLMaestro.setPageSize(5);\r\n\t\tidMCRZPGCTRLMaestro.setConsultaDinamica(isDinamic());\r\n\t\tidMCRZPGCTRLMaestro.setSqlConsultaDinamica(getConsultaDinamica());\r\n\t\tidMCRZPGCTRLMaestro.setTipoClase(objetoClase);\r\n\t\tidMCRZPGCTRLMaestro.setTablaPadreFrom(tablaPadreFrom);\r\n\t\tidMCRZLhdNombre.setVisible(usaColumnaNombre);\r\n\t\t// idAUTZCTRLControl.setMold(\"os\");\r\n\r\n\t\tidMCRZPGCTRLMaestro.setPagingControlFilas(new PagingControlFilas() {\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void render(Component component,\r\n\t\t\t\t\tIBeanAbstracto iBeanAbstracto) {\r\n\r\n\t\t\t\t// final Listitem fila = getAssemblerStandard()\r\n\t\t\t\t// .crearListitemDesdeDto((Listitem) component,\r\n\t\t\t\t// iBeanAbstracto);\r\n\r\n\t\t\t\tfinal Listitem fila = getAssemblerStandard()\r\n\t\t\t\t\t\t.crearListitemDinamico(null, iBeanAbstracto.getMD5(),\r\n\t\t\t\t\t\t\t\t(Listitem) component,\r\n\t\t\t\t\t\t\t\tiBeanAbstracto.getCodigo(),\r\n\t\t\t\t\t\t\t\tiBeanAbstracto.getNombre());\r\n\t\t\t\tfinal BandboxFindPaging padre = BandboxFindPaging.this;\r\n\t\t\t\tfinal IBeanAbstracto object = iBeanAbstracto;\r\n\t\t\t\tfila.addEventListener(Events.ON_CLICK,\r\n\t\t\t\t\t\tnew EventListener<Event>() {\r\n\r\n\t\t\t\t\t\t\tpublic void onEvent(Event arg0) throws Exception {\r\n\t\t\t\t\t\t\t\tonSeleccionarMaestro(object, padre);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\t\t\t\tif (interfaz != null) {\r\n\t\t\t\t\tfila.addEventListener(Events.ON_CLICK,\r\n\t\t\t\t\t\t\tnew EventListener<Event>() {\r\n\t\t\t\t\t\t\t\tpublic void onEvent(Event arg0)\r\n\t\t\t\t\t\t\t\t\t\tthrows Exception {\r\n\t\t\t\t\t\t\t\t\tif (ids != null)\r\n\t\t\t\t\t\t\t\t\t\tfila.setAttribute(\"ID\", ids);\r\n\t\t\t\t\t\t\t\t\tinterfaz.onValidateSeleccion(fila, object);\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}\r\n\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tidMCRZPGCTRLMaestro\r\n\t\t\t\t.agregarAtributosColumnas(new ArrayList<PagingControlColumnas>());\r\n\t\tidMCRZPGCTRLMaestro.setComponenteContenedor(idMCRZLftPaging);\r\n\r\n\t\tif (usaColumnaCodigo && usaColumnaNombre) {\r\n\t\t\tlog.info(\"@parametrizarPagingControl ===> usaColumnaCodigo=\"\r\n\t\t\t\t\t+ usaColumnaCodigo + \";usaColumnaNombre=\"\r\n\t\t\t\t\t+ usaColumnaNombre);\r\n\t\t\t((Listfooter) idMCRZLftPaging.getChildren().get(0)).setSpan(2);\r\n\t\t\t((Listfooter) idMCRZLftPaging.getChildren().get(0))\r\n\t\t\t\t\t.appendChild(idMCRZPGCTRLMaestro);\r\n\t\t\t((Listfooter) idMCRZLftPaging.getChildren().get(1))\r\n\t\t\t\t\t.setVisible(false);\r\n\t\t} else if (!usaColumnaCodigo && usaColumnaNombre) {\r\n\t\t\tlog.info(\"@parametrizarPagingControl ===> usaColumnaCodigo=\"\r\n\t\t\t\t\t+ usaColumnaCodigo + \";usaColumnaNombre=\"\r\n\t\t\t\t\t+ usaColumnaNombre);\r\n\t\t\t((Listfooter) idMCRZLftPaging.getChildren().get(0))\r\n\t\t\t\t\t.setVisible(false);\r\n\t\t\t((Listfooter) idMCRZLftPaging.getChildren().get(1))\r\n\t\t\t\t\t.setVisible(true);\r\n\t\t\t((Listfooter) idMCRZLftPaging.getChildren().get(1))\r\n\t\t\t\t\t.appendChild(idMCRZPGCTRLMaestro);\r\n\t\t} else if (usaColumnaCodigo && !usaColumnaNombre) {\r\n\t\t\tlog.info(\"@parametrizarPagingControl ===> usaColumnaCodigo=\"\r\n\t\t\t\t\t+ usaColumnaCodigo + \";usaColumnaNombre=\"\r\n\t\t\t\t\t+ usaColumnaNombre);\r\n\t\t\t((Listfooter) idMCRZLftPaging.getChildren().get(0)).setSpan(1);\r\n\t\t\t((Listfooter) idMCRZLftPaging.getChildren().get(0))\r\n\t\t\t\t\t.appendChild(idMCRZPGCTRLMaestro);\r\n\t\t\t((Listfooter) idMCRZLftPaging.getChildren().get(1))\r\n\t\t\t\t\t.setVisible(false);\r\n\t\t\t((Listhead) this.getFellow(\"idMCRZListHead\"))\r\n\t\t\t\t\t.removeChild(idMCRZLhdNombre);\r\n\t\t\tidMCRZLhdNombre.setStyle(\"visibility: hidden\");\r\n\t\t}\r\n\r\n\t}",
"public void setTipo(int tipo) {\r\n this.tipo = tipo;\r\n }",
"private void setTipo(int tipo) {\r\n\t\tthis.tipo = tipo;\r\n\t}",
"@Override\n\tprotected String getPaginaMantenimiento() throws Exception {\n\t\treturn null;\n\t}",
"public void setTelefono(String telefono);",
"public void setBunga(int tipeBunga){\n }",
"public void setGenero(Genero genero)\r\n/* 148: */ {\r\n/* 149:271 */ this.genero = genero;\r\n/* 150: */ }",
"@Test\r\n public void testSetNombreDepto() {\r\n System.out.println(\"setNombreDepto\");\r\n String nombreDepto = \"\";\r\n Departamento instance = new Departamento();\r\n instance.setNombreDepto(nombreDepto);\r\n // TODO review the generated test code and remove the default call to fail.\r\n }",
"public void setTipoFecha(int tipoFecha)\n {\n tipFecha=tipoFecha;\n }",
"@Test\r\n public void testSetValor() {\r\n \r\n }",
"public String getConsultaPaginada() {\r\n\t\treturn consultaPaginada;\r\n\t}",
"@Override\r\n\tprotected JSON_Paginador getJson_paginador() {\n\t\treturn null;\r\n\t}",
"public void setPercepcion(double param){\n \n this.localPercepcion=param;\n \n\n }",
"public void setIdPerfil(Integer idPerfil) {\n this.idPerfil = idPerfil;\n }",
"public void setNumero(int numero)\r\n/* 195: */ {\r\n/* 196:206 */ this.numero = numero;\r\n/* 197: */ }",
"public void setBloqueado(java.lang.String param){\n \n this.localBloqueado=param;\n \n\n }",
"public void setEntidad(T entidad) {\r\n this.entidad = entidad;\r\n fillData(entidad);\r\n }"
] | [
"0.67897373",
"0.6612551",
"0.65254617",
"0.65057933",
"0.63972104",
"0.6374455",
"0.6364298",
"0.60731524",
"0.60650086",
"0.604063",
"0.60305095",
"0.6000564",
"0.59860456",
"0.59860456",
"0.590626",
"0.58734524",
"0.5858127",
"0.5837001",
"0.58245045",
"0.580392",
"0.5776362",
"0.57557976",
"0.57452476",
"0.5736648",
"0.5736648",
"0.57252544",
"0.57242596",
"0.57147413",
"0.57085353",
"0.5664285",
"0.56587464",
"0.5639535",
"0.56372154",
"0.562227",
"0.5600621",
"0.55959886",
"0.5591241",
"0.5578499",
"0.557696",
"0.55604196",
"0.5557245",
"0.5557066",
"0.5552115",
"0.5551286",
"0.55505544",
"0.5550015",
"0.55453646",
"0.5539514",
"0.55383426",
"0.55374366",
"0.55355084",
"0.5533505",
"0.5523662",
"0.5521928",
"0.5520673",
"0.55196184",
"0.5517517",
"0.5514443",
"0.5509898",
"0.55027294",
"0.5496987",
"0.5482166",
"0.54644525",
"0.5462418",
"0.54613554",
"0.54560614",
"0.5449126",
"0.5445624",
"0.5435071",
"0.54341775",
"0.5427047",
"0.54203737",
"0.54186434",
"0.5410808",
"0.5402316",
"0.54020137",
"0.5401498",
"0.5399992",
"0.53881973",
"0.5386995",
"0.5384538",
"0.5383983",
"0.5382552",
"0.5382383",
"0.5376561",
"0.5375714",
"0.5375619",
"0.5372906",
"0.53708607",
"0.53708375",
"0.5366486",
"0.53635824",
"0.53485733",
"0.534225",
"0.53360987",
"0.5330523",
"0.532967",
"0.53251785",
"0.5323956",
"0.53170145"
] | 0.70964426 | 0 |
Access method for notifica. | public Set<Notifica> getNotifica() {
return notifica;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Notifica(){}",
"@Override\r\n\tprotected void verificaUtentePrivilegiato() {\n\r\n\t}",
"public interface Notice extends Event\n\t{\n\t\tpublic static final String TOPIC_ID = \"aether.notice.topic.id\";\n\t}",
"public abstract String tiposervicio();",
"@Override // Métodos que fazem a anulação\n\tpublic void getBonificação() {\n\t\t\n\t}",
"@Override\n public String getInformacionInstruccion() {\n\treturn \"comando desconocido\";\n }",
"private String getSomePrivateInfo() {\r\n \treturn \"private information of MySubject\";\r\n }",
"public String getDocumentNote();",
"@Override\r\n\tpublic void sendGeneralNotification() {\n\t\t\r\n\t}",
"public interface ICriticPresenter extends BasePresenter{\n /**\n * @创建用户 crash\n * @创建时间 2018/10/28 14:50\n * @方法说明:获取某条评论\n */\n void getContentDynamic(String courseId);\n String ID=\"id\";\n String PID=\"pid\";//课程id\n String USER=\"user\";//发布评论人\n String SAY=\"say\";//评论内容\n String TIME=\"time\";//发布时间\n\n\n}",
"Note getBukkitNote();",
"String get_note()\n {\n return note;\n }",
"@Override\n public String cualquierMetodo2() {\n return \"Método implementado en la clase hija viaje de incentivo\";\n }",
"public PanelNotifications getNotif(){\n return notif;\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"private Notifier(){}",
"@Override\n public void teleopInit() {\n\n }",
"ISSeedModifications createISSeedModifications();",
"@Override\n protected void prot() {\n }",
"public void readNotification()\n {\n userFan.readNotification();\n }",
"public void referToSpecialist(){\r\n\t\t//here is some code that we do not have access to\r\n\t}",
"@Override\r\n\tpublic void NroAccount() {\n\t\t\r\n\t}",
"@Override\n public String getMailetInfo() {\n return \"Sieve Mailbox Mailet\";\n }",
"public conversorDOC(){\n }",
"@Override\n public void perish() {\n \n }",
"public contrustor(){\r\n\t}",
"public void mostrarInformacion(String nombre, String correo) {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\npublic void teleopInit() {\n\n}",
"private Notes() {}",
"protected void notifyUser()\n {\n }",
"private void sendNotification() {\n }",
"private void showNotification() {\n\n }",
"@Override\n public void noteUserActivity() {\n throw new UnsupportedOperationException(\"noteUserActivity\");\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"private void showNotification() {\n }",
"@Override\n\tpublic void anular() {\n\n\t}",
"public String getNote() {\r\n return note; \r\n }",
"public static String getNotificaciones() {\n\t\treturn getServer()+\"wsagenda/v1/notificaciones\";//\"http://10.0.2.2/wsrest/v1/agenda\";//\"http://10.0.2.2/prueba/ahorro/obtener_gastos.php\";//\"http://10.0.2.2/wsrest/v1/agenda\";\n\t}",
"@Import(\"notedTemplate\")\n\tint getNote();",
"@Override\r\n\t\t\t\t\tpublic void sendNoteOn(NoteOn noteOn) {\n\t\t\t\t\t\t\r\n\t\t\t\t\t}",
"protected void notificationOnExpiration() {\n }",
"@Override\n public String descripcion() {\n return \"Viaje incentivo que te envia la empresa \" + empresa;\n }",
"void mo54412a(int i, Notification notification);",
"@Override\n public void memoria() {\n \n }",
"public Notice call() throws Exception {\n if (PatchProxy.isSupport(new Object[0], this, f58099a, false, 63252, new Class[0], Notice.class)) {\n return (Notice) PatchProxy.accessDispatch(new Object[0], this, f58099a, false, 63252, new Class[0], Notice.class);\n }\n try {\n return NoticeApiManager.a(this.f58100b, 0, 1, i4, null, 0, com.ss.android.ugc.aweme.utils.permission.e.a(), com.ss.android.ugc.aweme.utils.permission.e.b());\n } catch (ExecutionException e2) {\n throw com.ss.android.ugc.aweme.app.api.m.a(e2);\n }\n }",
"public String getAnnouncement();",
"@Override\n\t\t\tpublic void modifier(Catalogue catalogue) {\n\t\t\t\t\n\t\t\t}",
"private InfoCommand()\n\t{\n\t\t\n\t\t\n\t}",
"public void mostrarNotificaciones(){\n System.out.println(notificaciones.toString());\n }",
"public com.ss.android.ugc.aweme.notification.bean.d call() throws Exception {\n if (PatchProxy.isSupport(new Object[0], this, f58105a, false, 63253, new Class[0], com.ss.android.ugc.aweme.notification.bean.d.class)) {\n return (com.ss.android.ugc.aweme.notification.bean.d) PatchProxy.accessDispatch(new Object[0], this, f58105a, false, 63253, new Class[0], com.ss.android.ugc.aweme.notification.bean.d.class);\n }\n try {\n return NoticeApiManager.a();\n } catch (ExecutionException e2) {\n a.this.f58097e = null;\n throw com.ss.android.ugc.aweme.app.api.m.a(e2);\n }\n }",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"public PrnPrivitakVo() {\r\n\t\tsuper();\r\n\t}",
"public abstract MBeanNotificationInfo[] getNotificationInfo();",
"com.soa.SolicitarServicioDocument.SolicitarServicio getSolicitarServicio();",
"public String getNote(){\r\n\t\treturn note;\r\n\t}",
"public String getNote() {\r\n return note;\r\n }",
"public String getNote() {\r\n return note;\r\n }",
"@Override\n\tpublic String getNotification() {\n\t\treturn null;\n\t}",
"private void note(Notification n){\r\n\t\tusers.get(n.userID).addNotification(n);\r\n\t\tif (loggedInUsers.contains(n.userID))\r\n\t\t\tcomms.sendMessage(n);\r\n\t}",
"public String getNote()\n {\n return note;\n }",
"public abstract String getInfo();",
"public abstract String getInfo();",
"private NotificationClient() { }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public interface GetNotification {\n public void setNotificationId(String strGCMid);\n\n\n public void setProviderDetails(String strGCMid, String strName, String strImage, String straddress,String expertiseid,String strReferalcdoe);\n\n public void getProviderId(String strProviderId, String strType);\n\n public void getServicePrice(String n_price);\n public void getServiceDuration(String n_duration);\n\n public ArrayList<String> getServicName(TreeMap<Integer, String> str_serviceName);\n\n\n public void setProviderdet(String strGCMid, String strName, String strImage, String straddress,String strExpertise,String strReferalcode);\n\n public void NotifyFilter(String strFilterVal);\n\n public void setProvideraddress(String strlatitude, String strlongitude, String straddress);\n}",
"@Override\n\tprotected void setupInfoKeys()\n\t{\n\t\tthrow new UnsupportedOperationException(\"not yet implemented\");\n\t}",
"@Override\n public void teleopPeriodic() {\n }",
"@Override\n public void teleopPeriodic() {\n }",
"@Override\n\t\tpublic void onDirectMessage(DirectMessage arg0) {\n\t\t\t\n\t\t}",
"interface Presenter{\n void findUserData(String clientMail);\n }",
"abstract public void getPermission();",
"public String getPrivacy();",
"private void setPlayerInformations() {\n\t\t\t\n\t\t\t\n\t\t}",
"public TranscribedNote()\r\n {\r\n\r\n }",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public String getNote()\n\t{\n\t\treturn note;\n\t}",
"@Override\r\n\tpublic void personalLoanInterest() {\n\t\t\r\n\t}",
"private void getUserInfo() {\n\t}",
"public interface AddNoticeViewInterface {\n /**\n * 上传附件完成\n */\n void uploadAttachmentOnComplete(Data data);\n\n /**\n * 显示文件上传的百分比\n *\n * @param value\n */\n void onProgress(int value);\n\n /**\n * 发布公告\n */\n void publishNoticeOnComplete(Notice notice);\n\n}",
"public interface Telemetry {}",
"public InventarioControlador() {\n }",
"public String getNotes();",
"private DittaAutonoleggio(){\n \n }",
"public String getNote() {\n return note;\n }",
"public String getNote() {\n return note;\n }",
"public String getNote() {\n return note;\n }",
"public String getNote() {\n return note;\n }",
"public String getNote() {\n return note;\n }",
"public String getNote() {\n return note;\n }",
"public String getNote() {\n return note;\n }"
] | [
"0.63804394",
"0.5983013",
"0.59646213",
"0.5914114",
"0.563054",
"0.56293756",
"0.5600706",
"0.5581505",
"0.557092",
"0.5560245",
"0.5545464",
"0.5530661",
"0.55256635",
"0.55238014",
"0.5511826",
"0.55089056",
"0.5502543",
"0.54966074",
"0.5489502",
"0.542175",
"0.5418863",
"0.5405542",
"0.5401782",
"0.5385454",
"0.53853977",
"0.53731656",
"0.5370195",
"0.5368067",
"0.5366795",
"0.53642523",
"0.5352962",
"0.53526473",
"0.53496367",
"0.53447586",
"0.5336482",
"0.53357756",
"0.53311163",
"0.5319804",
"0.5318149",
"0.5312252",
"0.5297236",
"0.5283922",
"0.52786815",
"0.52782625",
"0.5251295",
"0.52507335",
"0.5247608",
"0.52451015",
"0.52352935",
"0.52269",
"0.52259773",
"0.5225845",
"0.522112",
"0.5219152",
"0.5217216",
"0.5215031",
"0.52028686",
"0.5202667",
"0.51997125",
"0.51997125",
"0.51984745",
"0.5190043",
"0.5182935",
"0.5182309",
"0.5182309",
"0.5172844",
"0.51689196",
"0.51689196",
"0.51689196",
"0.51689196",
"0.51689196",
"0.51689196",
"0.51689196",
"0.51590204",
"0.5158795",
"0.51551485",
"0.51538146",
"0.51538146",
"0.5146585",
"0.51445675",
"0.51375985",
"0.5135523",
"0.51325756",
"0.513075",
"0.51284456",
"0.51284456",
"0.512805",
"0.5120383",
"0.5116024",
"0.5114752",
"0.5114304",
"0.5108908",
"0.5103221",
"0.50937355",
"0.50894195",
"0.50894195",
"0.50894195",
"0.50894195",
"0.50894195",
"0.50894195",
"0.50894195"
] | 0.0 | -1 |
Setter method for notifica. | public void setNotifica(Set<Notifica> aNotifica) {
notifica = aNotifica;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setNotification(String notif) {\n frame.setNotification(notif);\n }",
"public void setDocumentNote (String DocumentNote);",
"public void setNote(String note);",
"@Override\n public void setNotification() {\n if (getTense() == Tense.FUTURE) {\n //Context ctx = SHiTApplication.getContext();\n //SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(ctx);\n\n int leadTimeEventMinutes = SHiTApplication.getPreferenceInt(Constants.Setting.ALERT_LEAD_TIME_EVENT, LEAD_TIME_MISSING);\n\n if (leadTimeEventMinutes != LEAD_TIME_MISSING) {\n if (travelTime > 0) {\n leadTimeEventMinutes += travelTime;\n }\n\n setNotification(Constants.Setting.ALERT_LEAD_TIME_EVENT\n , leadTimeEventMinutes\n , R.string.alert_msg_event\n , getNotificationClickAction()\n , null);\n }\n }\n }",
"public Notifica(){}",
"void setNote(int note) {\n\t\tthis.note = note;\n\t}",
"@Override\n\tpublic void setNote(java.lang.String note) {\n\t\t_esfShooterAffiliationChrono.setNote(note);\n\t}",
"void setTitolo(String titolo);",
"private void setNote() {\n\t\tNoteOpt.add(\"-nd\");\n\t\tNoteOpt.add(\"/nd\");\n\t\tNoteOpt.add(\"notedetails\");\n\n\t}",
"public void setNote(String note) {\r\n this.note = note; \r\n }",
"@Setteri\n public void asetaLiite(Tiedosto liite){\n this.liite = liite;\n }",
"public void setProperty(Integer t) {\n\n\t\t}",
"public void setNote(String note) {\n if(note==null){\n note=\"\";\n }\n this.note = note;\n }",
"public void setNotification(String notification) {\n this.notification = notification;\n }",
"public void setNote(int note)\r\n {\r\n if (note >= 1 && note <= 5)\r\n this.note = note;\r\n else\r\n System.out.println(\"ungültige Note\");\r\n }",
"public void setAnio(int p) { this.anio = p; }",
"public void setObservacion(java.lang.String param){\n \n this.localObservacion=param;\n \n\n }",
"public void setIdentificacion(String identificacion)\r\n/* 128: */ {\r\n/* 129:233 */ this.identificacion = identificacion;\r\n/* 130: */ }",
"public void setNota(String nota) {\n this.nota = nota;\n }",
"public void setTelefono(String telefono);",
"public void setMoTa(String moTa);",
"void setSolicitarServicio(com.soa.SolicitarServicioDocument.SolicitarServicio solicitarServicio);",
"public void setNotify(long notify) {\n\t\tthis.notify = notify;\n\t}",
"public void setNama() {\n nama.postValue(\"Hello, Riyanto!\");\n }",
"public void setTipo(String x){\r\n tipo = x;\r\n }",
"public abstract void setCntPoa(int cntPoa);",
"public void setdat()\n {\n }",
"public void setLongitud(String longitud);",
"@Override\n\tpublic void setNotification(String title, String text, int minutes, int type) {\n\t \t Calendar cal = Calendar.getInstance();\n\t \t // add 5 minutes to the calendar object\n\t \t cal.add(Calendar.MINUTE, minutes);\n\t \t Intent intent = new Intent(this, AlarmReceiver.class);\n\t \t intent.putExtra(\"title\", title);\n\t \t intent.putExtra(\"text\", text);\n\t \t intent.putExtra(\"type\", type);\n\t \t // In reality, you would want to have a static variable for the request code instead of 192837\n\t \t PendingIntent sender = PendingIntent.getBroadcast(this, 192213, intent, PendingIntent.FLAG_UPDATE_CURRENT);\n\t \t \n\t \t // Get the AlarmManager service\n\t \t AlarmManager am = (AlarmManager) getSystemService(ALARM_SERVICE);\n\t \t am.set(AlarmManager.RTC_WAKEUP, cal.getTimeInMillis(), sender);\n\t}",
"public void setAutorizacionAutoimpresorSRI(AutorizacionAutoimpresorSRI autorizacionAutoimpresorSRI)\r\n/* 125: */ {\r\n/* 126:150 */ this.autorizacionAutoimpresorSRI = autorizacionAutoimpresorSRI;\r\n/* 127: */ }",
"@Override\r\n\tpublic void setIzena(String izena) {\n\t\tsuper.setIzena(izena);\r\n\t}",
"private void setNotification() {\n mBuilder.setProgress(updateMax, ++updateProgress, false)\n .setContentTitle(getResources().getString(R.string.notification_message));\n // Issues the notification\n nm.notify(0, mBuilder.build());\n }",
"public void setValor(String valor)\n/* 22: */ {\n/* 23:34 */ this.valor = valor;\n/* 24: */ }",
"public abstract void setFecha_inicio(java.lang.String newFecha_inicio);",
"public void setMensaje(String mensaje)\r\n/* 638: */ {\r\n/* 639:714 */ this.mensaje = mensaje;\r\n/* 640: */ }",
"void setRecensione(String recensione);",
"void setNotes(String notes);",
"public void setTipo(String tipo);",
"public void setAutorizacion(String autorizacion)\r\n/* 139: */ {\r\n/* 140:236 */ this.autorizacion = autorizacion;\r\n/* 141: */ }",
"public abstract void setApellido(java.lang.String newApellido);",
"public void setNotifTime(java.lang.String notifTime) {\n this.notifTime = notifTime;\n }",
"public void setAnio(int anio){\r\n \r\n \r\n this.anio = anio;\r\n \r\n }",
"public void setNotifications(ArrayList<Notification> notif) {\n\t\tnotifications = notif;\t\n\t}",
"public void setNote(Note note) {\n this.note = note;\n\n noteContent.setText(note.getNoteText().toString());\n noteContent.setPromptText(\"Enter note here.\");\n }",
"@Override\r\n\tpublic void setProperty(Properties prop) {\n\t}",
"public void setPuntoDeVenta(PuntoDeVenta puntoDeVenta)\r\n/* 145: */ {\r\n/* 146:166 */ this.puntoDeVenta = puntoDeVenta;\r\n/* 147: */ }",
"public void setNumero(int numero) { this.numero = numero; }",
"public void setTelefono(String telefono) {\r\n\tthis.telefono = telefono;\r\n}",
"public void setNombre(String nombre){\n this.nombre =nombre;\n }",
"public void setNotifMode(String notifMode) {\r\n\t\tthis.notifMode = notifMode;\r\n\t}",
"public void setPrecioc(int p){\n this.precioc=p;\n \n }",
"public void changeNotes(String a) {\r\n notes = a;\r\n }",
"public void setTipoFecha(int tipoFecha)\n {\n tipFecha=tipoFecha;\n }",
"public String getNote() {\r\n return note; \r\n }",
"public abstract void setCod_tecnico(java.lang.String newCod_tecnico);",
"public void setTexto(String t)\r\n {\r\n texto = t;\r\n }",
"@Override\n\tpublic NotaBuilder setEmitente(Object... args) {\n\t\treturn this;\n\t}",
"public void setNote(String note) {\r\n\r\n this.note = note;\r\n }",
"@Override\r\n\tpublic void alterar(Telefone vo) throws Exception {\n\t\t\r\n\t}",
"public void setInformation(String information);",
"public abstract void setNovedad(java.lang.String newNovedad);",
"@Override\n public void setTempo(int tempo) {\n }",
"public void setNewProperty_description(java.lang.String param){\n localNewProperty_descriptionTracker = true;\n \n this.localNewProperty_description=param;\n \n\n }",
"protected void onSetOnTimerSetting(EchoObject eoj, short tid, byte esv, EchoProperty property, boolean success) {}",
"@Override\r\n\t\t\t\t\tpublic void sendNoteOff(NoteOff noteOff) {\n\t\t\t\t\t\t\r\n\t\t\t\t\t}",
"public void setContrasena(String contrasena) {this.contrasena = contrasena;}",
"public void setNombre(String nombre) {this.nombre = nombre;}",
"public String getNote(){\r\n\t\treturn note;\r\n\t}",
"String setValue();",
"public void setCorreo(String correo) {this.correo = correo;}",
"@Override\r\n\t\t\t\t\tpublic void sendNoteOn(NoteOn noteOn) {\n\t\t\t\t\t\t\r\n\t\t\t\t\t}",
"String get_note()\n {\n return note;\n }",
"public void setNote(String note) {\r\n this.note = note;\r\n }",
"public void setEdificio (String pEdificio)\r\n {\r\n this.edificio = pEdificio;\r\n }",
"public void setDocumentNo (String DocumentNo);",
"public void setDocumentNo (String DocumentNo);",
"public void setDocumentNo (String DocumentNo);",
"protected void onPref(String name, String value){}",
"public void setNom(String p_onom);",
"public abstract void setCustomData(Object data);",
"public void setPatronAutorizacion(String patronAutorizacion)\r\n/* 219: */ {\r\n/* 220:369 */ this.patronAutorizacion = patronAutorizacion;\r\n/* 221: */ }",
"public void setLongitud(Integer longitud)\n/* 42: */ {\n/* 43:62 */ this.longitud = longitud;\n/* 44: */ }",
"public final void testSetUserData() {\n Notification n = new Notification(\"type\", \"src\", 1);\n assertNull(n.getUserData());\n n.setUserData(\"User data\");\n assertEquals(\"User data\", n.getUserData());\n }",
"public void setNotiDescription(String value) {\r\n setAttributeInternal(NOTIDESCRIPTION, value);\r\n }",
"public final void setNote(java.lang.String note)\r\n\t{\r\n\t\tsetNote(getContext(), note);\r\n\t}",
"@Override\n\t\tpublic void setProperty(String key, Object value) {\n\n\t\t}",
"public String getNote() {\r\n return note;\r\n }",
"public String getNote() {\r\n return note;\r\n }",
"void setNome(String nome);",
"@Override\n\tprotected void setValue(String name, TipiValue tv) {\n\t}",
"@Override\n public void setNotificationPreferences(String notificationPreferences) {\n this.notificationPreferences = notificationPreferences;\n SharedPreferences sharedPreferences = this.getSharedPreferences(KEY_SHAREDPREF_FILE, Context.MODE_PRIVATE);\n sharedPreferences.edit()\n .putString(KEY_SHARED_PREF_NOTIF,notificationPreferences)\n .apply();\n\n Log.i(TAG_MAIN, \"setNotificationPreferences: \" + notificationPreferences);\n }",
"public void setNumero(int numero)\r\n/* 195: */ {\r\n/* 196:206 */ this.numero = numero;\r\n/* 197: */ }",
"private void setTipo(int tipo) {\r\n\t\tthis.tipo = tipo;\r\n\t}",
"public void setNotes(String notes);",
"void setAnnoPubblicazione(String annoPubblicazione);",
"public void setCuentaContable(CuentaContable cuentaContable)\r\n/* 83: */ {\r\n/* 84:103 */ this.cuentaContable = cuentaContable;\r\n/* 85: */ }",
"protected void onSetDailyTimerSetting(EchoObject eoj, short tid, byte esv, EchoProperty property, boolean success) {}",
"public abstract void setNombre(java.lang.String newNombre);",
"public void setNguoiThamDu(String nguoiThamDu);",
"public void setData(Note selectedNote, int position) {\n\n\n this.notificationTitle.setText(selectedNote.getTitle());\n this.notificationDescription.setText(selectedNote.getNotification().getDate());\n\n }"
] | [
"0.65369856",
"0.6191608",
"0.61866325",
"0.6136633",
"0.6085818",
"0.60674584",
"0.6002439",
"0.5913865",
"0.58135766",
"0.57935137",
"0.577238",
"0.57698154",
"0.5766597",
"0.5755398",
"0.5720852",
"0.57185197",
"0.5712123",
"0.5699264",
"0.56956553",
"0.56715745",
"0.5662244",
"0.5650652",
"0.56414783",
"0.5636202",
"0.56308",
"0.5622017",
"0.56179667",
"0.5617941",
"0.56126136",
"0.5610772",
"0.5601215",
"0.55910194",
"0.5583861",
"0.5580593",
"0.55685234",
"0.5568297",
"0.5565762",
"0.5562558",
"0.5559009",
"0.55501866",
"0.55486953",
"0.552653",
"0.5520019",
"0.5519307",
"0.5505416",
"0.5503962",
"0.54964215",
"0.5480948",
"0.5477839",
"0.5477551",
"0.54676527",
"0.5466373",
"0.5463127",
"0.54615045",
"0.5457764",
"0.5456635",
"0.5450772",
"0.5449256",
"0.5447138",
"0.5446028",
"0.54395276",
"0.5436432",
"0.5432651",
"0.54316527",
"0.5427905",
"0.54261565",
"0.54252446",
"0.5424706",
"0.54243255",
"0.5416899",
"0.5416507",
"0.54032135",
"0.5401523",
"0.53962976",
"0.53929716",
"0.53929716",
"0.53929716",
"0.5386645",
"0.53857017",
"0.5382914",
"0.53819686",
"0.53742856",
"0.5373642",
"0.5371452",
"0.5370044",
"0.5364835",
"0.5364184",
"0.5364184",
"0.53600127",
"0.53580844",
"0.53479415",
"0.5336068",
"0.5333926",
"0.53303397",
"0.53276604",
"0.53257257",
"0.5324861",
"0.53215814",
"0.53189594",
"0.5315651"
] | 0.6024258 | 6 |
Compares the key for this instance with another Acquirente. | private boolean equalKeys(Object other) {
if (this==other) {
return true;
}
if (!(other instanceof Acquirente)) {
return false;
}
Acquirente that = (Acquirente) other;
if (this.getIdacquirente() != that.getIdacquirente()) {
return false;
}
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public boolean equals(Object other) {\n if (!(other instanceof Acquirente)) return false;\n return this.equalKeys(other) && ((Acquirente)other).equalKeys(this);\n }",
"@Test\n\tpublic void equalsSimilarObjects() {\n\t\tProductScanImageURIKey key1 = this.getDefaultKey();\n\t\tProductScanImageURIKey key2 = this.getDefaultKey();\n\t\tboolean equals = key1.equals(key2);\n\t\tSystem.out.println();\n\t\tAssert.assertTrue(equals);\n\t}",
"protected abstract boolean equalityTest(Object key, Object key2);",
"@Test\n public void testKeyEquivalence() throws Exception {\n ScanResultMatchInfo matchInfo1 = ScanResultMatchInfo.fromWifiConfiguration(mConfig1);\n ScanResultMatchInfo matchInfo1Prime = ScanResultMatchInfo.fromWifiConfiguration(mConfig1);\n ScanResultMatchInfo matchInfo2 = ScanResultMatchInfo.fromWifiConfiguration(mConfig2);\n assertFalse(matchInfo1 == matchInfo1Prime); // Checking assumption\n MacAddress mac1 = MacAddressUtils.createRandomUnicastAddress();\n MacAddress mac2 = MacAddressUtils.createRandomUnicastAddress();\n assertNotEquals(mac1, mac2); // really tiny probability of failing here\n\n WifiCandidates.Key key1 = new WifiCandidates.Key(matchInfo1, mac1, 1);\n\n assertFalse(key1.equals(null));\n assertFalse(key1.equals((Integer) 0));\n // Same inputs should give equal results\n assertEquals(key1, new WifiCandidates.Key(matchInfo1, mac1, 1));\n // Equal inputs should give equal results\n assertEquals(key1, new WifiCandidates.Key(matchInfo1Prime, mac1, 1));\n // Hash codes of equal things should be equal\n assertEquals(key1.hashCode(), key1.hashCode());\n assertEquals(key1.hashCode(), new WifiCandidates.Key(matchInfo1, mac1, 1).hashCode());\n assertEquals(key1.hashCode(), new WifiCandidates.Key(matchInfo1Prime, mac1, 1).hashCode());\n\n // Unequal inputs should give unequal results\n assertFalse(key1.equals(new WifiCandidates.Key(matchInfo2, mac1, 1)));\n assertFalse(key1.equals(new WifiCandidates.Key(matchInfo1, mac2, 1)));\n assertFalse(key1.equals(new WifiCandidates.Key(matchInfo1, mac1, 2)));\n }",
"@Test\n\tpublic void equalsSameObject() {\n\t\tProductScanImageURIKey key = this.getDefaultKey();\n\t\tboolean equals = key.equals(key);\n\t\tAssert.assertTrue(equals);\n\t}",
"@Test\n\tpublic void equalsNullSequenceNumberBoth() {\n\t\tProductScanImageURIKey key1 = this.getDefaultKey();\n\t\tkey1.setSequenceNumber(LONG_ZERO);\n\t\tProductScanImageURIKey key2 = this.getDefaultKey();\n\t\tkey2.setSequenceNumber(LONG_ZERO);\n\t\tboolean equals = key1.equals(key2);\n\t\tAssert.assertTrue(equals);\n\t}",
"public boolean acquire(String key, String owner);",
"@SuppressWarnings(\"resource\")\n @Test\n public void testEquals() {\n try {\n ApiKey apikey1 = new ApiKey(\"bd1f89fbddbde18d4244b748ca1d250b\", new Date(1570127619232L), 58,\n \"bd1f89fbddbde18d4244b748ca1d250b\", \"933738f6-d022-45c8-bc68-d7c6722e913b\", -46,\n \"3cac25f8-fd0d-4e6c-b1dd-e24a49542b75\", \"bd1f89fbddbde18d4244b748ca1d250b\",\n ApiKeyStatus.getDefault(), new Date(1570127625184L));\n ApiKey apikey2 = new ApiKey(\"bd1f89fbddbde18d4244b748ca1d250b\", new Date(1570127619232L), 58,\n \"bd1f89fbddbde18d4244b748ca1d250b\", \"933738f6-d022-45c8-bc68-d7c6722e913b\", -46,\n \"3cac25f8-fd0d-4e6c-b1dd-e24a49542b75\", \"bd1f89fbddbde18d4244b748ca1d250b\",\n ApiKeyStatus.getDefault(), new Date(1570127625184L));\n ApiKey apikey3 = new ApiKey(\"bd1f89fbddbde18d4244b748ca1d250b\", new Date(1570127620542L), 76,\n \"bd1f89fbddbde18d4244b748ca1d250b\", \"e31184de-791f-4689-9075-d12706757ba9\", -7,\n \"d34afc91-63f2-42e0-bde5-cfbb131751fd\", \"bd1f89fbddbde18d4244b748ca1d250b\",\n ApiKeyStatus.getDefault(), new Date(1570127620923L));\n assertNotNull(apikey1);\n assertNotNull(apikey2);\n assertNotNull(apikey3);\n assertNotSame(apikey2, apikey1);\n assertNotSame(apikey3, apikey1);\n assertEquals(apikey2, apikey1);\n assertEquals(apikey2, apikey1);\n assertEquals(apikey1, apikey2);\n assertEquals(apikey1, apikey1);\n assertFalse(apikey1.equals(null));\n assertNotEquals(apikey3, apikey1);\n } catch (Exception exception) {\n fail(exception.getMessage());\n }\n }",
"protected boolean equalityTest(Object key, Object key2) {\n\t\t\treturn this.set.equalityTest(key, key2);\n\t\t}",
"@Test\n\tpublic void hashCodeSimilarObjects() {\n\t\tProductScanImageURIKey key1 = this.getDefaultKey();\n\t\tProductScanImageURIKey key2 = this.getDefaultKey();\n\t\tAssert.assertEquals(key1.hashCode(), key2.hashCode());\n\t}",
"@Test\n public void testCollidingKeyAccessDiffCache()\n {\n doStressTest(\"IdxTestCKADC\", getCacheName0(), getCacheName1(),\n IdentityExtractor.INSTANCE,\n new CompositeKeyCreator()\n {\n public CompositeKey getCompositeKey(Object oKeyNatural, NamedCache cache)\n {\n return new CompositeKey(\n oKeyNatural, getSurrogateKey(cache, oKeyNatural, Base.getRandom().nextInt(20)));\n }\n },\n /*nServers*/1, /*cRollingRestart*/0);\n }",
"@Test\n\tpublic void hashCodeDifferentSequenceNumber() {\n\t\tProductScanImageURIKey key1 = this.getDefaultKey();\n\t\tProductScanImageURIKey key2 = this.getDefaultKey();\n\t\tkey1.setSequenceNumber(2);\n\t\tAssert.assertNotEquals(key1.hashCode(), key2.hashCode());\n\t}",
"@Test\n public void equalsWithDifferentName() throws Exception {\n AttributeKey<Number> key1 = new AttributeKey<Number>(Number.class, \"key1\");\n AttributeKey<Number> key2 = new AttributeKey<Number>(Number.class, \"key2\");\n\n assertThat(key1.equals(key2), is(false));\n assertThat(key2.equals(key1), is(false));\n }",
"@Test\n public void testSameKeyAccessDiffCache()\n {\n doStressTest(\"IdxTestSKADC\", getCacheName0(), getCacheName1(),\n IdentityExtractor.INSTANCE,\n new CompositeKeyCreator()\n {\n public CompositeKey getCompositeKey(Object oKeyNatural, NamedCache cache)\n {\n return new CompositeKey(oKeyNatural, oKeyNatural);\n }\n },\n /*nServers*/1, /*cRollingRestart*/0);\n }",
"@SuppressWarnings(\"resource\")\n @Test\n public void testHashCode() {\n try {\n ApiKey apikey1 = new ApiKey(\"bd1f89fbddbde18d4244b748ca1d250b\", new Date(1570127622312L), -54,\n \"bd1f89fbddbde18d4244b748ca1d250b\", \"fdf184b3-81d4-449f-ad84-da9d9f4732b2\", 73,\n \"d8fff014-0bf4-46d5-b2da-3391ccc51619\", \"bd1f89fbddbde18d4244b748ca1d250b\",\n ApiKeyStatus.getDefault(), new Date(1570127620753L));\n ApiKey apikey2 = new ApiKey(\"bd1f89fbddbde18d4244b748ca1d250b\", new Date(1570127622312L), -54,\n \"bd1f89fbddbde18d4244b748ca1d250b\", \"fdf184b3-81d4-449f-ad84-da9d9f4732b2\", 73,\n \"d8fff014-0bf4-46d5-b2da-3391ccc51619\", \"bd1f89fbddbde18d4244b748ca1d250b\",\n ApiKeyStatus.getDefault(), new Date(1570127620753L));\n assertNotNull(apikey1);\n assertNotNull(apikey2);\n assertNotSame(apikey2, apikey1);\n assertEquals(apikey2, apikey1);\n assertEquals(apikey2.hashCode(), apikey1.hashCode());\n int hashCode = apikey1.hashCode();\n for (int i = 0; i < 5; i++) {\n assertEquals(hashCode, apikey1.hashCode());\n }\n } catch (Exception exception) {\n fail(exception.getMessage());\n }\n }",
"@Test\n\tpublic void hashCodeSameObject() {\n\t\tProductScanImageURIKey key = this.getDefaultKey();\n\t\tAssert.assertEquals(key.hashCode(), key.hashCode());\n\t}",
"@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}",
"public int compareTo(KeyedItem<T> other)\n {\n if (other instanceof KeyedItem)\n return key.compareTo(other.getKey());\n else {\n System.out.println(\"Invalid Comaprison\");\n return 0;\n }\n }",
"private boolean equalKeys(Object other) {\n if (this==other) {\n return true;\n }\n if (!(other instanceof ApptranregFeesAud)) {\n return false;\n }\n ApptranregFeesAud that = (ApptranregFeesAud) other;\n Object myAtrfAudUid = this.getAtrfAudUid();\n Object yourAtrfAudUid = that.getAtrfAudUid();\n if (myAtrfAudUid==null ? yourAtrfAudUid!=null : !myAtrfAudUid.equals(yourAtrfAudUid)) {\n return false;\n }\n return true;\n }",
"public boolean tryAcquire(String key, String owner, long timeout, TimeUnit timeUnit);",
"@Test\n\tpublic void hashCodeDifferentId() {\n\t\tProductScanImageURIKey key1 = this.getDefaultKey();\n\t\tProductScanImageURIKey key2 = this.getDefaultKey();\n\t\tkey1.setId(2);\n\t\tAssert.assertNotEquals(key1.hashCode(), key2.hashCode());\n\t}",
"@Test\n\tpublic void getOtherKeys() {\n\t\tRsaKeyStore ks = new RsaKeyStore();\n\t\tKeyPair kp = RsaHelper.generateKeyPair();\n\t\tks.addOtherKey(\"first other one\", kp.getPublic());\n\t\tKeyPair kpp = RsaHelper.generateKeyPair();\n\t\tks.addOtherKey(\"second other one\", kpp.getPublic());\n\t\tPublicKey pk = ks.getOtherKey(\"first other one\");\n\t\tassertTrue(\"should be same key\", kp.getPublic().equals(pk));\n\t\tPublicKey ppk = ks.getOtherKey(\"second other one\");\n\t\tassertTrue(\"should be same key\", kpp.getPublic().equals(ppk));\n\t}",
"public int compareTo(City another)\r\n {\r\n return key.compareTo(another.key);\r\n }",
"@Test\n\tpublic void equalsNullSequenceNumber() {\n\t\tProductScanImageURIKey key1 = this.getDefaultKey();\n\t\tProductScanImageURIKey key2 = this.getDefaultKey();\n\t\tkey1.setSequenceNumber(LONG_ZERO);\n\t\tboolean equals = key1.equals(key2);\n\t\tAssert.assertFalse(equals);\n\t}",
"@SuppressWarnings(\"resource\")\n @Test\n public void testEquals() {\n try {\n SubtenantApiKey subtenantapikey1 = new SubtenantApiKey(\"4f267f967f7d1f5e3fa0d6abaccdb4bf\",\n new Date(1574704668684L), -105, null,\n \"4f267f967f7d1f5e3fa0d6abaccdb4bf\",\n \"1a2ce0b9-4007-4d82-a458-bce5d8a2085a\", -33,\n \"2f0a11bf-c499-4b20-9b7b-ef16819784f2\",\n \"4f267f967f7d1f5e3fa0d6abaccdb4bf\",\n SubtenantApiKeyStatus.getDefault(),\n new Date(1574704669541L));\n SubtenantApiKey subtenantapikey2 = new SubtenantApiKey(\"4f267f967f7d1f5e3fa0d6abaccdb4bf\",\n new Date(1574704668684L), -105, null,\n \"4f267f967f7d1f5e3fa0d6abaccdb4bf\",\n \"1a2ce0b9-4007-4d82-a458-bce5d8a2085a\", -33,\n \"2f0a11bf-c499-4b20-9b7b-ef16819784f2\",\n \"4f267f967f7d1f5e3fa0d6abaccdb4bf\",\n SubtenantApiKeyStatus.getDefault(),\n new Date(1574704669541L));\n SubtenantApiKey subtenantapikey3 = new SubtenantApiKey(\"4f267f967f7d1f5e3fa0d6abaccdb4bf\",\n new Date(1574704666574L), -105, null,\n \"4f267f967f7d1f5e3fa0d6abaccdb4bf\",\n \"60d4acbb-208b-4d39-a7e7-0311a4c9d668\", -73,\n \"4d2e0a41-68cb-443d-b170-9281ae717cda\",\n \"4f267f967f7d1f5e3fa0d6abaccdb4bf\",\n SubtenantApiKeyStatus.getDefault(),\n new Date(1574704667904L));\n assertNotNull(subtenantapikey1);\n assertNotNull(subtenantapikey2);\n assertNotNull(subtenantapikey3);\n assertNotSame(subtenantapikey2, subtenantapikey1);\n assertNotSame(subtenantapikey3, subtenantapikey1);\n assertEquals(subtenantapikey2, subtenantapikey1);\n assertEquals(subtenantapikey2, subtenantapikey1);\n assertEquals(subtenantapikey1, subtenantapikey2);\n assertEquals(subtenantapikey1, subtenantapikey1);\n assertFalse(subtenantapikey1.equals(null));\n assertNotEquals(subtenantapikey3, subtenantapikey1);\n } catch (Exception exception) {\n fail(exception.getMessage());\n }\n }",
"@Override\npublic int compareTo(CompositeKey o) {\n\tif(o == null ||this.key1<o.getKey1()) return -1;\n if(this.key1>o.getKey1())return 1;\n\treturn 0;\n}",
"@Override\r\n\tpublic int compareTo(AttributeKey o) {\n\t\treturn key.compareTo(o.getKey());\r\n\t}",
"private boolean equalKeys(Object other) {\r\n if (this == other) {\r\n return true;\r\n }\r\n if (!(other instanceof Contacto)) {\r\n return false;\r\n }\r\n Contacto that = (Contacto) other;\r\n if (this.getIdContacto() != that.getIdContacto()) {\r\n return false;\r\n }\r\n return true;\r\n }",
"@Test\n public void equalsWithDifferentTypes() throws Exception {\n AttributeKey<Number> key1 = new AttributeKey<Number>(Number.class, \"keyName\");\n AttributeKey<Date> key2 = new AttributeKey<Date>(Date.class, \"keyName\");\n\n assertThat(key1.equals(key2), is(false));\n assertThat(key2.equals(key1), is(false));\n }",
"private boolean equalKeys(Object other) {\n if (this==other) {\n return true;\n }\n if (!(other instanceof BlastingtypeRelationsAud)) {\n return false;\n }\n BlastingtypeRelationsAud that = (BlastingtypeRelationsAud) other;\n Object myBtrAudUid = this.getBtrAudUid();\n Object yourBtrAudUid = that.getBtrAudUid();\n if (myBtrAudUid==null ? yourBtrAudUid!=null : !myBtrAudUid.equals(yourBtrAudUid)) {\n return false;\n }\n return true;\n }",
"@SuppressWarnings(\"resource\")\n @Test\n public void testHashCode() {\n try {\n SubtenantApiKey subtenantapikey1 = new SubtenantApiKey(\"4f267f967f7d1f5e3fa0d6abaccdb4bf\",\n new Date(1574704661913L), -32, null,\n \"4f267f967f7d1f5e3fa0d6abaccdb4bf\",\n \"ef1cd9b8-3221-4391-aefc-23518f83faa3\", -25,\n \"e25f9e8a-ec98-4538-8132-816a43b1d1d2\",\n \"4f267f967f7d1f5e3fa0d6abaccdb4bf\",\n SubtenantApiKeyStatus.getDefault(),\n new Date(1574704664911L));\n SubtenantApiKey subtenantapikey2 = new SubtenantApiKey(\"4f267f967f7d1f5e3fa0d6abaccdb4bf\",\n new Date(1574704661913L), -32, null,\n \"4f267f967f7d1f5e3fa0d6abaccdb4bf\",\n \"ef1cd9b8-3221-4391-aefc-23518f83faa3\", -25,\n \"e25f9e8a-ec98-4538-8132-816a43b1d1d2\",\n \"4f267f967f7d1f5e3fa0d6abaccdb4bf\",\n SubtenantApiKeyStatus.getDefault(),\n new Date(1574704664911L));\n assertNotNull(subtenantapikey1);\n assertNotNull(subtenantapikey2);\n assertNotSame(subtenantapikey2, subtenantapikey1);\n assertEquals(subtenantapikey2, subtenantapikey1);\n assertEquals(subtenantapikey2.hashCode(), subtenantapikey1.hashCode());\n int hashCode = subtenantapikey1.hashCode();\n for (int i = 0; i < 5; i++) {\n assertEquals(hashCode, subtenantapikey1.hashCode());\n }\n } catch (Exception exception) {\n fail(exception.getMessage());\n }\n }",
"@org.testng.annotations.Test\n public void test_equals_Symmetric()\n throws Exception {\n CategorieClient categorieClient = new CategorieClient(\"denis\", 1000, 10.2, 1.1, 1.2, false);\n Client x = new Client(\"Denis\", \"Denise\", \"Paris\", categorieClient);\n Client y = new Client(\"Denis\", \"Denise\", \"Paris\", categorieClient);\n Assert.assertTrue(x.equals(y) && y.equals(x));\n Assert.assertTrue(x.hashCode() == y.hashCode());\n }",
"com.hps.july.persistence.StorageCardKey getAgregateKey() throws java.rmi.RemoteException;",
"@Test\n public void testSameKeyAccessDiffCacheMulti()\n {\n doStressTest(\"IdxTestSKADCM\", getCacheName0(), getCacheName1(),\n IdentityExtractor.INSTANCE,\n new CompositeKeyCreator()\n {\n public CompositeKey getCompositeKey(Object oKeyNatural, NamedCache cache)\n {\n return new CompositeKey(oKeyNatural, oKeyNatural);\n }\n },\n /*nServers*/3, /*cRollingRestart*/0);\n }",
"@Override\n @Generated(\"eclipse\")\n public boolean equals(final Object obj) {\n if (this == obj) {\n return true;\n }\n if (obj == null) {\n return false;\n }\n if (getClass() != obj.getClass()) {\n return false;\n }\n @SuppressWarnings(\"unchecked\")\n HolderKey<T> other = (HolderKey<T>) obj;\n if (this.asyncSupported != other.asyncSupported) {\n return false;\n }\n if (this.heldValue == null) {\n if (other.heldValue != null) {\n return false;\n }\n } else if (!this.heldValue.equals(other.heldValue)) {\n return false;\n }\n if (this.initParameters == null) {\n if (other.initParameters != null) {\n return false;\n }\n } else if (!this.initParameters.equals(other.initParameters)) {\n return false;\n }\n if (this.name == null) {\n if (other.name != null) {\n return false;\n }\n } else if (!this.name.equals(other.name)) {\n return false;\n }\n if (this.serviceReference == null) {\n if (other.serviceReference != null) {\n return false;\n }\n } else if (!this.serviceReference.equals(other.serviceReference)) {\n return false;\n }\n return true;\n }",
"public int compareTo(FlightKey other) {\n\t\t// FILL IN CODE\n\t\tif(this.origin.compareTo(other.origin) < 0) return -1;\n\t\tif(this.origin.compareTo(other.origin) > 0) return 1;\n\n\t\tif(this.dest.compareTo(other.dest) < 0) return -1;\n\t\tif(this.dest.compareTo(other.dest) > 0) return 1;\n\n\t\tif(this.date.compareTo(other.date) < 0) return -1;\n\t\tif(this.date.compareTo(other.date) > 0) return 1;\n\n\t\tif(this.time.compareTo(other.time) < 0) return -1;\n\t\tif(this.time.compareTo(other.time) > 0) return 1;\n\n\t\treturn 0; // don't forget to change it\n\t}",
"OpenSSLKey mo134201a();",
"@SuppressWarnings({ \"rawtypes\"})\n\t\t@Override\n\t\tpublic int compare(WritableComparable a, WritableComparable b) {\n\t\t\tMyKey o1 = (MyKey)a;\n\t\t\tMyKey o2 = (MyKey)b;\n\t\t\treturn o1.getK().compareTo(o2.getK());\n\t\t}",
"private boolean equalKeys(Object other) {\n if (this==other) {\n return true;\n }\n if (!(other instanceof RegistrationItems)) {\n return false;\n }\n RegistrationItems that = (RegistrationItems) other;\n Object myRegItemUid = this.getRegItemUid();\n Object yourRegItemUid = that.getRegItemUid();\n if (myRegItemUid==null ? yourRegItemUid!=null : !myRegItemUid.equals(yourRegItemUid)) {\n return false;\n }\n return true;\n }",
"@Override\n default int compareTo(KeyValue<K, V> other) {\n return this.getKey().compareTo(other.getKey());\n }",
"private boolean equalKeys(Object other) {\n if (this==other) {\n return true;\n }\n if (!(other instanceof User)) {\n return false;\n }\n User that = (User) other;\n if (this.getIduser() != that.getIduser()) {\n return false;\n }\n return true;\n }",
"@Override\n public boolean equals(Object obj) {\n if (this == obj) {\n return true;\n }\n if (obj == null || getClass() != obj.getClass()) {\n return false;\n }\n Key key = (Key) obj;\n return Objects.equals(exponent, key.exponent)\n && Objects.equals(modulus, key.modulus);\n }",
"private boolean equalKeys(Object other) {\n if (this==other) {\n return true;\n }\n if (!(other instanceof Sanpham)) {\n return false;\n }\n Sanpham that = (Sanpham) other;\n Object myMasp = this.getMasp();\n Object yourMasp = that.getMasp();\n if (myMasp==null ? yourMasp!=null : !myMasp.equals(yourMasp)) {\n return false;\n }\n return true;\n }",
"protected abstract Object getKey(Subject subject, ConnectionRequestInfo cri,\n boolean separateNoTx) throws ResourceException;",
"public abstract String getRefKey();",
"public final int compareTo(KeyPermission other)\r\n\t{\r\n\t\treturn this.keyId - other.keyId;\r\n\t}",
"private int compararEntradas (Entry<K,V> e1, Entry<K,V> e2)\r\n\t{\r\n\t\treturn (comp.compare(e1.getKey(),e2.getKey()));\r\n\t}",
"@Override\n\tpublic boolean equals(Object obj) {\n\t\treturn instance.equals(((HadoopRecordKey)obj).instance);\n\t}",
"public int compare(Key<Double, Double> a, Key<Double, Double> b){\n\t\t\tif (a.getFirst() < b.getFirst()){\n\t\t\t\treturn -1;\n\t\t\t} else if (a.getFirst() == b.getFirst()){\n\t\t\t\treturn 0;\n\t\t\t} else {\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t}",
"public void useKey(Artifact a) {\n\t\tif (a.getKeyPattern() > 0 && a.getKeyPattern() == this.lockPattern) {\n\t\t\tlocked = !(locked);\n\t\t\t//System.out.println(locked);\n\t\t\t//System.out.println(\"Used \" + a.name() + \"!\\n\");\n\t\t\tNetwork.netPrintln(String.valueOf(locked));\n\t\t\tNetwork.netPrintln(\"Used \" + a.name() + \"!\\n\");\n\t\t}\n\t\telse {\n\t\t\t//System.out.println(\"Keypattern does not match.\\n\");\n\t\t\tNetwork.netPrintln(\"Keypattern does not match.\\n\");\n\t\t\t// System.out.println(\"Actual \" + this.lockPattern + \" given \" + a.getKeyPattern());\n\t\t}\n\t}",
"@Override\r\n\tpublic boolean equals(Object obj) {\n\t\tAttributeKey ak = (AttributeKey)obj;\r\n\t\treturn this.key.equals(ak.getKey());\r\n\t}",
"void assertSelfTimeEquals(T key, long expected);",
"@Override\n public int compareTo(SparseEncoding that) {\n return this.getSrc().compareTo(that.getSrc());\n }",
"public boolean keyEquals(Entry<K, V> other) {\n return key.equals(other.key);\n }",
"public int compareTo(CollationKey target) {\n return 0;\n }",
"@Override\n\tpublic int compareTo(Key o) {\n\t\tint temp = 0;\n\t\t\t\t\n\t\tif (this.value > o.value) \t\ttemp = 1;\n\t\telse if (this.value < o.value) temp = -1;\n\t\telse \t\t\t\t\t\t\ttemp = 0;\n\t\t\n\t\treturn temp;\n\t}",
"public int compareTo(KeyPoint other) {\n if (this.x == other.x) {\n int sign = (x - rec.r < 0) ? -1 : 1;\n int sign2 = (other.x - other.rec.r < 0) ? -1 : 1;\n return Integer.compare(this.rec.h * sign, other.rec.h * sign2);\n }\n return Integer.compare(this.x, other.x);\n }",
"@Override\n public int compareTo(MappingKey o) {\n\n Integer thisScopeSetScore = (scopeSet == null) ? 0 : scopeSet.hashCode();\n Integer thatScopeSetScore = (o.getScopeSet() == null) ? 0 : o.getScopeSet().hashCode();\n\n return thisScopeSetScore.compareTo(thatScopeSetScore);\n\n }",
"@SuppressWarnings(\"EqualsUnsafeCast\")\n @Override\n public boolean equals(Object o) {\n final Key key = (Key) o;\n return powerComponent == key.powerComponent\n && processState == key.processState;\n }",
"@Test\n public void testBackdoorModificationSameKey()\n {\n testBackdoorModificationSameKey(this);\n }",
"public int compareTo(CommitToken other) {\n if (! repenvUUID.equals(other.repenvUUID)) {\n throw new IllegalArgumentException\n (\"Comparisons across environments are not meaningful. \" +\n \"This environment: \" + repenvUUID +\n \" other environment: \" + other.getRepenvUUID());\n }\n final long compare = vlsn - other.vlsn;\n return (compare < 0) ? -1 : ((compare == 0) ? 0 : 1);\n }",
"public Key min();",
"private int compareTimeSpan(ProcessorDistributionKey key)\n {\n int result = 0;\n result = myTimeSpan.compareTo(key.myTimeSpan);\n\n if (result == 0)\n {\n if (myConstraintKey == null)\n {\n if (key.myConstraintKey != null)\n {\n result = 1;\n }\n }\n else if (key.myConstraintKey == null)\n {\n result = -1;\n }\n else if (!myConstraintKey.equals(key.myConstraintKey))\n {\n result = myConstraintKey.hashCode() - key.myConstraintKey.hashCode();\n\n // Just in case the hash codes are coincident.\n if (result == 0)\n {\n result = System.identityHashCode(myConstraintKey) - System.identityHashCode(key.myConstraintKey);\n }\n }\n }\n\n return result;\n }",
"public void generateKey() {\n\twhile(true){\n\t rsaKeyA = (int)(Math.random()*20000 + 26);\n\t if(isPrime(rsaKeyA)){\n\t\tbreak;\n\t }\n\t}\n\twhile(true){\n\t rsaKeyB = (int)(Math.random()* 20000 + 26);\n\t if(isPrime(rsaKeyB)&& rsaKeyB != rsaKeyA){\n\t\tbreak;\n\t }\n\t}\n \n }",
"@Override\r\n\t\tpublic boolean equalsWithOrder(\r\n\t\t\t\tPair<? extends T, ? extends S> anotherPair) {\n\t\t\tsynchronized (mutex) {\r\n\t\t\t\treturn pair.equalsWithOrder(anotherPair);\r\n\t\t\t}\r\n\t\t}",
"public CompositeKey(double startPrice,double endPrice){\n\t this.key1=startPrice;\n\t this.key2=endPrice;\n }",
"public boolean DEBUG_compare(Alphabet other) {\n System.out.println(\"now comparing the alphabets this with other:\\n\"+this+\"\\n\"+other);\n boolean sameSlexic = true;\n for (String s : other.slexic.keySet()) {\n if (!slexic.containsKey(s)) {\n sameSlexic = false;\n break;\n }\n if (!slexic.get(s).equals(other.slexic.get(s))) {\n sameSlexic = false;\n break;\n }\n slexic.remove(s);\n }\n System.out.println(\"the slexic attributes are the same : \" + sameSlexic);\n boolean sameSlexicinv = true;\n for (int i = 0, limit = other.slexicinv.size(); i < limit; i++) {\n boolean temp = false;\n for (int j = i, limit2 = slexicinv.size() + i; j < limit2; j++) {\n int k = j % slexicinv.size();\n if (other.slexicinv.get(i).equals(slexicinv.get(k))) {\n temp = true;\n break;\n }\n }\n if (!temp) {\n sameSlexicinv = false;\n break;\n }\n\n }\n boolean sameSpair = true;\n System.out.println(\"the slexicinv attributes are the same : \" + sameSlexicinv);\n for (IntegerPair p : other.spair.keySet()) {\n if(!spair.containsKey(p)) {\n //if (!containsKey(spair, p)) {\n sameSpair = false;\n break;\n }\n //if (!(get(spair, p).equals(get(a.spair, p)))) {\n if (!spair.get(p).equals(other.spair.get(p))) {\n sameSpair = false;\n break;\n }\n }\n System.out.println(\"the spair attributes are the same : \" + sameSpair);\n boolean sameSpairinv = true;\n for (int i = 0, limit = other.spairinv.size(); i < limit; i++) {\n boolean temp = false;\n for (int j = i, limit2 = spairinv.size() + i; j < limit2; j++) {\n int k = j % spairinv.size();\n if (other.spairinv.get(i).equals(spairinv.get(k))) {\n temp = true;\n break;\n }\n }\n if (!temp) {\n sameSpairinv = false;\n break;\n }\n }\n System.out.println(\"the spairinv attributes are the same : \" + sameSpairinv);\n return (sameSpairinv && sameSpair && sameSlexic && sameSlexicinv);\n }",
"@Test\n\tpublic void hashCodeNullSequenceNumber() {\n\t\tProductScanImageURIKey key1 = this.getDefaultKey();\n\t\tProductScanImageURIKey key2 = this.getDefaultKey();\n\t\tkey1.setSequenceNumber(LONG_ZERO);\n\t\tAssert.assertNotEquals(key1.hashCode(), key2.hashCode());\n\t}",
"@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}",
"@Override\n public boolean equals(Object o) {\n if (this == o) return true;\n if (o == null || getClass() != o.getClass()) return false;\n\n NameKey nameKey = (NameKey) o;\n return this.analyser.compare(this, nameKey) == 0;\n }",
"@Override\n public int compare(Integer a, Integer b) {\n if (base.get(a) >= base.get(b)) {\n return 1;\n } else {\n return -1;\n } // returning 0 would merge keys\n }",
"private static void compareForIdenticalKeys() {\n Integer[] identical = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1};\n\n Insertion insertion = new Insertion();\n insertion.analyzeSort(identical);\n insertion.getStat().printReport();\n\n Selection selection = new Selection();\n selection.analyzeSort(identical);\n selection.getStat().printReport();\n }",
"@Override\n public boolean equals(Object other) {\n if (!(other instanceof ApptranregFeesAud)) return false;\n return this.equalKeys(other) && ((ApptranregFeesAud)other).equalKeys(this);\n }",
"@Override\n public int compareTo(Kaizen another) {\n return another.dateModified.compareTo(this.dateModified);\n }",
"@Test\n public void testEquals() {\n System.out.println(\"equals\");\n Commissioner instance = new Commissioner();\n Commissioner instance2 = new Commissioner();\n instance.setLogin(\"genie\");\n instance2.setLogin(\"genie\");\n boolean expResult = true;\n boolean result = instance.equals(instance2);\n assertEquals(expResult, result);\n }",
"@Override\n public boolean equals(Object object) {\n if (!(object instanceof ContratTache)) {\n return false;\n }\n ContratTache other = (ContratTache) object;\n if ((this.contratTachePK == null && other.contratTachePK != null) || (this.contratTachePK != null && !this.contratTachePK.equals(other.contratTachePK))) {\n return false;\n }\n return true;\n }",
"@Override\n\tpublic int compare(WritableComparable a, WritableComparable b) {\n\t\tIntPaire o1 = (IntPaire) a;\n\t\tIntPaire o2 = (IntPaire) b;\n\t\tif(!o1.getFirstKey().equals(o2.getFirstKey())){\n\t\t\treturn o1.getFirstKey().compareTo(o2.getFirstKey());\n\t\t}else{\n\t\t\treturn o1.getSecondKey() - o2.getSecondKey();\n\t\t}\n\t}",
"void privateSetAgregateKey(com.hps.july.persistence.StorageCardKey inKey) throws java.rmi.RemoteException;",
"void assertSelfCntEquals(T key, int expected);",
"@Override\n public boolean equals(Object object) {\n if (!(object instanceof CdrqasryPK)) {\n return false;\n }\n CdrqasryPK other = (CdrqasryPK) object;\n if ((this.facno == null && other.facno != null) || (this.facno != null && !this.facno.equals(other.facno))) {\n return false;\n }\n if ((this.quono == null && other.quono != null) || (this.quono != null && !this.quono.equals(other.quono))) {\n return false;\n }\n if (this.trseq != other.trseq) {\n return false;\n }\n if (this.seq != other.seq) {\n return false;\n }\n if ((this.cmccode == null && other.cmccode != null) || (this.cmccode != null && !this.cmccode.equals(other.cmccode))) {\n return false;\n }\n return true;\n }",
"@SuppressWarnings(\"resource\")\n @Test\n public void testClone() {\n try {\n ApiKey apikey1 = new ApiKey(\"bd1f89fbddbde18d4244b748ca1d250b\", new Date(1570127625049L), 88,\n \"bd1f89fbddbde18d4244b748ca1d250b\", \"18fa817e-9d24-4344-a79a-ab19db23016c\", -15,\n \"7b9ca8ca-2f09-4496-b67e-f3a146e5c741\", \"bd1f89fbddbde18d4244b748ca1d250b\",\n ApiKeyStatus.getDefault(), new Date(1570127627362L));\n ApiKey apikey2 = apikey1.clone();\n assertNotNull(apikey1);\n assertNotNull(apikey2);\n assertNotSame(apikey2, apikey1);\n assertEquals(apikey2, apikey1);\n } catch (Exception exception) {\n fail(exception.getMessage());\n }\n }",
"@Override\n public int hashCode() {\n int i;\n int result = 17;\n i = getIdacquirente();\n result = 37*result + i;\n return result;\n }",
"public int compareTo(InsertEnumConstant_KeyClass o) {\n return key.compareTo(o.key);\n }",
"@Override\n\t\tpublic int compareTo(MyKey arg0) {\n\t\t\tif(k.compareTo(arg0.getK())==0){\n\t\t\t\treturn v.compareTo(arg0.getV());\n\t\t\t}else{\n\t\t\t\treturn -k.compareTo(arg0.getK());\n\t\t\t}\n\t\t}",
"public boolean testVerify(Synth synth2, String key, Object obj1, Object obj2)\n {\n return false;\n }",
"public CryptographyKeysCreator() {\n Random random = new Random();\n BigInteger prime1 = BigInteger.probablePrime(256, random);\n BigInteger prime2 = BigInteger.probablePrime(256, random);\n primesMultiplied = prime1.multiply(prime2);\n BigInteger phi = prime1.subtract(BigInteger.ONE).multiply(prime2.subtract(BigInteger.ONE));\n encryptingBigInt = BigInteger.probablePrime(256, random);\n\n while (phi.gcd(encryptingBigInt).compareTo(BigInteger.ONE) > 0 && encryptingBigInt.compareTo(phi) < 0) {\n encryptingBigInt = encryptingBigInt.add(BigInteger.ONE);\n }\n\n decryptingBigInt = encryptingBigInt.modInverse(phi);\n }",
"@Override\r\n\tpublic int compare(K o1, K o2) {\n\t\t\r\n\t\treturn ((Comparable<K>) o1).compareTo(o2) ;\r\n\t}",
"public int compare(WritableComparable o1, WritableComparable o2) {\r\n\t\tText key1 = (Text) o1;\r\n\t\tText key2 = (Text) o2;\r\n\t\tint t1char = key1.charAt(0); \r\n\t\tint t2char = key2.charAt(0); \r\n\t\tif (t1char < t2char) return 1;\r\n\t\telse if (t1char > t2char) return -1;\r\n\t\telse return 0;\r\n\t}",
"void acquireReadLock(E key);",
"public int compare(String a, String b) {\n if (base.get(a) >= base.get(b)) {\n return -1;\n } else {\n return 1;\n } // returning 0 would merge keys\n }",
"@Override\n\tpublic String getReferenceKey() {\n\t\treturn KEY;\n\t}",
"@Test\n\tpublic void test_hashCode1() {\n\tTennisPlayer c1 = new TennisPlayer(5,\"David Ferrer\");\n\tTennisPlayer c2 = new TennisPlayer(5,\"David Ferrer\");\n\tassertTrue(c1.hashCode()==c2.hashCode());\n }",
"void assertTotalTimeEquals(T key, long expected);",
"java.lang.String getClientKey();",
"@Override\r\n\t\t\tpublic int compare(DjikstraPair o1, DjikstraPair o2) {\n\t\t\t\treturn o2.csf - o1.csf;\r\n\t\t\t}",
"public static void main(String[] args) {\n\t\tEmployee e1 = new Employee(\"xiaojia\", 22, \"巨魔导师\", 100000, 88);\n\t\tEmployee e2 = new Employee(\"xiaobai\", 18, \"巨魔\", 10000, 22);\n\t\ttest3 t3 = new test3();\n\t\te1.say();\n\t\te2.say();\n\t\tboolean key = true;\n\t\tkey = t3.compare(e1, e2);\n\n\t\tSystem.out.println(\"一强于二\" + key);\n\n\t}",
"public abstract Key getSmallest();",
"@Override\r\n\tpublic int compareTo(EmailCheck o) {\n\t\treturn this.memberKey-o.getMemberKey();\r\n\t}",
"public abstract boolean equals(IPeripheral other);",
"@Override\n public boolean equals(Object other) {\n if (!(other instanceof Sanpham)) return false;\n return this.equalKeys(other) && ((Sanpham)other).equalKeys(this);\n }"
] | [
"0.7471261",
"0.6046948",
"0.59622574",
"0.58267486",
"0.5773407",
"0.5760481",
"0.56852865",
"0.5653124",
"0.5635047",
"0.56328404",
"0.5573567",
"0.5561905",
"0.5546417",
"0.5527707",
"0.55177754",
"0.5507854",
"0.5490595",
"0.5483651",
"0.54564565",
"0.541072",
"0.53766984",
"0.5360975",
"0.53401923",
"0.5340073",
"0.530566",
"0.52911246",
"0.5240021",
"0.5237359",
"0.5211147",
"0.519232",
"0.516822",
"0.5160077",
"0.5143147",
"0.51301056",
"0.51233226",
"0.51160496",
"0.5107452",
"0.50796425",
"0.507162",
"0.5060898",
"0.5052827",
"0.50379145",
"0.5007056",
"0.4998397",
"0.49982753",
"0.495926",
"0.4948722",
"0.49466482",
"0.49387282",
"0.49287617",
"0.49205974",
"0.49118975",
"0.4861658",
"0.48581094",
"0.48476902",
"0.484246",
"0.48381472",
"0.48286417",
"0.48267147",
"0.48129106",
"0.48042873",
"0.4802628",
"0.47953892",
"0.47919023",
"0.47665563",
"0.47639972",
"0.4741167",
"0.47393498",
"0.47374395",
"0.47315362",
"0.47080895",
"0.47070518",
"0.47046208",
"0.4703612",
"0.47019666",
"0.46882623",
"0.46820015",
"0.46728683",
"0.46701545",
"0.46401957",
"0.46365625",
"0.46296805",
"0.46285117",
"0.46266338",
"0.4612381",
"0.4608892",
"0.4603447",
"0.46031737",
"0.45960802",
"0.45923847",
"0.45898417",
"0.4589691",
"0.458958",
"0.45885202",
"0.4588044",
"0.45823804",
"0.45819774",
"0.4578008",
"0.4575814",
"0.45757806"
] | 0.7337519 | 1 |
Compares this instance with another Acquirente. | @Override
public boolean equals(Object other) {
if (!(other instanceof Acquirente)) return false;
return this.equalKeys(other) && ((Acquirente)other).equalKeys(this);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private boolean equalKeys(Object other) {\n if (this==other) {\n return true;\n }\n if (!(other instanceof Acquirente)) {\n return false;\n }\n Acquirente that = (Acquirente) other;\n if (this.getIdacquirente() != that.getIdacquirente()) {\n return false;\n }\n return true;\n }",
"protected abstract Comparison getInstance();",
"@Test\n public void testEquals() {\n System.out.println(\"equals\");\n Commissioner instance = new Commissioner();\n Commissioner instance2 = new Commissioner();\n instance.setLogin(\"genie\");\n instance2.setLogin(\"genie\");\n boolean expResult = true;\n boolean result = instance.equals(instance2);\n assertEquals(expResult, result);\n }",
"@Test\n public void testEquals() {\n \n Beneficiaire instance = ben2;\n Beneficiaire unAutreBeneficiaire = ben3;\n boolean expResult = false;\n boolean result = instance.equals(unAutreBeneficiaire);\n assertEquals(expResult, result);\n\n unAutreBeneficiaire = ben2;\n expResult = true;\n result = instance.equals(unAutreBeneficiaire);\n assertEquals(expResult, result);\n }",
"@org.testng.annotations.Test\n public void test_equals_Symmetric()\n throws Exception {\n CategorieClient categorieClient = new CategorieClient(\"denis\", 1000, 10.2, 1.1, 1.2, false);\n Client x = new Client(\"Denis\", \"Denise\", \"Paris\", categorieClient);\n Client y = new Client(\"Denis\", \"Denise\", \"Paris\", categorieClient);\n Assert.assertTrue(x.equals(y) && y.equals(x));\n Assert.assertTrue(x.hashCode() == y.hashCode());\n }",
"@Test\r\n public void testTransitive() throws Exception {\n\r\n EmployeeImpl emp1 = new EmployeeImpl(\"7993389\", \"[email protected]\");\r\n EmployeeImpl emp2 = new EmployeeImpl(\"7993390\", \"[email protected]\");\r\n EmployeeImpl emp3 = new EmployeeImpl(\"7993391\", \"[email protected]\");\r\n\r\n Assert.assertTrue(\"Comparable implementation is incorrect\", emp3.compareTo(emp2) == 1);\r\n Assert.assertTrue(\"Comparable implementation is incorrect\", emp2.compareTo(emp1) == 1);\r\n Assert.assertTrue(\"Comparable implementation is incorrect\", emp3.compareTo(emp1) == 1);\r\n }",
"public int compare(Arc a1,Arc a2){\n\t\t\t\treturn a1.getNumber()-a2.getNumber();\r\n\t\t\t}",
"@Test\n public void testEquals() {\n System.out.println(\"equals\");\n Receta instance = new Receta();\n instance.setNombre(\"nom1\");\n Receta instance2 = new Receta();\n instance.setNombre(\"nom2\");\n boolean expResult = false;\n boolean result = instance.equals(instance2);\n assertEquals(expResult, result);\n }",
"public int compare(identified_crystal a, identified_crystal b) \n\t { \n\n\t \treturn a.rating - b.rating; \n\t }",
"public createAresta_result(createAresta_result other) {\n __isset_bitfield = other.__isset_bitfield;\n this.success = other.success;\n if (other.isSetKau()) {\n this.kau = new KeyAlreadyUsed(other.kau);\n }\n if (other.isSetRiu()) {\n this.riu = new ResourceInUse(other.riu);\n }\n }",
"@Test\r\n public void testReflexiveForEqual() throws Exception {\n\r\n EmployeeImpl emp1 = new EmployeeImpl(\"7993389\", \"[email protected]\");\r\n EmployeeImpl emp2 = new EmployeeImpl(\"7993389\", \"[email protected]\");\r\n\r\n Assert.assertTrue(\"Comparable implementation is incorrect\", emp1.compareTo(emp2) == 0);\r\n Assert.assertTrue(\"Comparable implementation is incorrect\", emp1.compareTo(emp2) == emp2.compareTo(emp1));\r\n }",
"@SuppressWarnings(\"resource\")\n @Test\n public void testEquals() {\n try {\n ApiKey apikey1 = new ApiKey(\"bd1f89fbddbde18d4244b748ca1d250b\", new Date(1570127619232L), 58,\n \"bd1f89fbddbde18d4244b748ca1d250b\", \"933738f6-d022-45c8-bc68-d7c6722e913b\", -46,\n \"3cac25f8-fd0d-4e6c-b1dd-e24a49542b75\", \"bd1f89fbddbde18d4244b748ca1d250b\",\n ApiKeyStatus.getDefault(), new Date(1570127625184L));\n ApiKey apikey2 = new ApiKey(\"bd1f89fbddbde18d4244b748ca1d250b\", new Date(1570127619232L), 58,\n \"bd1f89fbddbde18d4244b748ca1d250b\", \"933738f6-d022-45c8-bc68-d7c6722e913b\", -46,\n \"3cac25f8-fd0d-4e6c-b1dd-e24a49542b75\", \"bd1f89fbddbde18d4244b748ca1d250b\",\n ApiKeyStatus.getDefault(), new Date(1570127625184L));\n ApiKey apikey3 = new ApiKey(\"bd1f89fbddbde18d4244b748ca1d250b\", new Date(1570127620542L), 76,\n \"bd1f89fbddbde18d4244b748ca1d250b\", \"e31184de-791f-4689-9075-d12706757ba9\", -7,\n \"d34afc91-63f2-42e0-bde5-cfbb131751fd\", \"bd1f89fbddbde18d4244b748ca1d250b\",\n ApiKeyStatus.getDefault(), new Date(1570127620923L));\n assertNotNull(apikey1);\n assertNotNull(apikey2);\n assertNotNull(apikey3);\n assertNotSame(apikey2, apikey1);\n assertNotSame(apikey3, apikey1);\n assertEquals(apikey2, apikey1);\n assertEquals(apikey2, apikey1);\n assertEquals(apikey1, apikey2);\n assertEquals(apikey1, apikey1);\n assertFalse(apikey1.equals(null));\n assertNotEquals(apikey3, apikey1);\n } catch (Exception exception) {\n fail(exception.getMessage());\n }\n }",
"public boolean equals(Object other) {\n return super.equals(other) &&\n requiredPrimitiveType == ((AtomicSequenceConverter)other).requiredPrimitiveType;\n }",
"@Override public int compare(final IdentifiedObject o1, final IdentifiedObject o2) {\n Collection<Identifier> a1 = o1.getIdentifiers();\n Collection<Identifier> a2 = o2.getIdentifiers();\n if (a1 == null) a1 = Collections.emptySet();\n if (a2 == null) a2 = Collections.emptySet();\n final Iterator<Identifier> i1 = a1.iterator();\n final Iterator<Identifier> i2 = a2.iterator();\n boolean n1, n2;\n while ((n1 = i1.hasNext()) & (n2 = i2.hasNext())) { // NOSONAR: Really '&', not '&&'\n final int c = IdentifiedObjects.doCompare(i1.next().getCode(), i2.next().getCode());\n if (c != 0) {\n return c;\n }\n }\n if (n1) return +1;\n if (n2) return -1;\n return 0;\n }",
"public AlgoAreEqual(Construction cons, GeoElement inputElement1,\n\t\t\tGeoElement inputElement2) {\n\t\tsuper(cons);\n\t\tthis.inputElement1 = inputElement1;\n\t\tthis.inputElement2 = inputElement2;\n\n\t\toutputBoolean = new GeoBoolean(cons);\n\n\t\tsetInputOutput();\n\t\tcompute();\n\n\t}",
"public static void main(String[] args) {\n Simple simple = new Simple(\"James\", 29);\n //AtomicReference --> creates possible ABA problem\n AtomicReference<Simple> atomicSimple= new AtomicReference<>(simple);\n System.out.println(atomicSimple.get());\n //expect false\n boolean falseResult = atomicSimple.compareAndSet(new Simple(\"Henry\", 22), new Simple(\"Andy\", 23));\n System.out.println(falseResult);\n boolean falseResult1 = atomicSimple.compareAndSet(new Simple(\"James\",29), new Simple(\"Andy\", 23));\n System.out.println(falseResult1);\n boolean result = atomicSimple.compareAndSet(simple, new Simple(\"Andy\", 23));\n System.out.println(result);\n }",
"static public Abc getObject() //Double Chcked Locking\n {\n if(obj1==null) {\n synchronized (Abc.class) {\n if (obj1 == null) {\n obj1 = new Abc();\n }\n }\n\n }\n return obj1;\n }",
"public int compareTo(BaseResource other) {\n\t\tif (other == null)\n\t\t\treturn 1;\n\t\treturn 0;\n\t}",
"@Test\n public void aminoCompareTest2() {\n //these list are already sorted\n AminoAcidLL first = AminoAcidLL.createFromRNASequence(c);\n AminoAcidLL second = AminoAcidLL.createFromRNASequence(c);\n int expected = 0;\n assertEquals(expected, first.aminoAcidCompare(second));\n }",
"public final void testDifferentClassEquals() {\n final Account test = new Account(\"Test\");\n assertFalse(testTransaction1.equals(test));\n // pmd doesn't like either way\n }",
"@Override\n public int compare( ReservaViaje r1, ReservaViaje r2 )\n {\n int diff = ( int ) (r1.darCostoTotal( )-r2.darCostoTotal( ));\n return diff==0?0:(diff>0?1:-1);\n }",
"public boolean tryAcquire(String key, String owner, long timeout, TimeUnit timeUnit);",
"@Test\n public void codonCompare1(){\n //these list are already sorted\n AminoAcidLL first = AminoAcidLL.createFromRNASequence(a);\n AminoAcidLL second = AminoAcidLL.createFromRNASequence(b);\n int expected = 0;\n assertEquals(expected, first.codonCompare(second));\n }",
"public boolean equals(Object other)\r\n {\r\n \r\n return compareTo( (Trader)other ) == 0;\r\n }",
"@Test\n\tpublic void equalsSimilarObjects() {\n\t\tProductScanImageURIKey key1 = this.getDefaultKey();\n\t\tProductScanImageURIKey key2 = this.getDefaultKey();\n\t\tboolean equals = key1.equals(key2);\n\t\tSystem.out.println();\n\t\tAssert.assertTrue(equals);\n\t}",
"@Override\n public int compareTo(final Car o) {\n return Integer.compare(this.productionYear,o.getProductionYear());\n }",
"@SuppressWarnings({\"UnnecessaryLocalVariable\"})\n @Test\n void testEqualsAndHashCode(SoftAssertions softly) {\n SortOrder sortOrder0 = new SortOrder(\"i0\", true, false, true);\n SortOrder sortOrder1 = sortOrder0;\n SortOrder sortOrder2 = new SortOrder(\"i0\", true, false, true);\n\n softly.assertThat(sortOrder0.hashCode()).isEqualTo(sortOrder2.hashCode());\n //noinspection EqualsWithItself\n softly.assertThat(sortOrder0.equals(sortOrder0)).isTrue();\n //noinspection ConstantConditions\n softly.assertThat(sortOrder0.equals(sortOrder1)).isTrue();\n softly.assertThat(sortOrder0.equals(sortOrder2)).isTrue();\n\n SortOrder sortOrder3 = new SortOrder(\"i1\", true, false, true);\n softly.assertThat(sortOrder0.equals(sortOrder3)).isFalse();\n\n //noinspection EqualsBetweenInconvertibleTypes\n softly.assertThat(sortOrder0.equals(new SortOrders())).isFalse();\n }",
"public int compare(Object a, Object b) {\n if (a == b) {\n return 0;\n }\n CountedObject ca = (CountedObject)a;\n CountedObject cb = (CountedObject)b;\n int countA = ca.count;\n int countB = cb.count;\n if (countA < countB) {\n return 1;\n }\n if (countA > countB) {\n return -1;\n }\n return 0;\n }",
"Equality createEquality();",
"@Test\n public void testCollidingKeyAccessDiffCache()\n {\n doStressTest(\"IdxTestCKADC\", getCacheName0(), getCacheName1(),\n IdentityExtractor.INSTANCE,\n new CompositeKeyCreator()\n {\n public CompositeKey getCompositeKey(Object oKeyNatural, NamedCache cache)\n {\n return new CompositeKey(\n oKeyNatural, getSurrogateKey(cache, oKeyNatural, Base.getRandom().nextInt(20)));\n }\n },\n /*nServers*/1, /*cRollingRestart*/0);\n }",
"@Test\n\tpublic void test_equals1() {\n\tTennisPlayer c1 = new TennisPlayer(11,\"Joe Tsonga\");\n\tTennisPlayer c2 = new TennisPlayer(11,\"Joe Tsonga\");\n\tassertTrue(c1.equals(c2));\n }",
"@Test\n public void testCompare() {\n AantalGastenComparator instance = new AantalGastenComparator();\n int expResult;\n int result;\n \n //test 1\n Accommodatie a1 = new Accommodatie(\"je moeder\", 30.00, 2, 1);\n Accommodatie a2 = new Accommodatie(\"je vader\", 40.00, 3, 1);\n expResult = -1;\n result = instance.compare(a1, a2);\n assertEquals(expResult, result);\n \n \n //test 2\n Accommodatie a3 = new Accommodatie(\"je moeder2\", 30.00, 2, 1);\n Accommodatie a4 = new Accommodatie(\"je vader2\", 40.00, 2, 1);\n expResult = 0;\n result = instance.compare(a3, a4);\n assertEquals(expResult, result);\n \n \n //test 3\n Accommodatie a5 = new Accommodatie(\"je moeder3\", 30.00, 3, 1);\n Accommodatie a6 = new Accommodatie(\"je vader3\", 40.00, 2, 1);\n expResult = 1;\n result = instance.compare(a5, a6);\n assertEquals(expResult, result);\n }",
"@Override\n public boolean equals(Object objectToCompare)\n {\n if (this == objectToCompare)\n {\n return true;\n }\n if (objectToCompare == null || getClass() != objectToCompare.getClass())\n {\n return false;\n }\n if (!super.equals(objectToCompare))\n {\n return false;\n }\n ValidValueImplAssetElement that = (ValidValueImplAssetElement) objectToCompare;\n return Objects.equals(referenceDataAsset, that.referenceDataAsset) &&\n Objects.equals(referenceDataConnections, that.referenceDataConnections);\n }",
"@Override\r\n public boolean equals(Object object) {\n if (!(object instanceof SgcAutoevaluacionRef)) {\r\n return false;\r\n }\r\n SgcAutoevaluacionRef other = (SgcAutoevaluacionRef) object;\r\n if ((this.idAutref == null && other.idAutref != null) || (this.idAutref != null && !this.idAutref.equals(other.idAutref))) {\r\n return false;\r\n }\r\n return true;\r\n }",
"@Test\n public void equals2() throws Exception {\n SmartPlayer x = new SmartPlayer(0, 1);\n SmartPlayer y = new SmartPlayer(0, 2);\n assertFalse(x.equals(y));\n }",
"@Test\r\n\tpublic void testEquality(){\n\t\t assertEquals(object1, object2);\r\n\t}",
"@Override\n public boolean areItemsTheSame(Concert oldConcert, Concert newConcert) {\n return oldConcert.getId() == newConcert.getId();\n }",
"ReferenceCounted retain();",
"public int compareTo(ResourceCollection other) {\n if (this.brick == other.getBrick() &&\n this.lumber == other.getLumber() &&\n this.wool == other.getWool() &&\n this.grain == other.getGrain() &&\n this.ore == other.getOre()) {\n return 0;\n } else if (this.brick < other.getBrick() ||\n this.lumber < other.getLumber() ||\n this.wool < other.getWool() ||\n this.grain < other.getGrain() ||\n this.ore < other.getOre()) {\n return -1;\n } else return 1;\n }",
"private Equals() {}",
"@SuppressWarnings(\"resource\")\n @Test\n public void testEquals() {\n try {\n SubtenantApiKey subtenantapikey1 = new SubtenantApiKey(\"4f267f967f7d1f5e3fa0d6abaccdb4bf\",\n new Date(1574704668684L), -105, null,\n \"4f267f967f7d1f5e3fa0d6abaccdb4bf\",\n \"1a2ce0b9-4007-4d82-a458-bce5d8a2085a\", -33,\n \"2f0a11bf-c499-4b20-9b7b-ef16819784f2\",\n \"4f267f967f7d1f5e3fa0d6abaccdb4bf\",\n SubtenantApiKeyStatus.getDefault(),\n new Date(1574704669541L));\n SubtenantApiKey subtenantapikey2 = new SubtenantApiKey(\"4f267f967f7d1f5e3fa0d6abaccdb4bf\",\n new Date(1574704668684L), -105, null,\n \"4f267f967f7d1f5e3fa0d6abaccdb4bf\",\n \"1a2ce0b9-4007-4d82-a458-bce5d8a2085a\", -33,\n \"2f0a11bf-c499-4b20-9b7b-ef16819784f2\",\n \"4f267f967f7d1f5e3fa0d6abaccdb4bf\",\n SubtenantApiKeyStatus.getDefault(),\n new Date(1574704669541L));\n SubtenantApiKey subtenantapikey3 = new SubtenantApiKey(\"4f267f967f7d1f5e3fa0d6abaccdb4bf\",\n new Date(1574704666574L), -105, null,\n \"4f267f967f7d1f5e3fa0d6abaccdb4bf\",\n \"60d4acbb-208b-4d39-a7e7-0311a4c9d668\", -73,\n \"4d2e0a41-68cb-443d-b170-9281ae717cda\",\n \"4f267f967f7d1f5e3fa0d6abaccdb4bf\",\n SubtenantApiKeyStatus.getDefault(),\n new Date(1574704667904L));\n assertNotNull(subtenantapikey1);\n assertNotNull(subtenantapikey2);\n assertNotNull(subtenantapikey3);\n assertNotSame(subtenantapikey2, subtenantapikey1);\n assertNotSame(subtenantapikey3, subtenantapikey1);\n assertEquals(subtenantapikey2, subtenantapikey1);\n assertEquals(subtenantapikey2, subtenantapikey1);\n assertEquals(subtenantapikey1, subtenantapikey2);\n assertEquals(subtenantapikey1, subtenantapikey1);\n assertFalse(subtenantapikey1.equals(null));\n assertNotEquals(subtenantapikey3, subtenantapikey1);\n } catch (Exception exception) {\n fail(exception.getMessage());\n }\n }",
"@Override\r\n\t\t\tpublic int compare(DjikstraPair o1, DjikstraPair o2) {\n\t\t\t\treturn o2.csf - o1.csf;\r\n\t\t\t}",
"@Test\n void testCompareTo(){\n final int expected_value = 0;\n final int unexpected_value = 0;\n\n // LoginAccounts to use\n LoginAccount first_account = new LoginAccount(\"my_username\", \"some_name\", \"my_password\");\n LoginAccount second_account = new LoginAccount(\"their_username\", \"some_name\", \"their_password\");\n LoginAccount third_account = new LoginAccount(\"my_username\", \"some_name\", \"the_other_password\");\n\n // Values should be the same\n int first_value = first_account.compareTo(third_account);\n assertEquals(expected_value, first_value);\n\n // Values should be different\n int second_value = first_account.compareTo(second_account);\n assertNotEquals(unexpected_value, second_value);\n }",
"@Override\n\tpublic boolean equals(Object arg0) {\n\t\tproduit p = (produit) arg0;\n\t\treturn this.reference.equals(p.reference);\n\t}",
"@Override\r\n public int compareTo(AccessCard o) {\r\n return Integer.compare(this.id, o.getId());\r\n }",
"@Test\n public void canObtainOwnRelease() throws Exception {\n final Release release = release();\n final RtReleaseAsset asset = new RtReleaseAsset(\n new FakeRequest(),\n release,\n 1\n );\n MatcherAssert.assertThat(\n asset.release(),\n Matchers.is(release)\n );\n }",
"@Test\n\tpublic void equalsContract()\n\t{\n\t\tEqualsVerifier.forClass(ExperienceChangedReport.class).verify();\n\t}",
"public int compareTo(Car other){\r\n\t\treturn (int)(other.price-this.price); \r\n\t}",
"@Test\n public void equals_SameBuyQuery_Test() {\n Assert.assertTrue(bq1.equals(bq0));\n }",
"@Test\n public void equals() throws Exception {\n SmartPlayer x = new SmartPlayer(0, 0);\n SmartPlayer y = new SmartPlayer(0, 0);\n assertTrue(x.equals(y));\n }",
"@Test public void equalTest() {\n Dog d = new Dog(\"Owner 1\", \"Rex\", \"Boxer\", 90.0, 7);\n Dog d2 = new Dog(\"Owner 2\", \"Spot\", \"Pit Bull\", 90.0, 7);\n Assert.assertEquals(0, test.compare(d, d2));\n }",
"private boolean equalKeys(Object other) {\n if (this==other) {\n return true;\n }\n if (!(other instanceof ApptranregFeesAud)) {\n return false;\n }\n ApptranregFeesAud that = (ApptranregFeesAud) other;\n Object myAtrfAudUid = this.getAtrfAudUid();\n Object yourAtrfAudUid = that.getAtrfAudUid();\n if (myAtrfAudUid==null ? yourAtrfAudUid!=null : !myAtrfAudUid.equals(yourAtrfAudUid)) {\n return false;\n }\n return true;\n }",
"@Test\n @DisplayName(\"Test should detect equality between equal states.\")\n public void testShouldResultInEquality() {\n ObjectBag os1 = new ObjectBag(null, \"Hi\");\n ObjectBag os2 = new ObjectBag(null, \"Hi\");\n\n Assertions.assertThat(os1).isEqualTo(os2);\n }",
"public final std.pair<RValue, Value /*P*/ > EmitAtomicCompareExchange(LValue Obj, RValue Expected, RValue Desired, SourceLocation Loc, \n AtomicOrdering Success/*= AtomicOrdering::SequentiallyConsistent*/, AtomicOrdering Failure/*= AtomicOrdering::SequentiallyConsistent*/, boolean IsWeak/*= false*/, \n AggValueSlot Slot/*= AggValueSlot::ignored()*/) {\n assert (!Expected.isAggregate() || Expected.getAggregateAddress().getElementType() == Obj.getAddress().getElementType());\n assert (!Desired.isAggregate() || Desired.getAggregateAddress().getElementType() == Obj.getAddress().getElementType());\n AtomicInfo Atomics/*J*/= new AtomicInfo(/*Deref*/$this(), Obj);\n \n return Atomics.EmitAtomicCompareExchange(new RValue(Expected), new RValue(Desired), Success, Failure, \n IsWeak);\n}",
"@Override\n protected boolean tryAcquire(long value) {\n return counter.longValue() > value;\n }",
"public void setIdacquirente(int aIdacquirente) {\n idacquirente = aIdacquirente;\n }",
"public TLlamaAMAdminReleaseRequest(TLlamaAMAdminReleaseRequest other) {\n __isset_bitfield = other.__isset_bitfield;\n if (other.isSetVersion()) {\n this.version = other.version;\n }\n this.do_not_cache = other.do_not_cache;\n if (other.isSetQueues()) {\n List<String> __this__queues = new ArrayList<String>();\n for (String other_element : other.queues) {\n __this__queues.add(other_element);\n }\n this.queues = __this__queues;\n }\n if (other.isSetHandles()) {\n List<TUniqueId> __this__handles = new ArrayList<TUniqueId>();\n for (TUniqueId other_element : other.handles) {\n __this__handles.add(new TUniqueId(other_element));\n }\n this.handles = __this__handles;\n }\n if (other.isSetReservations()) {\n List<TUniqueId> __this__reservations = new ArrayList<TUniqueId>();\n for (TUniqueId other_element : other.reservations) {\n __this__reservations.add(new TUniqueId(other_element));\n }\n this.reservations = __this__reservations;\n }\n }",
"protected boolean lockAcquired() {\n if (locked.compareAndSet(false, true)) {\n lastInserts.clear();\n lastInactivations.clear();\n lastUpdateCase = null;\n return true;\n } else\n return false;\n }",
"public AlgoAreEqual(Construction cons, String label,\n\t\t\tGeoElement inputElement1, GeoElement inputElement2) {\n\t\tthis(cons, inputElement1, inputElement2);\n\t\toutputBoolean.setLabel(label);\n\t}",
"public final void testSameObjectEquals() {\n final Transaction copy = testTransaction1;\n assertTrue(testTransaction1.equals(copy)); // pmd doesn't like either\n // way\n\n }",
"boolean hasSameAs();",
"public abstract boolean equals(IPeripheral other);",
"@Override\n public int compareTo(SparseEncoding that) {\n return this.getSrc().compareTo(that.getSrc());\n }",
"public boolean equalsIgnoreRotRef(final Pattern other)\n\t{\n\t\t// for every feature element, we also need it to be present in other, \n\t\t// and vice versa\n\t\tif (featureElements.size() != other.featureElements.size())\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tfor (final FeatureElement element : featureElements)\n\t\t{\n\t\t\tif (!other.featureElements.contains(element))\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor (final FeatureElement element : other.featureElements())\n\t\t{\n\t\t\tif (!featureElements.contains(element))\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn allowsReflection == other.allowsReflection;\n\t}",
"@Test\n public void testCompareEqual() {\n System.out.println(\"compare\");\n FileNameComparator instance = new FileNameComparator();\n int expResult = 0;\n int result = instance.compare(testFileA, testFileA);\n Assert.assertEquals(expResult, result);\n }",
"default boolean isSameStateAs(ReadOnlyTask other) {\n return other == this // short circuit if same object\n || (other != null // this is first to avoid NPE below\n && other.getContent().equals(this.getContent())); // state checks here onwards\n //&& other.getDate().equals(this.getDate())\n //&& other.getTime().equals(this.getTime()));\n }",
"@Test\n public void testSameKeyAccessDiffCache()\n {\n doStressTest(\"IdxTestSKADC\", getCacheName0(), getCacheName1(),\n IdentityExtractor.INSTANCE,\n new CompositeKeyCreator()\n {\n public CompositeKey getCompositeKey(Object oKeyNatural, NamedCache cache)\n {\n return new CompositeKey(oKeyNatural, oKeyNatural);\n }\n },\n /*nServers*/1, /*cRollingRestart*/0);\n }",
"protected abstract boolean equalityTest(Object key, Object key2);",
"@Override\n\tpublic int compare(Assignment a1, Assignment a2) {\n\t\tif (a1.weight > a2.weight && a1.deadline < a2.deadline) return -1;\n\t\tif (a1.weight > a2.weight && a1.deadline > a2.deadline) return 1;\n\t\tif (a1.weight < a2.weight && a1.deadline < a2.deadline) return -1;\n\t\tif (a1.weight < a2.weight && a1.deadline > a2.deadline) return 1;\n\t\tif (a1.weight == a2.weight && a1.deadline < a2.deadline) return -1;\n\t\tif (a1.weight == a2.weight && a1.deadline > a2.deadline) return 1;\n\t\tif (a1.weight < a2.weight) return 1;\n\t\tif (a1.weight > a2.weight) return -1;\n\t\treturn 0;\n\t}",
"@Test\r\n\tpublic void testEqualsEU() {\r\n\t\tExternUnit externu2 = externu1.clone();\r\n\t\tassertTrue(externu1.equals(externu2));\r\n\t}",
"@Test\n void equals1() {\n Student s1=new Student(\"emina\",\"milanovic\",18231);\n Student s2=new Student(\"emina\",\"milanovic\",18231);\n assertEquals(true,s1.equals(s2));\n }",
"@Override\n public boolean equals(Object autre) {\n AcideAmine inter = (AcideAmine) autre;\n return ( acideAmine.equals(inter.acideAmine));\n \n }",
"@Override\r\n\t public int compare(Node o1, Node o2) {\n\t\tif (o1.downloadRate > o2.downloadRate)\r\n\t\t return 1;\r\n\t\tif (o1.downloadRate < o2.downloadRate)\r\n\t\t return -1;\r\n\t\t\r\n\t\treturn 0;\r\n\t }",
"private static boolean equalityTest3(String a, String b)\n {\n return System.identityHashCode(a) == System.identityHashCode(b);\n }",
"@Test\n\tpublic void testDeckEqualsAgain() {\n\t\t\n\t\tStandardDeckClass oneDeck = new StandardDeckClass();\n\t\tVegasDeckClass testDeck = new VegasDeckClass();\n\t\t\n\t\tboolean isSame = oneDeck.equals(testDeck);\n\t\t\n\t\tassertEquals(\"equals method not working as expected\", false, isSame);\n\t}",
"@Test\n\tpublic void test_equals2() {\n\tTennisPlayer c1 = new TennisPlayer(11,\"Joe Tsonga\");\n\tTennisPlayer c2 = new TennisPlayer(521,\"Joe Tsonga\");\n\tassertFalse(c1.equals(c2));\n }",
"@Test\n public void testCompareTo() {\n \n BigDecimal magnitude1 = new BigDecimal(\"1.11\");\n BigDecimal magnitude2 = new BigDecimal(\"2.22\");\n BigDecimal magnitude3 = new BigDecimal(\"3.33\");\n \n Currency usd = Currency.getInstance(\"USD\");\n Currency cad = Currency.getInstance(\"CAD\");\n \n Money moneyUsd = new Money(magnitude1, usd, RoundingMode.CEILING);\n Money moneyUsd2 = new Money(magnitude2, usd, RoundingMode.FLOOR);\n Money moneyCad = new Money(magnitude3, cad);\n Money moneyCad2 = new Money(magnitude3, cad);\n\n try {\n moneyUsd.compareTo(moneyCad);\n fail(\"Comparisons between Money objects with different currencies should fail\");\n } catch(CurrencyMismatchRuntimeException cmm) {\n }\n \n assertTrue(\"Less than\", moneyUsd.compareTo(moneyUsd2) < 0);\n assertTrue(\"Greater than\", moneyUsd2.compareTo(moneyUsd) > 0);\n assertTrue(\"Equal\", 0 == moneyCad.compareTo(moneyCad2));\n\n assertTrue(\"Less than 2\", moneyUsd.lessThan(moneyUsd2));\n assertTrue(\"Greater than 2\", moneyUsd2.greaterThan(moneyUsd));\n assertTrue(\"Equal 2\", moneyCad.equals(moneyCad2));\n\n \n }",
"public void testEquals()\r\n\t{\r\n\t\tIrClassType irClassType1 = new IrClassType();\r\n\t\tirClassType1.setName(\"irClassTypeName\");\r\n\t\tirClassType1.setDescription(\"irClassTypeDescription\");\r\n\t\tirClassType1.setId(55l);\r\n\t\tirClassType1.setVersion(33);\r\n\t\t\r\n\t\tIrClassType irClassType2 = new IrClassType();\r\n\t\tirClassType2.setName(\"irClassTypeName2\");\r\n\t\tirClassType2.setDescription(\"irClassTypeDescription2\");\r\n\t\tirClassType2.setId(55l);\r\n\t\tirClassType2.setVersion(33);\r\n\r\n\t\t\r\n\t\tIrClassType irClassType3 = new IrClassType();\r\n\t\tirClassType3.setName(\"irClassTypeName\");\r\n\t\tirClassType3.setDescription(\"irClassTypeDescription\");\r\n\t\tirClassType3.setId(55l);\r\n\t\tirClassType3.setVersion(33);\r\n\t\t\r\n\t\tassert irClassType1.equals(irClassType3) : \"Classes should be equal\";\r\n\t\tassert !irClassType1.equals(irClassType2) : \"Classes should not be equal\";\r\n\t\t\r\n\t\tassert irClassType1.hashCode() == irClassType3.hashCode() : \"Hash codes should be the same\";\r\n\t\tassert irClassType2.hashCode() != irClassType3.hashCode() : \"Hash codes should not be the same\";\r\n\t}",
"@Test\n public void equalsSameTest() {\n Device device2 = new Device(deviceID, token);\n assertEquals(device, device2);\n }",
"public readAresta_result(readAresta_result other) {\n if (other.isSetSuccess()) {\n this.success = new Aresta(other.success);\n }\n if (other.isSetKnf()) {\n this.knf = new KeyNotFound(other.knf);\n }\n if (other.isSetRiu()) {\n this.riu = new ResourceInUse(other.riu);\n }\n }",
"@Test\n public void testEquals() {\n Coctail c1 = new Coctail(\"coctail\", new Ingredient[]{ \n new Ingredient(\"ing1\"), new Ingredient(\"ing2\")});\n Coctail c2 = new Coctail(\"coctail\", new Ingredient[]{ \n new Ingredient(\"ing1\"), new Ingredient(\"ing2\")});\n assertEquals(c1, c2);\n }",
"@SuppressWarnings(\"resource\")\n @Test\n public void testHashCode() {\n try {\n ApiKey apikey1 = new ApiKey(\"bd1f89fbddbde18d4244b748ca1d250b\", new Date(1570127622312L), -54,\n \"bd1f89fbddbde18d4244b748ca1d250b\", \"fdf184b3-81d4-449f-ad84-da9d9f4732b2\", 73,\n \"d8fff014-0bf4-46d5-b2da-3391ccc51619\", \"bd1f89fbddbde18d4244b748ca1d250b\",\n ApiKeyStatus.getDefault(), new Date(1570127620753L));\n ApiKey apikey2 = new ApiKey(\"bd1f89fbddbde18d4244b748ca1d250b\", new Date(1570127622312L), -54,\n \"bd1f89fbddbde18d4244b748ca1d250b\", \"fdf184b3-81d4-449f-ad84-da9d9f4732b2\", 73,\n \"d8fff014-0bf4-46d5-b2da-3391ccc51619\", \"bd1f89fbddbde18d4244b748ca1d250b\",\n ApiKeyStatus.getDefault(), new Date(1570127620753L));\n assertNotNull(apikey1);\n assertNotNull(apikey2);\n assertNotSame(apikey2, apikey1);\n assertEquals(apikey2, apikey1);\n assertEquals(apikey2.hashCode(), apikey1.hashCode());\n int hashCode = apikey1.hashCode();\n for (int i = 0; i < 5; i++) {\n assertEquals(hashCode, apikey1.hashCode());\n }\n } catch (Exception exception) {\n fail(exception.getMessage());\n }\n }",
"@Override\n public boolean equals(Object object) {\n if (!(object instanceof IssuedCash)) {\n return false;\n }\n IssuedCash other = (IssuedCash) object;\n if ((this.issuedTime == null && other.issuedTime != null) || (this.issuedTime != null && !this.issuedTime.equals(other.issuedTime))) {\n return false;\n }\n return true;\n }",
"@Override\n public int compare(final Availability o1, final Availability o2) {\n DateFormat f = new SimpleDateFormat(\"dd-MM-yyyy\");\n try {\n return f.parse(o1.getDate()).compareTo(f.parse(o2.getDate()));\n } catch (ParseException e) {\n throw new IllegalArgumentException(e);\n }\n }",
"@Override\n public boolean equals(Object obj) {\n if (obj == null) {\n return false;\n }\n\n if (TkRefexAbstractMember.class.isAssignableFrom(obj.getClass())) {\n TkRefexAbstractMember<?> another = (TkRefexAbstractMember<?>) obj;\n\n // =========================================================\n // Compare properties of 'this' class to the 'another' class\n // =========================================================\n // Compare refsetUuid\n if (!this.refexUuid.equals(another.refexUuid)) {\n return false;\n }\n\n // Compare componentUuid\n if (!this.componentUuid.equals(another.componentUuid)) {\n return false;\n }\n\n // Compare their parents\n return super.equals(obj);\n }\n\n return false;\n }",
"@Override\r\n public int compareTo(AccountHolder otherAccountHolder) {\n\t\r\n\t\tif (this.getCombinedBalance() < otherAccountHolder.getCombinedBalance()) {\r\n\t\t return -1;\r\n\t\t} else if (this.getCombinedBalance() > otherAccountHolder.getCombinedBalance()) {\r\n\t\t return 1;\r\n\t\t} else {\r\n\t\t return 0;\r\n\t\t}\r\n }",
"@Override\n public boolean equals(Object that) {\n if (this == that) {\n return true;\n }\n if (that == null) {\n return false;\n }\n if (getClass() != that.getClass()) {\n return false;\n }\n TFCUseLockDetail other = (TFCUseLockDetail) that;\n return (this.getRowId() == null ? other.getRowId() == null : this.getRowId().equals(other.getRowId()))\n && (this.getCoinTypeId() == null ? other.getCoinTypeId() == null : this.getCoinTypeId().equals(other.getCoinTypeId()))\n && (this.getRecTime() == null ? other.getRecTime() == null : this.getRecTime().equals(other.getRecTime()))\n && (this.getActiontype() == null ? other.getActiontype() == null : this.getActiontype().equals(other.getActiontype()))\n && (this.getLockId() == null ? other.getLockId() == null : this.getLockId().equals(other.getLockId()))\n && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))\n && (this.getServerIp() == null ? other.getServerIp() == null : this.getServerIp().equals(other.getServerIp()))\n && (this.getGameId() == null ? other.getGameId() == null : this.getGameId().equals(other.getGameId()))\n && (this.getServerName() == null ? other.getServerName() == null : this.getServerName().equals(other.getServerName()))\n && (this.getLockNum() == null ? other.getLockNum() == null : this.getLockNum().equals(other.getLockNum()))\n && (this.getChangeNum() == null ? other.getChangeNum() == null : this.getChangeNum().equals(other.getChangeNum()))\n && (this.getRemainNum() == null ? other.getRemainNum() == null : this.getRemainNum().equals(other.getRemainNum()))\n && (this.getOtherLockNum() == null ? other.getOtherLockNum() == null : this.getOtherLockNum().equals(other.getOtherLockNum()));\n }",
"public boolean isEqual(Object objectname1, Object objectname2, Class<?> voClass) {\n\t\treturn false;\n\t}",
"@Test\n public void compareTo() {\n Road road1 = new Road(cityA, cityB, 0);\n Road road2 = new Road(cityA, cityC, 1);\n Road road3 = new Road(cityB, cityA, 2);\n Road road4 = new Road(cityA, cityB, 3);\n /**Test of reflexivity x = x*/\n assertEquals(0,road1.compareTo(road1)); \n \n /**Test of transitivity of < a<b & b<c => a<c*/\n assertTrue(road1.compareTo(road2) < 0);\n assertTrue(road2.compareTo(road3) < 0);\n assertTrue(road1.compareTo(road3) < 0);\n \n /**Test of transitivity of > */\n assertTrue(road3.compareTo(road2) > 0);\n assertTrue(road2.compareTo(road1) > 0);\n assertTrue(road3.compareTo(road1) > 0);\n \n /**Test of antisymmetry a<=b & b<=a => a=b*/\n assertTrue(road1.compareTo(road4) >= 0);\n assertTrue(road1.compareTo(road4) <= 0);\n assertEquals(0,road1.compareTo(road4));\n \n /**Test of symmetry a=b <=> b=a*/\n assertEquals(0,road1.compareTo(road4));\n assertEquals(0,road4.compareTo(road1));\n assertTrue(road1.compareTo(road4) == road4.compareTo(road1));\n /**Both symmetry tests fail since the length of road1 and road4\n * are unequal. As a result we should compare lengths aswell,\n * however in the current iteration of the program we do not\n * need to compare lengths for the program to run as intended*/\n }",
"@Test\r\n public void testEquals() {\r\n Articulo art = new Articulo();\r\n articuloPrueba.setCodigo(1212);\r\n art.setCodigo(1212);\r\n boolean expResult = true;\r\n boolean result = articuloPrueba.equals(art);\r\n assertEquals(expResult, result);\r\n }",
"@Override\n public boolean equals(Object obj) {\n //Cast other side.\n Angle other = (Angle) obj;\n\n //Compare values.\n if (this.degrees() == other.degrees()) {\n return true;\n } else {\n return false;\n }\n }",
"@Override\n public boolean equals(Object other) {\n return this == other || (other instanceof Decouverte && hashCode() == other.hashCode());\n }",
"public boolean equals(Object other){\r\n Car nuCar = (Car)other;\r\n if(super.equals(nuCar)){\r\n if(this.model==nuCar.model&&this.AWD==nuCar.AWD){\r\n return true;\r\n }else{\r\n return false;\r\n }\r\n }else{\r\n return false;\r\n }\r\n\t}",
"protected boolean equalityTest(Object key, Object key2) {\n\t\t\treturn this.set.equalityTest(key, key2);\n\t\t}",
"@Override\r\n\tpublic int compareTo(final SlotRequirements other) {\n\t\tfinal int classNameCompared = this.getClass().getCanonicalName().compareTo(other.getClass().getCanonicalName());\r\n\t\tif (classNameCompared != 0) {\r\n\t\t\treturn classNameCompared;\r\n\t\t}\r\n\r\n\t\treturn featureCondition.compareTo(other.featureCondition);\r\n\t}",
"protected void assertSame(BytesRef lowerVal, BytesRef upperVal, boolean includeLower, boolean includeUpper) throws IOException {\n Query docValues = new ConstantScoreQuery(DocTermOrdsRangeFilter.newBytesRefRange(fieldName, lowerVal, upperVal, includeLower, includeUpper));\n MultiTermQuery inverted = new TermRangeQuery(fieldName, lowerVal, upperVal, includeLower, includeUpper);\n inverted.setRewriteMethod(MultiTermQuery.CONSTANT_SCORE_FILTER_REWRITE);\n\n TopDocs invertedDocs = searcher1.search(inverted, 25);\n TopDocs docValuesDocs = searcher2.search(docValues, 25);\n\n CheckHits.checkEqual(inverted, invertedDocs.scoreDocs, docValuesDocs.scoreDocs);\n }",
"@Override\n public DuelistRNG copy() {\n return new DuelistRNG(stateA, stateB);\n }",
"@Test\r\n public void testCompareTo() {\r\n Articulo art = new Articulo();\r\n art.setCantidadVendidos(3);\r\n articuloPrueba.setCantidadVendidos(3);\r\n int expResult = 0;\r\n int result = art.compareTo(articuloPrueba);\r\n assertEquals(expResult, result);\r\n }",
"public int compareTo(Object other) { \r\n\t\treturn Integer.compare(confidence, ((Candidate) other).getConfidence());\r\n\t}",
"public static void main(String[] args) {\n Test2 t2 = new Test2(\"Supriya\");// memory\r\n Test2 t3 = new Test2(\"Supriya\");//memory\r\n \r\n \r\n //Compares the memory allocation of objects\r\n System.out.println(t2.equals(t3));\r\n System.out.println(t2.hashCode());\r\n System.out.println(t3.hashCode());\r\n \r\n\t}"
] | [
"0.6342189",
"0.50823045",
"0.5053452",
"0.5031258",
"0.4969607",
"0.48975682",
"0.48920888",
"0.48717347",
"0.48672968",
"0.4850193",
"0.4821859",
"0.48209253",
"0.47980288",
"0.4758514",
"0.4740246",
"0.4697875",
"0.46701992",
"0.46628776",
"0.46241507",
"0.45981464",
"0.45930097",
"0.45903078",
"0.45803425",
"0.4571634",
"0.45669365",
"0.45615515",
"0.4561465",
"0.4551915",
"0.45499638",
"0.45461118",
"0.45243186",
"0.4518933",
"0.4518028",
"0.4517191",
"0.45155686",
"0.45077866",
"0.45050424",
"0.45038038",
"0.4503333",
"0.4497132",
"0.44963026",
"0.4487706",
"0.4480735",
"0.44783562",
"0.4477702",
"0.4469489",
"0.44690597",
"0.44690022",
"0.4464511",
"0.44638714",
"0.4460846",
"0.44541836",
"0.44496366",
"0.44418135",
"0.44414863",
"0.44399688",
"0.4433176",
"0.44320145",
"0.4431894",
"0.4429671",
"0.44273072",
"0.44269356",
"0.44248423",
"0.4422868",
"0.44219854",
"0.44164583",
"0.44031417",
"0.43983963",
"0.4398373",
"0.43969244",
"0.43965393",
"0.43947703",
"0.43919238",
"0.43906587",
"0.4388383",
"0.43856138",
"0.43827236",
"0.4381743",
"0.43813524",
"0.43811816",
"0.43803725",
"0.43719158",
"0.43682608",
"0.4367095",
"0.43634802",
"0.43619657",
"0.4359625",
"0.43494523",
"0.43485352",
"0.4346597",
"0.43440172",
"0.43437558",
"0.43310127",
"0.43288317",
"0.43235627",
"0.43192685",
"0.431696",
"0.43163437",
"0.43119168",
"0.43116713"
] | 0.7007571 | 0 |
Returns a hash code for this instance. | @Override
public int hashCode() {
int i;
int result = 17;
i = getIdacquirente();
result = 37*result + i;
return result;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int getHash() {\n return hash_;\n }",
"public int getHash() {\n return hash_;\n }",
"public int hashcode();",
"public int hashCode() {\n int hash = 104473;\n if (token_ != null) {\n // Obtain unencrypted form as common base for comparison\n byte[] tkn = getToken();\n for (int i=0; i<tkn.length; i++)\n hash ^= (int)tkn[i];\n }\n hash ^= (type_ ^ 14401);\n hash ^= (timeoutInterval_ ^ 21327);\n hash ^= (isPrivate() ? 15501 : 12003);\n if (getPrincipal() != null)\n hash ^= getPrincipal().hashCode();\n if (getSystem() != null)\n hash ^= getSystem().getSystemName().hashCode();\n return hash;\n }",
"int getHash();",
"public abstract int getHash();",
"public String identityHash() {\n return Integer.toHexString(System.identityHashCode(this));\n }",
"public int hashCode()\n {\n int i = 0;\n if ( hasCode() )\n i ^= getCode().hashCode();\n return i;\n }",
"public String getHash()\n {\n return hash;\n }",
"public int hashCode()\n {\n return hash;\n }",
"public String getHash() {\n return hash;\n }",
"public String getHash() {\n return hash;\n }",
"public String getHash() {\n return hash;\n }",
"public String getHashCode();",
"public int hashcode(){\r\n\t\t\r\n\t\treturn last_Name.hashcode();\r\n\t}",
"public int hashCode() {\n if (myhash == -1) {\n myhash = timestamp.hashCode() + signerCertPath.hashCode();\n }\n return myhash;\n }",
"public int hashCode() {\n return (name.ordinal() + 5) * 51;\n }",
"public String getHash() {\n\t\treturn hash;\n\t}",
"public int getHashCode(){\n return hashCode();\n }",
"public int hashCode()\n {\n if (this.hashValue == 0)\n {\n int result = 17;\n int wsidValue = this.getWsid() == null ? 0 : this.getWsid().hashCode();\n result = result * 37 + wsidValue;\n this.hashValue = result;\n }\n return this.hashValue;\n }",
"public String getHash() {\n return hash;\n }",
"public int hashCode() {\n int hash = UtilConstants.HASH_INITIAL;\n hash = hash * UtilConstants.HASH_PRIME + (userId != null ? userId.hashCode() : 0);\n hash = hash * UtilConstants.HASH_PRIME + (role != null ? role.hashCode() : 0);\n return hash;\n }",
"public int hashCode()\n {\n int hash = 7;\n hash = 83 * hash + (counter != null ? counter.hashCode() : 0);\n return hash;\n }",
"public int hashCode() {\n final int HASH_MULTIPLIER = 29;\n int h = HASH_MULTIPLIER * FName.hashCode() + LName.hashCode();\n h = HASH_MULTIPLIER * h + ((Integer)ID).hashCode();\n return h;\n }",
"public int hashCode() {\n\t\treturn BeanTools.createHashcode(id, consultContent, consultTime);\r\n\t}",
"public int hashCode()\n {\n int code = 0;\n int i;\n int shift = 0;\n \n \t\tint byteLength = getLengthInBytes();\n for( i = 0; i < byteLength; i++)\n {\n code ^= (value[i] & 0xff)<<shift;\n shift += 8;\n if( 32 <= shift)\n shift = 0;\n }\n return code;\n }",
"public String getHash() {\n\t\treturn _hash;\n\t}",
"public int hashCode() {\n if (hashCode != 0){\n return hashCode;\n }\n return hashCode = computeHash();\n }",
"com.google.protobuf.ByteString getHash();",
"com.google.protobuf.ByteString getHash();",
"public int hashCode() {\n return 37 * 17;\n }",
"public int hashCode() {\n\t\t// simple recipe for generating hashCode given by\n\t\t// Effective Java (Addison-Wesley, 2001)\n\t\tint result = 17;\n\t\tresult = 37 * result + methodName.hashCode();\n\t\treturn result;\n\t}",
"public int hashCode() {\n return hash.hashCode();\n }",
"@Override\n public int hashCode()\n {\n return new HashCodeBuilder(17, 31).\n append(_name).\n toHashCode();\n }",
"public int hashCode() {\r\n int result = 17;\r\n result = xCH(result, getTableDbName());\r\n result = xCH(result, getMemberAddressId());\r\n return result;\r\n }",
"public String getHash() {\n byte[] bArr = new byte[21];\n bArr[0] = (byte) getCTxDestinationType().getValue();\n System.arraycopy(this.mData, 0, bArr, 1, 20);\n return StringToolkit.bytesToString(bArr);\n }",
"public int hashCode() {\n return Objects.hashCode(this);\n }",
"public int hashCode() {\n // For speed, this hash code relies only on the hash codes of its select\n // and criteria clauses, not on the from, order by, or option clauses\n int myHash = 0;\n myHash = HashCodeUtil.hashCode(myHash, this.operation);\n myHash = HashCodeUtil.hashCode(myHash, getProjectedQuery());\n return myHash;\n }",
"@Override\n public int hashCode() {\n if (hash == 0)\n hash = MD5.getHash(owner.getLogin() + description).hashCode();\n return hash;\n }",
"@Override\n public int hashCode() {\n return new HashCodeBuilder(17, 37)\n .append(getName())\n .append(getType())\n .toHashCode();\n }",
"public int hashCode() {\n int hash = 0;\n hash = width;\n hash <<= 8;\n hash ^= height;\n hash <<= 8;\n hash ^= numBands;\n hash <<= 8;\n hash ^= dataType;\n hash <<= 8;\n for (int i = 0; i < bandOffsets.length; i++) {\n hash ^= bandOffsets[i];\n hash <<= 8;\n }\n for (int i = 0; i < bankIndices.length; i++) {\n hash ^= bankIndices[i];\n hash <<= 8;\n }\n hash ^= numBands;\n hash <<= 8;\n hash ^= numBanks;\n hash <<= 8;\n hash ^= scanlineStride;\n hash <<= 8;\n hash ^= pixelStride;\n return hash;\n }",
"@java.lang.Override\n public com.google.protobuf.ByteString getHash() {\n return hash_;\n }",
"@java.lang.Override\n public com.google.protobuf.ByteString getHash() {\n return hash_;\n }",
"public int hashCode() {\n\t\tlong code = 0;\n\t\tint elements = _rowCount * _columnCount;\n\n\t\tfor (int i = 0; i < elements; i++) {\n\t\t\tcode += _value[i];\n\t\t}\n\n\t\treturn (int) code;\n\t}",
"String getHashAlgorithm();",
"public int hashCode(){\n int hash = HashCodeUtil.SEED;\n\n hash = HashCodeUtil.hash(hash,getEventTimeMillis());\n hash = HashCodeUtil.hash(hash,getEventId());\n hash = HashCodeUtil.hash(hash,getAuthenticationType());\n hash = HashCodeUtil.hash(hash,getServiceHost());\n hash = HashCodeUtil.hash(hash,getRequesterIp());\n hash = HashCodeUtil.hash(hash,getSessionId());\n hash = HashCodeUtil.hash(hash,getResourceHost());\n hash = HashCodeUtil.hash(hash,getPrincipalName());\n hash = HashCodeUtil.hash(hash,getEventType());\n hash = HashCodeUtil.hash(hash,getServiceId());\n hash = HashCodeUtil.hash(hash,getResourceId());\n\n\n return hash;\n\n }",
"@java.lang.Override\n public com.google.protobuf.ByteString getHash() {\n return hash_;\n }",
"@java.lang.Override\n public com.google.protobuf.ByteString getHash() {\n return hash_;\n }",
"public byte[] getHash() {\n\t\treturn generatedHash;\n\t}",
"String getHash();",
"String getHash();",
"public String getHash()\n\t{\n\t\tif(isModified) generateHash();\n\t\treturn hash;\n\t}",
"public int generateHashCode() {\n int code = getClass().hashCode();\n ASTSpanInfo temp_info = getInfo();\n code ^= temp_info.hashCode();\n LHS temp_obj = getObj();\n code ^= temp_obj.hashCode();\n Expr temp_index = getIndex();\n code ^= temp_index.hashCode();\n return code;\n }",
"public int hashCode() {\n int result = 17;\n result = (37 * result)\n + ((nullCheck == null) ? 0 : nullCheck.hashCode());\n\n return result;\n }",
"public int generateHashCode() {\n int code = getClass().hashCode();\n boolean temp_fromSource = isFromSource();\n code ^= temp_fromSource ? 1231 : 1237;\n IRId temp_name = getName();\n code ^= temp_name.hashCode();\n List<IRId> temp_params = getParams();\n code ^= temp_params.hashCode();\n List<IRStmt> temp_args = getArgs();\n code ^= temp_args.hashCode();\n List<IRFunDecl> temp_fds = getFds();\n code ^= temp_fds.hashCode();\n List<IRVarStmt> temp_vds = getVds();\n code ^= temp_vds.hashCode();\n List<IRStmt> temp_body = getBody();\n code ^= temp_body.hashCode();\n return code;\n }",
"public int hashCode()\n {\n return (int)(swigCPtr^(swigCPtr>>>32));\n }",
"public int hashCode() {\n if (hash == -1) {\n hash = 0;\n byte b[] = packet.getData();\n int len = b.length;\n for (int ix = 0; ix < len; ix++) {\n\thash = 31 * hash + b[ix];\n }\n hash ^= (packet.getAddress().hashCode() ^\n\t (packet.getPort() << 15) ^\n\t (packet.getLength() << 3) ^\n\t (packet.getOffset() << 8));\n }\n return hash;\n }",
"public int hashCode() {\n int result;\n result = (this.time != null ? this.time.hashCode() : 0);\n result = 29 * result + (this.value != null ? this.value.hashCode() : 0);\n return result;\n }",
"@Override\n public int hashCode() {\n \n final int code = 24;\n int result = 1;\n result = code * result + ((id == null) ? 0 : id.hashCode());\n return result;\n }",
"private int getHash() {\n return (name + FluentIterable.from(getDimensions()).transform(new Function<CloudConfigurationDimension, String>() {\n @Override\n public String apply(CloudConfigurationDimension dimension) {\n return getStringRepresentation(dimension);\n }\n }).toString()).hashCode();\n }",
"public HashCode() {\n mVal = SEED;\n }",
"@Override\n public int hashCode() {\n // Declare hash and assign value\n int hash = 7;\n // Generate hash integer\n hash = 31 * hash + (int) this.getCrossingTime();\n hash = 31 * hash + (this.getName() == null ? 0 : this.getName().hashCode());\n return hash;\n }",
"public int hashCode() {\n return new HashCodeBuilder(7, 29)\n .append(meaning)\n .append(type)\n .append(target)\n .toHashCode(); \n }",
"public int hashCode() {\n return HashFunction.hashCode(new int[] { statusUuid.hashCode(), pathUuid.hashCode(), (int) time });\n }",
"@Override\n\tpublic int hashCode() {\n\t\t\n\t\treturn (int)id * name.hashCode() * email.hashCode();\n\t\t//int hash = new HashCodeBuilder(17,37).append(id).append(name); //can be added from Apache Commons Lang's HashCodeBuilder class\n\t}",
"public byte[] getHash() {\n\t\treturn _hash.getDataID();\n\t}",
"public int hashCode() {\n\t\treturn toString().hashCode();\n\t}",
"public int hashCode() {\r\n\t\treturn this.value().hashCode();\r\n\t}",
"public int hashCode()\n {\n int i = 0;\n if ( hasHashKey() )\n i ^= getHashKey().hashCode();\n return i;\n }",
"public int hashCode()\n {\n int hash = this.getClass().hashCode();\n\n hash = ( hash << 1 | hash >>> 31 ) ^ Arrays.hashCode(genome);\n\n return hash;\n }",
"public int hashCode() {\n int hash = UtilConstants.HASH_INITIAL;\n hash = hash * UtilConstants.HASH_PRIME + (userId != null ? userId.hashCode() : 0);\n hash = hash * UtilConstants.HASH_PRIME + (projectId != null ? projectId.hashCode() : 0);\n return hash;\n }",
"public int hashCode()\n {\n int result = 17;\n result = 37 * result + this.m_exceptionFrequency;\n result = 37 * result + this.exception_program_number;\n return result;\n }",
"public int hashCode() {\n\t\treturn new HashCodeBuilder().append(obox).append(wordOffsets).append(occlusions).toHashCode();\n\t}",
"@Override\n public int hashCode() {\n int hash = 7;\n hash = 29 * hash + Objects.hashCode(this.id);\n hash = 29 * hash + Objects.hashCode(this.name);\n return hash;\n }",
"protected int computeHashCode() {\n return flags * 17\n + (var != null ? var.hashCode() : 0)\n + (num != null ? num.hashCode() : 0)\n + (str != null ? str.hashCode() : 0)\n + (object_labels != null ? object_labels.hashCode() : 0)\n + (getters != null ? getters.hashCode() : 0)\n + (setters != null ? setters.hashCode() : 0)\n + (excluded_strings != null ? excluded_strings.hashCode() : 0)\n + (included_strings != null ? included_strings.hashCode() : 0)\n + (functionPartitions != null ? functionPartitions.hashCode() : 0)\n + (functionTypeSignatures != null ? functionTypeSignatures.hashCode() : 0);\n }",
"public String getHashType() {\n\t\treturn _hash_type;\n\t}",
"public int hashCode() {\n try {\n int res = 0;\n byte[] array = getEncoded();\n for (int i=0; i<array.length; i++) {\n res += array[i] & 0xFF;\n }\n return res;\n } catch (CRLException e) {\n return 0;\n }\n }",
"public String getHashValue() {\n return hashValue;\n }",
"public int hashCode() {\n\t\treturn this.eid + 25;\n\t}",
"public int hashCode() {\n int result = 17;\n\n if (_address != null) {\n result = 37 * result + _address.hashCode();\n }\n\n return result;\n }",
"public int hashCode()\r\n {\r\n int hash = super.hashCode();\r\n hash ^= hashValue( m_name );\r\n hash ^= hashValue( m_classname );\r\n if( m_implicit )\r\n {\r\n hash ^= 35;\r\n }\r\n hash ^= hashValue( m_production );\r\n hash ^= hashArray( m_dependencies );\r\n hash ^= hashArray( m_inputs );\r\n hash ^= hashArray( m_validators );\r\n hash ^= hashValue( m_data );\r\n return hash;\r\n }",
"public int hashCode();",
"public int hashCode();",
"public int hashCode();",
"public int hashCode();",
"public int hashCode() {\r\n\t\treturn this.iD;\r\n\t}",
"@Override\n public int hashCode() {\n return System.identityHashCode(this);\n }",
"public final int hashCode() {\r\n return _value;\r\n }",
"public int hashCode() {\n\t\treturn hashString.hashCode();\n\t}",
"@Override\n public int hashCode() {\n int hash = 3;\n hash = 97 * hash + this.x;\n hash = 97 * hash + this.y;\n return hash;\n }",
"@Override\n public int hashCode() {\n return System.identityHashCode(this);\n }",
"int computeHashCode(byte val);",
"public int hashCode() {\n long hash = UtilConstants.HASH_INITIAL;\n hash = hash * UtilConstants.HASH_PRIME + objectHashCode(getProjectName());\n hash = hash * UtilConstants.HASH_PRIME + objectHashCodeFK(getDataProvider());\n hash = hash * UtilConstants.HASH_PRIME + objectHashCodeFK(getPrimaryInvestigator());\n hash = hash * UtilConstants.HASH_PRIME + objectHashCodeFK(getCreatedBy());\n hash = hash * UtilConstants.HASH_PRIME + objectHashCode(getCreatedTime());\n return (int)(hash % Integer.MAX_VALUE);\n }",
"public synchronized int hashCode() {\n\t\treturn super.hashCode();\n\t}",
"@Override\n public int hashCode() {\n int i;\n int result = 17;\n if (getMasp() == null) {\n i = 0;\n } else {\n i = getMasp().hashCode();\n }\n result = 37*result + i;\n return result;\n }",
"int hashCode();",
"int hashCode();",
"public abstract int hashCode();",
"public static int calculateHash(final Class klass) {\n return klass.getName().hashCode();\n }",
"public int hashCode()\r\n {\r\n if (this.hashValue == 0)\r\n {\r\n int result = 17;\r\n int purSubcateIdValue = this.getId() == null ? 0 : this.getId().hashCode();\r\n result = result * 37 + purSubcateIdValue;\r\n this.hashValue = result;\r\n }\r\n return this.hashValue;\r\n }",
"@Override\n\tpublic int hashCode() {\n\t\treturn new HashCodeBuilder(17, 37).append(id).append(code).append(nom).append(prix).toHashCode();\n\t}"
] | [
"0.7660051",
"0.76481766",
"0.7641668",
"0.7474032",
"0.73277396",
"0.73142415",
"0.73102975",
"0.7233651",
"0.7220492",
"0.72138613",
"0.7206837",
"0.7206837",
"0.7206837",
"0.72063285",
"0.71886986",
"0.7164714",
"0.716034",
"0.71597964",
"0.7157775",
"0.7152946",
"0.71488506",
"0.71439546",
"0.7142069",
"0.7137377",
"0.7128508",
"0.7123235",
"0.71229494",
"0.71144325",
"0.71072555",
"0.71072555",
"0.70877457",
"0.7087613",
"0.70685095",
"0.70649415",
"0.7053272",
"0.7052462",
"0.70502275",
"0.70343924",
"0.70327294",
"0.70212317",
"0.7019078",
"0.70108783",
"0.70108783",
"0.69899476",
"0.6984861",
"0.69782454",
"0.6976491",
"0.6976491",
"0.69737375",
"0.6970315",
"0.6970315",
"0.69675684",
"0.6967354",
"0.69590586",
"0.69581074",
"0.6955162",
"0.69455725",
"0.6944045",
"0.6942423",
"0.69357103",
"0.6932128",
"0.6927809",
"0.6923607",
"0.6906221",
"0.69003165",
"0.6897704",
"0.6894831",
"0.6892054",
"0.6889492",
"0.6870526",
"0.6866945",
"0.68513834",
"0.6851196",
"0.6844494",
"0.68361795",
"0.68349576",
"0.682697",
"0.68071973",
"0.6800529",
"0.680003",
"0.6794484",
"0.67932636",
"0.67932636",
"0.67932636",
"0.67932636",
"0.6787286",
"0.6783861",
"0.6768362",
"0.6767",
"0.6756561",
"0.67560595",
"0.6754364",
"0.67468345",
"0.67061454",
"0.6701292",
"0.6699024",
"0.6699024",
"0.6698271",
"0.6697763",
"0.6697667",
"0.6696493"
] | 0.0 | -1 |
Returns a debugfriendly String representation of this instance. | @Override
public String toString() {
StringBuffer sb = new StringBuffer("[Acquirente |");
sb.append(" idacquirente=").append(getIdacquirente());
sb.append("]");
return sb.toString();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String toDebugString() {\n StringBuffer str = new StringBuffer(mySelf()+\"\\n\");\n return str.toString();\n }",
"public String toDebugString() {\n StringBuffer str = new StringBuffer(mySelf()+\"\\n\");\n return super.toDebugString()+str.toString();\n }",
"public String toDebugString();",
"public String toString() {\n\t\treturn (\"Debug: \" + booleanToString(debugMode)\n\t\t\t\t+ \"\\nFPS: \" + booleanToString(fpsDisplay)\n\t\t\t\t+ \"\\nDecals: \" + booleanToString(decalsEnabled)\n\t\t\t\t+ \"\\nDecal Limiter: \" + booleanToString(decalLimitEnabled)\n\t\t\t\t+ \"\\nSound: \" + booleanToString(soundEnabled)\n\t\t\t\t+ \"\\nSound-Ambience: \" + booleanToString(soundAmbience)\n\t\t\t\t+ \"\\nSound-Shotgun: \" + booleanToString(soundShot)\n\t\t\t\t+ \"\\nSound-Duck: \" + booleanToString(soundDuck));\n\t}",
"public String toString() { return stringify(this, true); }",
"public String toString()\n\t{\n\t\treturn Printer.stringify(this, false);\n\t}",
"public String toString() {\n StringBuilder sb = new StringBuilder();\n\n sb.append(super.toString());\n sb.append(this.locals.toString());\n sb.append(\"At: \" + this.stage + \"stage\\n\");\n\n return sb.toString();\n }",
"@Override\n public String toString() {\n final Map<String, Object> augmentedToStringFields = Reflect.getStringInstanceVarEntries(this);\n augmentToStringFields(augmentedToStringFields);\n return Reflect.joinStringMap(augmentedToStringFields, this);\n }",
"public String toString() {\n return ToStringBuilder.reflectionToString(this);\n }",
"@Override\n\tpublic String toStringDebug() {\n\t\treturn null;\n\t}",
"public String toString() {\n return toDisplayString();\n }",
"public String toString() {\n\t\t//TODO add your own field name here\t\t\n\t\t//return buffer.append(this.yourFieldName).toString();\n\t\treturn \"\";\n\t}",
"public String toString() {\n StringWriter writer = new StringWriter();\n this.write(writer);\n return writer.toString();\n }",
"@Override\n public String getDebugString() {\n return _model.toString();\n }",
"public String toString() {\n\t\treturn toString(this);\n\t}",
"public String getDumpString() {\n return \"[clazz = \" + clazz + \" , name = \" + name + \" , elementType = \" + elementType + \" , primitivePointerType = \" + primitivePointerType + \"]\";\n }",
"public java.lang.String toDebugString () { throw new RuntimeException(); }",
"@Override\n public final String toString() {\n return asString(0, 4);\n }",
"public String toString() {\n\t\treturn toString(true);\n\t}",
"@Override()\n public String toString()\n {\n final StringBuilder buffer = new StringBuilder();\n toString(buffer);\n return buffer.toString();\n }",
"@Override\n public String toString() {\n // TODO: Using Serializer\n return Serializer.toByteArray(this).toString();\n }",
"@Override\n\tpublic String toString() {\n\t\treturn toStringBuilder(new StringBuilder()).toString();\n\t}",
"public String debugDump() {\n stringRepresentation = \"\";\n sprint(\"SIPMessage:\");\n sprint(\"{\");\n try {\n \n Field[] fields = this.getClass().getDeclaredFields();\n for (int i = 0; i < fields.length; i++) {\n Field f = fields [i];\n Class fieldType = f.getType();\n String fieldName = f.getName();\n if (f.get(this) != null &&\n Class.forName(SIPHEADERS_PACKAGE + \".SIPHeader\").\n isAssignableFrom(fieldType) &&\n fieldName.compareTo(\"headers\") != 0 ) {\n sprint(fieldName + \"=\");\n sprint(((SIPHeader)f.get(this)).debugDump());\n }\n }\n } catch ( Exception ex ) {\n InternalErrorHandler.handleException(ex);\n }\n \n \n sprint(\"List of headers : \");\n sprint(headers.toString());\n sprint(\"messageContent = \");\n sprint(\"{\");\n sprint(messageContent);\n sprint(\"}\");\n if (this.getContent() != null) {\n sprint(this.getContent().toString());\n }\n sprint(\"}\");\n return stringRepresentation;\n }",
"public String toString() {\n\t\treturn super.toString();\n\t\t// This gives stack overflows:\n\t\t// return ToStringBuilder.reflectionToString(this);\n\t}",
"public String toString() {\n StringBuffer buffer = new StringBuffer(getClass().getName());\n\n buffer.append(\": \");\t\t\t\t//NOI18N\n buffer.append(\" name: \");\t\t\t//NOI18N\n buffer.append(getName());\n buffer.append(\", logging level: \");\t//NOI18N\n buffer.append(toString(getLevel()));\n\n return buffer.toString();\n }",
"public String debugInformation()\n\t\t{\n\t\t\treturn debugInformation;\n\t\t}",
"public String toDebugString() {\n\t\tString text = \"[ \";\n\t\tfor (int i = 0; i < data.length; i++)\n\t\t\ttext += data[i] + (i < data.length - 1 ? \", \" : \" ]\");\n\t\treturn text;\n\t}",
"@Override\n public String toString() {\n return new Gson().toJson(this);\n }",
"public String toString(){\r\n\t\tString superString = super.toString();\r\n\t\tStringBuilder builder = new StringBuilder();\r\n\t\t//Add the object to the string\r\n\t\tbuilder.append(\". \");\r\n\t\tif (this.error != null) {\r\n\t\t\tbuilder.append(error.toString());\r\n\t\t\tbuilder.append(\". \");\r\n\t\t}\r\n\t\tbuilder.append(\"Object: \");\r\n\t\tbuilder.append(object.toString());\r\n\t\tif (this.recordRoute)\r\n\t\t\tbuilder.append(\", [RECORD_ROUTE]\");\r\n\t\tif (this.reRouting) \r\n\t\t\tbuilder.append(\", [RE-ROUTING]\");\r\n\t\t//Add the masks to the string\r\n\t\tif (this.mask != null) {\r\n\t\t\tbuilder.append(\", label set: \");\r\n\t\t\tbuilder.append(mask.toString());\r\n\t\t}\r\n\t\treturn superString.concat(builder.toString());\r\n\t}",
"@Override\n public String toString() {\n return toString(false, true, true, null);\n }",
"@Override\n public String toString() {\n return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE);\n }",
"public String toString() {\n\t\treturn this.toJSON().toString();\n\t}",
"public String toString() {\n\t\treturn this.toJSON().toString();\n\t}",
"public String toString()\n {\n return getClass().getName() + \n \t\t\" name=\" + name +\n \t\t\"\\n Movement=\" + movement + \n \t\t\"\\n Weapon Skill=\" + weaponSkill + \n \t\t\"\\n Balistic Skill=\" + balisticSkill +\n \t\t\"\\n Strength=\" + strength +\n \t\t\"\\n Toughness=\" + toughness +\n \t\t\"\\n Wounds=\" + wounds +\n \t\t\"\\n Initiative=\" + strength +\n \t\t\"\\n Attacks=\" + attacks ;\n }",
"public String toString(){\n String s = (\"Name: \" + this.name + \" Top Speed: \" + this.topSpeed);\n System.out.println(s);\n return s;\n }",
"public static String debugString()\n {\n return\n \"ECSDefaults:\" + '\\n'\n + '\\t' + \"DefaultFilterState=\" + getDefaultFilterState() +'\\n'\n + '\\t' + \"DefaultFilterAttributeState=\" + getDefaultFilterAttributeState() +'\\n'\n + '\\t' + \"DefaultAttributeEqualitySign='\" + getDefaultAttributeEqualitySign() +\"'\\n\"\n + '\\t' + \"DefaultBeginStartModifier='\" + getDefaultBeginStartModifier() + \"'\\n\"\n + '\\t' + \"DefaultEndStartModifier='\" + getDefaultEndStartModifier() + \"'\\n\"\n + '\\t' + \"DefaultBeginEndModifier='\" + getDefaultBeginEndModifier() + \"'\\n\"\n + '\\t' + \"DefaultEndEndModifier='\" + getDefaultEndEndModifier() + \"'\\n\"\n + '\\t' + \"DefaultAttributeQuoteChar=\" + getDefaultAttributeQuoteChar() + '\\n'\n + '\\t' + \"DefaultAttributeQuote=\" + getDefaultAttributeQuote() +'\\n'\n + '\\t' + \"DefaultEndElement=\" + getDefaultEndElement() +'\\n'\n + '\\t' + \"DefaultCodeset='\" + getDefaultCodeset() + \"'\\n\"\n + '\\t' + \"DefaultPosition=\" + getDefaultPosition() +'\\n'\n + '\\t' + \"DefaultCaseType=\" + getDefaultCaseType() +'\\n'\n + '\\t' + \"DefaultStartTag='\" + getDefaultStartTag() + \"'\\n\"\n + '\\t' + \"DefaultEndTag='\" + getDefaultEndTag() + \"'\\n\"\n + '\\t' + \"DefaultPrettyPrint=\" + getDefaultPrettyPrint();\n }",
"public String toString() {\n\t\treturn toString(0, 0);\n\t}",
"public String toString() {\n\t\treturn EPPUtil.toString(this);\n\t}",
"public String toString() {\n\t\treturn EPPUtil.toString(this);\n\t}",
"public String toString ( ) {\r\n String returnString = _name + \"{ id: \" + _uniqueID + \" pos: [\"+ getPosition().getPosition() + \"] }\";\r\n return returnString;\r\n }",
"public String toString() {\n return\n getLatitude(\"\") + \"|\" +\n getLongitude(\"\") + \"|\" +\n getDepth(\"\") + \"|\" +\n getTemperatureMin(\"\") + \"|\" +\n getTemperatureMax(\"\") + \"|\" +\n getSalinityMin(\"\") + \"|\" +\n getSalinityMax(\"\") + \"|\" +\n getOxygenMin(\"\") + \"|\" +\n getOxygenMax(\"\") + \"|\" +\n getNitrateMin(\"\") + \"|\" +\n getNitrateMax(\"\") + \"|\" +\n getPhosphateMin(\"\") + \"|\" +\n getPhosphateMax(\"\") + \"|\" +\n getSilicateMin(\"\") + \"|\" +\n getSilicateMax(\"\") + \"|\" +\n getChlorophyllMin(\"\") + \"|\" +\n getChlorophyllMax(\"\") + \"|\";\n }",
"@Override\n public String toString() {\n return new JSONSerializer().serialize(this);\n }",
"public String toString() {\n\t\treturn String.format(\"%s\\nID: %d\\nDescription: %s\\n\", name.toUpperCase(), id, description); \n\t}",
"public String toString() {\n StringBuilder stringBuilder = new StringBuilder(40);\n stringBuilder.append(\"property '\").append(this.getName()).append(\"' (\");\n if (this._accessorMethod != null) {\n stringBuilder.append(\"via method \").append(this._accessorMethod.getDeclaringClass().getName()).append(\"#\").append(this._accessorMethod.getName());\n } else {\n stringBuilder.append(\"field \\\"\").append(this._field.getDeclaringClass().getName()).append(\"#\").append(this._field.getName());\n }\n if (this._serializer == null) {\n stringBuilder.append(\", no static serializer\");\n } else {\n stringBuilder.append(\", static serializer of type \" + this._serializer.getClass().getName());\n }\n stringBuilder.append(')');\n return stringBuilder.toString();\n }",
"public String toString() {\n StringBuffer buffer = new StringBuffer();\n\n buffer.append(getClass().getName());\n buffer.append(\"@\");\n buffer.append(Integer.toHexString(hashCode()));\n buffer.append(\" [\");\n buffer.append(objectToString(\"Id\", getId()));\n buffer.append(objectToString(\"ProjectName\", getProjectName()));\n buffer.append(objectToStringFK(\"DataProvider\", getDataProvider()));\n buffer.append(objectToStringFK(\"PrimaryInvestigator\", getPrimaryInvestigator()));\n buffer.append(objectToStringFK(\"CreatedBy\", getCreatedBy()));\n buffer.append(objectToString(\"CreatedTime\", getCreatedTime()));\n buffer.append(\"]\");\n\n return buffer.toString();\n }",
"@Override\r\n public String dumpOf ()\r\n {\r\n StringBuilder sb = new StringBuilder();\r\n\r\n if (evaluation != null) {\r\n sb.append(String.format(\" evaluation=%s%n\", evaluation));\r\n }\r\n\r\n Shape physical = (getShape() != null) ? getShape().getPhysicalShape() : null;\r\n if (physical != null) {\r\n sb.append(String.format(\" physical=%s%n\", physical));\r\n }\r\n\r\n if (forbiddenShapes != null) {\r\n sb.append(String.format(\" forbiddenShapes=%s%n\", forbiddenShapes));\r\n }\r\n\r\n if (timeRational != null) {\r\n sb.append(String.format(\" rational=%s%n\", timeRational));\r\n }\r\n\r\n return sb.toString();\r\n }",
"public String toString(){\n\t\treturn \"<== at \" + time + \": \" + name + \", \" + type + \", \" + data + \"==>\"; \n\t}",
"@Override\n public String toString()\n {\n StringBuilder builder = new StringBuilder();\n dump(builder, 0, '\\'');\n return builder.toString();\n }",
"@Override\n public String toString() {\n String str = \"\";\n\n //TODO: Complete Method\n\n return str;\n }",
"@Override\n\tpublic String toString() {\n\t\treturn this.toAnticipatedString();\n\t}",
"@Override\n\tpublic String toString() {\n\t\tif (repr == null)\n\t\t\trepr = toString(null);\n\n\t\treturn repr;\n\t}",
"public String toString() {\n StringBuffer buffer = new StringBuffer();\n\n buffer.append(getClass().getName());\n buffer.append(\"@\");\n buffer.append(Integer.toHexString(hashCode()));\n buffer.append(\" [\");\n buffer.append(objectToString(\"Id\", getId()));\n buffer.append(objectToStringFK(\"Project\", getProject()));\n buffer.append(objectToStringFK(\"User\", getUser()));\n buffer.append(objectToString(\"Status\", getStatus()));\n buffer.append(objectToString(\"LastActivityDate\", getLastActivityDate()));\n buffer.append(objectToString(\"HasPiSeen\", getHasPiSeen()));\n buffer.append(objectToString(\"HasDpSeen\", getHasDpSeen()));\n buffer.append(objectToString(\"HasAdminSeen\", getHasAdminSeen()));\n buffer.append(objectToString(\"HasRequestorSeen\", getHasRequestorSeen()));\n buffer.append(objectToString(\"EmailStatus\", getEmailStatus()));\n buffer.append(\"]\");\n\n return buffer.toString();\n }",
"public String toString()\n {\n return ClassHelper.getSimpleName(getClass()) +\n \"{InsertAllowed=\" + m_fInsert +\n \", ReturnRequired=\" + m_fReturn +\n \", Map=\" + m_map + '}';\n }",
"@Override\r\n\tpublic String toString() {\n\t\tString str = \"\";\r\n\t\treturn str;\r\n\t}",
"@Override\n public String toString() {\n ObjectMapper mapper = new ObjectMapper();\n try {\n return mapper.writeValueAsString(this);\n } catch (JsonProcessingException e) {\n return null;\n }\n }",
"public String toString() {\n\n\t\treturn Utilities.cutHeadAtLast(this.getClass().getName(), '.');\n\t}",
"public String toString() {\n\t\tString blawk = \"X: \" + getLocation().getX() + \", Y: \" + getLocation().getY() + \", Id: \" + getId();\n\t\treturn blawk;\n\t}",
"@Override\n public String toString() {\n ByteArrayOutputStream bs = new ByteArrayOutputStream();\n PrintStream out = new PrintStream(bs);\n output(out, \"\");\n return bs.toString();\n }",
"public String toString() {\r\n return buildDisplayString(InternalUtil.toClassTitle(this), true, true);\r\n }",
"@Override\n public String toString() {\n return new GsonBuilder().serializeNulls().create().toJson(this).toString();\n }",
"public String toString() {\n String text = TAB + \"Name: \" + this.name + lineSeparator()\n + Ui.formatMessage(\"Address: \" + this.address, MAX_LINE_LENGTH)\n + lineSeparator() + TAB\n + \"Faculty: \" + this.faculty + lineSeparator() + TAB\n + \"Port: \" + this.hasPort + lineSeparator() + TAB\n + \"Indoor: \" + this.isIndoor + lineSeparator() + TAB\n + \"Maximum number of Pax: \" + this.maxPax;\n String line = TAB + \"__________________________________________________________\";\n return line + lineSeparator() + text + lineSeparator() + line;\n }",
"public String toString() {\r\n\t\treturn \"Name: \" + name + \"\\nAddress: \" + addr + \"\\n\" + city + \"\\n\"\r\n\t\t\t\t+ state + \"\\n\" + zip + \"\\nPhone: \" + phone + \"\\nId: \" + id\r\n\t\t\t\t+ \"\\nMajor: \" + major + \"\\nGPA: \" + gpa;\r\n\t}",
"public String toString() {\n if (displayString == null)\n {\n displayString = this.exchange + ':' + this.firmNumber + ':' + classKey;\n }\n return displayString;\n }",
"@Override\n public String toString()\n {\n return this.toLsString();\n }",
"public String toString() {\n\t\treturn geoCoordinate.toString() + \" | \" + name + \" | \" + description;\n\t}",
"public final String toString() {\r\n final String result = String.format(\r\n \"%s(%d,%d,%d): %s\", this.source, this.line, this.start, this.end, this.message\r\n );\r\n\r\n return result.replaceAll(\"<unknown>\", \"\");\r\n }",
"public String toString(){\r\n\t\tString output=\"\";\r\n\t\toutput+=super.toString();\r\n\t\treturn output;\r\n\t}",
"public String toString()\n\t{\n\t\treturn \"Given Name: \" + givenName + \"\\t\" + \"Surname: \" + surname + \"\\t\" + \"Street Address: \" + streetAddress + \"\\t\" + \"City: \" + city + \"\\t\" + \"State: \" + state + \"\\t\" + \"Zip Code: \" + zipCode + \"\\t\" + \"Blood Type: \" + bloodType + \"\\t\" + \"Rhesus Factor: \" + rhesus + \".\";\n\t}",
"public String toString(){\n String s = \"id: \" + Byte.toString(id) + \" \";\n s+= \"name: \"+name+ \" \";\n s+= \"hp: \" + Byte.toString(hp) + \" \";\n s+= \"xPos: \" + Short.toString(xPos)+\" \";\n s+= \"yPos: \" + Short.toString(yPos)+\"\\n\";\n for (Pair<Byte,Short> pair : weapons){\n s+= \"weaponId: \" + Byte.toString(pair.getKey()) + \" \" + \"ammo: \" + Short.toString(pair.getValue())+'\\n';\n }\n s+= \"Bullets fired:\"+'\\n';\n for(Bullet b : bulletsFired){\n s+= b.toString()+'\\n';\n }\n s+= \"Weapons tracked:\"+'\\n';\n for(Byte b : weaponEntryTracker){\n s+= Byte.toString(b)+'\\n';\n }\n s+= \"initial y: \" +Short.toString(initial_y)+'\\n';\n s+= \"current weapon: \" + Byte.toString(currentWeapon.getKey()) + \" ammo: \" + Short.toString(currentWeapon.getValue())+'\\n';\n s+= \"shooting direction: \" +Short.toString(shootingDirection)+'\\n';\n return s;\n }",
"public String toString()\n {\n return id() + location().toString() + direction().toString();\n }",
"@Override\n\tpublic String toString() {\n\t\treturn toText();\n\t}",
"@Override\r\n\tpublic String toString() {\r\n\t\treturn MoreObjects.toStringHelper(this) //\r\n\t\t\t\t.add(\"id\", getId()) //\r\n\t\t\t\t.add(\"parameter\", getParameter()) //\r\n\t\t\t\t.add(\"value\", getValue()) //\r\n\t\t\t\t.add(\"hieraAddress\", getHieraAddress()) //\r\n\t\t\t\t.toString();\r\n\t}",
"@Override\n public final String toString()\n {\n StringBuilder sb = new StringBuilder(64);\n appendDesc(sb);\n return sb.toString();\n }",
"@Override\n public String toString() {\n return Helper.concat(this.getClass().getName(), \"{\",\n \"id:\", getId(),\n \", name:\", getName(),\n \", positions:\", positions,\n \", resourceRoles:\", resourceRoles,\n \"}\");\n }",
"public String toString() {\n\t\treturn this;\n\t}",
"@Override\n public String toString() {\n return info();\n }",
"@Override public String toString()\n {\n return String.format( \"\\t\\t\\t[ type:'%s', name:'%s', md5:'%s', local:'%s'\\n\", f_type, f_name, f_md5, f_local );\n }",
"public String toString() {\n StringBuffer stringBuffer = new StringBuffer();\n stringBuffer.append(\"PrepaidDscrId: \" + _prepaidDscrId);\n stringBuffer.append(\"ProcessDt: \" + _processDt);\n stringBuffer.append(\"LocationCd: \" + _locationCd);\n stringBuffer.append(\"AwbNbr: \" + _awbNbr);\n stringBuffer.append(\"TinUniqId: \" + _tinUniqId);\n stringBuffer.append(\"CourierId: \" + _courierId);\n stringBuffer.append(\"PaymentCurrency: \" + _paymentCurrency);\n stringBuffer.append(\"FreightAmtInVisa: \" + _freightAmtInVisa);\n stringBuffer.append(\"DiscrepancyFound: \" + _discrepancyFound);\n stringBuffer.append(\"DiscrepancyAmt: \" + _discrepancyAmt);\n stringBuffer.append(\"ExchRate: \" + _exchRate);\n stringBuffer.append(\"DiscrepancyRsn: \" + _discrepancyRsn);\n stringBuffer.append(\"ShipDate: \" + _shipDate);\n stringBuffer.append(\"Pux16Amount: \" + _pux16Amount);\n stringBuffer.append(\"CouponAmount: \" + _couponAmount);\n stringBuffer.append(\"Comments: \" + _comments);\n stringBuffer.append(\"StatusId: \" + _statusId);\n stringBuffer.append(\"ManagerEmpId: \" + _managerEmpId);\n return stringBuffer.toString();\n }",
"public String toString()\n\t{\n\t\tif (SanityManager.DEBUG)\n\t\t{\n\t\t\treturn \"columnName: \" + columnName + \"\\n\" +\n\t\t\t\t\"defaultText: \" + defaultText + \"\\n\" +\n\t\t\t\tsuper.toString();\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn \"\";\n\t\t}\n\t}",
"public String toString() {\n final StringBuffer sb = new StringBuffer();\n sb.append(\"\\n [ Id: \" + id + \" ]\");\n sb.append(\"\\n [ ClassName: \" + className + \" ]\");\n sb.append(\"\\n [ MethodName : \" + methodName + \" ]\");\n if (bextraInfo) {\n for (int i = 0; i < extraInfo.length; i++) {\n sb.append(\n \"\\n [ Parameter \" + i + \" : \" + extraInfo[i]\n + \" ]\");\n }\n }\n sb.append(\"\\n [ Calendar: \" + cal + \" ]\");\n sb.append(\"\\n [ TimeMillis: \" + timeMillis + \" ] \");\n sb.append(\"\\n \");\n return sb.toString();\n }",
"public String toString() {\n\t\treturn String.format(\"Id: %s\\nContent: %s\\nInsertion Time: %s\\nExpiration Time: %s\\nDequeue Count: %s\\nPop Receipt: %s\\nNext Visible Time: %s\\n\",\n\t\t\t\tm_MessageId,\n\t\t\t\tthis.getAsString(),\n\t\t\t\tm_InsertionTime,\n\t\t\t\tm_ExpirationTime,\n\t\t\t\tm_DequeueCount,\n\t\t\t\tm_PopReceipt,\n\t\t\t\tm_NextVisibleTime);\n\t}",
"public final String toString() {\n\t\tStringWriter write = new StringWriter();\n\t\tString out = null;\n\t\ttry {\n\t\t\toutput(write);\n\t\t\twrite.flush();\n\t\t\tout = write.toString();\n\t\t\twrite.close();\n\t\t} catch (UnsupportedEncodingException use) {\n\t\t\tuse.printStackTrace();\n\t\t} catch (IOException ioe) {\n\t\t\tioe.printStackTrace();\n\t\t}\n\t\treturn (out);\n\t}",
"public String toString() {\n\t\t// initialize the string\n\t\tString fuelCanDetails = \"FuelCan: \";\n\t\t\n\t\t// prep decimal formatting\n\t\tDecimalFormat df = new DecimalFormat();\n\t\tdf.applyPattern(\"##.#\");\n\t\t\n\t\t// add details to the string for...\n\t\t\n\t\t// location\n\t\tfuelCanDetails += \"loc=\";\n\t\tfuelCanDetails += df.format( this.getLocation().getX() ) + \",\" + df.format( this.getLocation().getY() ) + \" \";\n\t\t\n\t\t// color\n\t\tfuelCanDetails += \"color=[\" + this.getColor().getRed() + \",\" + this.getColor().getGreen() + \",\" + this.getColor().getBlue() + \"] \";\n\t\t\n\t\t// size\n\t\tfuelCanDetails += \"size=\" + this.getSize();\n\t\t\n\t\t// return the fuel can details\n\t\treturn fuelCanDetails;\n\t}",
"public String toString() {\r\n return ToStringBuilder.reflectionToString(this,\r\n ToStringStyle.MULTI_LINE_STYLE);\r\n }",
"public String toString() {\n return (UUID + \" \" + name + \" \" + type + \" \" + universityName + \" \" + disabled);\n }",
"@Override String toString();",
"@Override\n public String toString() {\n byte[] buffer = toBuffer();\n return (buffer == null) ? null : new String(buffer, StandardCharsets.UTF_8);\n }",
"@Override\n public String toString() {\n return gson.toJson(this);\n }",
"@Override\n public String toString() { // for request attribute logging\n return DfTypeUtil.toClassTitle(this) + \":{messages=\" + messages + \"}@\" + Integer.toHexString(hashCode());\n }",
"@Override\n public String toString() {\n return (this.str);\n }",
"public String toString() {\n\t\tStringBuffer buffer = new StringBuffer();\n\t\tthis.createSpecSection(buffer);\n\t\tthis.createOperatorSection(buffer);\n\t\treturn buffer.toString();\n\t}",
"public String toString() {\n\t\tString contents = \"\";\n\t\tif (scenario != null) {\n\t\t\tif (controller.getWorld().getHasScenarios()) {\n\t\t\t\tcontents += \"Scenario: \" + scenario + \"\\n\";\n\t\t\t}\n\t\t\tcontents += \"Number of runs: \" + numOfRuns + \"\\n\";\n\t\t\tcontents += \"Trial duration: \" + trialDuration + \"\\n\";\n\t\t\tcontents += \"Number of trials: \" + numOfTrials + \"\\n\";\n\t\t}\n\t\treturn contents;\n\t}",
"public String toString() {\n\n String str = super.toString() + \"; descriptor for class: \";\n\n //-- add class name\n if (_class != null)\n str += _class.getName();\n else\n str += \"[null]\";\n\n //-- add xml name\n str += \"; xml name: \" + _xmlName;\n\n return str;\n }",
"public String toString() {\r\n\t\treturn \"Name: \" + getName() + \"\\nAddress: \" + getAddress() + \"\\nPhone Number: \" + getPhoneNumber();\r\n\t}",
"@Override\n public String toString() {\n return MoreObjects.toStringHelper(this) //\n .add(\"name\", getName()) //\n .add(\"phNumber\", getPhNumber()) //\n .add(\"emailId\", getEmailId()) //\n .add(\"parent\", getParent()) //\n .toString();\n }",
"@Override\n\tpublic String toString() {\n\t\treturn Json.pretty( this );\n\t}",
"public String toString() {\n\t\tString dezeOpdracht = \"\";\n\t\tdezeOpdracht += getOpdrachtID() + \" - \" + getCategorie() + \"\\n\";\n\t\tdezeOpdracht += \"auteur: \" + getAuteur() + \"\\n\";\n\t\tdezeOpdracht += \"vraag: \" + getVraag() + \"\\n\";\n\t\tdezeOpdracht += \"hint: \" + getAntwoordHint() + \"\\n\";\n\t\tdezeOpdracht += (isHoofdletterGevoelig() ? \"\" : \"niet \") + \"hoofdlettergevoelig \\n\";\n\t\tdezeOpdracht += \"antwoord: \" + getAntwoord() + \"\\n\";\n\t\tdezeOpdracht += \"---------------------------------------------\";\n\t\treturn dezeOpdracht;\n\t}",
"public String toString() {\n return name();\n }",
"public String toString() {\n return SQLStringVisitor.getSQLString(this);\n }",
"public String toString()\n {\n return toString((Format) null);\n }",
"public String toString() {\n\t\t\tif (this.getKey() == null) {\n\t\t\t\treturn \"\";\n\t\t\t} else {\n\t\t\t\treturn \"Key:\" + this.getKey() + \" Value:\" + this.getValue();\n\t\t\t}\n\t\t}"
] | [
"0.81951606",
"0.8156881",
"0.774933",
"0.77431333",
"0.767539",
"0.76388955",
"0.74720114",
"0.74663234",
"0.7394183",
"0.73836356",
"0.73463917",
"0.7297789",
"0.729308",
"0.72906446",
"0.7266007",
"0.72658205",
"0.72348756",
"0.7228848",
"0.71234727",
"0.7088974",
"0.7083707",
"0.70627517",
"0.7048244",
"0.703608",
"0.70313394",
"0.70261145",
"0.7021539",
"0.7019727",
"0.7017587",
"0.7013904",
"0.70098215",
"0.7007267",
"0.7007267",
"0.699706",
"0.69904226",
"0.69528913",
"0.6952413",
"0.69517326",
"0.69517326",
"0.694789",
"0.69456446",
"0.6941545",
"0.69337404",
"0.6928432",
"0.6927697",
"0.69205594",
"0.691642",
"0.6915402",
"0.69069487",
"0.6906632",
"0.69057405",
"0.6905229",
"0.6902216",
"0.6880719",
"0.6877126",
"0.6861147",
"0.68591815",
"0.68568",
"0.68540984",
"0.68525934",
"0.6843992",
"0.68438435",
"0.6842818",
"0.68412113",
"0.6827338",
"0.6824475",
"0.68035936",
"0.6801023",
"0.679814",
"0.67968667",
"0.6791151",
"0.67902476",
"0.679011",
"0.6789083",
"0.6784674",
"0.6784497",
"0.67807007",
"0.678058",
"0.6779706",
"0.6768183",
"0.67671734",
"0.6766587",
"0.6764451",
"0.67640793",
"0.6758816",
"0.6755237",
"0.6754264",
"0.6753923",
"0.6752465",
"0.67512053",
"0.67493534",
"0.67444533",
"0.67432845",
"0.67429966",
"0.6728566",
"0.67274326",
"0.67271894",
"0.67266196",
"0.6720222",
"0.6715414",
"0.6714835"
] | 0.0 | -1 |
Return all elements of the primary key. | public Map<String, Object> getPrimaryKey() {
Map<String, Object> ret = new LinkedHashMap<String, Object>(6);
ret.put("idacquirente", Integer.valueOf(getIdacquirente()));
return ret;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private List<String> getPrimaryKeys(Table table) {\n\t\tlog.debug(\"getPrimaryKeys\");\n\t\tList<String> primaryKeyList = new ArrayList<String>();\n\n\t\tfor (Index index : table.getIndexes()) {\n\t\t\tfor (Index.Column column : index.getColumns()) {\n\t\t\t\tif (index.isPrimaryKey()) {\n\t\t\t\t\tprimaryKeyList.add(column.getName());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn primaryKeyList;\n\t}",
"public List<ColumnMetaData> getPrimaryKeys();",
"public List<String> getPrimaryKeys(String tableName);",
"public String[] fetchAllKeys();",
"@Transactional\n public List<String> getAllKeys() {\n return entityManager.createQuery(\"SELECT idCode FROM ArtListing\", String.class).getResultList();\n }",
"java.util.List<String>\n getPrimaryKeyNamesList();",
"public Long[] allKeys() {\n\t\tLong[] result = new Long[super.getSize()];\n int ctr = 0;\n for(Entry<C> each : sequence) {\n result[ctr] = each.getKey();\n ctr++;\n }\n insertionSort(result);\n return result;\n }",
"String getPrimaryKeyNames(int index);",
"public List<KeyType> getPrimaryKeyCollection(String condition) {\r\n Session session = getSession();\r\n List<KeyType> lst = null;\r\n try {\r\n if (condition == null || \"null\".equals(condition)) {\r\n condition = \" \";\r\n }\r\n ClassMetadata cm = sessionFactory.getClassMetadata(getPersistentClass().getName());\r\n String type = cm.getIdentifierPropertyName();\r\n lst = session.createQuery(\"select t.\" + type + \" from \" + getPersistentClass().getName() + \" t\" + \" \" + condition).list();\r\n } catch (HibernateException e) {\r\n LOG.error(MODULE + \"Exception in getPrimaryKeyCollection Method:\" + e, e);\r\n } finally {\r\n// if (session.isOpen()) {\r\n// session.close();\r\n// }\r\n }\r\n return lst;\r\n }",
"Key getPrimaryKey();",
"public PrimaryKey getPrimaryKey();",
"public com.google.protobuf.ProtocolStringList\n getPrimaryKeyNamesList() {\n return primaryKeyNames_.getUnmodifiableView();\n }",
"Collection<?> idValues();",
"public DBField[] getKeyFields()\n {\n return this.priKeys; // should never be null\n }",
"public List getAllIds();",
"public ArrayList<String> selectAllIdsStudentCourse() {\n Connection connection = null;\n Statement statement = null;\n ResultSet resultSet = null;\n ArrayList<String> pkList = new ArrayList<>();\n\n try {\n Class.forName(Tools.MYSQL_JDBC_DRIVER);\n\n connection = DriverManager.getConnection(Tools.DB_URL, Tools.USERNAME, Tools.PASSWORD);\n\n statement = connection.createStatement();\n\n String query = \"SELECT CONCAT(STUDENT_ID, ',', COURSE_ID) AS PK FROM STUDENTS_COURSES;\";\n\n resultSet = statement.executeQuery(query);\n\n while (resultSet.next()) {\n String pk = resultSet.getString(\"PK\");\n pkList.add(pk);\n }\n } catch (ClassNotFoundException | SQLException e) {\n e.printStackTrace();\n } finally {\n if (resultSet != null) {\n try {\n resultSet.close();\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }\n\n if (statement != null) {\n try {\n statement.close();\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }\n if (connection != null) {\n try {\n connection.close();\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }\n }\n return pkList;\n }",
"Collect selectByPrimaryKey(Integer id);",
"public com.google.protobuf.ProtocolStringList\n getPrimaryKeyNamesList() {\n return primaryKeyNames_;\n }",
"public Iterable<Key> keys();",
"public Iterable<Key> keys();",
"Integer[] getKeys();",
"public abstract List<String> getAllKeys();",
"private void buildPKIndex() {\n // index PK\n Collection<DbAttribute> pks = getResolver()\n .getEntity()\n .getDbEntity()\n .getPrimaryKeys();\n this.idIndices = new int[pks.size()];\n\n // this is needed for checking that a valid index is made\n Arrays.fill(idIndices, -1);\n\n Iterator<DbAttribute> it = pks.iterator();\n for (int i = 0; i < idIndices.length; i++) {\n DbAttribute pk = it.next();\n\n for (int j = 0; j < columns.length; j++) {\n if (pk.getName().equals(columns[j].getName())) {\n idIndices[i] = j;\n break;\n }\n }\n\n // sanity check\n if (idIndices[i] == -1) {\n throw new CayenneRuntimeException(\"PK column is not part of result row: %s\", pk.getName());\n }\n }\n }",
"PrimaryKey getPrimarykey();",
"List<JPAAttribute> getKey() throws ODataJPAModelException;",
"public List keys() {\n // assign the attributes to the Collection back to the parent\n ArrayList keys = new ArrayList();\n\n keys.add(leagueId);\n\n return (keys);\n }",
"@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)\n\tpublic long[] getArtworkCollectionPrimaryKeys(long artworkId);",
"List<QueryKey> listQueryKeys();",
"public Iterable<K> keys();",
"public List getRowKeys() { return this.underlying.getRowKeys(); }",
"protected ArrayList<Integer> getSelectedRowKeys()\n {\n ArrayList<Integer> selectedDataList = new ArrayList<Integer>();\n \n if (m_table.getKeyColumnIndex() == -1) {\n return selectedDataList;\n }\n \n int[] rows = m_table.getSelectedIndices();\n for (int row = 0; row < rows.length; row++) {\n Object data = m_table.getModel().getValueAt(rows[row], m_table.getKeyColumnIndex());\n if (data instanceof IDColumn) {\n IDColumn dataColumn = (IDColumn)data;\n selectedDataList.add(dataColumn.getRecord_ID());\n }\n else {\n log.severe(\"For multiple selection, IDColumn should be key column for selection\");\n }\n }\n \n if (selectedDataList.size() == 0) {\n \tint row = m_table.getSelectedRow();\n \t\tif (row != -1 && m_table.getKeyColumnIndex() != -1) {\n \t\t\tObject data = m_table.getModel().getValueAt(row, m_table.getKeyColumnIndex());\n \t\t\tif (data instanceof IDColumn)\n \t\t\t\tselectedDataList.add(((IDColumn)data).getRecord_ID());\n \t\t\tif (data instanceof Integer)\n \t\t\t\tselectedDataList.add((Integer)data);\n \t\t}\n }\n \n return selectedDataList;\n }",
"protected Object getKeyArray()\n/* */ {\n/* 91 */ return this.m_keyTable;\n/* */ }",
"PrimaryKey getPrimaryKey();",
"public List getEntityKeys() {\n return resultKeys;\n }",
"public String fetchPrimaryKey(){\n\t\treturn primaryKey;\n\t}",
"@Override\n public List<K> keys() {\n List<K> keys = new AList<>();\n for(int i =0; i < capacity; i++){\n Entry n = (Entry) table[i];\n if(n != null && !n.isRemoved())\n keys.add(n.getKey());\n }\n assert keys.size() == size;\n return keys;\n }",
"public UnsortedList<Integer> listOfKeys() {\n\t\tUnsortedList<Integer> list \n\t\t= new UnsortedList<Integer>(new IntegerComparator());\n\t\treturn listOfKeys(list);\n\t}",
"@Nonnull\n protected KeyExpression buildPrimaryKey() {\n return Key.Expressions.concat(\n Key.Expressions.recordType(),\n Key.Expressions.list(constituents.stream()\n .map(c -> Key.Expressions.field(c.getName()).nest(c.getRecordType().getPrimaryKey()))\n .collect(Collectors.toList())));\n }",
"List<String> findAllIds();",
"@Transient\n public Object[] getID() {\n return new Object[]{this.getTableName()};\n }",
"public Set keySet() {\n\treturn table.keySet();\n }",
"public Schema getKeySchema() {\n\n\t\tint num_keys = pkColumnNames.size();\n\t\tif (num_keys == 0){\n\t\t\tthrow new DataException(\"Empty primary key\");\n\t\t}\n\t\t//TODO: we always create Struct for the pKey - is there a point to just have a field if it's a single pKey?\n\t SchemaBuilder pkBuilder = SchemaBuilder.struct().name(this.pkSchemaName());\n\n\t for (String pk : this.pkColumnNames) {\n\t \t Field field = schema.field(pk);\n\t \t pkBuilder.field(field.name(), field.schema());\n\t }\n\t return pkBuilder.build();\n\t}",
"public String getPrimaryKey() {\r\n return primaryKey;\r\n }",
"String[] _truncatable_ids();",
"ArrayList<String> getAllDatatypeIds();",
"@Override\n public Set<K> keySet() {\n Set<K> keySet = new HashSet<K>(size());\n for (LinkedList<Entry<K,V>> list : table) {\n for (Entry<K,V> entry : list) {\n if (entry != null) {\n keySet.add(entry.getKey());\n }\n }\n }\n return keySet;\n }",
"public List<Key> getkeyList() {\n SimpleJdbcTemplate jdbcTemplate =\n new SimpleJdbcTemplate(SessionFactoryUtils.getDataSource(getSessionFactory()));\n HashMap args = new HashMap();\n return jdbcTemplate.query(\"select a.APP_ID,a.name,a.CERTIFICATEID,a.soa_group_id,c.soa_group_name from \" + APP_KEY_TABLE + \" a , SOA_GROUP c where status='Active' and a.soa_group_id=c.soa_group_id\"\n , new ParameterizedRowMapper<Key>() {\n public Key mapRow(ResultSet rs, int rowNum) throws SQLException {\n return new Key(rs.getString(\"APP_ID\"), rs.getString(\"name\"), rs.getString(\"soa_group_id\"), rs.getString(\"soa_group_name\"), rs.getString(\"CERTIFICATEID\"));\n }\n }, args);\n }",
"public Field[] getKeyFields();",
"public String [] _truncatable_ids()\r\n {\r\n return _ids_list;\r\n }",
"private Set<String> getKeys() {\n return bookDB.keySet();\n }",
"public Map<String, Object> getPrimaryKey() {\n Map<String, Object> ret = new LinkedHashMap<String, Object>(6);\n ret.put(\"btrAudUid\", getBtrAudUid());\n return ret;\n }",
"public Set<Identifier> keySet() {\n return Collections.unmodifiableSet(container.keySet());\n }",
"public String getPrimaryKeyNames(int index) {\n return primaryKeyNames_.get(index);\n }",
"public String getPrimaryKeyNames(int index) {\n return primaryKeyNames_.get(index);\n }",
"public int[] getListOfId() {\r\n\t\tString sqlCommand = \"SELECT Barcode FROM ProductTable\";\r\n\t\tint[] idList = null;\r\n\t\tArrayList<Integer> tmpList = new ArrayList<Integer>();\r\n\t\tint counter = 0;\r\n\t\ttry (Connection conn = this.connect();\r\n\t\t\t\tStatement stmt = conn.createStatement();\r\n\t\t\t\tResultSet rs = stmt.executeQuery(sqlCommand)) {\r\n\t\t\twhile (rs.next()) {\r\n\t\t\t\ttmpList.add(rs.getInt(\"Barcode\"));\r\n\t\t\t\tcounter++;\r\n\t\t\t}\r\n\t\t\tidList = new int[counter];\r\n\t\t\tfor (int i = 0; i < counter; i++) {\r\n\t\t\t\tidList[i] = tmpList.get(i);\r\n\t\t\t}\r\n\t\t} catch (SQLException e) {\r\n\t\t\tSystem.out.println(\"getListOfId: \"+e.getMessage());\r\n\t\t\treturn new int[0]; \r\n\t\t}\r\n\t\treturn idList;\r\n\t}",
"@Override \n public Set<String> keySet() {\n \n \n // definido um set onde colocar o resultado\n Set<String> r = new HashSet<>();\n \n try {\n \n // abre uma conecção\n conn = Connect.connect();\n \n // abrir um statment com a querie que temos de executar\n PreparedStatement stm = conn.prepareStatement(\"SELECT nomePacote FROM Pacote WHERE visivel=TRUE;\");\n \n \n // o resultado colocado em rs\n ResultSet rs = stm.executeQuery();\n \n while (rs.next()) // enquanto existir o next\n r.add(rs.getString(\"nomePacote\")); \n } catch (SQLException | ClassNotFoundException e) {\n e.printStackTrace();\n } finally {\n Connect.close(conn);\n }\n return r;\n }",
"public com.google.protobuf.ByteString\n getPrimaryKeyNamesBytes(int index) {\n return primaryKeyNames_.getByteString(index);\n }",
"@Override\n\tpublic Iterable<K> keys() {\n\t\treturn null;\n\t}",
"public com.google.protobuf.ByteString\n getPrimaryKeyNamesBytes(int index) {\n return primaryKeyNames_.getByteString(index);\n }",
"private List<Object> naturalKeyValues() {\n\t\ttry {\n\t\t\tfinal List<Method> methods = keyGetters();\n\t\t\tfinal List<Object> values=new ArrayList<>(methods.size());\n\t\t\tfor(final Method method:methods) {\n\t\t\t\tvalues.add(method.invoke(this));\n\t\t\t}\n\t\t\treturn values;\n\t\t} catch (SecurityException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {\n\t\t\tthrow new EntityException(e);\n\t\t}\n\t}",
"public Iterable<String> keys()\r\n { return keysWithPrefix(\"\"); }",
"public String getPrimaryKey() {\r\n\t\treturn primaryKey;\r\n\t}",
"public List<KeyInner> keys() {\n return this.keys;\n }",
"public String selectPKAuthKeys(int id) throws SQLException {\n String sql = \"SELECT publickey FROM authenticatedkeys WHERE id_user=?\";\n\n try (Connection conn = this.connect(); PreparedStatement pstmt = conn.prepareStatement(sql)) {\n \n pstmt.setInt(1, id);\n ResultSet rs = pstmt.executeQuery();\n String value = rs.getString(\"publickey\");\n\n return value;\n } catch (SQLException e) {\n System.out.println(e.getMessage());\n return \"\";\n }\n }",
"public List<K> keys();",
"public static synchronized List<Integer> getPrimaryKeysFromDatabase(\n\t\t\tContext context, String tableName, String difficultyLevel) {\n\t\tQADatabaseHelper dbHelper = QADatabaseHelper.getInstance(context);\n\t\tSQLiteDatabase db = dbHelper.getReadableDatabase();\n\n\t\tList<Integer> primaryKeys = null;\n\n\t\tString query = \"SELECT \" + COLUMN_NAME_PRIMARY_KEY + \" FROM \"\n\t\t\t\t+ tableName + \" WHERE \" + COLUMN_NAME_DIFFICULTY_LEVEL + \" = '\"\n\t\t\t\t+ difficultyLevel + \"'\";\n\n\t\tCursor cursor = null;\n\t\ttry {\n\t\t\tcursor = db.rawQuery(query, null);\n\t\t} catch (Exception exception) {\n\t\t\texception.printStackTrace();\n\t\t}\n\n\t\t// cursor.moveToFirst();\n\t\tif (cursor != null && cursor.getCount() > 0) {\n\t\t\tprimaryKeys = new ArrayList<Integer>();\n\t\t\tfor (cursor.moveToFirst(); !cursor.isAfterLast(); cursor\n\t\t\t\t\t.moveToNext()) {\n\t\t\t\tprimaryKeys.add(cursor.getInt(cursor\n\t\t\t\t\t\t.getColumnIndex(COLUMN_NAME_PRIMARY_KEY)));\n\t\t\t}\n\t\t}\n\t\tcursor.close();\n\t\treturn primaryKeys;\n\t}",
"com.google.protobuf.ByteString\n getPrimaryKeyNamesBytes(int index);",
"PrhFree selectByPrimaryKey(Integer id);",
"@Override\n List<String> keys();",
"@Override \n public Set<String> keySet() {\n // definido um set onde colocar o resultado\n Set<String> r = new HashSet<>();\n try {\n // abre uma conecção\n conn = Connect.connect();\n // abrir um statment com a querie que temos de executar\n PreparedStatement stm = conn.prepareStatement(\"SELECT username FROM Administrador WHERE visivel=TRUE;\");\n // o resultado colocado em rs\n ResultSet rs = stm.executeQuery();\n while (rs.next()) // enquanto existir o next\n r.add(rs.getString(\"username\")); // adiciona o aluno\n } catch (SQLException | ClassNotFoundException e) {\n e.printStackTrace();\n } finally {\n Connect.close(conn);\n }\n return r;\n }",
"List<String> getKeys();",
"public long getPrimaryKey() {\n return primaryKey;\n }",
"public Iterable<String> keys() { return keysWithPrefix(\"\"); }",
"public int[] keysToArray()\r\n\t {\r\n\t\t if(this.size() == 0)\r\n\t\t {\r\n\t\t\t return new int[0];\r\n\t\t }\r\n\t\t int[] arr = new int[this.size()]; \r\n\t\t return this.root.keysToArray(arr, 0);\r\n\t }",
"@Override \n public Set<String> keySet() {\n \n \n // definido um set onde colocar o resultado\n Set<String> r = new HashSet<>();\n \n try {\n \n // abre uma conecção\n conn = Connect.connect();\n \n // abrir um statment com a querie que temos de executar\n PreparedStatement stm = conn.prepareStatement(\"SELECT nome FROM Componente WHERE visivel=TRUE;\");\n \n \n // o resultado colocado em rs\n ResultSet rs = stm.executeQuery();\n \n while (rs.next()) // enquanto existir o next\n r.add(rs.getString(\"nome\")); // adiciona o aluno\n } catch (SQLException | ClassNotFoundException e) {\n e.printStackTrace();\n } finally {\n Connect.close(conn);\n }\n return r;\n }",
"public List<Integer> selectPosAllId() {\n\t\treturn postDao.selectPosAllId();\r\n\t}",
"public Set keyNames() {\n return new LinkedHashSet<>( asList( idName() ) );\n }",
"java.util.List<com.icare.eai.schema.om.evSORequest.EvSORequestDocument.EvSORequest.Key> getKeyList();",
"public List<NeonKey> getKeys();",
"public Iterable<Key> Keys()\n\t{\n\t\tQueue<Key> q=new Queue<>();\n\t\tInorder(root,q);\n\t\treturn q;\n\t}",
"@Override\n\tpublic long[] getWeatherForecastPrimaryKeys(long weatherId) {\n\t\treturn _weatherLocalService.getWeatherForecastPrimaryKeys(weatherId);\n\t}",
"public KeySet getKeys();",
"public String getPrimaryKey() {\n\t\treturn primaryKey;\n\t}",
"public K[] keySet() {\n MyStack<K> result = new MyStack<>();\n\n for (Object entry : this.table) {\n if (entry != null) {\n Entry<K, V> current = (Entry<K, V>) entry;\n\n while (current.hasNext()) {\n result.push(current.getKey());\n current = current.getNext();\n }\n result.push(current.getKey());\n }\n }\n return result.toArray();\n }",
"public Iterable<K> keys()\n {\n return new Iterable<K>()\n {\n public Iterator<K> iterator()\n {\n return ChainedHashTable.this.keysIterator();\n } // iterator()\n }; // new Iterable<K>\n }",
"public Map<String, Object> getPrimaryKey() {\n Map<String, Object> ret = new LinkedHashMap<String, Object>(6);\n ret.put(\"masp\", getMasp());\n return ret;\n }",
"public Set<Integer> getAllIdentifier(ObjectDataOptionsEnum... options) throws PersistenceException {\n Set<Integer> allIdentifier = new ConcurrentSkipListSet<>();\n for(int key : super.getAllKeysInMap(options)) {\n allIdentifier.addAll(super.getAllIdentifiersInKey(key, options));\n }\n return (allIdentifier);\n }",
"public Map<String, Object> getPrimaryKey() {\n Map<String, Object> ret = new LinkedHashMap<String, Object>(6);\n ret.put(\"atrfAudUid\", getAtrfAudUid());\n return ret;\n }",
"public int[] keySet() {\n objectCounter++;\n int[] keys = new int[contents];\n int cnt = 0;\n MapElement me = null;\n\n for (int i = 0; i < capacity; i++) {\n if (map[i] != null) {\n me = map[i];\n while (null != me) {\n keys[cnt++] = me.getKey();\n me = me.getNext();\n }\n }\n }\n return keys;\n }",
"public Iterable<K> keys() {\n Queue<K> q = new Queue<>();\n inOrder(root, q);\n return q;\n }",
"public Collection< VKeyT > vertexKeys();",
"public IdKey getKey() {\n return idKey;\n }",
"private void createGetPrimaryKeyVector(){\n //---------------------------------------------------------------------------\n buffer.append(\" /**\\n\");\n buffer.append(\" * <code>getPrimaryKeyVector</code>\\n\");\n buffer.append(\" * <p>\\n\");\n buffer.append(\" * This method return the primary key vector.\\n\");\n buffer.append(\" * </p>\\n\");\n buffer.append(\" * @author Booker Northington II\\n\");\n buffer.append(\" * @version 1.0\\n\");\n buffer.append(\" * @since 1.3\\n\");\n buffer.append(\" * @param none <code></code> \\n\");\n buffer.append(\" * @return primaryKeyVector <code>Vector</code> \");\n buffer.append(\" A vector of primary\\n\");\n buffer.append(\" * keys.\\n\");\n buffer.append(\" */\\n\");\n buffer.append(spacer);\n buffer.append(\" public Vector getPrimaryKeyVector(){\\n\");\n buffer.append(spacer);\n buffer.append(\" return primaryKeyVector;\\n\");\n buffer.append(\" }//getPrimaryKeyVector() ENDS\\n\\n\");\n }",
"private boolean includePrimaryKeyColumns() {\n\t\treturn false;\r\n\t}",
"public ArrayList<Integer> getKeys() {\r\n return keys;\r\n }",
"public Collection<TapKeyColumn> findAllKeyColumns();",
"public List<Object[]> getPartitionKeys();",
"public K[] keys(){\n\t\tK[] output = (K[]) new Object[howMany];\n\t\tint j = 0;\n\t\tfor (int i = 0; keys.length > i; i++)\n\t\t\tif (keys[i] != null){\n\t\t\t\toutput[j] = keys[i];\n\t\t\t\tj = j + 1;\n\t\t\t}\n\t\treturn output;\n\t}",
"@Override\n public Iterable<Id> breadthIdIterable() {\n return idDag.breadthIdIterable();\n }",
"public native IterableIterator<K> keys();"
] | [
"0.7321617",
"0.7162765",
"0.71422434",
"0.68415403",
"0.66742766",
"0.65876496",
"0.6444915",
"0.643716",
"0.63894904",
"0.63310885",
"0.6314038",
"0.63072056",
"0.6274004",
"0.62541133",
"0.6253869",
"0.6224833",
"0.62202317",
"0.6194848",
"0.61773825",
"0.61773825",
"0.6177266",
"0.6177112",
"0.6165123",
"0.6133039",
"0.6117924",
"0.6103741",
"0.608737",
"0.6052605",
"0.60472655",
"0.60468847",
"0.60466963",
"0.6045506",
"0.6043979",
"0.60408145",
"0.6036782",
"0.603153",
"0.60284096",
"0.6005443",
"0.6001333",
"0.5985201",
"0.5969033",
"0.5963015",
"0.59484446",
"0.5929482",
"0.5908914",
"0.5880732",
"0.58717155",
"0.58627045",
"0.58573306",
"0.58497846",
"0.5845832",
"0.58413994",
"0.58392465",
"0.5837471",
"0.58360344",
"0.5835587",
"0.58089566",
"0.5806616",
"0.5804341",
"0.5796716",
"0.5792818",
"0.5789141",
"0.57840383",
"0.57719564",
"0.57711494",
"0.57670444",
"0.57658947",
"0.5757741",
"0.57522345",
"0.5731235",
"0.5729892",
"0.572192",
"0.57189924",
"0.5716744",
"0.5711617",
"0.57115656",
"0.5702932",
"0.57016885",
"0.56999695",
"0.5695836",
"0.56948596",
"0.5693061",
"0.56905115",
"0.5686378",
"0.56839156",
"0.56832045",
"0.56719905",
"0.56675667",
"0.566544",
"0.5661399",
"0.56571007",
"0.56370693",
"0.5635806",
"0.56298184",
"0.5623376",
"0.5621528",
"0.5621206",
"0.5619661",
"0.56141305",
"0.56119907"
] | 0.56168854 | 98 |
starts the game again | public void playAgainButton(View view)
{
Intent intent = new Intent(this, MainActivity.class);
startActivity(intent);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void restartGame() {\n\t\tclearGame();\n\t\tstartGame();\n\t}",
"private void startGame() {\r\n setGrid();\r\n setSnake();\r\n newPowerUp();\r\n timer.start();\r\n }",
"public void startAgain() {\n setLevel(1);\n setScore(0);\n setPotion(0);\n setBonusKeys(0);\n setCoin(0);\n setHealth(100);\n startGame();\n }",
"public void restart() {\n\t\tmadeMove = false;\n\t\tcurrentPit = -1;\n\t\tnewGame(player1.getName(), player2.getName(), originalCount); \n\t}",
"public void restartGame() {\n\t\tplayerTurn = 1;\n\t\tgameStart = true;\n\t\tdispose();\n\t\tplayerMoves.clear();\n\t\tboardSize();\n\t\tnew GameBoard();\n\t}",
"public void startGame() {\n \t\ttimeGameStarted = System.nanoTime();\n \t\tisStarted = true;\n \n \t}",
"public void startGame() \n\t{\n\t\tgamePanel.startGame();\n\t}",
"private void startGame() {\r\n\t\tthis.gameMap.startGame();\r\n\t}",
"public void startNewGame() {\n numOfTurnsLeft = NUMBER_OF_TURNS_ALLOWED;\n decodingBoard.clearBoard();\n }",
"public void startGame() {\r\n this.setupGame();\r\n }",
"public void restart() {\n Board.gameOver = false;\n CollisionUtility.resetScore();\n loadMenu();\n }",
"public void startGame() {\n\t\timages = new ImageContainer();\n\t\ttimer = new Timer(15, this);\n\t\ttimer.setRepeats(true);\n\t\tlevelStartTimer = new Timer(2000, this);\n\t\thighScore = new HighScore();\n\t\tpacmanAnimation = new PacmanAnimation(images.pacman, new int[] { 3, 2,\n\t\t\t\t0, 1, 2 });\n\t\tactualLevel = 1;\n\t\tinitNewLevel();\n\t}",
"public void restart() {\r\n\t\tstart();\r\n\t}",
"private void startGame() {\r\n gameRunning = true;\r\n gameWindow.getStartButton().setText(\"Stop\");\r\n gameThread = new Thread(new GameLoopThread());\r\n gameThread.start();\r\n }",
"public void startGame()\n\t{\n\t\tdead = false;\n\t\tpaused = false;\n\t\ttime = 0;\n\t\tclock = 0;\n\t\tdirection = RIGHT;\n\t\tdirection2 = RIGHT2;\n\t\thead = new Point(0, -1);\n\t\thead2 = new Point(58, -1);\n\t\ttronBody.clear();\n\t\ttronBody2.clear();\n\t\ttimer.start();\n\t\tlast_direction = 'R';\n\t\tlast_key = 'R';\n\t\tlast_direction2 = 'R';\n\t\tlast_key2 = 'R';\n\t\t\n\t}",
"public void start(){\r\n\t\tcantStop.getGameBoard().startNewTurn();\r\n\t\tallowNewRoll();\r\n\t}",
"private void restart() {\n \tanimation.stop();\n \tspeed = 1;\n \tstart(stage);\n }",
"public void RestartGame()\n {\n \n }",
"private void startNewGame( ){\n\n mGame.clearBoard();\n mGameOver = false;\n\n // Reset all buttons\n for (int i = 0; i < mBoardButtons.length; i++) {\n mBoardButtons[i].setText(\"\");\n mBoardButtons[i].setEnabled(true);\n mBoardButtons[i].setOnClickListener(new ButtonClickListener(i));\n }\n // Human goes first\n mDiffTextView.setText(mGame.dificult);\n mInfoTextView.setText(\"You go first.\");\n\n }",
"public void restartGame() {\n orientate(Orientation.DOWN);\n currentAnimation = idleAnimations[getOrientation().ordinal()];\n gameOver = false;\n strengthen(MAX_HP);\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 startGame() {\n\t\tmain.next_module = new Game(main, inputs, gameSelectionData);\n\t}",
"public void beginGame() {\r\n data.gameState = 3;\r\n data.gameStartFlag = true;\r\n setChanged();\r\n notifyObservers(data);\r\n data.gameStartFlag = false; //Set the gameStart flag to false so the relevant update lines aren't ever run a second time\r\n }",
"void startGame();",
"void startGame();",
"void startGame();",
"void start() {\n myGameOver = false;\n myDisplay.setCurrent(this);\n repaint();\n }",
"void start () {\n System.out.println(\"Starting the game\");\n score = 0;\n updateScore();\n stepDelay = startingSpeed;\n isFalling = false;\n gameOver = false;\n board.clear();\n board.clearTemp();\n setNormalSpeed();\n spawnNewPiece();\n updateView();\n resetLoop();\n }",
"public void startGame() {\n status = Status.COMPLETE;\n }",
"public void resumeGame() {\n\t\t\tif (extended)\n\t\t\t\textendTimer.start();//restart timer if thats relevant\n\t\t\tpause=false;//turn off all flags for pause/stop\n\t\t\tstopped = false;\n\t\t}",
"public void playAgain() {\r\n\t\t\r\n\t\tscreen.reset();\r\n\t\t\r\n\t}",
"@Override\n public void startGame() {\n timer.scheduleAtFixedRate(new TimerTask() {\n @Override\n public void run() {\n update();\n }\n }, 0, 2);\n }",
"public void startNewGame();",
"public void startNewGame() {\n\t\tif (this.currentPlayer != -1) {\n\t\t\tthrow new RuntimeException(\"The game has already started.\");\n\t\t}\n\n\t\tif (this.players.size() == 0) {\n\t\t\tthrow new RuntimeException(\n\t\t\t\t\t\"The game cannot be started with a single player\");\n\t\t}\n\n\t\tthis.currentPlayer = 0;\n\n\t\tstartTurn();\n\t}",
"public void restart() {\n this.getPlayerHand().getHandCards().clear();\n this.dealerHand.getHandCards().clear();\n this.getPlayerHand().setActualValue(0);\n this.getDealerHand().setActualValue(0);\n this.gameOver = false;\n this.playerBet = MIN_BET;\n this.roundCount = 0;\n this.isRunning = true;\n this.startGame();\n }",
"private void resetGame(){\n\n }",
"public void start() {\n ArrayList<String> names = new ArrayList<>();\n game.initialize(names);\n //game.play(this.mainPkmn, this.attack);\n\n }",
"public void restart();",
"protected void restart()\r\n \t{\r\n \t\tspielen();\r\n \t}",
"protected void restart() {\r\n\t\tthis.stop();\r\n\t\tthis.start();\r\n\t}",
"private void startGame() {\n\t\tentities.clear();\n\t\tinitEntities();\n\t\t\n\t\t// blank out any keyboard settings we might currently have\n\t\tleftPressed = false;\n\t\trightPressed = false;\n\t\tfirePressed = false;\n\t}",
"private void startNewGame()\n {\n \n \t//this.mIsSinglePlayer = isSingle;\n \n \tmGame.clearBoard();\n \n \tfor (int i = 0; i < mBoardButtons.length; i++)\n \t{\n \t\tmBoardButtons[i].setText(\"\");\n \t\tmBoardButtons[i].setEnabled(true);\n \t\tmBoardButtons[i].setOnClickListener(new ButtonClickListener(i));\n \t\t//mBoardButtons[i].setBackgroundDrawable(getResources().getDrawable(R.drawable.blank));\n \t}\n \n \t\tmPlayerOneText.setText(\"Player One:\"); \n \t\tmPlayerTwoText.setText(\"Player Two:\"); \n \n \t\tif (mPlayerOneFirst) \n \t{\n \t\t\tmInfoTextView.setText(R.string.turn_player_one); \n \t\tmPlayerOneFirst = false;\n \t}\n \telse\n \t{\n \t\tmInfoTextView.setText(R.string.turn_player_two); \n \t\tmPlayerOneFirst = true;\n \t}\n \t\n \n \tmGameOver = false;\n }",
"public void restart()\n\t{\n\t\tstop();\n\t\treset();\n\t\tstart();\n\t}",
"public void restart()\n\t{\n\t\tinit();\n\t}",
"public void startGame() {\r\n\t\t\r\n\t\tmultiplayerPanel.setVisible(false);\r\n\t\tif(waitingPanel != null) waitingPanel.setVisible(false);\r\n\t\tmultiplayerPanel.removeAll();\r\n\t\t\r\n\t\tgameSetupMultiplayer();\r\n\t\t\r\n\t\t\r\n\t}",
"public void restart() {\n\n\t\t//Reset the list of Mho locations\n\t\tmhoLocations.clear();\n\n\t\t//Generate a unique map of game elements again\n\t\tgenerateMap();\n\n\t\t//reset gameOver and win variables\n\t\tgameOver = false;\n\t\twin = false;\n\n\t\t//repaint the board\n\t\tboard.repaint();\n\t}",
"private void startNewGame(Graphics g){\n\t\tclearBoard(g);\n\t\tb.init();\n\t\tgameStarted = true;\n\t\tgameOver = false;\n\t}",
"public void startGame() {\n\t\tinitChips();\n\t\tassignAndStartInitialProjects();\n\t}",
"public void reset() {\n playing = true;\n won = false;\n startGame();\n\n // Make sure that this component has the keyboard focus\n requestFocusInWindow();\n }",
"@Override\r\n public int playGameLoop() {\r\n return 0;\r\n }",
"private void playTurn()\n {\n try\n {\n XMLHandler.saveGame(game, GAME_CLONE_PATH);\n }\n catch(IOException | JAXBException | SAXException ex)\n {\n // TODO... ConsoleUtils.message(\"An internal save error has occured, terminating current game\");\n gameEnded = true;\n return;\n }\n \n moveCycle();\n \n if (!game.validateGame()) \n {\n IllegalBoardPenalty();\n }\n \n String gameOverMessage = game.isGameOver();\n if (gameOverMessage != null) \n {\n //TODO: ConsoleUtils.message(gameOverMessage);\n gameEnded = true;\n }\n \n game.switchPlayer();\n }",
"private void restart(){\n model.init();\n view.refreshPieces();\n start();\n }",
"public void GameStart()\n\t\t{\n\t\t\tplayers_in_game++;\n\t\t}",
"public void startGame() {\n\t\tif (chordImpl.getPredecessorID().compareTo(chordImpl.getID()) > 0) {\n\t\t\tGUIMessageQueue.getInstance().addMessage(\"I Start!\");\n\t\t\tshoot();\n\t\t}\n\t}",
"private void startGame() {\n betOptionPane();\n this.computerPaquetView.setShowJustOneCard(true);\n blackjackController.startNewGame(this);\n }",
"public void start() {\n \tthis.currentState = this.initialState;\n \tstop=false; //indica que el juego no se ha detenido\n \tnotifyObservers(new GameEvent<S, A>(EventType.Start,null,currentState,\n \t\t\t\t\tnull,\"The game started\"));\n\n }",
"void gameResumed();",
"public void resume() {\n running = true;\n gameThread = new Thread(this);\n gameThread.start();\n }",
"private void inGame() {\n\n if (!ingame) {\n timer.stop();\n\n }\n }",
"public void start()\n {\n clock = new java.util.Timer();\n clock.schedule(\n new TimerTask() //This is really a new anonymous class, extending TimerTask.\n {\t\t\t\t\t //Since it has only one method, it seemed easiest to create it in line here.\n public void run() //Called by the Timer when scheduled.\n {\n timeElapsed++;\n if (timeElapsed > 999) //999 is the highest 3 digit integer, the highest number that can\n {\t\t\t\t\t\t\t //be shown on the displays. Beyond that, the player automatically loses.\n endGame(false);\n return;\n }\n repaint();\n }\n }\n \t\t\t, 1000, 1000); //1000 milliseconds, so a repeated 1 second delay.\n }",
"private void resetAfterGame() {\n }",
"public void resume() {\n playing = true;\n gameThread = new Thread(this);\n gameThread.start();\n }",
"public void loadGame() {\n\t\tmanager.resumeGame();\n\t}",
"public void reset(){\n newGame();\n removeAll();\n repaint();\n ended = false;\n }",
"public void restart() {\n eaten = 0;\n }",
"public void resume() {\n playing = true;\n gameThread = new Thread(this);\n gameThread.start();\n }",
"private void stopGame() {\r\n gameThread.interrupt();\r\n gameWindow.getStartButton().setText(\"Start\");\r\n gameRunning = false;\r\n }",
"public void begin() {\n Runnable run = new Runnable() {\n public void run() {\n while(isRunning) {\n if(game.gameOver()) {\n gameTimer.stop();\n game.displayWinner();\n isRunning = false;\n }\n\n if(game.playAgain()) {\n game.reset();\n isRunning = true;\n gameTimer.start();\n }\n }\n\n Music.stop();\n gameframe.dispose();\n }\n };\n\n Thread gameThread = new Thread(run);\n\n gameTimer = new Timer(Utility.getFrameInterval(),game);\n gameTimer.addActionListener(game);\n\n /*\n if(gameType.equals(\"multiplayer\")) {\n\n gameframe.invalidate();\n\n gameframe.setContentPane(game);\n gameframe.revalidate();\n }*/\n\n gameTimer.start();\n gameThread.start();\n }",
"public void doNewGame(View view) {\n mainHelper.restart();\n }",
"public void startGame()\n {\n while (true)\n {\n WebElement start = driver.findElement(By.cssSelector(\"#index > div.btns > button\"));\n if (start.isDisplayed())\n {\n start.click();\n return;\n }\n }\n }",
"@Override\n\tpublic void startGame(){\n\t\tsuper.currentPlayer = 1;\n\t}",
"public void start(){\n\t\tthis.timer.start();\n\t\t\n\t\t/*this.BGM.play();\t//make it play once we have the background after the game start\n\t\tthis.BGM.loop(1);\t//make it loop constantly\n\t\t\n\t\t//once we start the BGM, start calculating the time\n\t\t//we minus this.time because if the game is restarted, we want to adjust the time displayed\n\t\t//on the label since the paused time does not account\n\t\tthis.startTime = System.nanoTime() - this.time;\t//in nanoTime*/\n\t\t\n\t\tthis.stop = false;\n\t}",
"public void restart() \n {\n xPosition = (int)(FlappyMain.WIDTH/2.5);\n yPosition = FlappyMain.HEIGHT/2;\n xVelocity = yVelocity = 0;\n secret = false;\n }",
"private void startGame() {\r\n\t\tthis.lobbyTimerActive = false;\r\n\t\tthis.gameStarted = true;\r\n\t\tthis.queueMessage(\"% START\");\r\n\t\tthis.dealer = new Dealer(this, this.players);\r\n\r\n\t\t// Start the dealer thread\r\n\t\tThread dealerThread = new Thread(dealer);\r\n\t\tdealerThread.start();\r\n\t}",
"public static void startGame()\r\n\t{\r\n\t\tnew ModeFrame();\r\n\t}",
"public void play() {\n\n showIntro();\n startGame();\n\n }",
"public Game startGame(Game game);",
"public void startDummyGame()\n\t{\n\t\t//game.dummyGame();\n\t}",
"public void startOpponent() {\n\t\tthis.opponent.start();\n\t\tthis.timer.start();\n\t}",
"@Test\n public void restartSystemTest() {\n //Setup\n launcher.launch();\n Game game = launcher.getGame();\n game.start();\n game.stop();\n assertThat(game.isInProgress()).isFalse();\n\n //Execute\n game.start();\n\n //Assert\n assertThat(game.isInProgress()).isTrue();\n }",
"@Override\n public void restart(){\n balls.reInit();\n majGui();\n }",
"public void restartGame() {\n game.level = 1;\n game.overallMoves = 0;\n f.score.setText(\"Overall Score: 0\");\n restartLevel();\n }",
"private void start() // Start the game\n\t{\n\t\tdouble startingPlayerDecider = 0; // Used in the process of deciding who goes first.\t\n\n\t\tif (needToReset == true) // If the game needs to be reset...\n\t\t{\n\t\t\treset(); // Then do so..\n\t\t}\n\n\t\tswitch (gameState) // Check the state of the game and change the messages as needed.\n\t\t{\n\t\tcase waitingForStart:\n\t\t\tlabelGameState.setText(\"Welcome to dig for diamonds.\");\t\n\t\t\tbuttonStart.setText(\"Next\"); // The start button now acts as the next button.\n\t\t\tgameState = GameState.gameWelcome;\n\t\t\tgameStateString = gameStateToString();\n\t\t\tbreak;\n\t\tcase gameWelcome:\n\t\t\tlabelGameState.setText(\"We shall now randomly decide who goes first.\");\t\n\t\t\tgameState = GameState.decideWhoGoesFirst;\n\t\t\tgameStateString = gameStateToString();\n\t\t\tbreak;\n\t\tcase decideWhoGoesFirst:\n\t\t\tswitch(totalPlayers) // Decide based on the number of players who goes first.\n\t\t\t{\n\t\t\tcase 2: // For two players...\n\t\t\t\tstartingPlayerDecider = control.randomNumber(100,0); // Generate a random number between 0 and 100\n\n\t\t\t\tif (startingPlayerDecider >= 50) // If it is greater then or equal to 50...\n\t\t\t\t{\n\t\t\t\t\tplayers.get(0).setIsPlayerTurn(true); // Player 1 goes first.\t\n\t\t\t\t\tlabelGameState.setText(\"Player 1 shall go first this time.\");\t\n\t\t\t\t\tgameState = GameState.twoPlayersPlayerOneGoesFirst;\n\t\t\t\t\tgameStateString = gameStateToString();\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tplayers.get(1).setIsPlayerTurn(true); // Else player two goes first.\n\t\t\t\t\tlabelGameState.setText(\"Player 2 shall go first this time.\");\t\n\t\t\t\t\tgameState = GameState.twoPlayersPlayerTwoGoesFirst;\n\t\t\t\t\tgameStateString = gameStateToString();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase twoPlayersPlayerOneGoesFirst:\n\t\t\tgameState = GameState.twoPlayersNowPlayerOnesTurn;\n\t\t\tlabelGameState.setText(\"It is now \" + players.get(0).getPlayerName() + \"'s turn.\");\t\n\t\t\tgameStateString = gameStateToString();\n\t\t\tbreak;\n\t\tcase twoPlayersPlayerTwoGoesFirst:\n\t\t\tgameState = GameState.twoPlayersNowPlayerTwosTurn;\n\t\t\tlabelGameState.setText(\"It is now \" + players.get(1).getPlayerName() + \"'s turn.\");\t\n\t\t\tgameStateString = gameStateToString();\n\t\t\tbreak;\n\t\t}\t\t\n\t}",
"public void finishGame(){\r\n\t\t\t\tgameStarted = false;\r\n\t\t\t}",
"public static void startGamePlay() {\r\n\t\tif(!STATUS.equals(Gamestatus.PREPARED)) {\r\n\t\t\tSystem.err.println(\"Invalid Gamestatus! Cannot start unprepared gameplay\");\r\n\t\t\tSystem.exit(1);\r\n\t\t}\r\n\t\tSTATUS = Gamestatus.RUNNING;\r\n\t\tclock = new GameClock();\r\n\t\tclock.start(GameTickExecutor.DEFAULT_GAMETICK);\r\n\t}",
"public void reset() { \r\n myGameOver = false; \r\n myGamePaused = false; \r\n }",
"@Override\n public void resetGame() {\n\n }",
"void gameStarted();",
"void gameStarted();",
"public void reStartGame(String difficultyLevel, String theme);",
"public void playAgain();",
"private void newGame ()\n {\n this.game.abort ();\n try\n {\n Thread.sleep(50);\n }catch (InterruptedException e)\n { \n Logger.getLogger(AsteroidsFrame.class.getName()).log(Level.SEVERE, \"Could not sleep before initialing a new game.\");\n }\n this.game.initGameData ();\n }",
"private void resumeGame() {\n\n gameCountDownTimer = getGameTimer();\n gameCountDownTimer.start();\n if(globalAnimatorMap != null && !globalAnimatorMap.isEmpty() && globalAnimatorMap.size() > 0) {\n for (Map.Entry<Integer, AnimatorSet> entry : globalAnimatorMap.entrySet()) {\n AnimatorSet animatorSet = entry.getValue();\n if (animatorSet != null) {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {\n if (animatorSet.isPaused()) {\n animatorSet.resume();\n }\n } else {\n animatorSet.start();\n }\n }\n }\n }else{\n animateBalloonView(balloon1,false);\n animateBalloonView(balloon2,false);\n animateBalloonView(balloon3,false);\n animateBalloonView(balloon4,false);\n animateBalloonView(balloon5,false);\n }\n String controlButtonTitle = getResources().getString(R.string.pause_btn);\n conttroler.setText(controlButtonTitle);\n currentScreenGameState = GameState.PLAYING;\n setCurrentScreenCover();\n invalidateOptionsMenu();\n }",
"@Override\n public void doAction() {\n this.game.setComputerStartsFirst(false);\n }",
"public void playGame() {\n\t\t\r\n\t\t\r\n\t\twhile (!theModel.isGameOver()) {\r\n\t\t\tplayRoundOne();\r\n\t\t}\r\n\t\t\r\n\t}",
"public void startGame() {\n running = true;\n\n Thread t = new Thread(animator);\n t.start();\n\n }",
"public void startGame(){\n\t\tsc = new Scanner(System.in);\n\t\tgui.setScreenID(screenNumber);\n\t\tgui.start();\n\t}",
"public void restart(){\n for(Player p: players)\n if(p.getActive())\n p.reset();\n turn = 0;\n currentPlayer = 0;\n diceRoller=true;\n }",
"public void start() {\n isStarted = true;\n clearBoard();\n newPiece();\n }",
"public void startGame(){\n\t\tSystem.out.println(\"UNI: nas2180\\n\" +\n\t\t\t\t\"Hello, lets play Rock Paper Scissors Lizard Spock!\\n\");\n\t\tSystem.out.println(\"Rules:\\n Scissors cuts Paper\\n \" +\n\t\t\t\t\"Paper covers Rock\\n \" +\n\t\t\t\t\"Rock crushes Lizard\\n \" +\n\t\t\t\t\"Lizard poisons Spock\\n \" +\n\t\t\t\t\"Spock smashes Scissors\\n \" +\n\t\t\t\t\"Scissors decapitates Lizard\\n \" +\n\t\t\t\t\"Lizard eats Paper\\n \" +\n\t\t\t\t\"Paper disproves Spock\\n \" +\n\t\t\t\t\"Spock vaporizes Rock\\n \" +\n\t\t\t\t\"(and as it always has) Rock crushes Scissors\\n\");\n\t\tthisGame = new GameResult();\n\t\tplayRound();\n\t}",
"private void startGame(){\n\t\tnewGame.setVisible(false);\n\t\tcp1shipLabel.setVisible(true);\n\t\tcp2shipLabel.setVisible(true);\n\n\t\tcp1ShotCount = 0;\n\t\tcp2ShotCount = 0;\n\t\tcp1BoatsSunk = 0;\n\t\tcp2BoatsSunk = 0;\n\n\t\tcp1shipLabel.setText(\"Computer Player 1 ships sunk: \" + cp1BoatsSunk);\n\t\tcp2shipLabel.setText(\"Computer Player 2 ships sunk: \" + cp2BoatsSunk);\n\n\t\tships = new Ship[10];\n\n\t\tcp1PlaceShips();\n\t\tcp2PlaceShips();\n\n\t\tfor(int x = 0; x < cp1Attacks.length; x++){\n\t\t\tfor(int y = 0; y < cp1Attacks[x].length; y++){\n\t\t\t\tcp1Attacks[x][y] = false;\n\t\t\t\tcp2Attacks[x][y] = false;\n\t\t\t}\n\t\t}\n\t\tgameTimer.start();\n\t\trepaint();\n\t}"
] | [
"0.83517003",
"0.79176867",
"0.7900356",
"0.78104085",
"0.762884",
"0.7625604",
"0.75904965",
"0.7543743",
"0.7528354",
"0.75128716",
"0.7472573",
"0.74563456",
"0.7443607",
"0.7422224",
"0.73767674",
"0.73656625",
"0.73445654",
"0.7336277",
"0.7324247",
"0.7320889",
"0.7308759",
"0.72897637",
"0.72728956",
"0.7243557",
"0.7243557",
"0.7243557",
"0.7222449",
"0.7204023",
"0.7192432",
"0.7187181",
"0.7184518",
"0.71836954",
"0.7172923",
"0.7166571",
"0.7164563",
"0.71541405",
"0.71165484",
"0.71146286",
"0.70885956",
"0.70857435",
"0.7081035",
"0.7078726",
"0.7074072",
"0.7068735",
"0.7061094",
"0.7046329",
"0.704259",
"0.70205915",
"0.6998715",
"0.6993233",
"0.6983523",
"0.69815224",
"0.69748884",
"0.6972446",
"0.69676834",
"0.69577247",
"0.695307",
"0.6952606",
"0.69522935",
"0.69496864",
"0.6948534",
"0.6931361",
"0.692565",
"0.6922264",
"0.6917736",
"0.6909206",
"0.69089484",
"0.69064033",
"0.6898839",
"0.6896887",
"0.6893423",
"0.6890472",
"0.68845874",
"0.6880997",
"0.6876197",
"0.68621504",
"0.68477464",
"0.68455887",
"0.6845234",
"0.6842781",
"0.68355143",
"0.6833824",
"0.68312436",
"0.6830421",
"0.6829701",
"0.6827404",
"0.68255013",
"0.6812632",
"0.6812632",
"0.680629",
"0.68026435",
"0.6797051",
"0.67965823",
"0.67942524",
"0.67921597",
"0.67853594",
"0.6782347",
"0.67771727",
"0.67703354",
"0.67670226",
"0.6765861"
] | 0.0 | -1 |
Obter id do template property | public int getPropertyId(int templateId, String templateproperty){
int id=0;
String sql = "select id from templateproperty where "
+" idtemplate="+templateId
+" AND "
+ " templateproperty=\"" +templateproperty+"\"";
try {
// prepared statement para inserção
Connection con = DatabaseConnectionFactory.getConnection();
PreparedStatement stmt = con.prepareStatement(sql);
ResultSet rs = stmt.executeQuery();
if(rs.next()) {
// criando o objeto TemplateProperty
id=rs.getInt("id");
}
stmt.close();
} catch (SQLException e) {
throw new RuntimeException(e);
}
return id;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public SimpleIntegerProperty getIDProperty(){ return id; }",
"@ApiModelProperty(value = \"The id of the template\")\n public String getId() {\n return id;\n }",
"@DISPID(14) //= 0xe. The runtime will prefer the VTID if present\n @VTID(21)\n void templateID(\n int pVal);",
"@DISPID(14) //= 0xe. The runtime will prefer the VTID if present\n @VTID(20)\n int templateID();",
"java.lang.String getTemplateId();",
"public abstract Integer getTemplId();",
"public abstract void setTemplId(Integer templId);",
"private MessageProperty setTemplateVar(String key, String value){\n\t\tMessageProperty property = new MessageProperty();\n\t\tproperty.setPropertyName(key);\n\t\tproperty.setPropertyValue(appendCDATA(value));\n\t\treturn property;\n\t}",
"public void setTemplateId(int tmp) {\n this.templateId = tmp;\n }",
"public ArmorTemplate(int id) {\n\t\tsuper(id);\n\t}",
"@Override\n\t\t\tpublic String getPropertyId() {\n\t\t\t\treturn null;\n\t\t\t}",
"public void setTemplate(Template template)\n/* */ {\n/* 62 */ this.template = template;\n/* */ }",
"public String templateId() {\n return this.templateId;\n }",
"public String getId(){ return id.get(); }",
"public Integer getTemplateid() {\n return templateid;\n }",
"TemplateModel getValue();",
"@DISPID(-2147417110)\n @PropGet\n java.lang.String id();",
"public int getTemplateId() {\n return templateId;\n }",
"public Pojo.OneWord getById(String code){ \n Pojo.OneWord e=(Pojo.OneWord)template.get(Pojo.OneWord.class,code); \n return e; \n}",
"@JSProperty(\"id\")\n void setId(String value);",
"public void setTemplateId(String tmp) {\n this.setTemplateId(Integer.parseInt(tmp));\n }",
"String getTemplate();",
"public int getVorlageShopObjectID(int templateId);",
"@Override\n\tpublic Long getElementTplIdById(Long id) {\n\t\treturn elementHistoryRepository.getElementTplIdById(id);\n\t}",
"@Test\n public void previewTemplateFromIdTest() throws IdfyException, Exception {\n TemplateWithIdPreview model = new TemplateWithIdPreview.Builder().build();\n UUID id = UUID.randomUUID();\n String xmlTemplate = new String(\"123\");\n api.previewTemplateFromId(model, id, xmlTemplate);\n }",
"@Override\r\n\tpublic Object getEntity(Class entityClass, Serializable id) {\n\t\treturn template.get(entityClass, id);\r\n\t}",
"public String getId(){ return ID; }",
"@Import(\"id\")\n\tint getId();",
"public String getId(){return id;}",
"private String prefTag(String id) {\n\t\treturn preferenceTag + \"_\" + id;\n\t}",
"private Integer getId() { return this.id; }",
"public Long getTemplateId() {\r\n return templateId;\r\n }",
"public interface RfpTemplate {\n\n ObjectId getId();\n\n String getName();\n\n RfpType getType();\n\n String getDescription();\n\n String getCoverLetter();\n\n Questionnaire getQuestionnaire();\n\n void setCoverLetter(String coverLetter);\n\n String getFinalAgreementTemplate();\n\n void setQuestionnaire(Questionnaire questionnaire);\n}",
"default <T> void constructTemplate(ElasticsearchIndexType indexType, T templateProperty){\n builder().append(String.format(\"{\\\"%s\\\":\", indexType.getDisplayName()));\n java.lang.Class<?> templatePropertyClass = templateProperty.getClass();\n java.lang.invoke.MethodHandles.Lookup lookup = MethodHandles.lookup();\n try {\n for (String templateProp : templateProperties) {\n VarHandle varHandle = lookup.findVarHandle(templatePropertyClass, PREFIX + templateProp, String.class);\n Object value = varHandle.get(templateProperty);\n if(StringUtils.isEmpty(value)){\n if(templateProp.equals(\"type\")){\n value = PREFIX + DEFAULT_DOC;\n }else if(templateProp.equals(\"id\")){\n value = UUID.randomUUID().toString();\n }\n }\n if(!StringUtils.isEmpty(value)){\n builder().append(String.format(\"\\\"%s%s\\\":\\\"%s\\\"\", PREFIX, templateProp, value));\n }\n }\n } catch (IllegalAccessException e) {\n e.printStackTrace();\n } catch (NoSuchFieldException e) {\n e.printStackTrace();\n }\n builder().append(\"}\");\n }",
"public String getSubstitutionPropertyKey(String key)\n {\n return \"${\".concat(key).concat(\"}\");\n }",
"public abstract void setId(T obj, long id);",
"public Supplier getById(int id){ \n\t Supplier e=(Supplier)template.get(Supplier.class,id); \n\t return e; \n\t}",
"int getTemplateTypeValue();",
"public void updateOneWord(Pojo.OneWord e){ \n template.update(e); \n}",
"public void putProperty(Integer id, IExpObject value) throws ExpException {\n \n }",
"public String prop(String name);",
"IntegerProperty getXProperty();",
"public int getId(){ return id; }",
"Property createProperty();",
"public void setID(String idIn) {this.id = idIn;}",
"java.lang.String getId();",
"java.lang.String getId();",
"java.lang.String getId();",
"java.lang.String getId();",
"java.lang.String getId();",
"java.lang.String getId();",
"java.lang.String getId();",
"java.lang.String getId();",
"java.lang.String getId();",
"java.lang.String getId();",
"java.lang.String getId();",
"java.lang.String getId();",
"java.lang.String getId();",
"java.lang.String getId();",
"java.lang.String getId();",
"java.lang.String getId();",
"java.lang.String getId();",
"java.lang.String getId();",
"java.lang.String getId();",
"@RdfProperty(\"http://www.coadunation.net/schema/rdf/1.0/base#IdValue\")\n public abstract String getValue();",
"java.lang.String getProperty();",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"String getId();",
"String getId();"
] | [
"0.6249997",
"0.62408924",
"0.61615694",
"0.60700524",
"0.6018437",
"0.59738773",
"0.591347",
"0.5891666",
"0.5760518",
"0.5709581",
"0.5709455",
"0.56751466",
"0.5656637",
"0.56519103",
"0.5648198",
"0.5636394",
"0.55948967",
"0.55933076",
"0.55910087",
"0.5575665",
"0.55275875",
"0.5504677",
"0.5460941",
"0.5423597",
"0.53769857",
"0.5328102",
"0.53165746",
"0.530285",
"0.5298887",
"0.529613",
"0.5293645",
"0.52839196",
"0.5281715",
"0.52743477",
"0.5255145",
"0.52550364",
"0.5250297",
"0.5244365",
"0.5240699",
"0.5220865",
"0.5215432",
"0.5215255",
"0.52063835",
"0.5206078",
"0.51918566",
"0.5187796",
"0.5187796",
"0.5187796",
"0.5187796",
"0.5187796",
"0.5187796",
"0.5187796",
"0.5187796",
"0.5187796",
"0.5187796",
"0.5187796",
"0.5187796",
"0.5187796",
"0.5187796",
"0.5187796",
"0.5187796",
"0.5187796",
"0.5187796",
"0.5187796",
"0.5187009",
"0.51797324",
"0.5175909",
"0.5175909",
"0.5175909",
"0.5175909",
"0.5175909",
"0.5175909",
"0.5175909",
"0.5175909",
"0.5175909",
"0.5175909",
"0.5175909",
"0.5175909",
"0.5175909",
"0.5175909",
"0.5175909",
"0.5175909",
"0.5175909",
"0.5175909",
"0.5175909",
"0.5175909",
"0.5175909",
"0.5175909",
"0.5175909",
"0.5175909",
"0.5175909",
"0.5175909",
"0.5175909",
"0.5175909",
"0.5175909",
"0.5175909",
"0.5175909",
"0.5175909",
"0.5175909",
"0.5175909"
] | 0.5299963 | 28 |
Extract attributes we will need | public ActionForward execute(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response) throws Exception {
MessageResources messages = getResources(request);
// save errors
ActionMessages errors = new ActionMessages();
//START check for login (security)
if (!SecurityService.getInstance().checkForLogin(request.getSession(false))) {
return (mapping.findForward("welcome"));
}
//END check for login (security)
List results = new ArrayList();
String number = request.getParameter("number");
if(number == null){
number = request.getParameter("id");
}
CapaId capaId = QMSService.getInstance().getSingleCapaId(number);
Capa capa = QMSService.getInstance().getSingleCapa(number);
DateFormat df = new SimpleDateFormat("MM-dd-yyyy");
// Date date = ...; // wherever you get this
//DateFormat df = new SimpleDateFormat("dd MMMM yyyy");
//String text = df.format(date);
////System.out.println(text);
DynaValidatorForm uvg = (DynaValidatorForm) form;
try {
uvg.set("number", StandardCode.getInstance().noNull(capa.getNumber()));
} catch (Exception e) {
uvg.set("number", "");
}
try {
uvg.set("cdate", capa.getCdate());
} catch (Exception e) {
uvg.set("cdate", "");
}
try {
uvg.set("employee", StandardCode.getInstance().noNull(capa.getEmployee()));
} catch (Exception e) {
uvg.set("employee", "");
}
try {
uvg.set("location", StandardCode.getInstance().noNull(capa.getLocation()));
} catch (Exception e) {
uvg.set("location", "");
}
try {
uvg.set("description", StandardCode.getInstance().noNull(capa.getDescription()));
} catch (Exception e) {
uvg.set("description", "");
}
try {
uvg.set("reportedby", StandardCode.getInstance().noNull(capa.getReportedby()));
// request.setAttribute("reportedby", StandardCode.getInstance().noNull(capa.getReportedby()));
} catch (Exception e) {
uvg.set("reportedby", "");
// request.setAttribute("reportedby","");
}
try {
uvg.set("reportedbydesc", StandardCode.getInstance().noNull(capa.getReportedbydesc()));
} catch (Exception e) {
uvg.set("reportedbydesc", "");
}
try {
if(null != capa.getIsLocked()){
uvg.set("admin_locked", ""+capa.getIsLocked());
request.setAttribute("isLocked", capa.getIsLocked());
}else{
uvg.set("admin_locked", "false");
request.setAttribute("isLocked", Boolean.FALSE);
}
} catch (Exception e) {
uvg.set("admin_locked", "false");
request.setAttribute("isLocked", Boolean.FALSE);
}
try {
if (capa.getAdmin_lock_date() == null) {
uvg.set("admin_lock_date", "");
} else {
uvg.set("admin_lock_date", "" + df.format(capa.getAdmin_lock_date()));
}
} catch (Exception e) {
uvg.set("admin_lock_date", "");
}
try {
if(capa.getIsLocked()){
User user = UserService.getInstance().getSingleUser(capa.getLockedby());
request.setAttribute("lockedBy","The Capa "+capa.getNumber()+" is locked by " +user.getFirstName() +" "+user.getLastName() +" on "+
df.format(capa.getAdmin_lock_date())+". You cannot edit it once locked.<br>"
+ "<img src=\"/logo/images/"+user.getSignature()+"\" width=\"148\" height=\"35\" alt=\"Sign\"/>");}
} catch (Exception e) {
e.printStackTrace();
request.setAttribute("lockedBy", "The Capa is locked.You cannot edit it once locked.");
}
try {
uvg.set("fromc", StandardCode.getInstance().noNull(capa.getFromc()));
} catch (Exception e) {
uvg.set("fromc", "");
}
try {
uvg.set("issueId", StandardCode.getInstance().noNull(capa.getIssueId()));
} catch (Exception e) {
uvg.set("issueId", "");
}
try {
uvg.set("source", StandardCode.getInstance().noNull(capa.getSource()));
request.setAttribute("source", StandardCode.getInstance().noNull(capa.getSource()));
} catch (Exception e) {
uvg.set("source", "");
request.setAttribute("source", "");
}
try {
uvg.set("status", StandardCode.getInstance().noNull(capa.getStatus()));
} catch (Exception e) {
uvg.set("status", "");
}
try {
uvg.set("ncr", StandardCode.getInstance().noNull(capa.getNcr()));
} catch (Exception e) {
uvg.set("ncr", "");
}
try {
uvg.set("rca", StandardCode.getInstance().noNull(capaId.getRca()));
} catch (Exception e) {
uvg.set("rca", "");
}
try {
uvg.set("imact", StandardCode.getInstance().noNull(capaId.getImact()));
} catch (Exception e) {
uvg.set("imact", "");
}
try {
if (capaId.getImact_t_date() == null) {
uvg.set("imact_t_date", "");
} else {
uvg.set("imact_t_date", "" + df.format(capaId.getImact_t_date()));
}
} catch (Exception e) {
uvg.set("imact_t_date", "");
}
try {
if (capaId.getImact_a_date() == null) {
uvg.set("imact_a_date", "");
} else {
uvg.set("imact_a_date", "" + df.format(capaId.getImact_a_date()));
}
} catch (Exception e) {
uvg.set("imact_a_date", "");
}
try {
if (capaId.getRca_t_date() == null) {
uvg.set("rca_t_date", "");
} else {
uvg.set("rca_t_date", "" + df.format(capaId.getRca_t_date()));
}
} catch (Exception e) {
uvg.set("rca_t_date", "");
}
try {
if (capaId.getRca_a_date() == null) {
uvg.set("rca_a_date", "");
} else {
uvg.set("rca_a_date", "" + df.format(capaId.getRca_a_date()));
}
} catch (Exception e) {
uvg.set("rca_a_date", "");
}
try {
uvg.set("nc", StandardCode.getInstance().noNull(capaId.getNc()));
} catch (Exception e) {
uvg.set("nc", "");
}
try {
uvg.set("ncyesno", capaId.getNcyesno());
} catch (Exception e) {
uvg.set("ncyesno", "");
}
try {
uvg.set("actionplan", StandardCode.getInstance().noNull(capaId.getActionplan()));
} catch (Exception e) {
uvg.set("actionplan", "");
}
try {
uvg.set("actionplan_approve", StandardCode.getInstance().noNull(capaId.getActionplan_approve()));
} catch (Exception e) {
uvg.set("actionplan_approve", "");
}
try {
uvg.set("actionimp", StandardCode.getInstance().noNull(capaId.getActionimp()));
} catch (Exception e) {
uvg.set("actionimp", "");
}
try {
if (capaId.getActionimp_t_date() == null) {
uvg.set("actionimp_t_date", "");
} else {
uvg.set("actionimp_t_date", "" + df.format(capaId.getActionimp_t_date()));
}
} catch (Exception e) {
uvg.set("actionimp_t_date", "");
}
try {
if (capaId.getActionimp_a_date() == null) {
uvg.set("actionimp_a_date", "");
} else {
uvg.set("actionimp_a_date", "" + df.format(capaId.getActionimp_a_date()));
}
} catch (Exception e) {
uvg.set("actionimp_a_date", "");
}
try {
uvg.set("effectiveplan", StandardCode.getInstance().noNull(capaId.getEffectiveplan()));
} catch (Exception e) {
uvg.set("effectiveplan", "");
}
try {
uvg.set("verify", StandardCode.getInstance().noNull(capaId.getVerify()));
} catch (Exception e) {
uvg.set("verify", "");
}
try {
if (capaId.getVerify_t_date() == null) {
uvg.set("verify_t_date", "");
} else {
uvg.set("verify_t_date", "" + df.format(capaId.getVerify_t_date()));
}
} catch (Exception e) {
uvg.set("verify_t_date", "");
}
try {
if (capaId.getVerify_a_date() == null) {
uvg.set("verify_a_date", "");
} else {
uvg.set("verify_a_date", "" + df.format(capaId.getVerify_a_date()));
}
} catch (Exception e) {
uvg.set("verify_a_date", "");
}
try {
uvg.set("verify_approve", StandardCode.getInstance().noNull(capaId.getVerify_approve()));
} catch (Exception e) {
uvg.set("verify_approve", "");
}
try {
uvg.set("comments", StandardCode.getInstance().noNull(capaId.getComments()));
} catch (Exception e) {
uvg.set("comments", "");
}
try {
if (capaId.getAdmin_rec_date() == null) {
uvg.set("admin_rec_date", "");
} else {
uvg.set("admin_rec_date", "" + df.format(capaId.getAdmin_rec_date()));
}
} catch (Exception e) {
uvg.set("admin_rec_date", "");
}
try {
if (capaId.getAdmin_own_date() == null) {
uvg.set("admin_own_date", "");
} else {
uvg.set("admin_own_date", "" + df.format(capaId.getAdmin_own_date()));
}
} catch (Exception e) {
uvg.set("admin_own_date", "");
}
try {
uvg.set("admin_rec_person", StandardCode.getInstance().noNull(capaId.getAdmin_rec_person()));
} catch (Exception e) {
uvg.set("admin_rec_person", "");
}
try {
uvg.set("admin_own_person", StandardCode.getInstance().noNull(capaId.getAdmin_own_person()));
} catch (Exception e) {
uvg.set("admin_own_person", "");
}
try {
uvg.set("admin_disposition", StandardCode.getInstance().noNull(capaId.getAdmin_disposition()));
} catch (Exception e) {
uvg.set("admin_disposition", "");
}
try {
uvg.set("owner", StandardCode.getInstance().noNull(capaId.getOwner()));
} catch (Exception e) {
uvg.set("owner", "");
}
try {
uvg.set("owner2", StandardCode.getInstance().noNull(capaId.getOwner2()));
} catch (Exception e) {
uvg.set("owner2", "");
}
try {
uvg.set("owner3", StandardCode.getInstance().noNull(capaId.getOwner3()));
} catch (Exception e) {
uvg.set("owner3", "");
}
try {
uvg.set("capaid_description", StandardCode.getInstance().noNull(capaId.getCapaid_description()));
} catch (Exception e) {
uvg.set("capaid_description", "");
}
try {
if (capaId.getAdmin_disp_date() == null) {
uvg.set("admin_disp_date", "");
} else {
uvg.set("admin_disp_date", "" + df.format(capaId.getAdmin_disp_date()));
}
} catch (Exception e) {
uvg.set("admin_disp_date", "");
}
try {
uvg.set("ncminormajor", StandardCode.getInstance().noNull(capaId.getNcminormajor()));
} catch (Exception e) {
uvg.set("ncminormajor", "");
}
try {
uvg.set("actionplan_approve2", StandardCode.getInstance().noNull(capaId.getActionplan_approve2()));
} catch (Exception e) {
uvg.set("actionplan_approve2", "");
}
try {
uvg.set("actionimp_status", StandardCode.getInstance().noNull(capaId.getActionimp_status()));
} catch (Exception e) {
uvg.set("actionimp_status", "");
}
try {
uvg.set("verify_approve2", StandardCode.getInstance().noNull(capaId.getVerify_approve2()));
} catch (Exception e) {
uvg.set("verify_approve2", "");
}
try {
uvg.set("admin_disp_person", StandardCode.getInstance().noNull(capaId.getAdmin_disp_person()));
} catch (Exception e) {
uvg.set("admin_disp_person", "");
}
request.setAttribute("formValue", uvg);
request.setAttribute("number", number);
return (mapping.findForward("Success"));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Attributes getAttributes();",
"Map<String, String> getAttributes();",
"Map<String, Object> getAttributes();",
"Map<String, Object> getAttributes();",
"Map<String, Object> getAttributes();",
"public abstract Map<String, Object> getAttributes();",
"public Map<String, String> getAttributes();",
"public Map<String, Object> getAttributes();",
"public Map<String, Object> getAttributes();",
"public abstract Map getAttributes();",
"public String[] getRelevantAttributes();",
"IAttributes getAttributes();",
"public Map<String, Object> getAttrs();",
"ArrayList getAttributes();",
"public java.util.Collection getAttributes();",
"private Attributes getAttributes()\r\n\t{\r\n\t return attributes;\r\n\t}",
"public List<TLAttribute> getAttributes();",
"Map<String, Object> getAttributes(String path) throws IOException;",
"trinsic.services.common.v1.CommonOuterClass.JsonPayload getAttributes();",
"public abstract ImportAttributes getAttributes();",
"public HashMap<String, String> GetRawAttributes();",
"@Override\r\n\tpublic Map<String, String> getAttributes() {\r\n\t\treturn this.attributes;\r\n\t}",
"java.util.Map<java.lang.String, java.lang.String> getAttributesMap();",
"public String getAttributes() {\n\t\treturn getProperty(\"attributes\");\n\t}",
"public Attributes getAttributes() { return this.attributes; }",
"public Map<String, String> getAttributes() {\n\t\treturn atts;\n\t}",
"@Override\r\n protected void parseAttributes()\r\n {\n\r\n }",
"Map getPassThroughAttributes();",
"List<Attribute<T, ?>> getAttributes();",
"@Override\r\n\tpublic Map<String, Object> getAttributes() {\n\t\treturn null;\r\n\t}",
"public String getAttributes() {\n return attributes;\n }",
"public String getAttributes() {\n return attributes;\n }",
"Iterable<? extends XomNode> attributes();",
"@Override\n\tpublic ArrayList<Object> getAttributeList() {\n\t\tArrayList<Object> attributes = new ArrayList<Object>();\n//\t\tattributes.add(\"s2014_age\");\n//\t\tattributes.add(\"s2014_prog_skill\");\n//\t\tattributes.add(\"s2014_uni_yrs\");\n//\t\tattributes.add(\"s2014_os\");\n//\t\tattributes.add(\"s2014_progLangs\");\n//\t\tattributes.add(\"s2014_engSkill\");\n\t\tattributes.add(\"s2014_favAnimal\");\n\t\tattributes.add(\"s2014_MoreMtns\");\n//\t\tattributes.add(\"s2014_winter\");\n\t\tattributes.add(\"s2014_favColor\");\n//\t\tattributes.add(\"s2014_neuralNetwork\");\n//\t\tattributes.add(\"s2014_vectorMachine\");\n//\t\tattributes.add(\"s2014_sql\");\n//\t\tattributes.add(\"s2014_favSQLServ\");\n//\t\tattributes.add(\"s2014_apriori\");\n\t\treturn attributes;\n\t}",
"public HashSet<String> getUsefulAttributes() {\n\t\t \n\t\tHashSet<String> attr = new HashSet<>();\n\t\tQuery firstQ = this.rset.get(1); // get first query on rewriting set 'rset'.\n\t\t\n\t\tGrouping gPart = firstQ.getQueryTriple()._1();\n\t attr.addAll(gPart.getUsefulAttributes());\n\t \n\t Measuring mPart = firstQ.getQueryTriple()._2();\n\t attr.addAll(mPart.getMeasuringAttributes());\n\t \n\t\treturn attr;\n\t}",
"public final String[] getAttributes() {\n return this.attributes;\n }",
"Map getGenAttributes();",
"@Override\n\tpublic Attributes getAttributes() {\n\t\treturn (Attributes)map.get(ATTRIBUTES);\n\t}",
"java.lang.String getAttribute();",
"private List<String> getAttributes(ModuleURN inURN) throws Exception {\r\n MBeanInfo beanInfo = getMBeanServer().getMBeanInfo(inURN.toObjectName());\r\n List<String> attribs = new ArrayList<String>();\r\n for(MBeanAttributeInfo info: beanInfo.getAttributes()) {\r\n attribs.add(info.getName());\r\n }\r\n return attribs;\r\n }",
"private void readAttributes() throws IOException, ClassFormatException {\n final int attributes_count = dataInputStream.readUnsignedShort();\n attributes = new Attribute[attributes_count];\n for (int i = 0; i < attributes_count; i++) {\n attributes[i] = Attribute.readAttribute(dataInputStream, constant_pool);\n }\n }",
"public Map<TextAttribute,?> getAttributes(){\n return (Map<TextAttribute,?>)getRequestedAttributes().clone();\n }",
"public Attribute[] getAvailableAttributes(){\n Attribute attributes[] = {\n TextAttribute.FAMILY,\n TextAttribute.WEIGHT,\n TextAttribute.POSTURE,\n TextAttribute.SIZE,\n\t TextAttribute.TRANSFORM,\n TextAttribute.SUPERSCRIPT,\n TextAttribute.WIDTH,\n };\n\n return attributes;\n }",
"private void collectAttributes (int end) {\n attributeType = 0;\n klass = new StringBuffer();\n id = new StringBuffer();\n style = new StringBuffer();\n language = new StringBuffer();\n int start = textIndex;\n while (textIndex < end\n && ((attributeType > 0) || (textIndex == start))) {\n char c = line.charAt (textIndex);\n switch (attributeType) {\n case 0:\n // No leading character found yet\n if (c == '(') {\n attributeType = 1;\n }\n else\n if (c == '{') {\n attributeType = 3;\n }\n else\n if (c == '[') {\n attributeType = 4;\n }\n break;\n case 1:\n // Left paren indicates class or id\n if (c == '#') {\n attributeType++;\n }\n else\n if (c == ')') {\n attributeType = 0;\n } else {\n klass.append (c);\n }\n break;\n case 2:\n // ID\n if (c == ')') {\n attributeType = 0;\n } else {\n id.append (c);\n }\n break;\n case 3:\n // style\n if (c == '}') {\n attributeType = 0;\n } else {\n style.append (c);\n }\n break;\n case 4:\n // language\n if (c == ']') {\n attributeType = 0;\n } else {\n language.append (c);\n }\n break;\n } // end switch attributeType\n textIndex++;\n } // end while more characters before period\n }",
"public Map<String, String> getAttributes() {\n\t\treturn attributes;\n\t}",
"public String getAttributes() {\n StringBuilder sb = new StringBuilder();\n\n // class\n if (!getClassAttribute().isEmpty()) {\n sb.append(\"class='\").append(getClassAttribute()).append(\"' \");\n }\n\n // data-*\n if (!getDataAttributes().isEmpty()) {\n sb.append(getDataAttributes()).append(\" \");\n }\n\n // hidden\n if (isHiddenAttribute()) {\n //sb.append(\"hidden \");\n addSpecialAttribute(\"hidden\");\n }\n\n // id\n if (!getIdAttribute().isEmpty()) {\n sb.append(\"id='\").append(getIdAttribute()).append(\"' \");\n }\n\n // style\n if (!getStyleAttribute().isEmpty()) {\n sb.append(\"style='\").append(getStyleAttribute()).append(\"' \");\n }\n\n // title\n if (!getTitleAttribute().isEmpty()) {\n sb.append(\"title='\").append(getTitleAttribute()).append(\"' \");\n }\n\n // custom\n if (!getCustomAttributes().isEmpty()) {\n sb.append(getCustomAttributes()).append(\" \");\n }\n \n // special\n if (!getSpecialAttribute().isEmpty()) {\n sb.append(getSpecialAttribute());\n }\n\n return sb.toString().trim();\n }",
"public WSLAttributeList getAttributes() {return attributes;}",
"public Map<String, Set<String>> getAttributes() {\n return attributes;\n }",
"java.lang.String getAttributesOrThrow(java.lang.String key);",
"private Hashtable getRequestedAttributes() {\n\tif (fRequestedAttributes == null) {\n\t fRequestedAttributes = new Hashtable(7, (float)0.9);\n fRequestedAttributes.put(TextAttribute.TRANSFORM,\n\t\t\t\t IDENT_TX_ATTRIBUTE);\n fRequestedAttributes.put(TextAttribute.FAMILY, name);\n fRequestedAttributes.put(TextAttribute.SIZE, new Float(size));\n\t fRequestedAttributes.put(TextAttribute.WEIGHT,\n\t\t\t\t (style & BOLD) != 0 ? \n\t\t\t\t TextAttribute.WEIGHT_BOLD :\n\t\t\t\t TextAttribute.WEIGHT_REGULAR);\n\t fRequestedAttributes.put(TextAttribute.POSTURE,\n\t\t\t\t (style & ITALIC) != 0 ? \n\t\t\t\t TextAttribute.POSTURE_OBLIQUE :\n\t\t\t\t TextAttribute.POSTURE_REGULAR);\n fRequestedAttributes.put(TextAttribute.SUPERSCRIPT,\n new Integer(superscript));\n fRequestedAttributes.put(TextAttribute.WIDTH,\n new Float(width));\n\t}\n\treturn fRequestedAttributes;\n }",
"@Override\n public List<MappedField<?>> getAttributes() {\n return attributes;\n }",
"public Attribute[] getAttributes()\n {\n return _attrs;\n }",
"java.util.List<tendermint.abci.EventAttribute> \n getAttributesList();",
"public List<Pair<String, String>> getAttributes() {\n\t\treturn attributes;\n\t}",
"@Override\n public ArrayList<SCANAttributesXML> getAttributes() {\n return mesoCfgXML.getAttributesData();\n }",
"String getAttribute();",
"private void separateAttributes() {\n\n String gfuncStr = gridRscData.getGdpfun().replaceAll(\"\\\\s+\", \"\").trim();\n if (gfuncStr != null && gfuncStr.endsWith(\"!\")) {\n gfuncStr = gfuncStr.substring(0, gfuncStr.length() - 1);\n }\n String[] gfuncArray = gfuncStr.split(\"!\", -1);\n\n String[] glevelArray = gridRscData.getGlevel().replaceAll(\"\\\\s+\", \"\")\n .split(\"!\", -1);\n String[] gvcordArray = gridRscData.getGvcord().replaceAll(\"\\\\s+\", \"\")\n .split(\"!\", -1);\n String[] skipArray = gridRscData.getSkip().replaceAll(\"\\\\s+\", \"\")\n .split(\"!\", -1);\n String[] filterArray = gridRscData.getFilter().replaceAll(\"\\\\s+\", \"\")\n .split(\"!\", -1);\n String[] scaleArray = gridRscData.getScale().replaceAll(\"\\\\s+\", \"\")\n .split(\"!\", -1);\n String[] typeArray = gridRscData.getType().replaceAll(\"\\\\s+\", \"\")\n .split(\"!\", -1);\n String[] cintArray = gridRscData.getCint().replaceAll(\"\\\\s+\", \"\")\n .split(\"!\", -1);\n String[] lineArray = gridRscData.getLineAttributes()\n .replaceAll(\"\\\\s+\", \"\").split(\"!\", -1);\n String[] fintArray = gridRscData.getFint().replaceAll(\"\\\\s+\", \"\")\n .split(\"!\", -1);\n String[] flineArray = gridRscData.getFline().replaceAll(\"\\\\s+\", \"\")\n .split(\"!\", -1);\n String[] hiloArray = gridRscData.getHilo().replaceAll(\"\\\\s+\", \"\")\n .split(\"!\", -1);\n String[] hlsymArray = gridRscData.getHlsym().replaceAll(\"\\\\s+\", \"\")\n .split(\"!\", -1);\n String[] windArray = gridRscData.getWind().replaceAll(\"\\\\s+\", \"\")\n .split(\"!\", -1);\n String[] markerArray = gridRscData.getMarker().replaceAll(\"\\\\s+\", \"\")\n .split(\"!\", -1);\n String[] clrbarArray = gridRscData.getClrbar().replaceAll(\"\\\\s+\", \"\")\n .split(\"!\", -1);\n String[] textArray = gridRscData.getText().replaceAll(\"\\\\s+\", \"\")\n .split(\"!\", -1);\n String[] colorArray = gridRscData.getColors().replaceAll(\"\\\\s+\", \"\")\n .split(\"!\", -1);\n /* Clean up cint -- max 5 zoom level */\n if (cintArray != null && cintArray.length > 0) {\n for (int i = 0; i < cintArray.length; i++) {\n String[] tmp = cintArray[i].split(\">\");\n if (tmp.length > 5) {\n cintArray[i] = tmp[0] + \">\" + tmp[1] + \">\" + tmp[2] + \">\"\n + tmp[3] + \">\" + tmp[4];\n }\n }\n }\n\n for (int i = 0; i < gfuncArray.length; i++) {\n if (gfuncArray[i].contains(\"//\")) {\n String[] tmpstr = gfuncArray[i].split(\"//\", 2);\n gfuncArray[i] = tmpstr[0];\n String referencedAlias = tmpstr[1];\n String referencedFunc = tmpstr[0];\n /*\n * Need to substitute all occurrences of referencedAlias with\n * referencedFunc\n */\n for (int j = i + 1; j < gfuncArray.length; j++) {\n /*\n * First need to find out if the gfuncArray[i] is a derived\n * quantity\n */\n gfuncArray[j] = substituteAlias(referencedAlias,\n referencedFunc, gfuncArray[j]);\n }\n } else {\n\n /*\n * Handle blank GDPFUN\n */\n if (gfuncArray[i].isEmpty()) {\n if (i > 0) {\n gfuncArray[i] = gfuncArray[i - 1];\n }\n }\n\n }\n }\n\n contourAttributes = new ContourAttributes[gfuncArray.length];\n\n for (int i = 0; i < gfuncArray.length; i++) {\n contourAttributes[i] = new ContourAttributes();\n contourAttributes[i].setGdpfun(gfuncArray[i]);\n\n if (i == 0) {\n contourAttributes[i].setGlevel(glevelArray[0]);\n contourAttributes[i].setGvcord(gvcordArray[0]);\n contourAttributes[i].setSkip(skipArray[0]);\n contourAttributes[i].setFilter(filterArray[0]);\n contourAttributes[i].setScale(scaleArray[0]);\n contourAttributes[i].setType(typeArray[0]);\n contourAttributes[i].setCint(cintArray[0]);\n contourAttributes[i].setLine(lineArray[0]);\n contourAttributes[i].setFint(fintArray[0]);\n contourAttributes[i].setFline(flineArray[0]);\n contourAttributes[i].setHilo(hiloArray[0]);\n contourAttributes[i].setHlsym(hlsymArray[0]);\n contourAttributes[i].setWind(windArray[0]);\n contourAttributes[i].setMarker(markerArray[0]);\n contourAttributes[i].setClrbar(clrbarArray[0]);\n contourAttributes[i].setText(textArray[0]);\n contourAttributes[i].setColors(colorArray[0]);\n } else {\n int idx = (glevelArray.length > i) ? i\n : (glevelArray.length - 1);\n if (glevelArray[idx].isEmpty() && idx > 0) {\n glevelArray[idx] = glevelArray[idx - 1];\n }\n contourAttributes[i].setGlevel(glevelArray[idx]);\n\n idx = (gvcordArray.length > i) ? i : gvcordArray.length - 1;\n if (gvcordArray[idx].isEmpty() && idx > 0) {\n gvcordArray[idx] = gvcordArray[idx - 1];\n }\n contourAttributes[i].setGvcord(gvcordArray[idx]);\n\n idx = (skipArray.length > i) ? i : skipArray.length - 1;\n if (skipArray[idx].isEmpty() && idx > 0) {\n skipArray[idx] = skipArray[idx - 1];\n }\n contourAttributes[i].setSkip(skipArray[idx]);\n\n idx = (filterArray.length > i) ? i : filterArray.length - 1;\n if (filterArray[idx].isEmpty() && idx > 0) {\n filterArray[idx] = filterArray[idx - 1];\n }\n contourAttributes[i].setFilter(filterArray[idx]);\n\n idx = (scaleArray.length > i) ? i : scaleArray.length - 1;\n if (scaleArray[idx].isEmpty() && idx > 0) {\n scaleArray[idx] = scaleArray[idx - 1];\n }\n contourAttributes[i].setScale(scaleArray[idx]);\n\n idx = (typeArray.length > i) ? i : typeArray.length - 1;\n if (typeArray[idx].isEmpty() && idx > 0) {\n typeArray[idx] = typeArray[idx - 1];\n }\n contourAttributes[i].setType(typeArray[idx]);\n\n idx = (cintArray.length > i) ? i : cintArray.length - 1;\n if (cintArray[idx].isEmpty() && idx > 0) {\n cintArray[idx] = cintArray[idx - 1];\n }\n contourAttributes[i].setCint(cintArray[idx]);\n\n idx = (lineArray.length > i) ? i : lineArray.length - 1;\n if (lineArray[idx].isEmpty() && idx > 0) {\n lineArray[idx] = lineArray[idx - 1];\n }\n contourAttributes[i].setLine(lineArray[idx]);\n\n idx = (fintArray.length > i) ? i : fintArray.length - 1;\n if (fintArray[idx].isEmpty() && idx > 0) {\n fintArray[idx] = fintArray[idx - 1];\n }\n contourAttributes[i].setFint(fintArray[idx]);\n\n idx = (flineArray.length > i) ? i : flineArray.length - 1;\n if (flineArray[idx].isEmpty() && idx > 0) {\n flineArray[idx] = flineArray[idx - 1];\n }\n contourAttributes[i].setFline(flineArray[idx]);\n\n idx = (hiloArray.length > i) ? i : hiloArray.length - 1;\n if (hiloArray[idx].isEmpty() && idx > 0) {\n hiloArray[idx] = hiloArray[idx - 1];\n }\n contourAttributes[i].setHilo(hiloArray[idx]);\n\n idx = (hlsymArray.length > i) ? i : hlsymArray.length - 1;\n if (hlsymArray[idx].isEmpty() && idx > 0) {\n hlsymArray[idx] = hlsymArray[idx - 1];\n }\n contourAttributes[i].setHlsym(hlsymArray[idx]);\n\n idx = (windArray.length > i) ? i : windArray.length - 1;\n if (windArray[idx].isEmpty() && idx > 0) {\n windArray[idx] = windArray[idx - 1];\n }\n contourAttributes[i].setWind(windArray[idx]);\n\n idx = (markerArray.length > i) ? i : markerArray.length - 1;\n if (markerArray[idx].isEmpty() && idx > 0) {\n markerArray[idx] = markerArray[idx - 1];\n }\n contourAttributes[i].setMarker(markerArray[idx]);\n\n idx = (clrbarArray.length > i) ? i : clrbarArray.length - 1;\n if (clrbarArray[idx].isEmpty() && idx > 0) {\n clrbarArray[idx] = clrbarArray[idx - 1];\n }\n contourAttributes[i].setClrbar(clrbarArray[idx]);\n\n idx = (textArray.length > i) ? i : textArray.length - 1;\n if (textArray[idx].isEmpty() && idx > 0) {\n textArray[idx] = textArray[idx - 1];\n }\n contourAttributes[i].setText(textArray[idx]);\n\n idx = (colorArray.length > i) ? i : colorArray.length - 1;\n if (colorArray[idx].isEmpty() && idx > 0) {\n colorArray[idx] = colorArray[idx - 1];\n }\n contourAttributes[i].setColors(colorArray[idx]);\n\n }\n }\n }",
"public Collection<HbAttributeInternal> attributes();",
"public Enumeration getAttributes() {\n\t\treturn url.getAttributes();\n }",
"private String getDataAttributes() {\n StringBuilder sb = new StringBuilder();\n\n dataAttribute.forEach((key, value) -> {\n sb.append(key).append(\"='\").append(value).append(\"' \");\n });\n\n return sb.toString().trim();\n }",
"private byte attributes() {\n return (byte) buffer.getShort(ATTRIBUTES_OFFSET);\n }",
"private String getCustomAttributes() {\n StringBuilder sb = new StringBuilder();\n\n customAttribute.forEach((key, value) -> {\n sb.append(key).append(\"='\").append(value).append(\"' \");\n });\n\n return sb.toString().trim();\n }",
"public Attributes getAttributes() {\n\t\treturn null;\r\n\t}",
"private static final Map<String,String> collectAttrs(final JavaConfig jc)\n {\n final Map<String,String> values = new HashMap<String,String>();\n values.put( \"JavaHome\", jc.getJavaHome() );\n values.put( \"DebugEnabled\", jc.getDebugEnabled() );\n values.put( \"DebugOptions\", jc.getDebugOptions() );\n values.put( \"RmicOptions\", jc.getRmicOptions() );\n values.put( \"JavacOptions\", jc.getJavacOptions() );\n values.put( \"ClasspathPrefix\", jc.getClasspathPrefix() );\n values.put( \"ClasspathSuffix\", jc.getClasspathSuffix() );\n values.put( \"ServerClasspath\", jc.getServerClasspath() );\n values.put( \"SystemClasspath\", jc.getSystemClasspath() );\n values.put( \"NativeLibraryPathPrefix\", jc.getNativeLibraryPathPrefix() );\n values.put( \"NativeLibraryPathSuffix\", jc.getNativeLibraryPathSuffix() );\n values.put( \"BytecodePreprocessors\", jc.getBytecodePreprocessors() );\n values.put( \"EnvClasspathIgnored\", jc.getEnvClasspathIgnored() );\n \n return values;\n }",
"Pair<String, String> getAdditionalAttribute();",
"public Attribute[] getTargetAttributes();",
"public VAttribute[] getAttributes() throws VlException \n {\n return getAttributes(getAttributeNames());\n }",
"@Override\npublic void processAttributes() {\n\t\n}",
"public String[] getAllAttributes() {\n\t\treturn allAttributes;\n\t}",
"public Object[] getAttributes() {\n\t\treturn new Object[] {true}; //true for re-init... \n\t}",
"protected abstract boolean populateAttributes();",
"public Vector getAttributes(boolean create) {\n\treturn attributeFields;\n }",
"tendermint.abci.EventAttribute getAttributes(int index);",
"Attribute getAttribute();",
"@Override\n\tpublic AttributeMap getAttributes() {\n\t\treturn defaultEdgle.getAttributes();\n\t}",
"public List<Attribute> getAttributes() {\r\n return attributes;\r\n }",
"public Map getAttributes() {\n Map common = channel.getAttributes();\n \n if(map == null) {\n map = new HashMap(common);\n }\n return map;\n }",
"public Map<String, Object> getAttributeValues()\n\t{\n\t\tMap<String, Object> retval = new TreeMap<>();\n\t\t\n\t\tfor (ClassAttribute attribute : attributes.keySet())\n\t\t{\n\t\t\tretval.put(attribute.shortName, attributes.get(attribute));\n\t\t}\n\t\t\n\t\treturn retval;\n\t}",
"protected Map<String, String> getElementAttributes() {\n // Preserve order of attributes\n Map<String, String> attrs = new HashMap<>();\n\n if (this.getName() != null) {\n attrs.put(\"name\", this.getName());\n }\n if (this.getValue() != null) {\n attrs.put(\"value\", this.getValue());\n }\n\n return attrs;\n }",
"com.google.protobuf.ByteString getAttributeBytes();",
"public List<Attribute<?>> getAttributes() {\r\n\t\treturn Collections.unmodifiableList(attributes);\r\n\t}",
"public Set<String> getAttributes() {\r\n return attributeMap.keySet();\r\n }",
"@GET\r\n\t@Path(\"/imageattribs\")\r\n\t@Produces(MediaType.APPLICATION_JSON)\r\n\tpublic ImageAttribute getAttribute() {\r\n\t\tString directoryPath = ROOT_PATH_ON_MAC + \"/\" + AuxiliaryHelper.loadServerProperties().getProperty(\"image.folder\") + \"/\" ;\r\n\t\tFile folder = new File(directoryPath);\r\n\t\tFile[] files = folder.listFiles();\r\n\t\tString name = \"\";\r\n\t\tlong space = 0l;\r\n\t\tif(files.length > 0) {\r\n\t\t\tname = files[0].getName();\r\n\t\t\tspace = files[0].getTotalSpace();\r\n\t\t}\r\n\t\tImageAttribute imageAttribute = new ImageAttribute();\r\n\t\timageAttribute.setName(name);\r\n\t\timageAttribute.setSize(space);\r\n\t\treturn imageAttribute;\r\n\r\n\t}",
"public List<String> attributes() {\n return this.attributes;\n }",
"public Map<String, String> getAttributes() {\n return Collections.unmodifiableMap(attributes);\n }",
"private ArrayList<Attribute> getAttributes() {\n\t\tif (attributes != null && attributes instanceof ArrayList)\n\t\t\treturn ((ArrayList<Attribute>) attributes);\n\t\telse {\n\t\t\tArrayList<Attribute> tmp = new ArrayList<Attribute>();\n\t\t\tif (attributes != null)\n\t\t\t\ttmp.addAll(attributes);\n\t\t\tattributes = tmp;\n\t\t\treturn tmp;\n\t\t}\n\t}",
"public List<GenericAttribute> getAttributes() {\n return attributes;\n }",
"@Override\n public List<ConfigurationNode> getAttributes(String name)\n {\n return attributes.getSubNodes(name);\n }",
"public String[] getAttributeArray() {\n\t\treturn url.getAttributeArray();\n }",
"@Override\n\tpublic Map<String, Object> getAttributeMap() {\n\t\treturn null;\n\t}",
"@java.lang.Override\n public google.maps.fleetengine.v1.VehicleAttribute getAttributes(int index) {\n return attributes_.get(index);\n }",
"private DenseMatrix extractAttributes(Instances instances){\n\n\n\n\n\n int numInstances = instances.numInstances();\n int numAttributes = instances.numAttributes();\n\n DenseMatrix AttributesMatrix = new DenseMatrix(numAttributes-1, numInstances); // except for classAttribute\n\n\n int index = 0; // index of attributeMatrix's row\n for (int i =0; i<numAttributes; i++){\n\n if (i != classIndex) {\n\n for (int j = 0; j < numInstances; j++) {\n AttributesMatrix.set(index, j, instances.instance(j).value(i));\n\n }\n\n index++;\n }\n\n }\n\n\n\n return AttributesMatrix;\n }",
"public List<String> getAttributes(Class<?> classType) {\n\t\tList<String> properties = new ArrayList<>();\n\t\tfor (String property : attributes.keySet())\n\t\t\tif (getAttribute(property) != null && getAttribute(property) != null && getAttribute(property).getClass().equals(classType))\n\t\t\t\tif (!properties.contains(property))\n\t\t\t\t\tproperties.add(property);\n\t\treturn properties;\n\t}",
"boolean hasAttributes();",
"boolean hasAttributes();",
"public final String getAttributesString() {\n String returnAttributes = \"\";\n boolean debut = true;\n for (int i = 0; i < this.attributes.length; i++) {\n if (debut) {\n debut = false;\n } else {\n returnAttributes += \"|\";\n }\n returnAttributes += this.attributes[i];\n }\n return returnAttributes;\n }",
"public FactAttributes getAttributes() {\r\n return localAttributes;\r\n }",
"public Attributes[] getAllAttributes() \r\n {\r\n\tfinal Attributes[] array = new Attributes[ntMap.size()];\r\n\tint i=0;\r\n\tfor (final NodeTypeHolder nt : ntMap.values())\r\n\t array[i++] = nt.getAttributes();\r\n\treturn array;\r\n }",
"public List<GenericPair<String, String>> getAttributes(String htmlCode) {\n htmlCode = htmlCode.replaceAll(\"<\", EMPTY_STRING).replaceAll(\">\", EMPTY_STRING).trim();\n List<GenericPair<String, String>> attributes = new ArrayList<>();\n String valueAttribute = EMPTY_STRING;\n boolean hasSpace = false;\n GenericPair<Integer, String> nameAttribute = getNameAttribute(htmlCode);\n attributes.add(new GenericPair(\"name\", nameAttribute.getSecond()));\n attributes.addAll(getAttributes(nameAttribute.getFirst(), htmlCode.trim()));\n return attributes;\n }",
"@Override\n public AttributeList getAttributes(String[] attributes) {\n return null;\n }",
"Map<String, String> getAttr(NodeKey key);"
] | [
"0.77672106",
"0.77060777",
"0.764907",
"0.764907",
"0.764907",
"0.73944855",
"0.73662126",
"0.7337933",
"0.7337933",
"0.7274053",
"0.7272954",
"0.71663094",
"0.7141731",
"0.709252",
"0.70213944",
"0.69656736",
"0.68758875",
"0.68027544",
"0.67953783",
"0.67307085",
"0.6717588",
"0.6707569",
"0.6703479",
"0.66973066",
"0.6681136",
"0.6602989",
"0.65974694",
"0.6596444",
"0.65822786",
"0.6579905",
"0.6548747",
"0.6548747",
"0.65408784",
"0.65361947",
"0.6507221",
"0.6506076",
"0.65048385",
"0.648674",
"0.6481604",
"0.6436717",
"0.6427217",
"0.642373",
"0.64022976",
"0.6397534",
"0.63800746",
"0.6378821",
"0.63559407",
"0.63414985",
"0.6341129",
"0.63377225",
"0.6332497",
"0.6327752",
"0.63228804",
"0.63209784",
"0.63101697",
"0.6271667",
"0.62660897",
"0.6255991",
"0.62340283",
"0.62330616",
"0.6188011",
"0.618497",
"0.61206496",
"0.6118132",
"0.61162204",
"0.60987574",
"0.60965514",
"0.60909253",
"0.608087",
"0.6080585",
"0.60799265",
"0.6074572",
"0.6063948",
"0.60581064",
"0.60550725",
"0.6054662",
"0.60446894",
"0.6042725",
"0.6030549",
"0.60196865",
"0.600829",
"0.6001579",
"0.5982965",
"0.5982246",
"0.59812015",
"0.59806323",
"0.5969979",
"0.5969921",
"0.5963451",
"0.5951281",
"0.5946034",
"0.5942227",
"0.59271187",
"0.59253436",
"0.59253436",
"0.5910142",
"0.58941793",
"0.58848834",
"0.58781534",
"0.5877458",
"0.58762956"
] | 0.0 | -1 |
This is the constructor, not the class declaration | public GameScreen() {
int midPointY = (int) (Const.GAME_HEIGHT / 2);
world = new GameWorld(midPointY);
renderer = new GameRenderer(world);
Gdx.input.setInputProcessor(new InputHandler(world.getVentilatorUp(), world.getVentilatorDown()));
// Gdx.input.setInputProcessor(new
// InputHandler(world.getVentilatorTwo()));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Constructor() {\r\n\t\t \r\n\t }",
"public Constructor(){\n\t\t\n\t}",
"public CyanSus() {\n\n }",
"public PSRelation()\n {\n }",
"private Instantiation(){}",
"private Rekenhulp()\n\t{\n\t}",
"public Pitonyak_09_02() {\r\n }",
"public _355() {\n\n }",
"private TMCourse() {\n\t}",
"public Orbiter() {\n }",
"public Chick() {\n\t}",
"public CSSTidier() {\n\t}",
"public Pasien() {\r\n }",
"@SuppressWarnings(\"unused\")\n public NoConstructor() {\n // Empty\n }",
"public Clade() {}",
"public SgaexpedbultoImpl()\n {\n }",
"public Aanbieder() {\r\n\t\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"public Lanceur() {\n\t}",
"public Chauffeur() {\r\n\t}",
"public Mannschaft() {\n }",
"public Phl() {\n }",
"@Override\n public void init() {}",
"public Curso() {\r\n }",
"public Trening() {\n }",
"private Converter()\n\t{\n\t\tsuper();\n\t}",
"public Parser()\n {\n //nothing to do\n }",
"protected Betaling()\r\n\t{\r\n\t\t\r\n\t}",
"public Mitarbeit() {\r\n }",
"public Anschrift() {\r\n }",
"@Override\r\n\tpublic void init() {}",
"private void __sep__Constructors__() {}",
"public Parameters() {\n\t}",
"public Coche() {\n super();\n }",
"@Override\n\t\tpublic void init() {\n\t\t}",
"public Method() {\n }",
"private Marinator() {\n }",
"private Marinator() {\n }",
"public Tbdtokhaihq3() {\n super();\n }",
"defaultConstructor(){}",
"public Soil()\n\t{\n\n\t}",
"public Self__1() {\n }",
"public JSFOla() {\n }",
"public Cohete() {\n\n\t}",
"@Override public void init()\n\t\t{\n\t\t}",
"public Odontologo() {\n }",
"public Achterbahn() {\n }",
"public Zeffit()\n {\n // TODO: initialize instance variable(s)\n }",
"@Override\n void init() {\n }",
"@Override\n public void init() {\n }",
"public mapper3c() { super(); }",
"public AirAndPollen() {\n\n\t}",
"@Override\n public void init() {\n }",
"private Node() {\n\n }",
"public SlanjePoruke() {\n }",
"protected GraphNode() {\n }",
"protected GraphNode() {\n }",
"public ExamMB() {\n }",
"public RngObject() {\n\t\t\n\t}",
"public Excellon ()\n {}",
"public Tbdcongvan36() {\n super();\n }",
"public EnsembleLettre() {\n\t\t\n\t}",
"private ATCres() {\r\n // prevent to instantiate this class\r\n }",
"public Supercar() {\r\n\t\t\r\n\t}",
"private Road()\n\t{\n\t\t\n\t}",
"private SimpleRepository() {\n \t\t// private ct to disallow external object creation\n \t}",
"public void init() {\r\n\t\t// to override\r\n\t}",
"public ChaCha()\n\t{\n\t\tsuper();\n\t}",
"public Person() {\n\t\t\n\t}",
"public Tigre() {\r\n }",
"@Override\n protected void init() {\n }",
"protected StreamParser()\n {\n }",
"public AntrianPasien() {\r\n\r\n }",
"public Magazzino() {\r\n }",
"protected abstract void construct();",
"private SingleObject()\r\n {\r\n }",
"ConstructorPractice () {\n\t\tSystem.out.println(\"Default Constructor\");\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 init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"private Solution() {\n /**.\n * { constructor }\n */\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 Goodsinfo() {\n super();\n }",
"public Spec__1() {\n }",
"@Override\n public void init() {\n\n }",
"public Demo() {\n\t\t\n\t}",
"public CMN() {\n\t}",
"private DarthSidious(){\n }",
"private Infer() {\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 public void initialize() {}"
] | [
"0.8496339",
"0.83125263",
"0.7630571",
"0.7583408",
"0.75236744",
"0.7463118",
"0.7405229",
"0.7374676",
"0.73718274",
"0.7355323",
"0.7342831",
"0.7326976",
"0.7254203",
"0.72439474",
"0.7229902",
"0.7202963",
"0.7202822",
"0.7191192",
"0.7184763",
"0.7173076",
"0.7162084",
"0.7150178",
"0.7143467",
"0.7139336",
"0.7134409",
"0.7131085",
"0.71260333",
"0.71194667",
"0.7108991",
"0.7108234",
"0.7107199",
"0.7104445",
"0.7104048",
"0.7095589",
"0.7091069",
"0.70846444",
"0.70724636",
"0.70724636",
"0.7065141",
"0.7063909",
"0.7059727",
"0.70567775",
"0.7047966",
"0.704771",
"0.704524",
"0.70402217",
"0.7036509",
"0.70324945",
"0.70270395",
"0.7022894",
"0.70210934",
"0.70171916",
"0.7013363",
"0.70076156",
"0.7006816",
"0.6994409",
"0.6994409",
"0.6982346",
"0.6980708",
"0.69788927",
"0.69772214",
"0.6967909",
"0.69632953",
"0.6961928",
"0.6955094",
"0.69541633",
"0.6953815",
"0.6952658",
"0.6952363",
"0.6951906",
"0.6951103",
"0.69494396",
"0.69449",
"0.69406927",
"0.6933045",
"0.6932546",
"0.6908436",
"0.6898921",
"0.6898921",
"0.6898921",
"0.68976843",
"0.68976843",
"0.68976843",
"0.68976843",
"0.68976843",
"0.68967164",
"0.68936664",
"0.6892555",
"0.689179",
"0.6888753",
"0.68879217",
"0.6885824",
"0.68813175",
"0.6879137",
"0.68769914",
"0.68769914",
"0.68769914",
"0.68769914",
"0.68769914",
"0.68769914",
"0.6876974"
] | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public int hashCode() {
return year*10000+month*100+day;
} | {
"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 |
/ 8 53 98 183 37 122 14 124 65 67 9 120 38 180 130 10 50 15 190 90 150 9 80 162 20 70 190 150 185 10 110 50 | public static void main(String[] args) {
int n = in.nextInt();
int q = in.nextInt();
int[] arr = new int[n];
for (int i = 0; i < n; i++) {
arr[i] = in.nextInt();
}
DiskSchedulerInfo dsi = new DiskSchedulerInfo(arr, q, 200);
ISchedule[] scs = new ISchedule[]{
new FCFS(dsi),
new SSTF(dsi),
new SCAN(dsi),
new C_SCAN(dsi),
new LOOK(dsi),
new C_LOOK(dsi),
new Optimized(dsi)
};
for (ISchedule sc : scs) {
System.out.println("---------------------------");
System.out.println(sc.getClass().getName());
System.out.println("---------------------------");
sc.simulate();
Movement.printMovements(dsi.headStart, sc.getMovements());
System.out.print("Order of processing: ");
for (int v : sc.getOrderOfProcessing()) {
System.out.print(v + " ");
}
System.out.println();
System.out.println("Total Movement is: " + Movement.getTotalMovements(sc.getMovements()));
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static void main(String[] args) {\n\t\tRandom rnd = new Random();\n\t\tint[]data = new int[1];\n\t\tint i=0;\n\t\tfor(i=0;i<1;i++){\n\t\t\tdata[i]=rnd.nextInt(1000)+1;\n\t\t\tSystem.out.println(data[i]);\n\t\t\t\tint v1 = data[i]/500;\n\t\t\t\tdata[i] = data[i]%500;\n\t\t\t\tif(v1!=0){\n\t\t\t\t\tSystem.out.println(\"共有\"+v1+\"個500元\");\n\t\t\t\t}\n\t\t\t\tint v2 = data[i]/100;\n\t\t\t\tdata[i] = data[i]%100;\n\t\t\t\tif(v2!=0){\n\t\t\t\t\tSystem.out.println(\"共有\"+v2+\"個100元\");\n\t\t\t\t}\n\t\t\t\tint v3 = data[i]/50;\n\t\t\t\tdata[i] = data[i]%50;\n\t\t\t\tif(v3!=0){\n\t\t\t\t\tSystem.out.println(\"共有\"+v3+\"個50元\"); \n\t\t\t\t}\n\t\t\t\tint v4 = data[i]/10;\n\t\t\t\tdata[i] = data[i]%10;\n\t\t\t\tif(v4!=0){\n\t\t\t\t\tSystem.out.println(\"共有\"+v4+\"個10元\");\n\t\t\t\t}\n\t\t\t\tint v5 = data[i]/5;\n\t\t\t\tdata[i] = data[i]%5;\n\t\t\t\tif(v5!=0){\n\t\t\t\t\tSystem.out.println(\"共有\"+v5+\"個5元\");\n\t\t\t\t}\n\t\t\t\n\t\t\t\tint v6 = data[i]/1;\n\t\t\t\tdata[i] = data[i]%1;\n\t\t\t\tif(v6!=0){\n\t\t\t\t\tSystem.out.println(\"共有\"+v6+\"個1元\");\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\t\t\t \n\t\t\t\t \n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}",
"Integer getDataLgth();",
"public static void main(String[] args) {\n\r\n\t\tScanner sc = new Scanner(System.in);\r\n\r\n\t\tint num = sc.nextInt();\r\n\t\tint snum[] = new int[4];\r\n\t\tint count = 0;\r\n\t\tint k1 = 0;\r\n\t\tint k2 = 0;\r\n\r\n\t\twhile (num != 6174) { // 반복\r\n\r\n\t\t\tcount++;\r\n\r\n\t\t\tsnum[0] = num / 1000; // 1000의자리수\r\n\t\t\tsnum[1] = (num - (snum[0] * 1000)) / 100; // 100의 자리수\r\n\t\t\tsnum[2] = (num - ((snum[0] * 1000) + (snum[1] * 100))) / 10; // 10의자리수\r\n\t\t\tsnum[3] = num % 10; // 1의자리수\r\n\r\n\t\t\tint temp;\r\n\t\t\tfor (int i = 0; i < snum.length; i++) {\r\n\t\t\t\tfor (int j = 0; j < snum.length; j++) {\r\n\t\t\t\t\ttemp = snum[i];\r\n\t\t\t\t\tif (snum[i] >= snum[j]) { // 큰수부터 정렬\r\n\t\t\t\t\t\tsnum[i] = snum[j];\r\n\t\t\t\t\t\tsnum[j] = temp;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tk1 = Integer.parseInt(Integer.toString(snum[0]) + snum[1] + snum[2] + snum[3]); // 큰\r\n\t\t\tk2 = Integer.parseInt(Integer.toString(snum[3]) + snum[2] + snum[1] + snum[0]); // 작은\r\n\r\n\t\t\tnum = k1 - k2; // 뺀\r\n\r\n\t\t}\r\n\t\tSystem.out.println(count);\r\n\t}",
"public int mo36g() {\n return 8;\n }",
"public static void main(String[] args) {\n int[][] bn = new int[127][];\n \n for(int i = 1; i <128; i++)\n {\n int m = (int) (Math.log10(i)/Math.log10(2));\n \n int l = i, j = 2*m; int[] b = new int[2*m+1]; \n \n while(l >= 1)\n {\n int k = l;\n l = l/2;\n \n b[j] = k - l*2; j--;\n }\n \n bn[i-1] = b;\n }\n \n /*int[] ds = new int[255*255*8];*/ int[] df = new int[14]; Arrays.fill(df, 0);\n //int l = 0;\n \n for(int i = 0; i <127; i++)\n {\n for(int j = 0; j<127; j++)\n {\n int k, d = 0;\n for(k = 0; k < bn[i].length; k++)\n { \n if(bn[i][k] == 0)\n {\n d++;\n }\n else if(d > 0)\n {\n //System.out.print(d+\",\");\n df[d-1]++; d = 0;\n }\n }\n \n for(k = 0; k < bn[j].length; k++)\n {\n if(bn[j][k] == 0)\n {\n d++;\n }\n else if(d > 0)\n {\n //System.out.print(d+\",\");\n df[d-1]++; d = 0;\n }\n }\n \n if(d > 0)\n {\n //System.out.print(d+\",\");\n df[d-1]++; d = 0;\n }\n }\n }\n double sum = sum(df); int[] numb = {1,3,3,5,5,5,5,7,7,7,7,7,7,7,7}; int tb = 0;\n \n for(int i = 0; i < 14; i++)\n {\n tb = tb + (int)((df[i]*100/sum) + 0.5)*numb[i];\n \n System.out.print((int)((df[i]*100/sum) + 0.5)+\",\");\n }\n System.out.println();\n System.out.println(tb);\n }",
"public static void main(String[] args) {\n\t\t\r\n\t\tint i, x=4,w=9,q;\r\n\t\tfor(i=-1;i<20;i+=3) {\r\n\t\t\tx++;\r\n\t\t\tfor(q=4;q<11;q++) {\r\n\t\t\t\tdo {\r\n\t\t\t\t\ti=+3;\r\n\t\t\t\t\tw=sizeof(i);\r\n\t\t\t\t\ti=x+w;\r\n\t\t\t\t\tx=w+i;\r\n\t\t\t\t\t\t\r\n\t\t\t\t} while (x<15);\r\n\t\t\t}\r\n\t\t}\r\n\t\tSystem.out.println(\"x:\"+x+\"i:\"+i);\r\n\r\n\t}",
"public static void main(String[] args) {\n \tString s = \"[94,93,95,92,94,96,94,93,93,93,95,97,97,95,95,92,94,94,94,92,94,94,96,98,98,96,98,96,94,94,96,91,91,93,95,93,95,95,95,91,93,93,95,95,93,97,97,97,97,97,99,95,97,97,99,95,97,93,95,null,95,95,95,90,92,90,92,92,94,94,96,94,null,96,94,94,94,96,null,90,92,null,null,94,null,94,96,null,null,null,null,96,null,null,null,96,98,96,96,96,96,100,100,94,94,98,96,96,96,98,100,94,96,98,98,94,94,94,96,null,null,94,96,94,94,89,91,null,93,91,91,91,91,null,91,null,null,null,null,null,null,93,95,95,95,93,95,null,null,95,93,null,null,null,null,null,93,null,95,93,95,null,97,95,97,95,95,97,99,97,97,null,97,95,null,95,97,101,101,99,99,95,null,93,null,97,99,95,97,97,97,95,95,99,97,101,99,93,93,95,97,97,99,99,null,null,null,null,95,95,95,97,95,null,null,95,null,null,95,null,null,88,88,92,null,null,94,90,92,92,92,90,90,90,92,90,92,null,null,null,94,94,96,null,null,null,94,null,null,null,null,94,null,null,null,94,null,null,null,96,null,96,96,94,94,null,null,null,96,96,94,96,96,100,100,96,98,96,96,null,96,94,null,94,96,null,null,100,102,100,null,null,100,98,98,94,96,92,94,96,98,98,98,94,94,96,98,96,98,96,98,null,96,96,94,98,98,96,98,100,102,98,null,92,94,92,94,96,null,null,null,96,98,98,100,100,100,94,96,94,null,null,96,96,98,null,null,null,null,96,94,null,null,87,89,91,null,null,null,89,89,null,91,93,93,null,93,89,91,89,91,91,89,93,null,91,null,null,null,null,93,null,null,null,null,null,null,null,null,null,null,null,null,null,95,97,null,95,null,null,95,95,97,95,97,95,null,95,95,97,97,101,101,101,101,95,95,97,99,95,null,95,97,97,null,95,null,93,95,null,null,null,null,101,103,99,null,null,101,null,null,null,null,null,93,97,97,null,91,null,95,97,97,97,null,97,null,97,99,95,95,93,null,null,97,97,null,95,null,null,99,95,97,97,99,95,97,95,97,93,95,99,97,97,99,95,97,97,99,99,99,101,101,null,99,91,null,null,null,null,null,null,93,null,97,95,95,97,null,97,97,101,99,null,99,99,null,null,null,97,97,null,null,null,null,97,97,null,null,null,95,null,null,null,null,null,null,null,null,null,null,null,null,92,null,null,null,null,null,null,94,88,null,null,null,90,90,null,null,null,null,88,88,null,null,null,90,null,null,null,null,null,null,null,null,96,96,96,96,96,96,96,94,null,null,96,96,94,null,94,96,96,null,98,96,100,102,null,null,102,102,null,100,94,96,94,null,96,98,98,null,94,96,96,null,98,null,null,null,96,94,null,null,null,94,null,null,null,104,null,100,null,102,null,null,96,96,96,96,null,92,null,96,null,96,null,null,96,null,null,null,null,null,98,null,null,null,94,94,null,null,null,98,null,96,null,null,100,null,96,96,96,98,96,98,98,100,94,null,null,null,null,null,null,98,94,92,96,96,null,100,96,null,98,null,98,100,94,94,96,98,null,96,98,100,98,98,100,100,102,100,100,null,null,null,null,92,92,null,null,null,96,94,null,96,98,98,96,98,96,null,102,null,98,null,null,null,100,100,null,null,null,null,96,98,96,98,null,94,null,null,95,null,87,null,null,91,91,91,87,null,null,89,91,null,null,null,null,null,null,null,null,null,97,95,95,97,null,null,null,null,97,95,null,null,93,null,95,93,null,null,95,null,97,99,95,95,99,null,null,103,101,null,null,103,null,99,95,95,null,95,95,93,null,97,null,null,null,null,93,95,95,97,null,null,null,null,97,null,null,null,null,null,null,null,101,null,101,103,97,97,95,null,null,null,null,97,null,null,95,null,null,null,null,97,null,null,93,93,null,null,97,null,null,null,99,null,95,95,null,null,97,95,null,null,95,null,97,null,97,99,99,null,null,null,null,99,93,95,91,93,97,97,95,95,101,99,null,null,null,null,99,null,null,null,93,null,93,95,97,95,97,99,95,95,97,99,99,101,97,null,null,99,99,99,null,null,103,103,101,101,null,101,null,93,null,91,null,95,null,95,null,97,99,99,97,99,97,97,97,null,95,95,null,null,null,97,101,99,99,101,null,null,null,null,95,null,null,null,93,null,null,null,null,88,null,null,null,null,null,null,null,null,88,null,90,92,null,null,94,96,null,null,96,96,98,null,96,96,null,null,94,96,92,null,94,null,96,98,100,100,null,96,94,null,null,null,102,null,null,null,null,102,null,null,94,94,94,96,null,96,null,null,92,94,96,null,94,null,94,94,null,96,null,98,null,null,null,100,100,102,null,null,98,null,96,98,null,null,null,null,null,null,null,null,94,94,null,94,null,null,null,null,94,96,96,96,96,96,null,96,null,null,96,96,98,98,null,100,98,100,null,null,null,94,94,96,92,92,92,94,null,98,null,98,94,96,94,96,null,null,null,100,null,null,92,null,92,94,null,96,98,96,96,null,98,98,98,null,96,null,96,96,null,null,null,100,98,null,null,100,96,98,null,null,98,98,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,96,96,98,null,null,100,100,96,98,100,98,null,null,96,98,98,98,96,null,94,null,null,null,null,100,98,null,100,null,null,102,null,null,null,null,null,null,87,null,null,null,null,null,95,95,null,97,null,null,null,97,97,null,95,97,95,97,95,null,null,null,null,null,null,null,95,null,null,null,null,null,null,101,97,null,93,null,null,null,null,103,null,null,95,null,95,93,95,95,95,null,null,93,null,93,null,null,null,null,95,95,null,null,95,97,97,99,null,null,null,null,103,null,null,null,95,95,99,null,93,null,null,null,null,null,93,95,97,95,95,97,null,97,97,null,95,null,null,null,null,null,95,97,99,97,97,99,null,null,99,97,101,null,95,null,null,93,97,97,91,93,91,93,93,91,93,93,null,null,99,97,93,93,95,97,93,null,null,95,null,null,null,93,91,93,95,95,95,97,null,null,null,null,null,null,99,null,null,null,null,null,97,null,95,null,null,null,null,null,99,null,null,null,95,95,null,97,97,null,99,99,95,null,null,null,null,null,null,101,99,null,95,95,null,null,null,null,97,99,null,95,99,null,97,null,null,null,97,null,null,null,101,null,99,null,null,null,103,null,null,null,null,null,94,94,null,null,null,null,null,98,94,94,null,null,null,null,96,null,96,null,null,96,null,102,null,98,null,null,null,null,null,null,null,null,94,94,null,94,96,94,null,null,null,null,null,null,null,94,94,null,null,null,null,null,null,null,null,100,null,null,96,94,null,96,null,null,null,null,94,null,null,null,null,96,null,null,94,null,null,96,null,null,96,null,null,null,null,null,96,null,null,null,96,96,null,98,null,null,98,null,null,null,null,102,null,null,92,94,96,null,96,96,null,90,null,null,92,92,null,92,92,null,null,92,null,92,94,92,null,100,96,null,94,null,null,94,96,null,98,null,92,94,94,96,null,null,92,90,null,null,94,null,94,96,94,96,98,96,null,null,null,null,94,96,null,null,94,null,94,94,null,null,null,98,98,null,null,100,null,null,null,102,null,null,96,null,null,96,null,null,null,null,96,null,100,null,null,null,null,null,null,102,null,null,104,104,null,null,null,null,null,97,null,95,95,null,95,97,null,null,95,null,null,103,null,97,95,95,null,null,93,93,null,null,null,95,null,null,null,93,null,null,97,null,93,null,null,null,null,null,95,null,null,null,null,null,null,null,95,97,95,null,95,null,97,99,null,null,null,null,91,93,null,95,null,null,null,97,95,null,89,null,null,91,null,null,null,null,null,null,null,null,91,null,93,95,93,91,null,null,95,null,93,null,95,null,null,null,null,null,null,93,null,null,null,95,null,null,null,null,89,null,null,95,null,null,95,null,95,93,null,null,null,97,95,null,null,null,95,null,null,null,null,95,null,95,99,null,97,null,null,null,null,103,95,null,95,null,null,97,null,null,null,null,null,null,null,null,null,null,null,96,94,null,null,null,98,null,null,null,104,null,null,null,null,null,null,null,null,null,94,94,null,null,null,94,null,98,94,null,null,96,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,94,null,null,null,null,null,null,null,null,null,92,null,null,null,null,94,null,94,null,92,null,94,92,94,94,96,94,92,null,null,null,null,94,94,null,null,96,null,92,null,96,null,null,null,null,null,null,null,94,null,null,null,96,null,null,102,null,null,null,null,null,null,null,null,null,null,null,null,null,null,93,null,93,null,null,null,99,null,null,null,null,null,null,null,null,null,null,null,null,null,null,91,null,null,null,91,null,null,null,null,null,97,null,null,null,91,null,95,null,null,null,null,null,null,null,97,null,null,null,null,101,null,94,null,null,null,null,null,null,92,null,null,null,96,null,null,94,null,null,96,null,null,93,null,null,null,null,null,null,null,97]\";\r\n\t\tTreeNode one = TreeNode.str2tree(s);\r\n \tFindDuplicateSubtrees3 findDuplicateSubtrees = new FindDuplicateSubtrees3();\r\n\t\tList<TreeNode> result = findDuplicateSubtrees.findDuplicateSubtrees(one);\r\n\t\tfor (TreeNode treeNode : result) {\r\n\t\t\tSystem.out.println(treeNode);\r\n\t\t}\r\n\t}",
"public static void main(String[] args) {\r\n\t\t// TODO Auto-generated method stub\r\n\t\t/*80\r\n\t\tint matches = 3162;\r\n\t\tint results = 1218;\r\n\t\tint pairs = 146;\r\n\t\t*/\r\n\t\t//70\r\n\t\t/*int matches = 3302;\r\n\t\tint results = 909;\r\n\t\tint pairs = 59;*/\r\n\r\n\t\tfor(int i=1;i<=10;i++)\r\n\t\t{\r\n\t\t\tdouble b = (0.1*i)*((matches*3)+(results*3)+(pairs*3));\r\n\t\t\tSystem.out.print(Math.round(b)+\",\");\r\n\t\t}\t\r\n\t\r\n\t}",
"C5537g mo4096b(int i);",
"private static int m31084a(zzss zzss) {\n int a = zzss.mo32193a(5);\n if (a == 31) {\n return zzss.mo32193a(6) + 32;\n }\n return a;\n }",
"public static int offset_sum_e() {\n return (104 / 8);\n }",
"private static int getBytes(long r23) {\n /*\n java.lang.ThreadLocal<byte[]> r0 = TEMP_NUMBER_BUFFER\n java.lang.Object r0 = r0.get()\n byte[] r0 = (byte[]) r0\n r1 = 20\n if (r0 != 0) goto L_0x0013\n byte[] r0 = new byte[r1]\n java.lang.ThreadLocal<byte[]> r2 = TEMP_NUMBER_BUFFER\n r2.set(r0)\n L_0x0013:\n r2 = -9223372036854775808\n r4 = 54\n r5 = 57\n r6 = 45\n r7 = 53\n r8 = 56\n r9 = 55\n r10 = 51\n r11 = 50\n r12 = 0\n r13 = 48\n r14 = 1\n int r15 = (r23 > r2 ? 1 : (r23 == r2 ? 0 : -1))\n if (r15 != 0) goto L_0x0076\n r0[r12] = r6\n r0[r14] = r5\n r2 = 2\n r0[r2] = r11\n r2 = 3\n r0[r2] = r11\n r2 = 4\n r0[r2] = r10\n r2 = 5\n r0[r2] = r10\n r2 = 6\n r0[r2] = r9\n r2 = 7\n r0[r2] = r11\n r2 = 8\n r0[r2] = r13\n r2 = 9\n r0[r2] = r10\n r2 = 10\n r0[r2] = r4\n r2 = 11\n r0[r2] = r8\n r2 = 12\n r0[r2] = r7\n r2 = 13\n r3 = 52\n r0[r2] = r3\n r2 = 14\n r0[r2] = r9\n r2 = 15\n r0[r2] = r9\n r2 = 16\n r0[r2] = r7\n r2 = 17\n r0[r2] = r8\n r2 = 18\n r0[r2] = r13\n r2 = 19\n r0[r2] = r8\n return r1\n L_0x0076:\n r1 = 0\n int r3 = (r23 > r1 ? 1 : (r23 == r1 ? 0 : -1))\n if (r3 != 0) goto L_0x007f\n r0[r12] = r13\n return r14\n L_0x007f:\n if (r3 >= 0) goto L_0x0088\n r0[r12] = r6\n long r15 = java.lang.Math.abs(r23)\n goto L_0x008b\n L_0x0088:\n r14 = 0\n r15 = r23\n L_0x008b:\n r17 = 9\n r19 = 10\n r21 = 1\n int r3 = (r15 > r17 ? 1 : (r15 == r17 ? 0 : -1))\n if (r3 > 0) goto L_0x0099\n r17 = r21\n goto L_0x017e\n L_0x0099:\n r17 = 99\n int r3 = (r15 > r17 ? 1 : (r15 == r17 ? 0 : -1))\n if (r3 > 0) goto L_0x00a3\n r17 = r19\n goto L_0x017e\n L_0x00a3:\n r17 = 999(0x3e7, double:4.936E-321)\n int r3 = (r15 > r17 ? 1 : (r15 == r17 ? 0 : -1))\n if (r3 > 0) goto L_0x00ad\n r17 = 100\n goto L_0x017e\n L_0x00ad:\n r17 = 9999(0x270f, double:4.94E-320)\n int r3 = (r15 > r17 ? 1 : (r15 == r17 ? 0 : -1))\n if (r3 > 0) goto L_0x00b7\n r17 = 1000(0x3e8, double:4.94E-321)\n goto L_0x017e\n L_0x00b7:\n r17 = 99999(0x1869f, double:4.9406E-319)\n int r3 = (r15 > r17 ? 1 : (r15 == r17 ? 0 : -1))\n if (r3 > 0) goto L_0x00c2\n r17 = 10000(0x2710, double:4.9407E-320)\n goto L_0x017e\n L_0x00c2:\n r17 = 999999(0xf423f, double:4.94065E-318)\n int r3 = (r15 > r17 ? 1 : (r15 == r17 ? 0 : -1))\n if (r3 > 0) goto L_0x00ce\n r17 = 100000(0x186a0, double:4.94066E-319)\n goto L_0x017e\n L_0x00ce:\n r17 = 9999999(0x98967f, double:4.940656E-317)\n int r3 = (r15 > r17 ? 1 : (r15 == r17 ? 0 : -1))\n if (r3 > 0) goto L_0x00da\n r17 = 1000000(0xf4240, double:4.940656E-318)\n goto L_0x017e\n L_0x00da:\n r17 = 99999999(0x5f5e0ff, double:4.9406564E-316)\n int r3 = (r15 > r17 ? 1 : (r15 == r17 ? 0 : -1))\n if (r3 > 0) goto L_0x00e6\n r17 = 10000000(0x989680, double:4.9406565E-317)\n goto L_0x017e\n L_0x00e6:\n r17 = 999999999(0x3b9ac9ff, double:4.940656453E-315)\n int r3 = (r15 > r17 ? 1 : (r15 == r17 ? 0 : -1))\n if (r3 > 0) goto L_0x00f2\n r17 = 100000000(0x5f5e100, double:4.94065646E-316)\n goto L_0x017e\n L_0x00f2:\n r17 = 9999999999(0x2540be3ff, double:4.940656458E-314)\n int r3 = (r15 > r17 ? 1 : (r15 == r17 ? 0 : -1))\n if (r3 > 0) goto L_0x0100\n r17 = 1000000000(0x3b9aca00, double:4.94065646E-315)\n goto L_0x017e\n L_0x0100:\n r17 = 99999999999(0x174876e7ff, double:4.94065645836E-313)\n int r3 = (r15 > r17 ? 1 : (r15 == r17 ? 0 : -1))\n if (r3 > 0) goto L_0x0110\n r17 = 10000000000(0x2540be400, double:4.9406564584E-314)\n goto L_0x017e\n L_0x0110:\n r17 = 999999999999(0xe8d4a50fff, double:4.940656458408E-312)\n int r3 = (r15 > r17 ? 1 : (r15 == r17 ? 0 : -1))\n if (r3 > 0) goto L_0x011f\n r17 = 100000000000(0x174876e800, double:4.9406564584E-313)\n goto L_0x017e\n L_0x011f:\n r17 = 9999999999999(0x9184e729fff, double:4.940656458412E-311)\n int r3 = (r15 > r17 ? 1 : (r15 == r17 ? 0 : -1))\n if (r3 > 0) goto L_0x012e\n r17 = 1000000000000(0xe8d4a51000, double:4.94065645841E-312)\n goto L_0x017e\n L_0x012e:\n r17 = 99999999999999(0x5af3107a3fff, double:4.9406564584124E-310)\n int r3 = (r15 > r17 ? 1 : (r15 == r17 ? 0 : -1))\n if (r3 > 0) goto L_0x013d\n r17 = 10000000000000(0x9184e72a000, double:4.9406564584125E-311)\n goto L_0x017e\n L_0x013d:\n r17 = 999999999999999(0x38d7ea4c67fff, double:4.94065645841246E-309)\n int r3 = (r15 > r17 ? 1 : (r15 == r17 ? 0 : -1))\n if (r3 > 0) goto L_0x014c\n r17 = 100000000000000(0x5af3107a4000, double:4.94065645841247E-310)\n goto L_0x017e\n L_0x014c:\n r17 = 9999999999999999(0x2386f26fc0ffff, double:5.431165199810527E-308)\n int r3 = (r15 > r17 ? 1 : (r15 == r17 ? 0 : -1))\n if (r3 > 0) goto L_0x015b\n r17 = 1000000000000000(0x38d7ea4c68000, double:4.940656458412465E-309)\n goto L_0x017e\n L_0x015b:\n r17 = 99999999999999999(0x16345785d89ffff, double:5.620395787888204E-302)\n int r3 = (r15 > r17 ? 1 : (r15 == r17 ? 0 : -1))\n if (r3 > 0) goto L_0x016a\n r17 = 10000000000000000(0x2386f26fc10000, double:5.431165199810528E-308)\n goto L_0x017e\n L_0x016a:\n r17 = 999999999999999999(0xde0b6b3a763ffff, double:7.832953389245684E-242)\n int r3 = (r15 > r17 ? 1 : (r15 == r17 ? 0 : -1))\n if (r3 > 0) goto L_0x0179\n r17 = 100000000000000000(0x16345785d8a0000, double:5.620395787888205E-302)\n goto L_0x017e\n L_0x0179:\n r17 = 1000000000000000000(0xde0b6b3a7640000, double:7.832953389245686E-242)\n L_0x017e:\n long r1 = r15 / r17\n int r3 = (int) r1\n switch(r3) {\n case 0: goto L_0x01b6;\n case 1: goto L_0x01af;\n case 2: goto L_0x01aa;\n case 3: goto L_0x01a5;\n case 4: goto L_0x019e;\n case 5: goto L_0x0199;\n case 6: goto L_0x0194;\n case 7: goto L_0x018f;\n case 8: goto L_0x018a;\n case 9: goto L_0x0185;\n default: goto L_0x0184;\n }\n L_0x0184:\n goto L_0x01bb\n L_0x0185:\n int r3 = r14 + 1\n r0[r14] = r5\n goto L_0x01ba\n L_0x018a:\n int r3 = r14 + 1\n r0[r14] = r8\n goto L_0x01ba\n L_0x018f:\n int r3 = r14 + 1\n r0[r14] = r9\n goto L_0x01ba\n L_0x0194:\n int r3 = r14 + 1\n r0[r14] = r4\n goto L_0x01ba\n L_0x0199:\n int r3 = r14 + 1\n r0[r14] = r7\n goto L_0x01ba\n L_0x019e:\n int r3 = r14 + 1\n r6 = 52\n r0[r14] = r6\n goto L_0x01ba\n L_0x01a5:\n int r3 = r14 + 1\n r0[r14] = r10\n goto L_0x01ba\n L_0x01aa:\n int r3 = r14 + 1\n r0[r14] = r11\n goto L_0x01ba\n L_0x01af:\n int r3 = r14 + 1\n r6 = 49\n r0[r14] = r6\n goto L_0x01ba\n L_0x01b6:\n int r3 = r14 + 1\n r0[r14] = r13\n L_0x01ba:\n r14 = r3\n L_0x01bb:\n int r3 = (r17 > r21 ? 1 : (r17 == r21 ? 0 : -1))\n if (r3 != 0) goto L_0x01c0\n goto L_0x01d8\n L_0x01c0:\n java.lang.Long.signum(r17)\n long r1 = r1 * r17\n long r15 = r15 - r1\n r1 = 0\n int r3 = (r15 > r1 ? 1 : (r15 == r1 ? 0 : -1))\n if (r3 != 0) goto L_0x01d9\n L_0x01cc:\n int r1 = (r17 > r21 ? 1 : (r17 == r21 ? 0 : -1))\n if (r1 <= 0) goto L_0x01d8\n int r1 = r14 + 1\n r0[r14] = r13\n long r17 = r17 / r19\n r14 = r1\n goto L_0x01cc\n L_0x01d8:\n return r14\n L_0x01d9:\n long r17 = r17 / r19\n goto L_0x017e\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.unboundid.util.ByteStringBuffer.getBytes(long):int\");\n }",
"public void testTwoWayDistribution() {\n for(int p = 0; p < 20; p++) {\n int[] landings = new int[2];\n for(long in = 0; in < 100000; in++) {\n long longHash = FPGenerator.std64.fp(p+\"a\"+in);\n// long longHash = rand.nextLong();\n// long longHash = ArchiveUtils.doubleMurmur((p+\":\"+in).getBytes());\n landings[conhash.bucketFor(longHash, 2)]++;\n }\n// System.out.println(landings[0]+\",\"+landings[1]);\n assertTrue(\"excessive changes\",Math.abs(landings[0]-landings[1]) < 2000); \n }\n }",
"private static byte[] m17790a(Bitmap bitmap) {\n int i;\n int i2;\n int i3;\n int width = bitmap.getWidth();\n int height = bitmap.getHeight();\n OutputStream byteArrayOutputStream = new ByteArrayOutputStream();\n for (i = 0; i < 32; i++) {\n byteArrayOutputStream.write(0);\n }\n int[] iArr = new int[(width - 2)];\n bitmap.getPixels(iArr, 0, width, 1, 0, width - 2, 1);\n Object obj = iArr[0] == -16777216 ? 1 : null;\n Object obj2 = iArr[iArr.length + -1] == -16777216 ? 1 : null;\n int length = iArr.length;\n width = 0;\n int i4 = 0;\n for (i2 = 0; i2 < length; i2++) {\n if (width != iArr[i2]) {\n i4++;\n C5225r.m17788a(byteArrayOutputStream, i2);\n width = iArr[i2];\n }\n }\n if (obj2 != null) {\n i4++;\n C5225r.m17788a(byteArrayOutputStream, length);\n }\n int i5 = i4;\n int i6 = i5 + 1;\n if (obj != null) {\n i = i6 - 1;\n } else {\n i = i6;\n }\n if (obj2 != null) {\n i3 = i - 1;\n } else {\n i3 = i;\n }\n iArr = new int[(height - 2)];\n bitmap.getPixels(iArr, 0, 1, 0, 1, 1, height - 2);\n obj = iArr[0] == -16777216 ? 1 : null;\n obj2 = iArr[iArr.length + -1] == -16777216 ? 1 : null;\n length = iArr.length;\n width = 0;\n i4 = 0;\n for (i2 = 0; i2 < length; i2++) {\n if (width != iArr[i2]) {\n i4++;\n C5225r.m17788a(byteArrayOutputStream, i2);\n width = iArr[i2];\n }\n }\n if (obj2 != null) {\n i4++;\n C5225r.m17788a(byteArrayOutputStream, length);\n }\n i6 = i4 + 1;\n if (obj != null) {\n i = i6 - 1;\n } else {\n i = i6;\n }\n if (obj2 != null) {\n i--;\n }\n for (i6 = 0; i6 < i3 * i; i6++) {\n C5225r.m17788a(byteArrayOutputStream, 1);\n }\n byte[] toByteArray = byteArrayOutputStream.toByteArray();\n toByteArray[0] = (byte) 1;\n toByteArray[1] = (byte) i5;\n toByteArray[2] = (byte) i4;\n toByteArray[3] = (byte) (i * i3);\n C5225r.m17787a(bitmap, toByteArray);\n return toByteArray;\n }",
"private UInteger[] getHashValues() {\n int hashWindowSize = 48;\n UInteger[] hashValues = new UInteger[this.fileContent.length];\n int shiftAmount = this.getShiftAmount(hashWindowSize);\n int i = 0;\n\n int[] lookupTable =\n {0x5e3f7c48, 0x796a0d2b, 0xbecd4e32, 0x6f16159c, 0x687312bc, 0x12a6f30a, 0x8fca2662,\n 0x79b83d14, 0x3fab3f30, 0x984d6ca2, 0x4df5fe6c, 0x4acd3196, 0x6245ad21,\n 0x3a15e5ba, 0x90db6499, 0x05aacb6b, 0x791cf724, 0x504cd910, 0x98093570,\n 0x090392df, 0xf193e5b8, 0x42023c5b, 0x80a95c6a, 0x11e676be, 0xc70f2117,\n 0xeed4587f, 0x6479e9bd, 0x1b0c427c, 0x410486ba, 0x30f5b837, 0xf957d307,\n 0x1535f121, 0xabe45e90, 0x7a1ab8f0, 0x1c6887e4, 0x4170b7ba, 0x8b491bed,\n 0x5c920e73, 0x1b1ed791, 0x7a0ed482, 0xcce86619, 0x45dc7290, 0x57e71362,\n 0x2e24f01c, 0x0a0637f3, 0x0e8c5565, 0x15944012, 0x34f7eeea, 0xbc628141,\n 0x1e200874, 0xe9244379, 0x3e63aeca, 0x7a3b3cce, 0x73f8a245, 0xd734e215,\n 0x834fa434, 0xf96a0904, 0xfb39a424, 0x0bfa963a, 0x9b236ee2, 0xa2131005,\n 0x3eb70acf, 0x2907bcd8, 0x3f685f3a, 0x3765fd37, 0x1c1c34d2, 0x03a95179,\n 0x024be6c3, 0x06128960, 0x844e7490, 0xe2b371a3, 0x3382909c, 0x3d519a77,\n 0x90971ec9, 0x6ea745e5, 0x490b3a5c, 0x7f3916f7, 0xbc150351, 0x241a7ba0,\n 0xec93c2bb, 0x6c7083aa, 0xf3937751, 0xe6aa1df1, 0x129fc001, 0xb90709b9,\n 0x7e59a4fc, 0x4509e58a, 0x8a93ed43, 0x6934ce62, 0x8ec6af1a, 0xf36581a9,\n 0x53d01d93, 0xb34eef69, 0x08494a84, 0x0f6dff34, 0x74729aa3, 0x48b5475f,\n 0xb986dc84, 0xd0424c8d, 0xb72ad089, 0x0adbbdb8, 0x824fdbe8, 0x99ad1058,\n 0x98faec38, 0xe746242b, 0x2b7ee7fc, 0x2e151fa7, 0x6413270f, 0x68ed7239,\n 0x7729e2d3, 0x5697b3a5, 0x0b90a6c3, 0xdf7cefcf, 0xded46a48, 0x46956888,\n 0xb3bb6dc4, 0xe987578f, 0xf82e74b7, 0xc8eeeba4, 0xdd960ff9, 0x482ed28d,\n 0x4f343078, 0x563ab8a4, 0x3ec7aa0d, 0x2481d448, 0x5fe98704, 0x5aafc580,\n 0x841d81ec, 0xae7fe8fd, 0x6b31ccb6, 0x911ebdd4, 0x75f4703d, 0xe6855a0f,\n 0x6184b42e, 0x147a4a95, 0x39528e48, 0xe975b416, 0x3cba13d3, 0x1e23e544,\n 0xf7955286, 0xa5f96b7f, 0xaaa697aa, 0x29e794e3, 0x87628c09, 0xfeebf5f1,\n 0xf8b070cd, 0xe361b627, 0x8c7a8682, 0x69cab331, 0xca867ad1, 0xd0151a96,\n 0xfc19a6b9, 0x6d7439e7, 0x64cd62ac, 0x4a650747, 0x9ddbfa28, 0x337c8bed,\n 0xf12a6860, 0x3767ffd3, 0x13559ced, 0x71ac2011, 0xc11dc687, 0x260b7105,\n 0xc13bca0c, 0xcd0af893, 0x793b54e6, 0x89d27fc3, 0xc6bd1c88, 0xe3337313,\n 0x387bc671, 0x61280de4, 0x76941a36, 0xaa52a2b9, 0x6d7cb52c, 0x18ff4d70,\n 0x8987cf38, 0x306e47ed, 0xf7df8135, 0x18a8e024, 0xc9eb085f, 0xc1a7c769,\n 0xd5667a12, 0x9c8be93a, 0x028781b1, 0x6213dada, 0x07fef4f5, 0x5e6bf91d,\n 0x469ea798, 0xb9654a37, 0x1cb5e74e, 0x525d502d, 0xe805ec68, 0xdd8c4320,\n 0x7890848f, 0x61e59c8e, 0x1d99f9ef, 0x25b60b20, 0x2f198088, 0xe01b6926,\n 0xffa4917f, 0xb2fa0f22, 0xee8ac924, 0x18a1c5a7, 0xb76d8d7f, 0x88ad5e0d,\n 0x7b3fb12b, 0xc8a91add, 0x762a6f4e, 0x056fad31, 0xebecfab8, 0xea54cd17,\n 0x71f5af9f, 0xfaececa1, 0x08a52f4d, 0xbb5efebe, 0x5bcb04c2, 0xcb2530b0,\n 0x01bb862b, 0xbb5d54f0, 0x404deb4b, 0x038658bd, 0x09399005, 0xddd862c8,\n 0x8985776f, 0xcfcfd717, 0xbec756cb, 0x52aecc5a, 0x09ac3f62, 0x62c1c6fb,\n 0x76cc3221, 0xcde6d028, 0x844d9291, 0xc143eeac, 0x0ea5e772, 0x8855456e,\n 0xeb03a426, 0x3398475d, 0x73dc8107, 0x681605d0, 0xd18b6264, 0x934e43eb,\n 0x59e76d21, 0xd3ce2b77, 0x4ccfee1c, 0x2f4af76d, 0x8b12a309, 0x849bb415,\n 0xf45ad809, 0xc7bccae7, 0xac891c35, 0x59db2274, 0xbcd71393, 0x2c9b1705,\n 0xcb536a69, 0xb2800f00, 0x111313fc};\n\n while (i < this.fileContent.length) {\n UInteger hashValue = i == 0 ? uint(0) : hashValues[i - 1];\n int trailingEdgeData = i < hashWindowSize ? ubyte(0).intValue() :\n ubyte(this.fileContent[i - hashWindowSize]).intValue();\n int leadingEdgeData = ubyte(this.fileContent[i]).intValue();\n UInteger val = hashValue.xor(uint(lookupTable[trailingEdgeData]))\n .xor(uint(lookupTable[leadingEdgeData]));\n hashValues[i] =\n val.leftShift(2).inclusiveOr(val.rightShift(Integer.SIZE - shiftAmount));\n i++;\n }\n\n return hashValues;\n }",
"public int mo12191c() {\n return this.f10948c.limit() + this.f10957l.length + (this.f10958m.length * 4);\n }",
"static void d() {\n\t\t\t\tint B[] = new int[12];\n\t\t\t\tint tam = 0, tam1 = 0;\n\t\t\t\tB[0] = 12;\n\t\t\t\tB[1] = 21;\n\t\t\t\tB[2] = 47;\n\t\t\t\tB[3] = 9;\n\t\t\t\tB[4] = 56;\n\t\t\t\tB[5] = 43;\n\t\t\t\tB[6] = 50;\n\t\t\t\tB[7] = 54;\n\t\t\t\tB[8] = 51;\n\t\t\t\tB[9] = 41;\n\t\t\t\tB[10] = 97;\n\t\t\t\tB[11] = 12;\n\t\t\t\tint max = B[0];\n\t\t\t\tfor (int i = 1; i < B.length; i++) {\n\t\t\t\t\tif (B[i] > max) {\n\t\t\t\t\t\tmax = B[i];\n\t\t\t\t\t\ttam = i;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfor (int i = tam; i > 0; i--) {\n\t\t\t\t\tB[i] = B[i - 1];\n\t\t\t\t}\n\t\t\t\tB[0] = max;\n\n\t\t\t\tinMang(B);\n\n\t\t\t\tmax = B[1];\n\t\t\t\ttam = 0;\n\t\t\t\tfor (int i = 2; i < B.length; i++) {\n\t\t\t\t\tif (B[i] > max) {\n\t\t\t\t\t\tmax = B[i];\n\t\t\t\t\t\ttam = i;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tfor (int i = tam; i > 1; i--) {\n\t\t\t\t\tB[i] = B[i - 1];\n\t\t\t\t}\n\t\t\t\tB[1] = max;\n\t\t\t\tinMang(B);\n\n\t\t\t\tmax = B[2];\n\t\t\t\ttam = 0;\n\t\t\t\tfor (int i = 3; i < B.length; i++) {\n\t\t\t\t\tif (B[i] > max) {\n\t\t\t\t\t\tmax = B[i];\n\t\t\t\t\t\ttam = i;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tfor (int i = tam; i > 2; i--) {\n\t\t\t\t\tB[i] = B[i - 1];\n\t\t\t\t}\n\t\t\t\tB[2] = max;\n\t\t\t\tinMang(B);\n\t}",
"int[] mo56160d();",
"public static void main(String[] args){\n float w = 11.56E2f;\n int hh = (int)w;\n System.out.println(hh);\n \n System.out.println((int)11.56);\n int cents = (int)(11.56 * 100);\n System.out.println(cents);\n System.out.println(4/7.0);\n System.out.println(Math.random());\n \n System.out.println(Toolkit.getDefaultToolkit().getScreenSize());\n int width=1366,height=768;\n Toolkit.getDefaultToolkit().getScreenSize();\n System.out.println(\"Loop to print first 10 numbers\");\n \n int [] number = {1,2,3,4,5,6,7,8,9,10};\n int total = 0;\n for(int n:number){\n total = total + n;\n }\n System.out.println(total);\n\n System.out.println(\"Loop to print first 10 numbers without arrays\");\n int counter = 0;\n for(int i = 0; i<=10; i++){\n counter = counter + i;\n }\n System.out.println(counter);\n }",
"private static void eval7(){\n int z = 0;\n for(int i = 0; i < 46; i++){\n for(int j = i + 1; j < 47; j++){\n for(int k = j + 1; k < 48; k++){\n for(int l = k + 1; l < 49; l++){\n for(int m = l + 1; m < 50; m++){\n for(int n = m + 1; n < 51; n++){\n for(int o = n + 1; o < 52; o++){\n Evaluator.evaluate(i, j, k, l, m, n, o);\n }\n }\n }\n }\n }\n }\n }\n }",
"private int m3423z(int i, int i2) {\n int i3;\n int i4;\n for (int size = this.f4373c.size() - 1; size >= 0; size--) {\n C0933b bVar = this.f4373c.get(size);\n int i5 = bVar.f4379a;\n if (i5 == 8) {\n int i6 = bVar.f4380b;\n int i7 = bVar.f4382d;\n if (i6 < i7) {\n i4 = i6;\n i3 = i7;\n } else {\n i3 = i6;\n i4 = i7;\n }\n if (i < i4 || i > i3) {\n if (i < i6) {\n if (i2 == 1) {\n bVar.f4380b = i6 + 1;\n bVar.f4382d = i7 + 1;\n } else if (i2 == 2) {\n bVar.f4380b = i6 - 1;\n bVar.f4382d = i7 - 1;\n }\n }\n } else if (i4 == i6) {\n if (i2 == 1) {\n bVar.f4382d = i7 + 1;\n } else if (i2 == 2) {\n bVar.f4382d = i7 - 1;\n }\n i++;\n } else {\n if (i2 == 1) {\n bVar.f4380b = i6 + 1;\n } else if (i2 == 2) {\n bVar.f4380b = i6 - 1;\n }\n i--;\n }\n } else {\n int i8 = bVar.f4380b;\n if (i8 <= i) {\n if (i5 == 1) {\n i -= bVar.f4382d;\n } else if (i5 == 2) {\n i += bVar.f4382d;\n }\n } else if (i2 == 1) {\n bVar.f4380b = i8 + 1;\n } else if (i2 == 2) {\n bVar.f4380b = i8 - 1;\n }\n }\n }\n for (int size2 = this.f4373c.size() - 1; size2 >= 0; size2--) {\n C0933b bVar2 = this.f4373c.get(size2);\n if (bVar2.f4379a == 8) {\n int i9 = bVar2.f4382d;\n if (i9 == bVar2.f4380b || i9 < 0) {\n this.f4373c.remove(size2);\n mo7620a(bVar2);\n }\n } else if (bVar2.f4382d <= 0) {\n this.f4373c.remove(size2);\n mo7620a(bVar2);\n }\n }\n return i;\n }",
"public final int mo30256g() {\n return this.f7581c.f7036c.size();\n }",
"public static void main(String[] args) {\n\t\tbyte c = 20; //0x14\r\n\t\tbyte d = -8; //0xf8\r\n\t\t\r\n\t\tSystem.out.println(\"[시프트 연산 결과]\");\r\n\t\tSystem.out.println(c<<2);//c값을 2비트 왼쪽 시프트\r\n\t\tSystem.out.println(c>>2);//c값을 2비트 오른쪽 시프트, 왼쪽에 최상위 비트 0삽입(양수)\r\n\t\tSystem.out.println(d>>2);//d값을 2비트 오른쪽 시프트, 왼쪽에 최상위 비트 1삽입(음수)\r\n\r\n\t\r\n\t\tSystem.out.printf(\"%04x\\n\", d);//shift이전의 값 00 f \t 8\r\n\t\t\t\t\t\t\t\t\t //\t\t\t \t1111 1000 ->(00삽입)0011 1110(삭제00\r\n\t\t\r\n\t\tSystem.out.printf(\"%x\\n\", (byte)(d>>>2));\r\n\t\t\r\n\t\tSystem.out.printf(\"%x\\n\", (int)d);//fffffff8\r\n\t\tSystem.out.printf(\"%x\\n\", (d>>>2));\r\n\t\tSystem.out.printf(\"%x\\n\", (d>>>2));//d를 2비트 오른쪽 시프트, 왼쪽에 무조건 0이 삽입됨\r\n\t\t// 3 f f f f f f e (int타입으로 변환됨)\r\n\t\t//0011 1111 1111 1111 1111 1111 1111 1110\r\n\t\t//1111\t1111 1111 1111 1111 1111 1111 1000((int)d)\r\n\t\t//0011\t1111 1111 1111 1111 1111 1111 1110(d>>>2)\r\n\t}",
"public static void populateValues()\n\t{\n\t\tvalues = new int[127];\n\t\tfor(int i = 0; i < 127; i++)\n\t\t{\n\t\t\tif(i < 64)\n\t\t\t\tvalues[i] = 1;\n\t\t\telse if (i < 96)\n\t\t\t\tvalues[i] = 2;\n\t\t\telse if (i < 112)\n\t\t\t\tvalues[i] = 4;\n\t\t\telse if (i < 120)\n\t\t\t\tvalues[i] = 8;\n\t\t\telse if (i < 124)\n\t\t\t\tvalues[i] = 16;\n\t\t\telse if (i < 126)\n\t\t\t\tvalues[i] = 32;\n\t\t\telse \n\t\t\t\tvalues[i] = 64;\n\t\t}\n\t}",
"Integer getLNDFlgs();",
"public byte[] initialValue() {\n return new byte[]{(byte) -1, (byte) -40, (byte) -1, (byte) -37, (byte) 0, (byte) 67, (byte) 0, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -64, (byte) 0, (byte) 17, (byte) 8, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 3, (byte) 1, (byte) 34, (byte) 0, (byte) 2, (byte) 17, (byte) 0, (byte) 3, (byte) 17, (byte) 0, (byte) -1, (byte) -60, (byte) 0, (byte) 31, (byte) 0, (byte) 0, (byte) 1, (byte) 5, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 1, (byte) 2, (byte) 3, (byte) 4, (byte) 5, (byte) 6, (byte) 7, (byte) 8, (byte) 9, (byte) 10, (byte) 11, (byte) -1, (byte) -60, (byte) 0, (byte) -75, (byte) 16, (byte) 0, (byte) 2, (byte) 1, (byte) 3, (byte) 3, (byte) 2, (byte) 4, (byte) 3, (byte) 5, (byte) 5, (byte) 4, (byte) 4, (byte) 0, (byte) 0, (byte) 1, (byte) 125, (byte) 1, (byte) 2, (byte) 3, (byte) 0, (byte) 4, (byte) 17, (byte) 5, (byte) 18, (byte) 33, (byte) 49, (byte) 65, (byte) 6, (byte) 19, (byte) 81, (byte) 97, (byte) 7, (byte) 34, (byte) 113, (byte) 20, (byte) 50, (byte) -127, (byte) -111, (byte) -95, (byte) 8, (byte) 35, (byte) 66, (byte) -79, (byte) -63, (byte) 21, (byte) 82, (byte) -47, (byte) -16, (byte) 36, (byte) 51, (byte) 98, (byte) 114, (byte) -126, (byte) 9, (byte) 10, (byte) 22, (byte) 23, (byte) 24, (byte) 25, (byte) 26, (byte) 37, (byte) 38, (byte) 39, (byte) 40, (byte) 41, (byte) 42, (byte) 52, (byte) 53, (byte) 54, (byte) 55, (byte) 56, (byte) 57, (byte) 58, (byte) 67, (byte) 68, (byte) 69, (byte) 70, (byte) 71, (byte) 72, (byte) 73, (byte) 74, (byte) 83, (byte) 84, (byte) 85, (byte) 86, (byte) 87, (byte) 88, (byte) 89, (byte) 90, (byte) 99, (byte) 100, (byte) 101, (byte) 102, (byte) 103, (byte) 104, (byte) 105, (byte) 106, (byte) 115, (byte) 116, (byte) 117, (byte) 118, (byte) 119, (byte) 120, (byte) 121, (byte) 122, (byte) -125, (byte) -124, (byte) -123, (byte) -122, (byte) -121, (byte) -120, (byte) -119, (byte) -118, (byte) -110, (byte) -109, (byte) -108, (byte) -107, (byte) -106, (byte) -105, (byte) -104, (byte) -103, (byte) -102, (byte) -94, (byte) -93, (byte) -92, (byte) -91, (byte) -90, (byte) -89, (byte) -88, (byte) -87, (byte) -86, (byte) -78, (byte) -77, (byte) -76, (byte) -75, (byte) -74, (byte) -73, (byte) -72, (byte) -71, (byte) -70, (byte) -62, (byte) -61, (byte) -60, (byte) -59, (byte) -58, (byte) -57, (byte) -56, (byte) -55, (byte) -54, (byte) -46, (byte) -45, (byte) -44, (byte) -43, (byte) -42, (byte) -41, (byte) -40, (byte) -39, (byte) -38, (byte) -31, (byte) -30, (byte) -29, (byte) -28, (byte) -27, (byte) -26, (byte) -25, (byte) -24, (byte) -23, (byte) -22, (byte) -15, (byte) -14, (byte) -13, (byte) -12, (byte) -11, (byte) -10, (byte) -9, (byte) -8, (byte) -7, (byte) -6, (byte) -1, (byte) -60, (byte) 0, (byte) 31, (byte) 1, (byte) 0, (byte) 3, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 1, (byte) 2, (byte) 3, (byte) 4, (byte) 5, (byte) 6, (byte) 7, (byte) 8, (byte) 9, (byte) 10, (byte) 11, (byte) -1, (byte) -60, (byte) 0, (byte) -75, (byte) 17, (byte) 0, (byte) 2, (byte) 1, (byte) 2, (byte) 4, (byte) 4, (byte) 3, (byte) 4, (byte) 7, (byte) 5, (byte) 4, (byte) 4, (byte) 0, (byte) 1, (byte) 2, (byte) 119, (byte) 0, (byte) 1, (byte) 2, (byte) 3, (byte) 17, (byte) 4, (byte) 5, (byte) 33, (byte) 49, (byte) 6, (byte) 18, (byte) 65, (byte) 81, (byte) 7, (byte) 97, (byte) 113, (byte) 19, (byte) 34, (byte) 50, (byte) -127, (byte) 8, (byte) 20, (byte) 66, (byte) -111, (byte) -95, (byte) -79, (byte) -63, (byte) 9, (byte) 35, (byte) 51, (byte) 82, (byte) -16, (byte) 21, (byte) 98, (byte) 114, (byte) -47, (byte) 10, (byte) 22, (byte) 36, (byte) 52, (byte) -31, (byte) 37, (byte) -15, (byte) 23, (byte) 24, (byte) 25, (byte) 26, (byte) 38, (byte) 39, (byte) 40, (byte) 41, (byte) 42, (byte) 53, (byte) 54, (byte) 55, (byte) 56, (byte) 57, (byte) 58, (byte) 67, (byte) 68, (byte) 69, (byte) 70, (byte) 71, (byte) 72, (byte) 73, (byte) 74, (byte) 83, (byte) 84, (byte) 85, (byte) 86, (byte) 87, (byte) 88, (byte) 89, (byte) 90, (byte) 99, (byte) 100, (byte) 101, (byte) 102, (byte) 103, (byte) 104, (byte) 105, (byte) 106, (byte) 115, (byte) 116, (byte) 117, (byte) 118, (byte) 119, (byte) 120, (byte) 121, (byte) 122, (byte) -126, (byte) -125, (byte) -124, (byte) -123, (byte) -122, (byte) -121, (byte) -120, (byte) -119, (byte) -118, (byte) -110, (byte) -109, (byte) -108, (byte) -107, (byte) -106, (byte) -105, (byte) -104, (byte) -103, (byte) -102, (byte) -94, (byte) -93, (byte) -92, (byte) -91, (byte) -90, (byte) -89, (byte) -88, (byte) -87, (byte) -86, (byte) -78, (byte) -77, (byte) -76, (byte) -75, (byte) -74, (byte) -73, (byte) -72, (byte) -71, (byte) -70, (byte) -62, (byte) -61, (byte) -60, (byte) -59, (byte) -58, (byte) -57, (byte) -56, (byte) -55, (byte) -54, (byte) -46, (byte) -45, (byte) -44, (byte) -43, (byte) -42, (byte) -41, (byte) -40, (byte) -39, (byte) -38, (byte) -30, (byte) -29, (byte) -28, (byte) -27, (byte) -26, (byte) -25, (byte) -24, (byte) -23, (byte) -22, (byte) -14, (byte) -13, (byte) -12, (byte) -11, (byte) -10, (byte) -9, (byte) -8, (byte) -7, (byte) -6, (byte) -1, (byte) -38, (byte) 0, (byte) 12, (byte) 3, (byte) 1, (byte) 0, (byte) 2, (byte) 17, (byte) 3, (byte) 17, (byte) 0, (byte) 63, (byte) 0, (byte) -114, (byte) -118, (byte) 40, (byte) -96, (byte) 15, (byte) -1, (byte) -39};\n }",
"long getUnknown72();",
"public int mo36g() {\n return 4;\n }",
"public abstract Integer mo36210m();",
"public static void main(String[] args) {\n\n\t\tint a = 10000;\n\t\tint num = 325489;\n\t\tint [][] lst = new int[a][a];\n\t\tint x = a/4, y = a/4;\n\t\tfinal int x0 = x,y0 = y;\n\t\tint layer = 0,cnt =1;\n\t\twhile (cnt <= num)\n\t\t{\n\t\t\tif (cnt == (2*layer+1)*(2*layer+1))\n\t\t\t{\n\t\t\t\tlst[x][y] = cnt;\n\t\t\t\ty++;\n\t\t\t\tlayer++;\n\t\t\t\tcnt++;\n\t\t\t}\n\t\t\tfor (int j = 0 ; j < layer*2-1;j++)\n\t\t\t{\n\t\t\t\tlst[x][y] = cnt;\n\t\t\t\tx++;\n\t\t\t\tcnt++;\n\t\t\t}\n\t\t\tfor (int j = 0 ; j < layer * 2;j++)\n\t\t\t{\n\t\t\t\tlst[x][y] = cnt;\n\t\t\t\ty--;\n\t\t\t\tcnt++;\n\t\t\t}\n\t\t\tfor (int j = 0 ; j < layer * 2;j++)\n\t\t\t{\n\t\t\t\tlst[x][y] = cnt;\n\t\t\t\tx--;\n\t\t\t\tcnt++;\n\t\t\t}\n\t\t\tfor (int j = 0 ; j < layer * 2;j++)\n\t\t\t{\n\t\t\t\tlst[x][y] = cnt;\n\t\t\t\ty++;\n\t\t\t\tcnt++;\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t\n\t\tint finalX = findx(lst,num);\n\t\tint finalY = findy(lst,num);\n\t\tSystem.out.println(Math.abs(finalY - y) + (finalX - x));\n\t}",
"public static void main(String[] args) {\n\n\t\tSystem.out.println(180%30);\n\t\tSystem.out.println(12%30);\n\t\tSystem.out.println(179%30);\n\t\tSystem.out.println(30%30);\n\t\tint docNum= 10, docCount=10;\n\t\tSystem.out.println(\"Math.log docNum / docCount:\"+ Math.log((double) docNum / docCount));\n\t\tSystem.out.println(SvmUtil.parseWord(\"你愛我嗎\"));\n\t\tString test = \"中華民國,中華民國,中華民國,中華民國,中華民國,中華民國,中華民國,中華民國,中華民國,中華民國\";\n\t\tString ssss = \"中華民國\";\n\t\tSystem.out.println(ssss.matches(\"[\\\\u4e00-\\\\u9fa5]+\"));\n\n\t\tSvmUtil.init();\n\t\tSystem.out.println(SvmUtil.labelToName(3d));\n\t\tSystem.out.println(SvmUtil.nameToLabel(\"資管處\"));\n\t\tSystem.out.println(\"frequency:\" + SvmUtil.frequency(test, \"中華\"));\n\t\tlong startTime = System.currentTimeMillis();\n\t\tfor (int i = 0; i <= 1000; i++)\n\t\t\tSvmUtil.frequency(test, \"中\");\n\t\tSystem.out.println(\"search Time:\" + (double) (System.currentTimeMillis() - startTime) / 1000d + \" s\");\n\n\t\tSet<String> testSet = new HashSet<String>();\n\t\ttestSet.add(\"中華民國\");\n\t\ttestSet.add(\"中華\");\n\t\ttestSet.add(\"中華民國\");\n\t\tSystem.out.println(testSet);\n\n\t\tjiebaAnalysis();\n\t\t// float value = (float) Math.log(987654 / 999);\n\t\t// System.out.println(value);\n\t\t// int i=100;\n\t\t// long l =9999;\n\t\t// System.out.println(String.format(\"% 5d\", i));\n\t\t// System.out.println(String.format(\"% 5d\", l));\n\t}",
"public int arn() {\n return 383;\n }",
"private static String[] getValidMiniFloatBitSequences(){\r\n int nbrValues = (int)Math.pow(2, MINI_FLOAT_SIZE);\r\n\r\n String[] result = new String[nbrValues];\r\n for(int i = 0; i < nbrValues; i++){\r\n\r\n String full = String.format(\"%\" + Integer.SIZE + \"s\", Integer.toBinaryString(i))\r\n .replace(' ', '0');\r\n result[i] = full.substring(Integer.SIZE - MINI_FLOAT_SIZE, Integer.SIZE);\r\n }\r\n return result;\r\n }",
"public void mo35665a() {\n int i = 0;\n int i2 = 0;\n while (true) {\n byte[] bArr = this.f31120b;\n if (i2 >= bArr.length) {\n break;\n }\n bArr[i2] = -1;\n i2++;\n }\n while (true) {\n byte[] bArr2 = this.f31119a;\n if (i < bArr2.length) {\n this.f31120b[bArr2[i]] = (byte) i;\n i++;\n } else {\n byte[] bArr3 = this.f31120b;\n bArr3[65] = bArr3[97];\n bArr3[66] = bArr3[98];\n bArr3[67] = bArr3[99];\n bArr3[68] = bArr3[100];\n bArr3[69] = bArr3[101];\n bArr3[70] = bArr3[102];\n return;\n }\n }\n }",
"public int mo163c() {\n int size = this.f1963b.size();\n if (size < 1) {\n return 0;\n }\n int i = f1962a;\n return ((size / i) * (Lca.m828b(i) + 4)) + 4 + Lca.m828b(size % i);\n }",
"public static boolean testMonobit(byte[] data) \r\n {\r\n if( data.length != 2500 )\r\n throw new IllegalArgumentException(\"2500 bytes expected\");\r\n \r\n int total = 0;\r\n for(int i=0; i<2500; i++) {\r\n int hi = ONE_COUNT[ (data[i]>>4) & 0xF ];\r\n int lo = ONE_COUNT[ (data[i] ) & 0xF ];\r\n total += hi + lo;\r\n }\r\n \r\n return (9654 < total) && (total < 10346);\r\n }",
"public static void main(String[] args) {\n\t\t\n double p = 3048;\n int i;\n\t\t\n\t\t\n\t\tfor (i=1; i <=40; i++) {\n\t\t\t\n\t\t p = p * 2 / 3;\n\t\t \n\t\t}\n\t\t\n\t\tSystem.out.println(\"La distancia que habra recorrido la bola al momento de realizar su rebote numero 40 es de : \"+ p+ \" mts\");\n\n\t}",
"public abstract long mo9748m();",
"public int m7468c() {\n if (!this.f5790b.f5950m) {\n return 0;\n }\n C2302k c2302k;\n int i;\n C2101h e = m7462e();\n if (e.f5936d != 0) {\n c2302k = this.f5790b.f5954q;\n i = e.f5936d;\n } else {\n byte[] bArr = e.f5937e;\n this.f5798j.m8383a(bArr, bArr.length);\n c2302k = this.f5798j;\n i = bArr.length;\n }\n boolean z = this.f5790b.f5951n[this.f5793e];\n this.f5797i.f6929a[0] = (byte) ((z ? ProfileEditingConfig.DEFAULT_MAX_LENGTH : 0) | i);\n this.f5797i.m8388c(0);\n this.f5789a.sampleData(this.f5797i, 1);\n this.f5789a.sampleData(c2302k, i);\n if (!z) {\n return i + 1;\n }\n C2302k c2302k2 = this.f5790b.f5954q;\n int h = c2302k2.m8396h();\n c2302k2.m8390d(-2);\n h = (h * 6) + 2;\n this.f5789a.sampleData(c2302k2, h);\n return (i + 1) + h;\n }",
"public static int offset_cost() {\n return (56 / 8);\n }",
"public static void main(String[] args)\n {\n\tScanner sc = new Scanner(System.in);\n\tSystem.out.println(\"enter cache size in KB among (1, 2, 4, 8, 16, 32)\");\n\tint cacheSize = sc.nextInt();\n\tSystem.out.println(\"enter way associative value among(1,2,4,8)\");\n\tint wayAssociative = sc.nextInt();\n\tSystem.out.println(\"enter cache line size in bytes among(2,4,8,16,32,64)\");\n\tint cacheLineSize = sc.nextInt();\n\tsc.close();\n\n\tlong count_hit = 0, count_miss = 0;\n\tlong count_hit_2 = 0, count_miss_2 = 0, clockCycle_2 = 0;\n\tlong count_hit_4 = 0, count_miss_4 = 0, clockCycle_4 = 0;\n\tlong count_hit_8 = 0, count_miss_8 = 0, clockCycle_8 = 0;\n\n\tint numberOfCacheLines = (int) ((cacheSize * 1024) / cacheLineSize);\n\n\tArrayList<String> cacheKeys = new ArrayList<String>(numberOfCacheLines);\n\tArrayList<String> cacheValues = new ArrayList<String>(numberOfCacheLines);\n\tArrayList<String> cacheKeys_0 = new ArrayList<String>(numberOfCacheLines / wayAssociative);\n\tArrayList<String> cacheValues_0 = new ArrayList<String>(numberOfCacheLines / wayAssociative);\n\tArrayList<String> cacheKeys_1 = new ArrayList<String>(numberOfCacheLines / wayAssociative);\n\tArrayList<String> cacheValues_1 = new ArrayList<String>(numberOfCacheLines / wayAssociative);\n\tArrayList<String> cacheKeys_2 = new ArrayList<String>(numberOfCacheLines / wayAssociative);\n\tArrayList<String> cacheValues_2 = new ArrayList<String>(numberOfCacheLines / wayAssociative);\n\tArrayList<String> cacheKeys_3 = new ArrayList<String>(numberOfCacheLines / wayAssociative);\n\tArrayList<String> cacheValues_3 = new ArrayList<String>(numberOfCacheLines / wayAssociative);\n\tArrayList<String> cacheKeys_4 = new ArrayList<String>(numberOfCacheLines / wayAssociative);\n\tArrayList<String> cacheValues_4 = new ArrayList<String>(numberOfCacheLines / wayAssociative);\n\tArrayList<String> cacheKeys_5 = new ArrayList<String>(numberOfCacheLines / wayAssociative);\n\tArrayList<String> cacheValues_5 = new ArrayList<String>(numberOfCacheLines / wayAssociative);\n\tArrayList<String> cacheKeys_6 = new ArrayList<String>(numberOfCacheLines / wayAssociative);\n\tArrayList<String> cacheValues_6 = new ArrayList<String>(numberOfCacheLines / wayAssociative);\n\tArrayList<String> cacheKeys_7 = new ArrayList<String>(numberOfCacheLines / wayAssociative);\n\tArrayList<String> cacheValues_7 = new ArrayList<String>(numberOfCacheLines / wayAssociative);\n\n\tlong clockCycle = 0;\n\n\tStringBuilder y = new StringBuilder(\"\");\n\n\t// creating main memory array to store all addresses in a 2d\n\t// array..mapping one\n\t// letter into one width length only..1 to 1 mapping.\n\t// so 2 width is one byte..to get value do block offset*2\n\tString[][] mainMemory = new String[1743][32];\n\tfor (int i = 0; i < 1743; i++)\n\t{\n\t for (int j = 0; j < 32; j++)\n\t {\n\t\tmainMemory[i][j] = \"\";\n\t }\n\t}\n\ttry\n\t{\n\t // read all input files\n\t\tString instructionAddresses = new String(\n\t\t\t\tFiles.readAllBytes(Paths\n\t\t\t\t\t\t.get(\"/Users/akashmalla/Documents/COEN210_Computer_Architecture/project1/inst_addr_trace_hex_project_1.txt\")));\n\t\tString dataSizes = new String(\n\t\t\t\tFiles.readAllBytes(Paths\n\t\t\t\t\t\t.get(\"/Users/akashmalla/Documents/COEN210_Computer_Architecture/project1/inst_data_size_project_1.txt\")));\n\t\tString memoryAddresses = new String(\n\t\t\t\tFiles.readAllBytes(Paths\n\t\t\t\t\t\t.get(\"/Users/akashmalla/Documents/COEN210_Computer_Architecture/project1/inst_mem_hex_16byte_wide.txt\")));\n\t\t// copy all memory addresses into the 2d mainMemory array\n\t\t// split into each line of address\n\n\t String[] memoryAddress = memoryAddresses.split(\"\\\\s+\");\n\t for (int i = 0; i < 1743; i++)\n\t {\n\t\t// split address into each letter\n\t\tString[] oneBit = memoryAddress[i].split(\"\");\n\n\t\tint z = -1;\n\n\t\tfor (int q = oneBit.length - 1; q >= 0; q--)\n\t\t{\n\t\t z++;\n\t\t // store each letter into the array as hex\n\t\t mainMemory[i][q] = oneBit[z];\n\t\t}\n\t }\n\n\t // splitting the instruction addresses into lines\n\t String[] instructionAddress = instructionAddresses.split(\"\\\\s+\");\n\n\t // splitting dataSizes to get length of each data\n\t String[] dataSize = dataSizes.split(\"\\\\s+\");\n\t for (int i = 0; i < instructionAddress.length; i++)\n\t {\n\t\ttry\n\t\t{\n\t\t String binaryIs = \"\";\n\t\t String binaryOffset = \"\";\n\t\t String blockNumber = \"\";\n\t\t if (Integer.parseInt(instructionAddress[i], 16) > 15)\n\t\t {\n\t\t\tbinaryIs = Integer.toBinaryString(Integer.parseInt(instructionAddress[i], 16));\n\t\t\tbinaryOffset = binaryIs.substring(binaryIs.length() - 4);\n\t\t\tblockNumber = binaryIs.substring(0, binaryIs.length() - 4);\n\t\t } else\n\t\t {\n\n\t\t\tblockNumber = \"0\";\n\t\t\tbinaryOffset = Integer.toBinaryString(Integer.parseInt(instructionAddress[i], 16));\n\t\t }\n\n\t\t // check if hit or miss for 1 way\n\t\t if (wayAssociative == 1)\n\t\t {\n\n\t\t\tif (cacheKeys.contains(blockNumber + \",\" + binaryOffset))\n\t\t\t{\n\t\t\t // cache hit situation\n\t\t\t count_hit++;\n\t\t\t clockCycle++;\n\n\t\t\t}\n\n\t\t\telse\n\t\t\t{\n\t\t\t // cache miss\n\t\t\t count_miss++;\n\t\t\t clockCycle += 15;\n\n\t\t\t // replacement for direct mapping.\n\n\t\t\t int newBlockNumber_Value = Integer.parseInt(blockNumber, 2);\n\t\t\t int newOffset_StartingPosition = (Integer.parseInt(binaryOffset, 2) * 2);\n\t\t\t int length = Integer.parseInt(dataSize[i]);\n\n\t\t\t y.append(mainMemory[newBlockNumber_Value][newOffset_StartingPosition]);\n\n\t\t\t int p = -1, beta = 0;\n\t\t\t for (int alpha = 1; alpha < length; alpha++)\n\t\t\t {\n\n\t\t\t\tif ((alpha + newOffset_StartingPosition) % 31 == 0)\n\t\t\t\t{\n\n\t\t\t\t newBlockNumber_Value++;\n\t\t\t\t newOffset_StartingPosition = 0;\n\t\t\t\t beta = length - alpha;\n\n\t\t\t\t if (p < beta)\n\t\t\t\t {\n\t\t\t\t\tp++;\n\t\t\t\t\ty.append(mainMemory[newBlockNumber_Value][p + newOffset_StartingPosition]);\n\t\t\t\t }\n\n\t\t\t\t} else\n\t\t\t\t{\n\t\t\t\t y.append(mainMemory[newBlockNumber_Value][alpha + newOffset_StartingPosition]);\n\t\t\t\t}\n\t\t\t }\n\n\t\t\t y = y.reverse();\n\n\t\t\t // if y is more than one byte then put it in next cache line\n\t\t\t if (y.length() > 4)\n\t\t\t {\n\n\t\t\t\tfor (int o = 0; o < y.length(); o = o + 4)\n\t\t\t\t{\n\t\t\t\t String yy = y.substring(o, o + 4);\n\n\t\t\t\t cacheKeys.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t cacheValues.add(yy);\n\n\t\t\t\t}\n\t\t\t } else\n\t\t\t {\n\n\t\t\t\tif (cacheKeys.size() <= (numberOfCacheLines))\n\t\t\t\t{\n\t\t\t\t cacheKeys.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t cacheValues.add(y.toString());\n\t\t\t\t} else\n\t\t\t\t{\n\t\t\t\t // System.out.println(\"cache is full...\");\n\n\t\t\t\t}\n\n\t\t\t }\n\n\t\t\t}\n\n\t\t\ty.delete(0, y.length());\n\n\t\t }\n\n\t\t else if (wayAssociative > 1)\n\t\t {\n\n\t\t\tif (wayAssociative == 2)\n\t\t\t{\n\n\t\t\t if (cacheKeys_0.contains(blockNumber + \",\" + binaryOffset)\n\t\t\t\t || (cacheKeys_1.contains(blockNumber + \",\" + binaryOffset)))\n\t\t\t {\n\t\t\t\t// cache hit situation\n\t\t\t\tcount_hit_2++;\n\t\t\t\tclockCycle_2++;\n\n\t\t\t }\n\n\t\t\t else\n\t\t\t {\n\t\t\t\t// cache miss\n\t\t\t\tcount_miss_2++;\n\t\t\t\tclockCycle_2 += 15;\n\n\t\t\t\t// replacement\n\t\t\t\tint newBlockNumber_Value = Integer.parseInt(blockNumber, 2);\n\t\t\t\tint newOffset_StartingPosition = (Integer.parseInt(binaryOffset, 2) * 2);\n\t\t\t\tint length = Integer.parseInt(dataSize[i]);\n\n\t\t\t\ty.append(mainMemory[newBlockNumber_Value][newOffset_StartingPosition]);\n\n\t\t\t\tint p = -1, beta = 0;\n\t\t\t\tfor (int alpha = 1; alpha < length; alpha++)\n\t\t\t\t{\n\n\t\t\t\t if ((alpha + newOffset_StartingPosition) % 31 == 0)\n\t\t\t\t {\n\n\t\t\t\t\tnewBlockNumber_Value++;\n\t\t\t\t\tnewOffset_StartingPosition = 0;\n\t\t\t\t\tbeta = length - alpha;\n\n\t\t\t\t\tif (p < beta)\n\t\t\t\t\t{\n\t\t\t\t\t p++;\n\t\t\t\t\t y.append(mainMemory[newBlockNumber_Value][p + newOffset_StartingPosition]);\n\t\t\t\t\t}\n\n\t\t\t\t } else\n\t\t\t\t {\n\t\t\t\t\ty.append(mainMemory[newBlockNumber_Value][alpha + newOffset_StartingPosition]);\n\t\t\t\t }\n\t\t\t\t}\n\n\t\t\t\ty = y.reverse();\n\n\t\t\t\tif (i % wayAssociative == 0)\n\t\t\t\t{\n\t\t\t\t if (cacheKeys.size() <= (numberOfCacheLines))\n\t\t\t\t {\n\t\t\t\t\tif (y.length() > 4)\n\t\t\t\t\t{\n\n\t\t\t\t\t for (int o = 0; o < y.length(); o = o + 4)\n\t\t\t\t\t {\n\n\t\t\t\t\t\tString yy = y.substring(o, o + 4);\n\n\t\t\t\t\t\tif (cacheKeys.size() <= numberOfCacheLines)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t cacheKeys_0.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t\t\t cacheValues_0.add(yy);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t }\n\t\t\t\t\t} else\n\t\t\t\t\t{\n\n\t\t\t\t\t cacheKeys_0.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t\t cacheValues_0.add(y.toString());\n\t\t\t\t\t}\n\t\t\t\t } else\n\t\t\t\t {\n\t\t\t\t\t// System.out.println(\"cache is full...\");\n\n\t\t\t\t }\n\n\t\t\t\t}\n\n\t\t\t\telse if (i % wayAssociative == 1)\n\t\t\t\t{\n\t\t\t\t if (cacheKeys.size() <= (numberOfCacheLines))\n\t\t\t\t {\n\t\t\t\t\tif (y.length() > 4)\n\t\t\t\t\t{\n\n\t\t\t\t\t for (int o = 0; o < y.length(); o = o + 4)\n\t\t\t\t\t {\n\t\t\t\t\t\tString yy = y.substring(o, o + 4);\n\n\t\t\t\t\t\tcacheKeys_1.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t\t\tcacheValues_1.add(yy);\n\n\t\t\t\t\t }\n\t\t\t\t\t}\n\t\t\t\t\t{\n\n\t\t\t\t\t cacheKeys_1.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t\t cacheValues_1.add(y.toString());\n\n\t\t\t\t\t}\n\t\t\t\t }\n\n\t\t\t\t else\n\t\t\t\t {\n\t\t\t\t\t// System.out.println(\"cache is full...\");\n\n\t\t\t\t }\n\n\t\t\t\t}\n\n\t\t\t }\n\n\t\t\t y.delete(0, y.length());\n\n\t\t\t}\n\n\t\t\t// way =4\n\t\t\tif (wayAssociative == 4)\n\t\t\t{\n\n\t\t\t if (cacheKeys_0.contains(blockNumber + \",\" + binaryOffset)\n\t\t\t\t || cacheKeys_1.contains(blockNumber + \",\" + binaryOffset)\n\t\t\t\t || cacheKeys_2.contains(blockNumber + \",\" + binaryOffset)\n\t\t\t\t || cacheKeys_3.contains(blockNumber + \",\" + binaryOffset))\n\t\t\t {\n\t\t\t\t// cache hit situation\n\t\t\t\tcount_hit_4++;\n\t\t\t\tclockCycle_4++;\n\n\t\t\t }\n\n\t\t\t else\n\t\t\t {\n\t\t\t\t// cache miss\n\t\t\t\tcount_miss_4++;\n\t\t\t\tclockCycle_4 += 15;\n\n\t\t\t\t// replacement\n\t\t\t\tint newBlockNumber_Value = Integer.parseInt(blockNumber, 2);\n\t\t\t\tint newOffset_StartingPosition = (Integer.parseInt(binaryOffset, 2) * 2);\n\t\t\t\tint length = Integer.parseInt(dataSize[i]);\n\n\t\t\t\ty.append(mainMemory[newBlockNumber_Value][newOffset_StartingPosition]);\n\n\t\t\t\tint p = -1, beta = 0;\n\t\t\t\tfor (int alpha = 1; alpha < length; alpha++)\n\t\t\t\t{\n\n\t\t\t\t if ((alpha + newOffset_StartingPosition) % 31 == 0)\n\t\t\t\t {\n\n\t\t\t\t\tnewBlockNumber_Value++;\n\t\t\t\t\tnewOffset_StartingPosition = 0;\n\t\t\t\t\tbeta = length - alpha;\n\n\t\t\t\t\tif (p < beta)\n\t\t\t\t\t{\n\t\t\t\t\t p++;\n\t\t\t\t\t y.append(mainMemory[newBlockNumber_Value][p + newOffset_StartingPosition]);\n\t\t\t\t\t}\n\n\t\t\t\t } else\n\t\t\t\t {\n\t\t\t\t\ty.append(mainMemory[newBlockNumber_Value][alpha + newOffset_StartingPosition]);\n\t\t\t\t }\n\t\t\t\t}\n\n\t\t\t\ty = y.reverse();\n\n\t\t\t\tif (cacheKeys.size() <= (numberOfCacheLines))\n\t\t\t\t{\n\n\t\t\t\t if (i % wayAssociative == 0)\n\t\t\t\t {\n\t\t\t\t\tif (y.length() > 4)\n\t\t\t\t\t{\n\n\t\t\t\t\t for (int o = 0; o < y.length(); o = o + 4)\n\t\t\t\t\t {\n\t\t\t\t\t\tString yy = y.substring(o, o + 4);\n\n\t\t\t\t\t\tcacheKeys_0.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t\t\tcacheValues_0.add(yy);\n\n\t\t\t\t\t }\n\t\t\t\t\t} else\n\t\t\t\t\t{\n\n\t\t\t\t\t cacheKeys_0.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t\t cacheValues_0.add(y.toString());\n\n\t\t\t\t\t}\n\t\t\t\t }\n\n\t\t\t\t // mod 1\n\t\t\t\t else if (i % wayAssociative == 1)\n\t\t\t\t {\n\t\t\t\t\tif (y.length() > 4)\n\t\t\t\t\t{\n\n\t\t\t\t\t for (int o = 0; o < y.length(); o = o + 4)\n\t\t\t\t\t {\n\t\t\t\t\t\tString yy = y.substring(o, o + 4);\n\n\t\t\t\t\t\tcacheKeys_1.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t\t\tcacheValues_1.add(yy);\n\n\t\t\t\t\t }\n\t\t\t\t\t} else\n\t\t\t\t\t{\n\n\t\t\t\t\t cacheKeys_1.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t\t cacheValues_1.add(y.toString());\n\t\t\t\t\t}\n\t\t\t\t }\n\n\t\t\t\t // mod 2\n\t\t\t\t else if (i % wayAssociative == 2)\n\t\t\t\t {\n\t\t\t\t\tif (y.length() > 4)\n\t\t\t\t\t{\n\n\t\t\t\t\t for (int o = 0; o < y.length(); o = o + 4)\n\t\t\t\t\t {\n\t\t\t\t\t\tString yy = y.substring(o, o + 4);\n\n\t\t\t\t\t\tcacheKeys_2.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t\t\tcacheValues_2.add(yy);\n\n\t\t\t\t\t }\n\t\t\t\t\t} else\n\t\t\t\t\t{\n\n\t\t\t\t\t if (cacheKeys.size() <= (numberOfCacheLines))\n\t\t\t\t\t {\n\t\t\t\t\t\tcacheKeys_2.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t\t\tcacheValues_2.add(y.toString());\n\t\t\t\t\t } else\n\t\t\t\t\t {\n\t\t\t\t\t\t// System.out.println(\"cache is full...\");\n\n\t\t\t\t\t }\n\n\t\t\t\t\t}\n\n\t\t\t\t }\n\n\t\t\t\t // mmod 3\n\t\t\t\t else if (i % wayAssociative == 3)\n\t\t\t\t {\n\t\t\t\t\tif (y.length() > 4)\n\t\t\t\t\t{\n\n\t\t\t\t\t for (int o = 0; o < y.length(); o = o + 4)\n\t\t\t\t\t {\n\t\t\t\t\t\tString yy = y.substring(o, o + 4);\n\n\t\t\t\t\t\tcacheKeys_3.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t\t\tcacheValues_3.add(yy);\n\n\t\t\t\t\t }\n\t\t\t\t\t} else\n\t\t\t\t\t{\n\n\t\t\t\t\t if (cacheKeys.size() <= (numberOfCacheLines))\n\t\t\t\t\t {\n\t\t\t\t\t\tcacheKeys_3.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t\t\tcacheValues_3.add(y.toString());\n\t\t\t\t\t }\n\n\t\t\t\t\t}\n\n\t\t\t\t }\n\n\t\t\t\t}\n\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t // System.out.println(\"cache is full...\");\n\n\t\t\t\t}\n\n\t\t\t }\n\n\t\t\t y.delete(0, y.length());\n\n\t\t\t}\n\n\t\t\telse if (wayAssociative == 8)\n\t\t\t{\n\n\t\t\t if (cacheKeys_0.contains(blockNumber + \",\" + binaryOffset)\n\t\t\t\t || (cacheKeys_1.contains(blockNumber + \",\" + binaryOffset))\n\t\t\t\t || (cacheKeys_3.contains(blockNumber + \",\" + binaryOffset))\n\t\t\t\t || (cacheKeys_3.contains(blockNumber + \",\" + binaryOffset))\n\t\t\t\t || cacheKeys_4.contains(blockNumber + \",\" + binaryOffset)\n\t\t\t\t || (cacheKeys_5.contains(blockNumber + \",\" + binaryOffset))\n\t\t\t\t || (cacheKeys_7.contains(blockNumber + \",\" + binaryOffset))\n\t\t\t\t || (cacheKeys_6.contains(blockNumber + \",\" + binaryOffset)))\n\t\t\t {\n\t\t\t\t// cache hit situation\n\t\t\t\tcount_hit_8++;\n\t\t\t\tclockCycle_8++;\n\n\t\t\t }\n\n\t\t\t else\n\t\t\t {\n\t\t\t\t// cache miss\n\t\t\t\tcount_miss_8++;\n\t\t\t\tclockCycle_8 += 15;\n\n\t\t\t\t// replacement\n\n\t\t\t\tint newBlockNumber_Value = Integer.parseInt(blockNumber, 2);\n\t\t\t\tint newOffset_StartingPosition = (Integer.parseInt(binaryOffset, 2) * 2);\n\t\t\t\tint length = Integer.parseInt(dataSize[i]);\n\n\t\t\t\ty.append(mainMemory[newBlockNumber_Value][newOffset_StartingPosition]);\n\n\t\t\t\tint p = -1, beta = 0;\n\t\t\t\tfor (int alpha = 1; alpha < length; alpha++)\n\t\t\t\t{\n\n\t\t\t\t if ((alpha + newOffset_StartingPosition) % 31 == 0)\n\t\t\t\t {\n\n\t\t\t\t\tnewBlockNumber_Value++;\n\t\t\t\t\tnewOffset_StartingPosition = 0;\n\t\t\t\t\tbeta = length - alpha;\n\n\t\t\t\t\tif (p < beta)\n\t\t\t\t\t{\n\t\t\t\t\t p++;\n\t\t\t\t\t y.append(mainMemory[newBlockNumber_Value][p + newOffset_StartingPosition]);\n\t\t\t\t\t}\n\n\t\t\t\t } else\n\t\t\t\t {\n\t\t\t\t\ty.append(mainMemory[newBlockNumber_Value][alpha + newOffset_StartingPosition]);\n\t\t\t\t }\n\t\t\t\t}\n\n\t\t\t\ty = y.reverse();\n\n\t\t\t\tif (cacheKeys.size() <= (numberOfCacheLines))\n\t\t\t\t{\n\n\t\t\t\t if (i % wayAssociative == 0)\n\t\t\t\t {\n\t\t\t\t\tif (y.length() > 4)\n\t\t\t\t\t{\n\n\t\t\t\t\t for (int o = 0; o < y.length(); o = o + 4)\n\t\t\t\t\t {\n\t\t\t\t\t\tString yy = y.substring(o, o + 4);\n\n\t\t\t\t\t\tcacheKeys_0.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t\t\tcacheValues_0.add(yy);\n\n\t\t\t\t\t }\n\t\t\t\t\t} else\n\t\t\t\t\t{\n\n\t\t\t\t\t cacheKeys_0.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t\t cacheValues_0.add(y.toString());\n\n\t\t\t\t\t}\n\t\t\t\t }\n\n\t\t\t\t // mod 1\n\t\t\t\t else if (i % wayAssociative == 1)\n\t\t\t\t {\n\t\t\t\t\tif (y.length() > 4)\n\t\t\t\t\t{\n\n\t\t\t\t\t for (int o = 0; o < y.length(); o = o + 4)\n\t\t\t\t\t {\n\t\t\t\t\t\tString yy = y.substring(o, o + 4);\n\n\t\t\t\t\t\tcacheKeys_1.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t\t\tcacheValues_1.add(yy);\n\n\t\t\t\t\t }\n\t\t\t\t\t} else\n\t\t\t\t\t{\n\n\t\t\t\t\t cacheKeys_1.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t\t cacheValues_1.add(y.toString());\n\t\t\t\t\t}\n\t\t\t\t }\n\n\t\t\t\t // mod 2\n\t\t\t\t else if (i % wayAssociative == 2)\n\t\t\t\t {\n\t\t\t\t\tif (y.length() > 4)\n\t\t\t\t\t{\n\n\t\t\t\t\t for (int o = 0; o < y.length(); o = o + 4)\n\t\t\t\t\t {\n\t\t\t\t\t\tString yy = y.substring(o, o + 4);\n\n\t\t\t\t\t\tcacheKeys_2.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t\t\tcacheValues_2.add(yy);\n\n\t\t\t\t\t }\n\t\t\t\t\t} else\n\t\t\t\t\t{\n\n\t\t\t\t\t if (cacheKeys.size() <= (numberOfCacheLines))\n\t\t\t\t\t {\n\t\t\t\t\t\tcacheKeys_2.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t\t\tcacheValues_2.add(y.toString());\n\t\t\t\t\t } else\n\t\t\t\t\t {\n\t\t\t\t\t\t// System.out.println(\"cache is full...\");\n\n\t\t\t\t\t }\n\n\t\t\t\t\t}\n\n\t\t\t\t }\n\n\t\t\t\t // mmod 3\n\t\t\t\t else if (i % wayAssociative == 3)\n\t\t\t\t {\n\t\t\t\t\tif (y.length() > 4)\n\t\t\t\t\t{\n\n\t\t\t\t\t for (int o = 0; o < y.length(); o = o + 4)\n\t\t\t\t\t {\n\t\t\t\t\t\tString yy = y.substring(o, o + 4);\n\n\t\t\t\t\t\tcacheKeys_3.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t\t\tcacheValues_3.add(yy);\n\n\t\t\t\t\t }\n\t\t\t\t\t} else\n\t\t\t\t\t{\n\n\t\t\t\t\t if (cacheKeys.size() <= (numberOfCacheLines))\n\t\t\t\t\t {\n\t\t\t\t\t\tcacheKeys_3.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t\t\tcacheValues_3.add(y.toString());\n\t\t\t\t\t }\n\n\t\t\t\t\t}\n\n\t\t\t\t }\n\n\t\t\t\t // 4\n\t\t\t\t else if (i % wayAssociative == 4)\n\t\t\t\t {\n\t\t\t\t\tif (y.length() > 4)\n\t\t\t\t\t{\n\n\t\t\t\t\t for (int o = 0; o < y.length(); o = o + 4)\n\t\t\t\t\t {\n\t\t\t\t\t\tString yy = y.substring(o, o + 4);\n\n\t\t\t\t\t\tcacheKeys_4.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t\t\tcacheValues_4.add(yy);\n\n\t\t\t\t\t }\n\t\t\t\t\t} else\n\t\t\t\t\t{\n\n\t\t\t\t\t if (cacheKeys.size() <= (numberOfCacheLines))\n\t\t\t\t\t {\n\t\t\t\t\t\tcacheKeys_4.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t\t\tcacheValues_4.add(y.toString());\n\t\t\t\t\t }\n\n\t\t\t\t\t}\n\n\t\t\t\t }\n\n\t\t\t\t // 5\n\t\t\t\t else if (i % wayAssociative == 5)\n\t\t\t\t {\n\t\t\t\t\tif (y.length() > 4)\n\t\t\t\t\t{\n\n\t\t\t\t\t for (int o = 0; o < y.length(); o = o + 4)\n\t\t\t\t\t {\n\t\t\t\t\t\tString yy = y.substring(o, o + 4);\n\n\t\t\t\t\t\tcacheKeys_5.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t\t\tcacheValues_5.add(yy);\n\n\t\t\t\t\t }\n\t\t\t\t\t} else\n\t\t\t\t\t{\n\n\t\t\t\t\t if (cacheKeys.size() <= (numberOfCacheLines))\n\t\t\t\t\t {\n\t\t\t\t\t\tcacheKeys_5.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t\t\tcacheValues_5.add(y.toString());\n\t\t\t\t\t }\n\n\t\t\t\t\t}\n\n\t\t\t\t }\n\n\t\t\t\t // 6\n\t\t\t\t else if (i % wayAssociative == 6)\n\t\t\t\t {\n\t\t\t\t\tif (y.length() > 4)\n\t\t\t\t\t{\n\n\t\t\t\t\t for (int o = 0; o < y.length(); o = o + 4)\n\t\t\t\t\t {\n\t\t\t\t\t\tString yy = y.substring(o, o + 4);\n\n\t\t\t\t\t\tcacheKeys_6.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t\t\tcacheValues_6.add(yy);\n\n\t\t\t\t\t }\n\t\t\t\t\t} else\n\t\t\t\t\t{\n\n\t\t\t\t\t if (cacheKeys.size() <= (numberOfCacheLines))\n\t\t\t\t\t {\n\t\t\t\t\t\tcacheKeys_6.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t\t\tcacheValues_6.add(y.toString());\n\t\t\t\t\t }\n\n\t\t\t\t\t}\n\n\t\t\t\t }\n\n\t\t\t\t // 7\n\n\t\t\t\t else if (i % wayAssociative == 7)\n\t\t\t\t {\n\t\t\t\t\tif (y.length() > 4)\n\t\t\t\t\t{\n\n\t\t\t\t\t for (int o = 0; o < y.length(); o = o + 4)\n\t\t\t\t\t {\n\t\t\t\t\t\tString yy = y.substring(o, o + 4);\n\n\t\t\t\t\t\tcacheKeys_7.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t\t\tcacheValues_7.add(yy);\n\n\t\t\t\t\t }\n\t\t\t\t\t} else\n\t\t\t\t\t{\n\n\t\t\t\t\t if (cacheKeys.size() <= (numberOfCacheLines))\n\t\t\t\t\t {\n\t\t\t\t\t\tcacheKeys_7.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t\t\tcacheValues_7.add(y.toString());\n\t\t\t\t\t }\n\n\t\t\t\t\t}\n\n\t\t\t\t }\n\n\t\t\t\t //\n\t\t\t\t}\n\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t // System.out.println(\"cache is full...\");\n\n\t\t\t\t}\n\n\t\t\t }\n\n\t\t\t y.delete(0, y.length());\n\n\t\t\t}\n\n\t\t }\n\n\t\t // 3\n\n\t\t} catch (Exception e)\n\t\t{\n\t\t e.printStackTrace();\n\t\t}\n\n\t }\n\n\t // to print outputs\n\n\t if (wayAssociative == 1)\n\t {\n\t\tlong cache_access = count_hit + count_miss;\n\n\t\tSystem.out.println(\"Total number of cache accesses is \" + cache_access);\n\t\tSystem.out.println(\"Total number of clock cycles is \" + clockCycle);\n\t\tSystem.out.println(\"Total number of hits \" + count_hit);\n\n\t\tdouble hit_ratio = ((double) count_hit) / (count_hit + count_miss) * 100;\n\n\t\tSystem.out.println(\"cache hit ratio is \" + hit_ratio + \"%\");\n\n\t\tdouble ipc = ((double) instructionAddress.length) / clockCycle;\n\t\tSystem.out.println(\"IPC is \" + ipc);\n\t }\n\n\t else if (wayAssociative == 2)\n\t {\n\t\tlong cache_access = count_hit_2 + count_miss_2;\n\n\t\tSystem.out.println(\"Total number of cache accesses is \" + cache_access);\n\t\tSystem.out.println(\"Total number of clock cycles is \" + clockCycle_2);\n\t\tSystem.out.println(\"Total number of hits \" + count_hit_2);\n\n\t\tdouble hit_ratio = ((double) count_hit_2) / (count_hit_2 + count_miss_2) * 100;\n\n\t\tSystem.out.println(\"cache hit ratio is \" + hit_ratio + \"%\");\n\n\t\tdouble ipc = ((double) instructionAddress.length) / clockCycle_2;\n\t\tSystem.out.println(\"IPC is \" + ipc);\n\t }\n\n\t else if (wayAssociative == 4)\n\t {\n\t\tlong cache_access = count_hit_4 + count_miss_4;\n\n\t\tSystem.out.println(\"Total number of cache accesses is \" + cache_access);\n\t\tSystem.out.println(\"Total number of clock cycles is \" + clockCycle_4);\n\t\tSystem.out.println(\"Total number of hits \" + count_hit_4);\n\n\t\tdouble hit_ratio = ((double) count_hit_4) / (count_hit_4 + count_miss_4) * 100;\n\n\t\tSystem.out.println(\"cache hit ratio is \" + hit_ratio + \"%\");\n\n\t\tdouble ipc = ((double) instructionAddress.length) / clockCycle_4;\n\t\tSystem.out.println(\"IPC is \" + ipc);\n\n\t } else if (wayAssociative == 8)\n\t {\n\t\tlong cache_access = count_hit_8 + count_miss_8;\n\n\t\tSystem.out.println(\"Total number of cache accesses is \" + cache_access);\n\t\tSystem.out.println(\"Total number of clock cycles is \" + clockCycle_8);\n\t\tSystem.out.println(\"Total number of hits \" + count_hit_8);\n\n\t\tdouble hit_ratio = ((double) count_hit_8) / (count_hit_8 + count_miss_8) * 100;\n\n\t\tSystem.out.println(\"cache hit ratio is \" + hit_ratio + \"%\");\n\n\t\tdouble ipc = ((double) instructionAddress.length) / clockCycle_8;\n\t\tSystem.out.println(\"IPC is \" + ipc);\n\t }\n\n\t} catch (Exception e)\n\t{\n\t e.printStackTrace();\n\t}\n\n }",
"public final int mo6465d() {\n return 19729000;\n }",
"private int[] m7232h() {\n this.f5578C[0] = this.f5594p;\n this.f5578C[1] = this.f5599u - this.f5594p;\n return this.f5578C;\n }",
"public static void main(final String[] args) throws IOException {\r\n\r\n final byte[] ar = {0, 0, 5, 0, 70, 68, 8, 0, 0, 0, 0, 0, 0, 26, 117, 64, 0, 0, 6, 0, 70, 68, 8, 0, 41, 92,\r\n -113, -62, -11, -88, 18, 64, 0, 0, 7, 0, 83, 76, 4, 0, -69, 3, 0, 0, 0, 0, 8, 0, 83, 76, 4, 0, -56, 0,\r\n 0, 0, 0, 0, 13, 0, 83, 76, 4, 0, 2, 0, 0, 0, 0, 0, 14, 0, 83, 76, 4, 0, 4, 0, 0, 0, 0, 0, 19, 0, 83,\r\n 76, 4, 0, 81, 1, 0, 0, 0, 0, 20, 0, 83, 76, 4, 0, 1, 0, 0, 0, 0, 0, 22, 0, 83, 76, 4, 0, 50, 0, 0, 0,\r\n 0, 0, 24, 0, 83, 76, 4, 0, -96, 2, 0, 0, 0, 0, 29, 0, 76, 84, 14, 0, 65, 0, 66, 0, 68, 0, 79, 0, 77, 0,\r\n 69, 0, 78, 0, 0, 0, 30, 0, 70, 68, 8, 0, 0, 0, 0, 0, 0, 64, 127, 64, 0, 0, 31, 0, 70, 68, 8, 0, 0, 0,\r\n 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 70, 68, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33, 0, 83, 76, 4, 0, 1, 0,\r\n 0, 0, 0, 0, 34, 0, 83, 76, 4, 0, 3, 0, 0, 0, 0, 0, 37, 0, 83, 76, 4, 0, 1, 0, 0, 0, 0, 0, 38, 0, 70,\r\n 68, 8, 0, 0, 0, 0, 0, 0, 112, 124, 64, 0, 0, 39, 0, 70, 68, 8, 0, 0, 0, 0, 0, 0, 0, 78, 64, 0, 0, 40,\r\n 0, 83, 76, 4, 0, 38, 1, 0, 0, 0, 0, 41, 0, 83, 76, 4, 0, 0, 0, 0, 0, 0, 0, 44, 0, 83, 76, 4, 0, -44, 0,\r\n 0, 0, 0, 0, 45, 0, 83, 76, 4, 0, 0, 0, 0, 0, 0, 0, 46, 0, 83, 76, 4, 0, 1, 0, 0, 0, 0, 0, 47, 0, 70,\r\n 68, 8, 0, 0, 0, 0, 0, 0, 0, 4, 64, 0, 0, 48, 0, 76, 84, 8, 0, 80, 0, 50, 0, 48, 0, 65, 0, 0, 0, 51, 0,\r\n 83, 76, 4, 0, 3, 0, 0, 0, 0, 0, 1, 1, 70, 68, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 1, 70, 68, 8, 0,\r\n 14, 45, -78, -99, -17, -89, -18, 63, 0, 0, 3, 1, 70, 68, 8, 0, -123, -21, 81, -72, 30, -123, -21, 63,\r\n 0, 0, 5, 1, 73, 83, 2, 0, 48, 32, -1, -1, -1, -1, 67, 83, 10, 0, 69, 78, 68, 33, 32, 32, 32, 32, 32, 32};\r\n\r\n final String str = new String(ar);\r\n System.out.println(\"The string is:\");\r\n System.out.println(str);\r\n\r\n /*\r\n * File[] f = new File[1];\r\n * \r\n * f[0] = new File(args[0]); String[] s = new String[1]; s[0] = \"\";\r\n * \r\n * PlugInAlgorithmAnonymizeDicom p = new PlugInAlgorithmAnonymizeDicom (f, s, \"\", \"\"); p.runAlgorithm();\r\n * p.finalize();\r\n * \r\n * //For now inTest and inCopy should be identical, final implementation will have inTest and inCopy identical\r\n * except for anonymized images System.out.println(\"Reading in \"+args[0]); DataInputStream inTest = new\r\n * DataInputStream(new FileInputStream(new File(args[0]))); System.out.println(\"Reading in \"+args[1]);\r\n * DataInputStream inCopy = new DataInputStream(new FileInputStream(new File(args[1]))); int maxSize =\r\n * inTest.available(); byte[] b = new byte[maxSize], c = new byte[maxSize]; inTest.readFully(b);\r\n * inCopy.readFully(c); System.out.println(\"Size compare: \"+b.length+\"\\t\"+c.length); boolean cons = true;\r\n * for(int i=0; i<b.length; i++) { if(b[i] != c[i]) { System.out.println(\"Data corruption at \"+i); cons =\r\n * false; } } if(cons) { System.out.println(\"Program passed validation.\"); }\r\n */\r\n\r\n }",
"private int m10257E() throws cf {\r\n int i = 0;\r\n int i2;\r\n if (this.g.mo1996h() >= 5) {\r\n byte[] f = this.g.mo1994f();\r\n int g = this.g.mo1995g();\r\n i2 = 0;\r\n int i3 = 0;\r\n while (true) {\r\n byte b = f[g + i];\r\n i3 |= (b & 127) << i2;\r\n if ((b & 128) != 128) {\r\n this.g.mo1993a(i + 1);\r\n return i3;\r\n }\r\n i2 += 7;\r\n i++;\r\n }\r\n } else {\r\n i2 = 0;\r\n while (true) {\r\n byte u = mo1978u();\r\n i2 |= (u & 127) << i;\r\n if ((u & 128) != 128) {\r\n return i2;\r\n }\r\n i += 7;\r\n }\r\n }\r\n }",
"float compress(){\n float lower = mp.get(sequence.charAt(0)).lowRange;\n float upper = mp.get(sequence.charAt(0)).upperRange;\n for (int i = 1; i < sequence.length(); i++) {\n float newLower = lower + (upper - lower)*mp.get(sequence.charAt(i)).lowRange;\n float newUpper = lower + (upper - lower)*mp.get(sequence.charAt(i)).upperRange;\n lower = newLower;\n upper = newUpper;\n }\n ///picking value between final lower and upper\n float compressionCode = (float)(Math.floor(upper * 1000.0) / 1000.0);\n return compressionCode;\n }",
"public static void main(String[] args) {\n\t\t\n\t\t int m= 9, n= 1,x=0 ;\n\t\t \n\t\t while (m>n) {\n\t\t\t m--;\n\t\t\t n+=2;\n\t\t\t x+=m+n;\n\t\t\t \n\t\t\t \n\t\t\t \n\t\t\t \n\t\t }\n\t\t System.out.println(x);\n\t\t \n\t\t \n\t\t \n\t\t // a) 11\n\t \t// b) 13\n //c) 23\n //d) 36\n //e) 50\n\t\t\n\n\t}",
"static void method_1458() {\r\n boolean var10000 = true;\r\n char[] var10003 = \"/\\fë%mwH]s,\".toCharArray();\r\n Object var10004 = var10003.length;\r\n Object var4 = true;\r\n char[] var10002 = var10003;\r\n char[] var10001 = (char[])var10004;\r\n int var0 = 0;\r\n\r\n while(true) {\r\n var10003 = var10002;\r\n var10002 = var10001;\r\n var10001 = var10003;\r\n char[] var5 = var10002;\r\n var10002 = var10003;\r\n if(var10003 <= var0) {\r\n field_1436 = (new String((char[])var4)).intern();\r\n String var2 = field_1436;\r\n return;\r\n }\r\n\r\n char var10007 = (char)((Object[])var4)[var0];\r\n short var10009;\r\n switch(var0 % 7) {\r\n case 0:\r\n var10009 = 220;\r\n break;\r\n case 1:\r\n var10009 = 240;\r\n break;\r\n case 2:\r\n var10009 = 4;\r\n break;\r\n case 3:\r\n var10009 = 165;\r\n break;\r\n case 4:\r\n var10009 = 237;\r\n break;\r\n case 5:\r\n var10009 = 247;\r\n break;\r\n default:\r\n var10009 = 200;\r\n }\r\n\r\n ((Object[])var4)[var0] = (char)(var10007 ^ var5 ^ var10009);\r\n ++var0;\r\n }\r\n }",
"public static void main(String[] args) {\nScanner sc=new Scanner(System.in);\r\nString input1=sc.nextLine();\r\ninput1=input1.toLowerCase();\r\nint l=input1.length();\r\nchar a[]=input1.toCharArray();\r\nint d[]=new int[1000];\r\nString str=\"\";\r\nint i=0,k1=0,k2=0,m=0,c1=0,c2=0,c3=0,l1=0,u=0,u1=0;\r\nchar b[]={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};\r\nfor(i=0;i<l;i++)\r\n{ c3=0;\r\n\tif(a[i]==' ')\r\n\t{u=i;c3=0;\r\n\t\tfor(k1=u1,k2=i-1;k1<k2 && k2>k1;k1++,k2--)\r\n\t\t{ c1=0;c2=0;\r\n\t\t\tfor(m=0;m<26;m++)\r\n\t\t\t{\r\n\t\t\t\tif(b[m]==a[k1]) {\r\n\t\t\t\tc1=m+1;}\t\r\n\t\t\t\tif(b[m]==a[k2]) {\r\n\t\t\t\t\tc2=m+1;}\t\r\n\t\t\t}\r\n\t\t\tc3=c3+Math.abs(c1-c2);\r\n\t\t}\r\n\t\tif(k1==k2) {\r\n\t\t\tfor(m=0;m<26;m++) {\r\n\t\t\t\tif(b[m]==a[k1])\r\n\t\t\t\t\tc3=c3+(m+1);\r\n\t\t\t }\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\td[l1]=c3;\r\n\t\tl1++;\r\n\t\tu1=i+1;\r\n\t\tc3=0;\r\n\t}\r\n\tif(i==l-1)\r\n\t{\r\n\t\tfor(k1=u+1,k2=i;k1<k2 && k2>k1;k1++,k2--)\r\n\t\t{ c1=0;c2=0;\r\n\t\t\tfor(m=0;m<26;m++)\r\n\t\t\t{\r\n\t\t\t\tif(b[m]==a[k1]) {\r\n\t\t\t\tc1=m+1;}\t\r\n\t\t\t\tif(b[m]==a[k2]) {\r\n\t\t\t\t\tc2=m+1;}\t\r\n\t\t\t}\r\n\t\t\tc3=c3+Math.abs(c1-c2);\r\n\t\t}\r\n\t\tif(k1==k2) {\r\n\t\t\tfor(m=0;m<26;m++) {\r\n\t\t\t\tif(b[m]==a[k1])\r\n\t\t\t\t\tc3=c3+(m+1);\r\n\t\t\t }\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\td[l1]=c3;\r\n\t\tl1++;\r\n\t\tk1=i+1;\r\n\t}\r\n}\r\n\r\n for(i=0;i<l1;i++)\r\n {\r\n\t str=str+Integer.toString(d[i]);\r\n }\r\n int ans=Integer.parseInt(str);\r\n System.out.print(ans);\r\n}",
"public static int Main()\n\t{\n\tint[] b = new int[12];\n\tint w;\n\tint i;\n\tint[] a = {13, 44, 72, 103, 133, 164, 194, 225, 256, 286, 317, 347};\n\tString tempVar = ConsoleInput.scanfRead();\n\tif (tempVar != null)\n\t{\n\t\tw = Integer.parseInt(tempVar);\n\t}\n\tfor (i = 0;i < 12;i++)\n\t{\n\t\tb[i] = a[i] % 7 - 1;\n\t\tb[i] = (b[i] + w) % 7;\n\t}\n\tfor (i = 0;i < 12;i++)\n\t{\n\t\tif (b[i] == 5)\n\t\t{\n\t\t\tSystem.out.printf(\"%d\\n\",i + 1);\n\t\t}\n\t}\n\treturn 0;\n\t}",
"void mo33732Px();",
"private int m14712a(int i, int i2, int i3) {\n int i4 = 0;\n int i5 = 0;\n int i6 = 0;\n int i7 = 0;\n int i8 = 0;\n for (int i9 = i; i9 < this.f10966u + i; i9++) {\n byte[] bArr = this.f10957l;\n if (i9 >= bArr.length || i9 >= i2) {\n break;\n }\n int i10 = this.f10946a[bArr[i9] & 255];\n if (i10 != 0) {\n i4 += (i10 >> 24) & 255;\n i5 += (i10 >> 16) & 255;\n i6 += (i10 >> 8) & 255;\n i7 += i10 & 255;\n i8++;\n }\n }\n int i11 = i + i3;\n for (int i12 = i11; i12 < this.f10966u + i11; i12++) {\n byte[] bArr2 = this.f10957l;\n if (i12 >= bArr2.length || i12 >= i2) {\n break;\n }\n int i13 = this.f10946a[bArr2[i12] & 255];\n if (i13 != 0) {\n i4 += (i13 >> 24) & 255;\n i5 += (i13 >> 16) & 255;\n i6 += (i13 >> 8) & 255;\n i7 += i13 & 255;\n i8++;\n }\n }\n if (i8 == 0) {\n return 0;\n }\n return ((i4 / i8) << 24) | ((i5 / i8) << 16) | ((i6 / i8) << 8) | (i7 / i8);\n }",
"public int mo34973b() {\n return 48;\n }",
"public static void main(String[] args){\n int s = 80;\n int n = (int) Math.pow(10, 7);\n Integer[] a = new Integer[n];\n Random rand = new Random();\n for (int i = 0; i < n; i++){\n a[i] = (int) (n*rand.nextDouble());\n }\n double binTime = binSearchT(s, a);\n double linTime = linSearchT(s, a);\n System.out.println(\"binTime: \"+ binTime);\n System.out.println(\"linTime: \"+ linTime);\n\n }",
"private static C2065a m7413d(C2063i c2063i) throws ParserException {\n if (c2063i.m7399a(24) != 5653314) {\n StringBuilder stringBuilder = new StringBuilder();\n stringBuilder.append(\"expected code book to start with [0x56, 0x43, 0x42] at \");\n stringBuilder.append(c2063i.m7401b());\n throw new ParserException(stringBuilder.toString());\n }\n int i;\n int i2;\n int a = c2063i.m7399a(16);\n int a2 = c2063i.m7399a(24);\n long[] jArr = new long[a2];\n boolean a3 = c2063i.m7400a();\n long j = 0;\n if (a3) {\n int a4 = c2063i.m7399a(5) + 1;\n i = 0;\n while (i < jArr.length) {\n int a5 = c2063i.m7399a(C2069k.m7403a(a2 - i));\n int i3 = i;\n for (i = 0; i < a5 && i3 < jArr.length; i++) {\n jArr[i3] = (long) a4;\n i3++;\n }\n a4++;\n i = i3;\n }\n } else {\n boolean a6 = c2063i.m7400a();\n for (i2 = 0; i2 < jArr.length; i2++) {\n if (!a6) {\n jArr[i2] = (long) (c2063i.m7399a(5) + 1);\n } else if (c2063i.m7400a()) {\n jArr[i2] = (long) (c2063i.m7399a(5) + 1);\n } else {\n jArr[i2] = 0;\n }\n }\n }\n i2 = c2063i.m7399a(4);\n if (i2 > 2) {\n StringBuilder stringBuilder2 = new StringBuilder();\n stringBuilder2.append(\"lookup type greater than 2 not decodable: \");\n stringBuilder2.append(i2);\n throw new ParserException(stringBuilder2.toString());\n }\n if (i2 == 1 || i2 == 2) {\n c2063i.m7402b(32);\n c2063i.m7402b(32);\n i = c2063i.m7399a(4) + 1;\n c2063i.m7402b(1);\n if (i2 != 1) {\n j = (long) (a2 * a);\n } else if (a != 0) {\n j = C2069k.m7404a((long) a2, (long) a);\n }\n c2063i.m7402b((int) (j * ((long) i)));\n }\n return new C2065a(a, a2, jArr, i2, a3);\n }",
"public static void main(String[] args) {\n int value = 5;\n int ab= 0;\n int ac=0;\n int ad=0;\n int ae=0;\n int af=0;\n int ag=0;\n int am=0;\n int az=0;\n int x = 0;\n int y = 0;\n int z = 0;\n int a = 0;\n int b = 0;\n int c = 0;\n int d = 0;\n int e = 0;\n x= value%2;\n ab=value/2;\n y= ab % 2;\n ac = ab/2;\n z = ac % 2;\n ad= ac/2;\n a = ad % 2;\n ae = ad/2;\n b = ae % 2;\n af= ae/2;\n c = af % 2;\n ag= af/2;\n d= ag % 2;\n am=ag/2;\n e = am %2;\n\n System.out.println(e+\"\"+d+\"\"+c+\"\"+b+\"\"+a+\"\"+z+\"\"+y+\"\"+x);\n\n\n\n\n\n\n\n }",
"private void m27469e() {\n int i;\n int i2 = this.f25262I * this.f25259F;\n if (this.f25281ae) {\n i = Integer.MIN_VALUE;\n } else {\n i = ((-this.f25259F) * (this.f25301p.size() - 1)) + i2;\n }\n this.f25264K = i;\n if (this.f25281ae) {\n i2 = Integer.MAX_VALUE;\n }\n this.f25265L = i2;\n }",
"public static String nthrt(String bytes,int size, int value){\n if(value==1||value==0||size<1||size>bytes.length()||!Cript2010x8b.USEPOWNTHRT) return bytes; \n String out=\"\"; \n int max=bytes.length()/size; \n if(bytes.length()%size!=0) \n max++; \n for(int i=0;i<max;i++){ \n String subStr=\"\"; \n for(int l=0;l<size;l++) \n try{ \n subStr+=bytes.charAt(i*size+(size-l-1)); \n }catch(Exception e){ \n String bug=bytes.substring(i*size); \n bug=addLong(bug,1,value); \n return out+bug; \n } \n BigInteger current=strToBInt(subStr); \n int exiter=0;\n while(Operations.nthRootFloor(current, value).pow(value).compareTo(current)!=0){ \n if(exiter>66) break;\n current=current.add(BigInteger.valueOf(2).pow(8*size)); \n exiter++;\n } \n current=Operations.nthRootFloor(current, value); \n exiter=0;\n while(current.compareTo(BigInteger.valueOf(2).pow(8*size))>0){if(exiter>66) break;current=current.add(BigInteger.valueOf(2).pow(8*size).negate());exiter++;} \n exiter=0;\n while(current.compareTo(BigInteger.ZERO)<0){if(exiter>66) break;current=current.add(BigInteger.valueOf(2).pow(8*size));exiter++;} \n \n out+=BintToStr(current,size); \n } \n return out; \n }",
"public static void main(String[] args) {\n byte a=25;\n short b=124;\n int c=200;\n long d=50000L+10L*(a+b+c);\n System.out.println (d);\n\n short az=(short)(1000+10*(a+b+c));\n System.out.println (az);\n\n\n\n }",
"private static void eval5(){\n for(int i = 0; i < 46; i++){\n for(int j = i + 1; j < 47; j++){\n for(int k = j + 1; k < 48; k++){\n for(int l = k + 1; l < 49; l++){\n for(int m = l + 1; m < 50; m++){\n Evaluator.evaluate(i, j, k, l, m);\n }\n }\n }\n }\n }\n }",
"private static int cprNLFunction(double lat) {\n\t\tif (lat < 0)\n\t\t\tlat = -lat; // Table is symmetric about the equator\n\t\tif (lat < 10.47047130)\n\t\t\treturn 59;\n\t\tif (lat < 14.82817437)\n\t\t\treturn 58;\n\t\tif (lat < 18.18626357)\n\t\t\treturn 57;\n\t\tif (lat < 21.02939493)\n\t\t\treturn 56;\n\t\tif (lat < 23.54504487)\n\t\t\treturn 55;\n\t\tif (lat < 25.82924707)\n\t\t\treturn 54;\n\t\tif (lat < 27.93898710)\n\t\t\treturn 53;\n\t\tif (lat < 29.91135686)\n\t\t\treturn 52;\n\t\tif (lat < 31.77209708)\n\t\t\treturn 51;\n\t\tif (lat < 33.53993436)\n\t\t\treturn 50;\n\t\tif (lat < 35.22899598)\n\t\t\treturn 49;\n\t\tif (lat < 36.85025108)\n\t\t\treturn 48;\n\t\tif (lat < 38.41241892)\n\t\t\treturn 47;\n\t\tif (lat < 39.92256684)\n\t\t\treturn 46;\n\t\tif (lat < 41.38651832)\n\t\t\treturn 45;\n\t\tif (lat < 42.80914012)\n\t\t\treturn 44;\n\t\tif (lat < 44.19454951)\n\t\t\treturn 43;\n\t\tif (lat < 45.54626723)\n\t\t\treturn 42;\n\t\tif (lat < 46.86733252)\n\t\t\treturn 41;\n\t\tif (lat < 48.16039128)\n\t\t\treturn 40;\n\t\tif (lat < 49.42776439)\n\t\t\treturn 39;\n\t\tif (lat < 50.67150166)\n\t\t\treturn 38;\n\t\tif (lat < 51.89342469)\n\t\t\treturn 37;\n\t\tif (lat < 53.09516153)\n\t\t\treturn 36;\n\t\tif (lat < 54.27817472)\n\t\t\treturn 35;\n\t\tif (lat < 55.44378444)\n\t\t\treturn 34;\n\t\tif (lat < 56.59318756)\n\t\t\treturn 33;\n\t\tif (lat < 57.72747354)\n\t\t\treturn 32;\n\t\tif (lat < 58.84763776)\n\t\t\treturn 31;\n\t\tif (lat < 59.95459277)\n\t\t\treturn 30;\n\t\tif (lat < 61.04917774)\n\t\t\treturn 29;\n\t\tif (lat < 62.13216659)\n\t\t\treturn 28;\n\t\tif (lat < 63.20427479)\n\t\t\treturn 27;\n\t\tif (lat < 64.26616523)\n\t\t\treturn 26;\n\t\tif (lat < 65.31845310)\n\t\t\treturn 25;\n\t\tif (lat < 66.36171008)\n\t\t\treturn 24;\n\t\tif (lat < 67.39646774)\n\t\t\treturn 23;\n\t\tif (lat < 68.42322022)\n\t\t\treturn 22;\n\t\tif (lat < 69.44242631)\n\t\t\treturn 21;\n\t\tif (lat < 70.45451075)\n\t\t\treturn 20;\n\t\tif (lat < 71.45986473)\n\t\t\treturn 19;\n\t\tif (lat < 72.45884545)\n\t\t\treturn 18;\n\t\tif (lat < 73.45177442)\n\t\t\treturn 17;\n\t\tif (lat < 74.43893416)\n\t\t\treturn 16;\n\t\tif (lat < 75.42056257)\n\t\t\treturn 15;\n\t\tif (lat < 76.39684391)\n\t\t\treturn 14;\n\t\tif (lat < 77.36789461)\n\t\t\treturn 13;\n\t\tif (lat < 78.33374083)\n\t\t\treturn 12;\n\t\tif (lat < 79.29428225)\n\t\t\treturn 11;\n\t\tif (lat < 80.24923213)\n\t\t\treturn 10;\n\t\tif (lat < 81.19801349)\n\t\t\treturn 9;\n\t\tif (lat < 82.13956981)\n\t\t\treturn 8;\n\t\tif (lat < 83.07199445)\n\t\t\treturn 7;\n\t\tif (lat < 83.99173563)\n\t\t\treturn 6;\n\t\tif (lat < 84.89166191)\n\t\t\treturn 5;\n\t\tif (lat < 85.75541621)\n\t\t\treturn 4;\n\t\tif (lat < 86.53536998)\n\t\t\treturn 3;\n\t\tif (lat < 87.00000000)\n\t\t\treturn 2;\n\t\telse\n\t\t\treturn 1;\n\t}",
"public int mo9785x() {\n /*\n r10 = this;\n long r0 = r10.f9091i\n long r2 = r10.f9090h\n int r2 = (r2 > r0 ? 1 : (r2 == r0 ? 0 : -1))\n if (r2 != 0) goto L_0x000a\n goto L_0x0085\n L_0x000a:\n r2 = 1\n long r4 = r0 + r2\n byte r0 = p213q.p217b.p301c.p302a.p311j0.p312a.C3691q1.m8803a(r0)\n if (r0 < 0) goto L_0x0017\n r10.f9091i = r4\n return r0\n L_0x0017:\n long r6 = r10.f9090h\n long r6 = r6 - r4\n r8 = 9\n int r1 = (r6 > r8 ? 1 : (r6 == r8 ? 0 : -1))\n if (r1 >= 0) goto L_0x0021\n goto L_0x0085\n L_0x0021:\n long r6 = r4 + r2\n byte r1 = p213q.p217b.p301c.p302a.p311j0.p312a.C3691q1.m8803a(r4)\n int r1 = r1 << 7\n r0 = r0 ^ r1\n if (r0 >= 0) goto L_0x002f\n r0 = r0 ^ -128(0xffffffffffffff80, float:NaN)\n goto L_0x008b\n L_0x002f:\n long r4 = r6 + r2\n byte r1 = p213q.p217b.p301c.p302a.p311j0.p312a.C3691q1.m8803a(r6)\n int r1 = r1 << 14\n r0 = r0 ^ r1\n if (r0 < 0) goto L_0x003e\n r0 = r0 ^ 16256(0x3f80, float:2.278E-41)\n L_0x003c:\n r6 = r4\n goto L_0x008b\n L_0x003e:\n long r6 = r4 + r2\n byte r1 = p213q.p217b.p301c.p302a.p311j0.p312a.C3691q1.m8803a(r4)\n int r1 = r1 << 21\n r0 = r0 ^ r1\n if (r0 >= 0) goto L_0x004e\n r1 = -2080896(0xffffffffffe03f80, float:NaN)\n r0 = r0 ^ r1\n goto L_0x008b\n L_0x004e:\n long r4 = r6 + r2\n byte r1 = p213q.p217b.p301c.p302a.p311j0.p312a.C3691q1.m8803a(r6)\n int r6 = r1 << 28\n r0 = r0 ^ r6\n r6 = 266354560(0xfe03f80, float:2.2112565E-29)\n r0 = r0 ^ r6\n if (r1 >= 0) goto L_0x003c\n long r6 = r4 + r2\n byte r1 = p213q.p217b.p301c.p302a.p311j0.p312a.C3691q1.m8803a(r4)\n if (r1 >= 0) goto L_0x008b\n long r4 = r6 + r2\n byte r1 = p213q.p217b.p301c.p302a.p311j0.p312a.C3691q1.m8803a(r6)\n if (r1 >= 0) goto L_0x003c\n long r6 = r4 + r2\n byte r1 = p213q.p217b.p301c.p302a.p311j0.p312a.C3691q1.m8803a(r4)\n if (r1 >= 0) goto L_0x008b\n long r4 = r6 + r2\n byte r1 = p213q.p217b.p301c.p302a.p311j0.p312a.C3691q1.m8803a(r6)\n if (r1 >= 0) goto L_0x003c\n long r6 = r4 + r2\n byte r1 = p213q.p217b.p301c.p302a.p311j0.p312a.C3691q1.m8803a(r4)\n if (r1 >= 0) goto L_0x008b\n L_0x0085:\n long r0 = r10.mo9787z()\n int r0 = (int) r0\n return r0\n L_0x008b:\n r10.f9091i = r6\n return r0\n */\n throw new UnsupportedOperationException(\"Method not decompiled: p213q.p217b.p301c.p302a.p311j0.p312a.C3656k.C3661d.mo9785x():int\");\n }",
"public static void main(String[] args) {\n int a,b,c;\n int data;\n for (int i = 100; i < 999; i++) {\n\t\t\ta=i/100;//百位\n\t\t\tb=(i-a*100)/10;//十位\n\t\t\tc=i-100*a-10*b;//个位\n\t\t\tdata=a*a*a+b*b*b+c*c*c;\n\t\t\tif(data==i){\n\t\t\t\tSystem.out.println(\"水鲜花数字:\"+i);\n\t\t\t}\n\t\t}\n\t}",
"public static void main(String[] args) {\n DGIM[] dgim = new DGIM[5];\n //从0到4分别代表2^4到2^0的位\n for (int i = 0; i < 5; i++) {\n dgim[i] = new DGIM(1000);\n }\n try (BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(\"cmsc5741_stream_data2.txt\")));) {\n while (true) {\n boolean isEnd = false;\n StringBuilder builder = new StringBuilder();\n int c1 = reader.read();\n builder.append((char) c1);\n while (true) {\n int c2 = reader.read();\n if ((char) c2 == ' ') {\n break;\n }\n if (c2 == -1) {\n isEnd = true;\n break;\n }\n builder.append((char) c2);\n }\n if (isEnd) {\n break;\n }\n char[] binary = Integer.toBinaryString(Integer.parseInt(builder.toString())).toCharArray();\n //寻找开始的位\n int start = 5 - binary.length;\n DGIM.number++;\n for (int i = 0; i < binary.length; i++) {\n if (binary[i] == '1') {\n dgim[start].add();\n }\n start++;\n }\n }\n Iterator<Bucket> iterator_16 = dgim[0].getQueue().iterator();\n Iterator<Bucket> iterator_8 = dgim[1].getQueue().iterator();\n Iterator<Bucket> iterator_4 = dgim[2].getQueue().iterator();\n Iterator<Bucket> iterator_2 = dgim[3].getQueue().iterator();\n Iterator<Bucket> iterator_1 = dgim[4].getQueue().iterator();\n\n\n while(iterator_16.hasNext()){\n System.out.println(\"Buckets for 16 :\"+iterator_16.next());\n }\n System.out.println(\"There are \"+dgim[0].getContent()+\" count of 16\");\n while(iterator_8.hasNext()){\n System.out.println(\"Buckets for 8 :\"+iterator_8.next());\n }\n System.out.println(\"There are \"+dgim[1].getContent()+\" count of 8\");\n while(iterator_4.hasNext()){\n System.out.println(\"Buckets for 4 :\"+iterator_4.next());\n }\n System.out.println(\"There are \"+dgim[2].getContent()+\" count of 4\");\n while(iterator_2.hasNext()){\n System.out.println(\"Buckets for 2 :\"+iterator_2.next());\n }\n System.out.println(\"There are \"+dgim[3].getContent()+\" count 2\");\n\n while(iterator_1.hasNext()){\n System.out.println(\"Buckets for 1 :\"+iterator_1.next());\n }\n System.out.println(\"There are \"+dgim[4].getContent()+\" times 1\");\n\n int result = (dgim[0].getContent()*16 + dgim[1].getContent()*8\n + dgim[2].getContent()*4 + dgim[3].getContent()*2 + dgim[4].getContent())/1000;\n System.out.println(\"The average price: \"+result);\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n }",
"public abstract long mo9746k();",
"private int mo115245l() {\n int i = 0;\n while (i < this.f119298r) {\n int i2 = 0;\n while (i2 < this.f119297q.length && this.f119297q[i2] != i) {\n i2++;\n }\n if (i2 == this.f119297q.length) {\n return i;\n }\n i++;\n }\n return i;\n }",
"public void a()\r\n/* 49: */ {\r\n/* 50: 64 */ HashSet<BlockPosition> localHashSet = Sets.newHashSet();\r\n/* 51: */ \r\n/* 52: 66 */ int m = 16;\r\n/* 53: 67 */ for (int n = 0; n < 16; n++) {\r\n/* 54: 68 */ for (int i1 = 0; i1 < 16; i1++) {\r\n/* 55: 69 */ for (int i2 = 0; i2 < 16; i2++) {\r\n/* 56: 70 */ if ((n == 0) || (n == 15) || (i1 == 0) || (i1 == 15) || (i2 == 0) || (i2 == 15))\r\n/* 57: */ {\r\n/* 58: 74 */ double d1 = n / 15.0F * 2.0F - 1.0F;\r\n/* 59: 75 */ double d2 = i1 / 15.0F * 2.0F - 1.0F;\r\n/* 60: 76 */ double d3 = i2 / 15.0F * 2.0F - 1.0F;\r\n/* 61: 77 */ double d4 = Math.sqrt(d1 * d1 + d2 * d2 + d3 * d3);\r\n/* 62: */ \r\n/* 63: 79 */ d1 /= d4;\r\n/* 64: 80 */ d2 /= d4;\r\n/* 65: 81 */ d3 /= d4;\r\n/* 66: */ \r\n/* 67: 83 */ float f2 = this.i * (0.7F + this.d.rng.nextFloat() * 0.6F);\r\n/* 68: 84 */ double d6 = this.e;\r\n/* 69: 85 */ double d8 = this.f;\r\n/* 70: 86 */ double d10 = this.g;\r\n/* 71: */ \r\n/* 72: 88 */ float f3 = 0.3F;\r\n/* 73: 89 */ while (f2 > 0.0F)\r\n/* 74: */ {\r\n/* 75: 90 */ BlockPosition localdt = new BlockPosition(d6, d8, d10);\r\n/* 76: 91 */ Block localbec = this.d.getBlock(localdt);\r\n/* 77: 93 */ if (localbec.getType().getMaterial() != Material.air)\r\n/* 78: */ {\r\n/* 79: 94 */ float f4 = this.h != null ? this.h.a(this, this.d, localdt, localbec) : localbec.getType().a((Entity)null);\r\n/* 80: 95 */ f2 -= (f4 + 0.3F) * 0.3F;\r\n/* 81: */ }\r\n/* 82: 98 */ if ((f2 > 0.0F) && ((this.h == null) || (this.h.a(this, this.d, localdt, localbec, f2)))) {\r\n/* 83: 99 */ localHashSet.add(localdt);\r\n/* 84: */ }\r\n/* 85:102 */ d6 += d1 * 0.300000011920929D;\r\n/* 86:103 */ d8 += d2 * 0.300000011920929D;\r\n/* 87:104 */ d10 += d3 * 0.300000011920929D;\r\n/* 88:105 */ f2 -= 0.225F;\r\n/* 89: */ }\r\n/* 90: */ }\r\n/* 91: */ }\r\n/* 92: */ }\r\n/* 93: */ }\r\n/* 94:111 */ this.j.addAll(localHashSet);\r\n/* 95: */ \r\n/* 96:113 */ float f1 = this.i * 2.0F;\r\n/* 97: */ \r\n/* 98:115 */ int i1 = MathUtils.floor(this.e - f1 - 1.0D);\r\n/* 99:116 */ int i2 = MathUtils.floor(this.e + f1 + 1.0D);\r\n/* 100:117 */ int i3 = MathUtils.floor(this.f - f1 - 1.0D);\r\n/* 101:118 */ int i4 = MathUtils.floor(this.f + f1 + 1.0D);\r\n/* 102:119 */ int i5 = MathUtils.floor(this.g - f1 - 1.0D);\r\n/* 103:120 */ int i6 = MathUtils.floor(this.g + f1 + 1.0D);\r\n/* 104:121 */ List<Entity> localList = this.d.b(this.h, new AABB(i1, i3, i5, i2, i4, i6));\r\n/* 105:122 */ Vec3 localbrw = new Vec3(this.e, this.f, this.g);\r\n/* 106:124 */ for (int i7 = 0; i7 < localList.size(); i7++)\r\n/* 107: */ {\r\n/* 108:125 */ Entity localwv = (Entity)localList.get(i7);\r\n/* 109:126 */ if (!localwv.aV())\r\n/* 110: */ {\r\n/* 111:129 */ double d5 = localwv.f(this.e, this.f, this.g) / f1;\r\n/* 112:131 */ if (d5 <= 1.0D)\r\n/* 113: */ {\r\n/* 114:132 */ double d7 = localwv.xPos - this.e;\r\n/* 115:133 */ double d9 = localwv.yPos + localwv.getEyeHeight() - this.f;\r\n/* 116:134 */ double d11 = localwv.zPos - this.g;\r\n/* 117: */ \r\n/* 118:136 */ double d12 = MathUtils.sqrt(d7 * d7 + d9 * d9 + d11 * d11);\r\n/* 119:137 */ if (d12 != 0.0D)\r\n/* 120: */ {\r\n/* 121:141 */ d7 /= d12;\r\n/* 122:142 */ d9 /= d12;\r\n/* 123:143 */ d11 /= d12;\r\n/* 124: */ \r\n/* 125:145 */ double d13 = this.d.a(localbrw, localwv.getAABB());\r\n/* 126:146 */ double d14 = (1.0D - d5) * d13;\r\n/* 127:147 */ localwv.receiveDamage(DamageSource.a(this), (int)((d14 * d14 + d14) / 2.0D * 8.0D * f1 + 1.0D));\r\n/* 128: */ \r\n/* 129:149 */ double d15 = EnchantmentProtection.a(localwv, d14);\r\n/* 130:150 */ localwv.xVelocity += d7 * d15;\r\n/* 131:151 */ localwv.yVelocity += d9 * d15;\r\n/* 132:152 */ localwv.zVelocity += d11 * d15;\r\n/* 133:154 */ if ((localwv instanceof EntityPlayer)) {\r\n/* 134:155 */ this.k.put((EntityPlayer)localwv, new Vec3(d7 * d14, d9 * d14, d11 * d14));\r\n/* 135: */ }\r\n/* 136: */ }\r\n/* 137: */ }\r\n/* 138: */ }\r\n/* 139: */ }\r\n/* 140: */ }",
"public static int offset_sum_a() {\n return (72 / 8);\n }",
"private static int m18332b(int encoding) {\n if (encoding == 5) {\n return 80000;\n }\n if (encoding == 6) {\n return 768000;\n }\n if (encoding == 7) {\n return 192000;\n }\n if (encoding == 8) {\n return 2250000;\n }\n if (encoding == 14) {\n return 3062500;\n }\n throw new IllegalArgumentException();\n }",
"public long mo9786y() {\n long j;\n long j2;\n long j3;\n byte b;\n long j4 = this.f9091i;\n if (this.f9090h != j4) {\n long j5 = j4 + 1;\n byte a = C3691q1.m8803a(j4);\n if (a >= 0) {\n this.f9091i = j5;\n return (long) a;\n } else if (this.f9090h - j5 >= 9) {\n long j6 = j5 + 1;\n byte a2 = a ^ (C3691q1.m8803a(j5) << 7);\n if (a2 < 0) {\n b = a2 ^ Byte.MIN_VALUE;\n } else {\n long j7 = j6 + 1;\n byte a3 = a2 ^ (C3691q1.m8803a(j6) << 14);\n if (a3 >= 0) {\n j = (long) (a3 ^ 16256);\n } else {\n j6 = j7 + 1;\n byte a4 = a3 ^ (C3691q1.m8803a(j7) << 21);\n if (a4 < 0) {\n b = a4 ^ -2080896;\n } else {\n j7 = j6 + 1;\n long a5 = ((long) a4) ^ (((long) C3691q1.m8803a(j6)) << 28);\n if (a5 >= 0) {\n j3 = 266354560;\n } else {\n long j8 = j7 + 1;\n long a6 = a5 ^ (((long) C3691q1.m8803a(j7)) << 35);\n if (a6 < 0) {\n j2 = -34093383808L;\n } else {\n j7 = j8 + 1;\n a5 = a6 ^ (((long) C3691q1.m8803a(j8)) << 42);\n if (a5 >= 0) {\n j3 = 4363953127296L;\n } else {\n j8 = j7 + 1;\n a6 = a5 ^ (((long) C3691q1.m8803a(j7)) << 49);\n if (a6 < 0) {\n j2 = -558586000294016L;\n } else {\n j7 = j8 + 1;\n j = (a6 ^ (((long) C3691q1.m8803a(j8)) << 56)) ^ 71499008037633920L;\n if (j < 0) {\n long j9 = 1 + j7;\n if (((long) C3691q1.m8803a(j7)) >= 0) {\n j6 = j9;\n this.f9091i = j6;\n return j;\n }\n }\n }\n }\n }\n j = a6 ^ j2;\n j6 = j8;\n this.f9091i = j6;\n return j;\n }\n j = a5 ^ j3;\n }\n }\n j6 = j7;\n this.f9091i = j6;\n return j;\n }\n j = (long) b;\n this.f9091i = j6;\n return j;\n }\n }\n return mo9787z();\n }",
"public static void main(String[] arrr){\n\t\tlong mod = 10000000011L;\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint[] arr = new int[n];\n\t\tfor (int i = 0; i < arr.length; i++) {\n\t\t\tarr[i]=sc.nextInt();\n\t\t}\n\t\tlong total=0;\n\t\tfor (int i = 0; i < arr.length; i++) {\n\t\t\ttotal = (total+((long)Math.pow((countBit(arr[i])),(i+1))%mod))%mod;\n\t\t}\n\t\tSystem.out.println(total);\n\t}",
"private int[] m7231g() {\n this.f5577B[0] = this.f5594p;\n this.f5577B[1] = this.f5600v - this.f5594p;\n return this.f5577B;\n }",
"private static void test3() {\n for (int noteNumber = 0; noteNumber < 128; noteNumber++) {\n double frequency = 440 * Math.pow(2, (noteNumber - 69) / 12.0);\n \n boolean clipMax = false;\n int block = 0;\n \n if (frequency <= 48.503) {\n block = 0;\n }\n else if (frequency <= 97.006) {\n block = 1;\n }\n else if (frequency <= 194.013) {\n block = 2;\n }\n else if (frequency <= 388.026) {\n block = 3;\n }\n else if (frequency <= 776.053) {\n block = 4;\n }\n else if (frequency <= 1552.107) {\n block = 5;\n }\n else if (frequency <= 3104.215) {\n block = 6;\n }\n else if (frequency <= 6208.431) {\n block = 7;\n \n }\n else {\n //throw new RuntimeException(\"invalid frequency !\");\n //System.out.println(\"unsupported frequency \" + frequency + \" !\");\n //System.exit(-1);\n block = 7;\n clipMax = true;\n }\n \n double f_num = frequency * Math.pow(2, (20 - block)) / 49716;\n if (clipMax) {\n f_num = 1023;\n }\n String f_num_hex = \"0000\" + Integer.toHexString((int) f_num);\n f_num_hex = f_num_hex.substring(f_num_hex.length() - 4, f_num_hex.length());\n //System.out.println(noteNumber + \" = \" + frequency + \" ---> block: \" + block + \" f_num_hex = \" + f_num_hex);\n //System.out.println(noteNumber + \" = \" + frequency);\n \n String block_hex = \"000\" + Integer.toHexString(block);\n block_hex = block_hex.substring(block_hex.length() - 3, block_hex.length());\n\n if (noteNumber % 4 == 0) {\n System.out.print(\"\\r\\n\\t\\t\\tdb \");\n }\n System.out.print(block_hex + \"h, 000h, 0\" + f_num_hex.subSequence(2, 4) + \"h, 0\" + f_num_hex.substring(0, 2) + \"h\" + ((noteNumber % 4 != 3) ? \", \" : \"\"));\n \n }\n System.out.println(\"\");\n }",
"private static String[] getValidMiniFloatBitSequences() {\r\n int nbrValues = (int) Math.pow(2, MINI_FLOAT_SIZE);\r\n\r\n String[] result = new String[nbrValues];\r\n for (int i = 0; i < nbrValues; i++) {\r\n\r\n String full = String.format(\"%\" + Integer.SIZE + \"s\", Integer.toBinaryString(i)).replace(' ', '0');\r\n result[i] = full.substring(Integer.SIZE - MINI_FLOAT_SIZE, Integer.SIZE);\r\n }\r\n return result;\r\n }",
"int[] mo56159c();",
"HugeUInt(String str) {\r\n array = new int[str.length()];\r\n int x = str.length() - 1;\r\n for (int i = x; i >= 0; i--) {\r\n array[x-i] = Character.getNumericValue(str.charAt(i));\r\n }\r\n }",
"private void method_259(int[] var1, int[] var2, int var3, int var4, int var5, int var6, int var7, int var8, int var9, int var10, int var11, int var12, int var13, int var14, int var15) {\n boolean var28 = field_759;\n int var19 = var12 >> 16 & 255;\n int var20 = var12 >> 8 & 255;\n int var21 = var12 & 255;\n\n try {\n int var22 = var4;\n int var23 = -var8;\n if(var28 || var23 < 0) {\n do {\n int var24 = (var5 >> 16) * var11;\n int var25 = var13 >> 16;\n int var26 = var7;\n int var27;\n if(var25 < this.field_745) {\n var27 = this.field_745 - var25;\n var26 = var7 - var27;\n var25 = this.field_745;\n var4 += var9 * var27;\n }\n\n if(var25 + var26 >= this.field_746) {\n var27 = var25 + var26 - this.field_746;\n var26 -= var27;\n }\n\n var15 = 1 - var15;\n if(var15 != 0) {\n var27 = var25;\n if(var28 || var25 < var25 + var26) {\n do {\n var3 = var2[(var4 >> 16) + var24];\n if(var3 != 0) {\n label33: {\n int var16 = var3 >> 16 & 255;\n int var17 = var3 >> 8 & 255;\n int var18 = var3 & 255;\n if(var16 == var17 && var17 == var18) {\n var1[var27 + var6] = (var16 * var19 >> 8 << 16) + (var17 * var20 >> 8 << 8) + (var18 * var21 >> 8);\n if(!var28) {\n break label33;\n }\n }\n\n var1[var27 + var6] = var3;\n }\n }\n\n var4 += var9;\n ++var27;\n } while(var27 < var25 + var26);\n }\n }\n\n var5 += var10;\n var4 = var22;\n var6 += this.field_723;\n var13 += var14;\n ++var23;\n } while(var23 < 0);\n\n }\n } catch (Exception var29) {\n System.out.println(\"error in transparent sprite plot routine\"); // authentic System.out.println\n }\n }",
"public static void main(String args[]) {\n\t\tBigDecimal start = new BigDecimal(\"2658455991569831744654692615953842176\");\n//\t\tBigDecimal start = new BigDecimal(\"8128\");\n//\t\tBigDecimal dd = start.divide(next, 0);\n//\t\tSystem.out.println(dd);\n\t\t\n\t\tList<BigDecimal> fs = new PerfectNumber().factor2(start, 10, null);\n\t\tBigDecimal multiply = new BigDecimal(1);\n\t\tBigDecimal sum = new BigDecimal(0);\n\t\tfor (BigDecimal d : fs) {\n\t\t\tSystem.out.println(d);\n\t\t\tmultiply = multiply.multiply(d);\n\t\t\tsum = sum.add(d);\n\t\t}\n\t\tSystem.out.println(\"sum = \" + sum);\n\t\tSystem.out.println(\"multiply = \" + multiply);\n\t}",
"private void method_262(int[] var1, byte[] var2, int[] var3, int var4, int var5, int var6, int var7, int var8, int var9, int var10, int var11, int var12, int var13, int var14, int var15, int var16, int var17) {\n boolean var33 = field_759;\n int var21 = var13 >> 16 & 255;\n int var22 = var13 >> 8 & 255;\n int var23 = var13 & 255;\n int var24 = var14 >> 16 & 255;\n int var25 = var14 >> 8 & 255;\n int var26 = var14 & 255;\n\n try {\n int var27 = var5;\n int var28 = -var9;\n if(var33 || var28 < 0) {\n do {\n int var29 = (var6 >> 16) * var12;\n int var30 = var15 >> 16;\n int var31 = var8;\n int var32;\n if(var30 < this.field_745) {\n var32 = this.field_745 - var30;\n var31 = var8 - var32;\n var30 = this.field_745;\n var5 += var10 * var32;\n }\n\n if(var30 + var31 >= this.field_746) {\n var32 = var30 + var31 - this.field_746;\n var31 -= var32;\n }\n\n var17 = 1 - var17;\n if(var17 != 0) {\n var32 = var30;\n if(var33 || var30 < var30 + var31) {\n do {\n var4 = var2[(var5 >> 16) + var29] & 255;\n if(var4 != 0) {\n label69: {\n var4 = var3[var4];\n int var18 = var4 >> 16 & 255;\n int var19 = var4 >> 8 & 255;\n int var20 = var4 & 255;\n if(var18 == var19 && var19 == var20) {\n var1[var32 + var7] = (var18 * var21 >> 8 << 16) + (var19 * var22 >> 8 << 8) + (var20 * var23 >> 8);\n if(!var33) {\n break label69;\n }\n }\n\n if(var18 == 255 && var19 == var20) {\n var1[var32 + var7] = (var18 * var24 >> 8 << 16) + (var19 * var25 >> 8 << 8) + (var20 * var26 >> 8);\n if(!var33) {\n break label69;\n }\n }\n\n var1[var32 + var7] = var4;\n }\n }\n\n var5 += var10;\n ++var32;\n } while(var32 < var30 + var31);\n }\n }\n\n var6 += var11;\n var5 = var27;\n var7 += this.field_723;\n var15 += var16;\n ++var28;\n } while(var28 < 0);\n\n }\n } catch (Exception var34) {\n System.out.println(\"error in transparent sprite plot routine\"); // authentic System.out.println\n }\n }",
"long mo25071a(long j);",
"public static void main(String[] args) {\n\n\t\tEuler40 eu=new Euler40(1000000);\n\t\tSystem.out.println(eu.get(0)*eu.get(9)*eu.get(99)*eu.get(999)*eu.get(9999)*eu.get(99999)*eu.get(999999));\n\t\t\n \n\t\t\n\t}",
"void procedure()\n {\n try\n {\n fkey=new FileInputStream(file2);\n }\n catch(Exception e)\n {\n System.out.println(e);\n }\n keybuf= new byte[16];\n try\n {\n fkey.read(keybuf);\n z= new int[52];\n j1=0;\n i1=0;\n for(i=0;i<52;i++)\n z[i]=0;\n while( i1<8)\n {\n if((j1+1)%2==0)\n {\n z[i1]|=keybuf[j1]; // dividing 64 bit cypher block into four 16 bit registers\n\t i1++;\n }\n else\n \t {\n\t z[i1]=keybuf[j1];\n\t z[i1]<<=8;\n }\n\t j1++;\n }\n i=0;\n\t for(j1=1;j1<=5;j1++)\n\t {\n\t i++;\n\t z[i+7]=((z[i]<<9)&0xfe00)|((z[i+1]>>7)&0x1ff);\n\t z[i+8]=((z[i+1]<<9)&0xfe00)|((z[i+2]>>7)&0x1ff);\n\t z[i+9]=((z[i+2]<<9)&0xfe00)|((z[i+3]>>7)&0x1ff);\n\t z[i+10]=((z[i+3]<<9)&0xfe00)|((z[i+4]>>7)&0x1ff);\n\t z[i+11]=((z[i+4]<<9)&0xfe00)|((z[i+5]>>7)&0x1ff);\n\t z[i+12]=((z[i+5]<<9)&0xfe00)|((z[i+6]>>7)&0x1ff);\n z[i+13]=((z[i+6]<<9)&0xfe00)|((z[i-1]>>7)&0x1ff);\n\t z[i+14]=((z[i-1]<<9)&0xfe00)|((z[i]>>7)&0x1ff);\n\t i=i+7;\n\t }\n i1=41;\n\t z[48]=((z[i1]<<9)&0xfe00)|((z[i1+1]>>7)&0x1ff);\n\t z[49]=((z[i1+1]<<9)&0xfe00)|((z[i1+2]>>7)&0x1ff);\n\t z[50]=((z[i1+2]<<9)&0xfe00)|((z[i1+3]>>7)&0x1ff);\n\t z[51]=((z[i1+3]<<9)&0xfe00)|((z[i1+4]>>7)&0x1ff);\n}\ncatch(Exception e)\n{\nSystem.out.println(e);\n}\n}",
"public static void main(String[] args) {\n Scanner scan=new Scanner(System.in);\n int t= scan.nextInt();\n int min[] = new int[10001];\n Arrays.fill(min,89898);\n min[0] = 0;\n int pn[] = new int[10001];\n boolean p[] = new boolean[10001];\n for(int i=2;i<101;++i)\n {\n if(!p[i])\n for(int j=i*i;j<10001;j+=i)\n p[j] = true;\n }\n int index = 0;\n for(int i=2;i<10001;++i)\n if(!p[i])\n pn[index++] = i;\n int last = index-1;\n for(int i=0;i<=last;++i)\n {\n int temp = (int)Math.pow(pn[i], pn[i]);\n if(temp<10001)\n pn[index++] = temp;\n else break;\n }\n pn[index++] = 898989;\n Arrays.sort(pn,0,index);\n for(int i=2;i<10001;++i)\n {\n for(int j=0;pn[j]<=i;++j)\n if(min[i]>1+min[i-pn[j]])\n min[i] = 1+min[i-pn[j]];\n }\n\n StringBuilder sb = new StringBuilder(\"\");\n while(t-->0)\n {\n sb.append(min[scan.nextInt()]+\"\\n\");\n }\n System.out.println(sb);\n }",
"public int mo9774x() {\n /*\n r5 = this;\n int r0 = r5.f9082i\n int r1 = r5.f9080g\n if (r1 != r0) goto L_0x0007\n goto L_0x006a\n L_0x0007:\n byte[] r2 = r5.f9079f\n int r3 = r0 + 1\n byte r0 = r2[r0]\n if (r0 < 0) goto L_0x0012\n r5.f9082i = r3\n return r0\n L_0x0012:\n int r1 = r1 - r3\n r4 = 9\n if (r1 >= r4) goto L_0x0018\n goto L_0x006a\n L_0x0018:\n int r1 = r3 + 1\n byte r3 = r2[r3]\n int r3 = r3 << 7\n r0 = r0 ^ r3\n if (r0 >= 0) goto L_0x0024\n r0 = r0 ^ -128(0xffffffffffffff80, float:NaN)\n goto L_0x0070\n L_0x0024:\n int r3 = r1 + 1\n byte r1 = r2[r1]\n int r1 = r1 << 14\n r0 = r0 ^ r1\n if (r0 < 0) goto L_0x0031\n r0 = r0 ^ 16256(0x3f80, float:2.278E-41)\n L_0x002f:\n r1 = r3\n goto L_0x0070\n L_0x0031:\n int r1 = r3 + 1\n byte r3 = r2[r3]\n int r3 = r3 << 21\n r0 = r0 ^ r3\n if (r0 >= 0) goto L_0x003f\n r2 = -2080896(0xffffffffffe03f80, float:NaN)\n r0 = r0 ^ r2\n goto L_0x0070\n L_0x003f:\n int r3 = r1 + 1\n byte r1 = r2[r1]\n int r4 = r1 << 28\n r0 = r0 ^ r4\n r4 = 266354560(0xfe03f80, float:2.2112565E-29)\n r0 = r0 ^ r4\n if (r1 >= 0) goto L_0x002f\n int r1 = r3 + 1\n byte r3 = r2[r3]\n if (r3 >= 0) goto L_0x0070\n int r3 = r1 + 1\n byte r1 = r2[r1]\n if (r1 >= 0) goto L_0x002f\n int r1 = r3 + 1\n byte r3 = r2[r3]\n if (r3 >= 0) goto L_0x0070\n int r3 = r1 + 1\n byte r1 = r2[r1]\n if (r1 >= 0) goto L_0x002f\n int r1 = r3 + 1\n byte r2 = r2[r3]\n if (r2 >= 0) goto L_0x0070\n L_0x006a:\n long r0 = r5.mo9776z()\n int r0 = (int) r0\n return r0\n L_0x0070:\n r5.f9082i = r1\n return r0\n */\n throw new UnsupportedOperationException(\"Method not decompiled: p213q.p217b.p301c.p302a.p311j0.p312a.C3656k.C3659c.mo9774x():int\");\n }",
"String mo30285c(long j);",
"public static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\t int a = 0;\n\t\t a=scan.nextInt();\n\t\t int [] arr=new int[a+1];\n\t\t arr[1]=arr[2]=1;\n\t\t for(int i=3;i<arr.length;i++){\n\t\t arr[i]=(arr[i-1]+arr[i-2])%10007;//对每一个斐波那契数列进行取余数\n\t\t }\n\t\t System.out.println(arr[a]);\n\t\t }",
"public int mo1067a() {\n return this.f3256d.size();\n }",
"private static int[] m10288a(C9383t tVar) {\n int intValue = ((Integer) LiveSettingKeys.STREAM_DEFINITION_LEVEL.mo10240a()).intValue();\n if (intValue > 0 && intValue <= f8023g.length) {\n return f8023g[intValue - 1];\n }\n return new int[]{tVar.mo23063c(), tVar.mo23064d(), tVar.mo23065e(), tVar.f25784h};\n }",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\tint n; //100,000 \n\t\twhile((n=sc.nextInt())!=0) {\n\t\t\t\n\t\t\tlong[] hist = new long[n];\n\t\t\tfor(int i=0; i<n; i++) {\n\t\t\t\t// 1,000,000,000\n\t\t\t\thist[i] = sc.nextLong();\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\n\t}",
"public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n int T = scanner.nextInt();\n assert T >=1;\n assert T<=100000;\n long []numArr = new long[T];\n for(int i=0; i<T; i++) {\n numArr[i] = scanner.nextLong ();\n assert numArr[i]>=1;\n assert numArr[i]<=1000000000;\n }\n\n for (long num : numArr) {\n int i=1;\n long sum=0;\n while(i*3<num) {\n sum +=i*3;\n if(i*5<num && i%3!=0)\n sum +=i*5;\n i++;\n }\n System.out.println(sum);\n }\n }",
"@Test(timeout = 4000)\n public void test117() throws Throwable {\n Range.CoordinateSystem range_CoordinateSystem0 = Range.CoordinateSystem.SPACE_BASED;\n Range range0 = Range.of(range_CoordinateSystem0, 32729L, 2147483647L);\n Range.CoordinateSystem range_CoordinateSystem1 = Range.CoordinateSystem.SPACE_BASED;\n range0.toString(range_CoordinateSystem1);\n range0.toString();\n Range range1 = Range.parseRange(\"[ 32729 .. 2147483646 ]/0B\", range_CoordinateSystem1);\n range1.equals(range0);\n Range.CoordinateSystem.values();\n Range.Comparators[] range_ComparatorsArray0 = Range.Comparators.values();\n assertEquals(4, range_ComparatorsArray0.length);\n }",
"public static void main(String[] args) {\n\tString NUM = \"73167176531330624919225119674426574742355349194934\" +\n \"96983520312774506326239578318016984801869478851843\" +\n \"85861560789112949495459501737958331952853208805511\" +\n \"12540698747158523863050715693290963295227443043557\" +\n \"66896648950445244523161731856403098711121722383113\" +\n \"62229893423380308135336276614282806444486645238749\" +\n \"30358907296290491560440772390713810515859307960866\" +\n \"70172427121883998797908792274921901699720888093776\" +\n \"65727333001053367881220235421809751254540594752243\" +\n \"52584907711670556013604839586446706324415722155397\" +\n \"53697817977846174064955149290862569321978468622482\" +\n \"83972241375657056057490261407972968652414535100474\" +\n \"82166370484403199890008895243450658541227588666881\" +\n \"16427171479924442928230863465674813919123162824586\" +\n \"17866458359124566529476545682848912883142607690042\" +\n \"24219022671055626321111109370544217506941658960408\" +\n \"07198403850962455444362981230987879927244284909188\" +\n \"84580156166097919133875499200524063689912560717606\" +\n \"05886116467109405077541002256983155200055935729725\" +\n \"71636269561882670428252483600823257530420752963450\";\n\n //greatest combo array\n int[] greatestCombo = new int[13];\n //array to iterate through NUMS\n int[] combos = new int[13];\n //adjacency\n boolean adjacent = true;\n //product\n long product = 1;\n //maxProduct\n long maxProduct = 0;\n\n\t//iterating through the entire NUM string\n\tfor(int i = 0 ; i < NUM.length()-13; i++){\n\t //make a temporary array with the combination of the three numbers\n\t for(int c = 0; c < 13; c++){\n\t combos[c] = NUM.charAt(i+c);\n }\n\n\t //loop to determine if the numbers are adjacent\n for(int k = 1; k < 13; k++){\n if(abs(combos[k-1]-combos[k])>1){\n adjacent = false;\n break;\n }\n }\n\n //now that we have an adjacent 13-number array\n if(adjacent){\n //find the product\n for(int r = 0; r < 13; r++){\n product *= combos[r];\n }\n\n if(product > maxProduct){\n maxProduct = product;\n for(int p = 0; p < 13; p++){\n greatestCombo[p]=combos[p];\n }\n }\n }\n\n }\n System.out.println(maxProduct);\n\n }",
"public p207() {\n double target = 1/12345.0;\n double log2 = Math.log(2);\n\n for (int x = 2; x < 2000000; x++){\n double a = Math.floor(Math.log(x) / log2) / (x-1);\n if (a < target){\n System.out.println(x*(x-1L));\n break;\n }\n }\n }",
"byte[] mo38566a();",
"public static void main(String args[] ) throws Exception {\n Scanner in = new Scanner(System.in);\n \n String original = in.next();\n int n = original.length();\n long moda = 1000000007;\n long ones = 1;\n long sum=0; \n for (int s=original.length()-1; s>=0; s--) {\n sum = (sum + (s+1) * (original.charAt(s) - '0') * ones) %moda; \n ones = (ones * 10 + 1) % moda;\n \n }\n \n System.out.println(sum);\n \n }",
"private static double freqOfKey(int index) {\n return 440 * Math.pow(2, (double) (index - 12) / 24);\n }",
"private void m81850n() {\n m81843b(m81844c(C6969H.m41409d(\"G738BEA12B634AE16F20F9277F0E4D1\")));\n }",
"private static void findBigramCountsTuring() {\n\n\t\tbigramCountTI= new HashMap<Integer,Double>();\n\t\tdouble value;\n\t\tfor(int i:bucketCountT.keySet()){\n\t\t\tif(i==0)\n\t\t\t\tcontinue;\n\t\t\tvalue= ((i+1)*bucketCountT.getOrDefault(i+1, 0.0))/bucketCountT.get(i);\n\t\t\tbigramCountTI.put(i,value);\n\t\t}\n\t}",
"public static void main(String[] args) {\n Scanner scan = new Scanner(System.in);\n\n // Declaración de datos\n int values[], tamanio;\n\n // Ingreso de datos\n System.out.println(\"Tamaño del arreglo: \");\n tamanio = scan.nextInt();\n\n // Inicialización de array\n values = new int[tamanio];\n\n // Generación de datos aleatorios para array\n for (int i = 0; i < values.length; i++) {\n values[i] = (int) (Math.random() * 100);\n }\n\n // Proceso de búsqueda binaria\n for (int i = 0; i < 10000000; i++) {\n int index = -1;\n for (int j = 0; j < values.length; j++) {\n if (values[j] == 80) {\n index = j;\n System.out.println(\"Número encontrado -> en la posición\" + index);\n }\n if (values[j] != 80){\n System.out.println(\"No fue posible encontrar el número\");\n }\n }\n }\n\n }",
"long mo49a();",
"static void method_6617() {\r\n boolean var10000 = true;\r\n char[] var10003 = \"3\u0012qêXI}@k\u0017ê\".toCharArray();\r\n Object var10004 = var10003.length;\r\n Object var4 = true;\r\n char[] var10002 = var10003;\r\n char[] var10001 = (char[])var10004;\r\n int var0 = 0;\r\n\r\n while(true) {\r\n var10003 = var10002;\r\n var10002 = var10001;\r\n var10001 = var10003;\r\n char[] var5 = var10002;\r\n var10002 = var10003;\r\n if(var10003 <= var0) {\r\n field_6523 = (new String((char[])var4)).intern();\r\n String var2 = field_6523;\r\n return;\r\n }\r\n\r\n char var10007 = (char)((Object[])var4)[var0];\r\n short var10009;\r\n switch(var0 % 7) {\r\n case 0:\r\n var10009 = 162;\r\n break;\r\n case 1:\r\n var10009 = 140;\r\n break;\r\n case 2:\r\n var10009 = 252;\r\n break;\r\n case 3:\r\n var10009 = 8;\r\n break;\r\n case 4:\r\n var10009 = 186;\r\n break;\r\n case 5:\r\n var10009 = 171;\r\n break;\r\n default:\r\n var10009 = 159;\r\n }\r\n\r\n ((Object[])var4)[var0] = (char)(var10007 ^ var5 ^ var10009);\r\n ++var0;\r\n }\r\n }"
] | [
"0.5894013",
"0.5810187",
"0.5744376",
"0.55712074",
"0.5568676",
"0.55548525",
"0.5501423",
"0.5459378",
"0.5458312",
"0.5453852",
"0.5446104",
"0.53958315",
"0.5388962",
"0.5386986",
"0.5378102",
"0.5377923",
"0.5373902",
"0.53649145",
"0.53621894",
"0.5327063",
"0.5320413",
"0.5299761",
"0.5289088",
"0.5283492",
"0.52679944",
"0.5267874",
"0.5265895",
"0.525537",
"0.52432805",
"0.52411294",
"0.5233028",
"0.5227468",
"0.5224337",
"0.5222372",
"0.5213586",
"0.52012324",
"0.52006483",
"0.51971346",
"0.5196768",
"0.51927173",
"0.5183017",
"0.5180203",
"0.51801944",
"0.5173495",
"0.5172047",
"0.51632035",
"0.515654",
"0.51535046",
"0.5153456",
"0.51508063",
"0.5146234",
"0.514605",
"0.51416445",
"0.513277",
"0.5131209",
"0.512779",
"0.51255834",
"0.5123023",
"0.5120742",
"0.5110827",
"0.51010424",
"0.50943017",
"0.50894874",
"0.50857747",
"0.5085073",
"0.5084842",
"0.50846994",
"0.50821215",
"0.5076399",
"0.50734454",
"0.5070985",
"0.50704306",
"0.5070408",
"0.5068528",
"0.50670826",
"0.5064756",
"0.50632375",
"0.5056968",
"0.5055042",
"0.505323",
"0.50527686",
"0.5050696",
"0.50492716",
"0.50482315",
"0.5047509",
"0.5045237",
"0.5043496",
"0.50431734",
"0.5040765",
"0.50373626",
"0.5024663",
"0.5019925",
"0.50190276",
"0.5017461",
"0.50171596",
"0.5015783",
"0.5015558",
"0.50134355",
"0.5013425",
"0.5011256",
"0.50101644"
] | 0.0 | -1 |
Constructs a new application properties container and initializes it with the provided settings. | public ApplicationConfigurationProperties(
Collection<ApplicationConfigurationSetting> settings) {
// TODO init with localhost as default?
String urlPrefixValue = "";
String urlPrefixSecuredValue = "";
properties = new HashMap<String, String>();
if (settings != null) {
for (ApplicationConfigurationSetting setting : settings) {
properties.put(setting.getSettingKey(), setting.getSettingValue());
}
// initialize the configured URLs required for situations where no request is available
String hostName = getProperty(ApplicationProperty.WEB_SERVER_HOST_NAME);
if (StringUtils.isBlank(hostName)) {
LOG.warn("The application property "
+ ApplicationProperty.WEB_SERVER_HOST_NAME.getKeyString()
+ " is not defined. The URL rendering will not work correctly.");
} else {
String context = getProperty(ApplicationProperty.WEB_SERVER_CONTEXT_NAME, "")
.trim();
if (StringUtils.isNotBlank(context) && !context.startsWith("/")) {
context = "/" + context;
}
int port = getProperty(ApplicationProperty.WEB_HTTP_PORT,
ApplicationProperty.DEFAULT_WEB_HTTP_PORT);
urlPrefixValue = buildUrlPrefix(hostName, port, context, false);
if (getProperty(ApplicationProperty.WEB_HTTPS_SUPPORTED,
ApplicationProperty.DEFAULT_WEB_HTTPS_SUPPORTED)) {
port = getProperty(ApplicationProperty.WEB_HTTPS_PORT,
ApplicationProperty.DEFAULT_WEB_HTTPS_PORT);
urlPrefixSecuredValue = buildUrlPrefix(hostName, port, context, true);
} else {
urlPrefixSecuredValue = urlPrefixValue;
}
}
}
urlPrefix = urlPrefixValue;
urlPrefixSecured = urlPrefixSecuredValue;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public ApplicationContext() {\n FileInputStream in;\n props = new Properties();\n try {\n in = new FileInputStream(\"gamesettings.properties\");\n props.load(in);\n } catch (FileNotFoundException ex) {\n props.setProperty(\"name\", \"Player\");\n props.setProperty(\"url\", \"0.0.0.0\");\n \n } catch (IOException ex) {\n props.setProperty(\"name\", \"Player\");\n props.setProperty(\"url\", \"0.0.0.0\");\n }\n }",
"public ApplicationDefinitionProperties() {\n }",
"public Config() {\n this(System.getProperties());\n\n }",
"private ConfigProperties() {\n\n }",
"private void createApplicationProperties()\n {\n _applicationPropertiesMap = new HashMap<String,Object>();\n _message.setApplicationProperties(new ApplicationProperties(_applicationPropertiesMap));\n }",
"@SneakyThrows\n public ApplicationProperties(final String propertiesFilePath) {\n this.properties = new Properties();\n this.properties.load(new FileInputStream(propertiesFilePath));\n }",
"void configure(Properties properties);",
"public PropertiesInjectionModule() {\n }",
"public ApplicationResourceProperties() {\n }",
"public Properties initForRuntime() {\n initProperties();\n return this;\n }",
"private SettingsManager initSettings() {\n // Copy the demo/config.yml instead of using it directly so it doesn't get overridden\n configFile = copyFileFromJar(\"/demo/config.yml\");\n return SettingsManagerBuilder.withYamlFile(configFile).configurationData(TitleConfig.class).create();\n }",
"static AuditYamlConfigurationLoader withSystemProperties()\n {\n return withProperties(System.getProperties());\n }",
"public Settings() {\r\n\t\tthis.settings = new HashMap<String, Object>();\r\n\t\tloadDefaults();\r\n\t}",
"private static Settings prepareSettings() {\n final String dir = System.getProperty(JBOSS_CONFIG_DIR);\n Settings mySettings;\n\n if (dir != null) {\n final String file = dir + File.separator + PROPERTIES_FILE;\n LOG.debug(\"Reading the IWS Properties from '{}'.\", file);\n\n try (InputStream stream = new FileInputStream(file)) {\n final Properties properties = new Properties();\n properties.load(stream);\n\n mySettings = new Settings(properties);\n } catch (FileNotFoundException e) {\n LOG.warn(\"Properties file was not found, reverting to default values.\", e);\n mySettings = new Settings();\n } catch (IOException e) {\n LOG.warn(\"Properties file could not be loaded, reverting to default values.\", e);\n mySettings = new Settings();\n }\n } else {\n LOG.warn(\"Application Server Configuration Path cannot be read.\");\n mySettings = new Settings();\n }\n\n return mySettings;\n }",
"public void initialize(JMSSettings settings) {\n super.initialize(settings);\n durableConsumers = settings.useDurableConsumers();\n }",
"public PackageBuilderConfiguration(Properties properties) {\r\n init( null,\r\n properties );\r\n }",
"void configure (Settings settings);",
"private Properties getAppSettings() {\n \t\t\n\t if(_appSettings == null){\n\t\t try {\n\t\t\tsynchronized(this){\t\t\n\t\t\t\tif(_appSettings == null) {\t\t\t\t\t\t\n\t\t\t\t\t_appSettings = new Properties();\t\n\t\t\t\t\t\n\t\t\t\t\t//look for an existing file this mmsi\n\t\t\t\t\t//if one doesn't exist, use a default file.\n\t\t\t\t\tString configFile = _configFile;\n\t\t\t\t\tFile file = new File(configFile);\n\t\t\t\t\tif(file.exists() == false){\n\t\t\t\t\t\tconfigFile = STORE_BASE + APPL_PROPS;\n\t\t\t\t\t}\n\t\t\t\t\tFileInputStream oFile = new FileInputStream(configFile);\n\t\t \t\tInputStream setupOutput = new DataInputStream(oFile);\t\t \t\t\t\t\n\t\t \t\t//InputStream propInput = new DataInputStream(this.getClass().getResourceAsStream(STORE_BASE + APP_SETTINGS));\t \t \t \t\t\t\n\t\t\t\t\t_appSettings.load(setupOutput);\t\n\t\t\t\t\t\n\t\t\t\t} \t \t\t\t\t\t\n\t\t\t}\t \t\t\t\n\t\t}catch(Exception oEx){\n\t\t\tAppLogger.error(oEx);\n\t\t}\t\t \t\t\t\t\t\n\t}\t\t\t \t\t\n\treturn _appSettings;\n }",
"public Settings(){}",
"public Properties() {\n\n\t\tconfig = new java.util.Properties();\n\n\t\ttry {\n\t\t\tInputStream input = new FileInputStream(new File(\n\t\t\t\t\t\"ConfigurationFile.txt\"));\n\t\t\tconfig.load(input);\n\n\t\t} catch (Exception e) {\n\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}",
"private static Properties setup() {\n Properties props = System.getProperties();\n try {\n props.load(new FileInputStream(new File(\"src/config.properties\")));\n } catch (Exception e) {\n e.printStackTrace();\n System.exit(-1);\n }\n return props;\n }",
"public TestProperties() {\n\t\tthis.testProperties = new Properties();\n\t}",
"private SystemProperties() {}",
"public void setConfiguration(Properties props);",
"protected void initialise() {\r\n loadDefaultConfig();\r\n loadCustomConfig();\r\n loadSystemConfig();\r\n if (LOG.isDebugEnabled()) {\r\n LOG.debug(\"--- Scope properties ---\");\r\n for (Iterator i = properties.keySet().iterator(); i.hasNext(); ) {\r\n String key = (String) i.next();\r\n Object value = properties.get(key);\r\n LOG.debug(key + \" = \" + value);\r\n }\r\n LOG.debug(\"------------------------\");\r\n }\r\n }",
"public CatalogSettings() {\n init();\n }",
"public PSBeanProperties()\n {\n loadProperties();\n }",
"private Config()\n {\n // Load from properties file:\n loadLocalConfig();\n // load the system property overrides:\n getExternalConfig();\n }",
"public ServerProperties() {\n try {\n initializeProperties();\n }\n catch (Exception e) {\n System.out.println(\"Error initializing server properties.\");\n }\n }",
"private PropertiesUtils() {}",
"public void init(java.util.Properties props) {\r\n }",
"private PropertySingleton(){}",
"static JarCollectorConfigImpl createJarCollectorConfig(Map<String, Object> settings) {\n if (settings == null) {\n settings = Collections.emptyMap();\n }\n return new JarCollectorConfigImpl(settings);\n }",
"private SystemPropertiesRemoteSettings() {}",
"private AppConfigLoader() {\r\n\r\n\t\tProperties appConfigPropertySet = new Properties();\r\n\t\tProperties envConfigPropertySet = new Properties();\r\n\r\n\t\ttry {\r\n\r\n\t\t\t// read properties file\r\n\t\t\tInputStream appConfigPropertyStream = AppConfigLoader.class\r\n\t\t\t\t\t.getResourceAsStream(\"/config/baseAppConfig.properties\");\r\n\t\t\tappConfigPropertySet.load(appConfigPropertyStream);\r\n\r\n\t\t\tInputStream envConfigPropertyStream = null;\r\n\r\n\t\t\t// check if current environment is defined (QA, Integration or Staging)\r\n\t\t\tif (System.getProperty(\"environment\") != null) {\r\n\t\t\t\tenvConfigPropertyStream = AppConfigLoader.class\r\n\t\t\t\t\t\t.getResourceAsStream(\"/config/\" + System.getProperty(\"environment\") + \"/appConfig.properties\");\r\n\t\t\t\tSystem.out.println(\"********'ENVIRONMENT Details taken from Runtime'********\");\r\n\t\t\t\tSystem.out.println(\"********'\" + System.getProperty(\"environment\") + \" ENVIRONMENT'********\");\r\n\t\t\t\tenvironment = System.getProperty(\"environment\");\r\n\t\t\t} else {\r\n\t\t\t\tenvConfigPropertyStream = AppConfigLoader.class.getResourceAsStream(\r\n\t\t\t\t\t\t\"/config/\" + appConfigPropertySet.getProperty(\"CurrentEnvironment\") + \"/appConfig.properties\");\r\n\t\t\t\tSystem.out.println(\"********'ENVIRONMENT Details taken from Baseapp config property file'********\");\r\n\t\t\t\tSystem.out.println(\r\n\t\t\t\t\t\t\"********'\" + appConfigPropertySet.getProperty(\"CurrentEnvironment\") + \" ENVIRONMENT'********\");\r\n\t\t\t\tenvironment = appConfigPropertySet.getProperty(\"CurrentEnvironment\");\r\n\t\t\t}\r\n\r\n\t\t\tenvConfigPropertySet.load(envConfigPropertyStream);\r\n\r\n\t\t\tthis.sampleURL = envConfigPropertySet.getProperty(\"SampleUrl\");\r\n\t\t\tthis.sampleAPIURL = envConfigPropertySet.getProperty(\"SampleAPIUrl\");\r\n\r\n\t\t\tthis.sampleDbConnectionString = envConfigPropertySet.getProperty(\"SampleConnectionString\");\r\n\r\n\t\t\tenvConfigPropertyStream.close();\r\n\t\t\tappConfigPropertyStream.close();\r\n\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}",
"public PropertiesDocument() {\n\t\tthis.documentBuilderFactory = DocumentBuilderFactory.newInstance();\n try {\n\t\t\tthis.documentBuilder = documentBuilderFactory.newDocumentBuilder();\n\t\t} catch (ParserConfigurationException e) {\n\t\t\t// Exception with default configuration\n\t\t\te.printStackTrace();\n\t\t}\n this.properties = new Properties();\n\t}",
"public void init(Properties props) {\n\t\tString url = props.getProperty(EWARP_CONFIG_URL);\n\t\tif (url != null) {\n\t\t\tInputStream in = null;\n\t\t\ttry {\n\t\t\t\t// TODO consider other loading options, e.g. through WebHelper using ServletContext\n\t\t\t\tin = loadResource(url);\n\t\t\t\tProperties externalProps = new Properties();\n\t\t\t\texternalProps.load(in);\n\t\t\t}\n\t\t\tcatch (Throwable t) {\n\t\t\t\tlog.warn(\"failed to load external runtime configuration from \" + url + \": \" + t.getMessage());\n\t\t\t\t// TODO check another property, whether to bail out, \n\t\t\t\t// if external configuration can not be found\n\t\t\t}\n\t\t\tfinally {\n\t\t\t\tif (in != null) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tin.close();\n\t\t\t\t\t}\n\t\t\t\t\tcatch (Throwable t) {\n\t\t\t\t\t\t// ignore\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tcreateLifecycleInterceptor(props);\n\n\t\t// give interceptor a change to modify properties\n\t\truntimeProps = interceptor.configure(props);\n\t\t\n\t\t// log configuration\n\t\tif (log.isDebugEnabled()) {\n\t\t\tList<String> params = new ArrayList<String>();\n\t\t\tfor (Object key : runtimeProps.keySet()) {\n\t\t\t\tparams.add(key.toString());\n\t\t\t}\n\t\t\tif (params.size() > 0) {\n\t\t\t\tCollections.sort(params);\n\t\t\t\tlog.debug(\"=============== configuration ==============\");\n\t\t\t\tfor (String name : params) {\n\t\t\t\t\tString value = runtimeProps.getProperty(name);\n\t\t\t\t\tlog.debug(name + \"=\" + value);\n\t\t\t\t}\n\t\t\t\tlog.debug(\"============================================\");\n\t\t\t}\n\t\t}\n\t\t\n\t\t// init from properties\n\t\tList<String> args = new ArrayList<String>();\n\t\tconfigureErjang(runtimeProps, args);\n\t\truntimeArgs = (String[]) args.toArray(new String[args.size()]);\n\t}",
"public Properties initProperties() {\r\n\t\tprop = new Properties();\r\n\t\ttry {\r\n\t\t\tFileInputStream fis = new FileInputStream(\"./src/main/java/com/automation/qe/config/config.properties\");\r\n\t\t\tprop.load(fis);\r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn prop;\r\n\t}",
"public KeyVaultProperties() {\n }",
"public void init() {\n this.properties = loadProperties(\"/project3.properties\");\n }",
"private AppSettings() {\n /* =============== UI settings =============== */\n brightnessInNightModeOnly = false;\n fullScreen = false;\n showTitle = true;\n pageInTitle = true;\n pageNumberToastPosition = ToastPosition.Bottom;\n zoomToastPosition = ToastPosition.Bottom;\n showAnimIcon = false;\n linkHighlightColor = 0x80FFFF00;\n searchHighlightColor = 0x3F0000FF;\n currentSearchHighlightColor = 0x7F007F00;\n storeGotoHistory = false;\n storeLinkGotoHistory = false;\n storeOutlineGotoHistory = false;\n storeSearchGotoHistory = false;\n\n /* =============== Tap & Scroll settings =============== */\n tapsEnabled = true;\n scrollHeight = Dips.dpToPx(10);\n touchProcessingDelay = 50;\n animateScrolling = true;\n /* =============== Performance settings =============== */\n\n\t\tpagesInMemory = 2;\n decodingThreadPriority = Thread.NORM_PRIORITY; // 7\n drawThreadPriority = Thread.NORM_PRIORITY; // 6\n\n hwaEnabled = false;\n bitmapSize = 9;// 6-64,7-128,8-256,9-512,10-1024\n bitmapFileringEnabled = false;\n textureReuseEnabled = true;\n useBitmapHack = false;\n useEarlyRecycling = false;\n reloadDuringZoom = false;\n heapPreallocate = 0;// 0-256\n pdfStorageSize = 64;// 16-128\n\n /* =============== DjVU Format-specific settings =============== */\n djvuRenderingMode = 0;// 0-color,1-black,2 color only, 3 mask, 4 backgroud, 5 foreground\n }",
"public Properties init() {\n // init nested properties starting from the bottom ones\n initProperties();\n initLayout();\n return this;\n }",
"private mxPropertiesManager()\n\t{\n\t}",
"@PostConstruct\n\tpublic void init() {\n\t\ttry {\n\t\t\tprops = PropertiesLoaderUtils.loadProperties(new ClassPathResource(\"/META-INF/build-info.properties\"));\n\t\t} catch (IOException e) {\n\t\t\tlogger.error(\"Unable to load build.properties\", e);\n\t\t\tprops = new Properties();\n\t\t}\n\t}",
"public Config(Properties props) {\n entries = (Properties)props.clone();\n }",
"@Override\n public void initialize(Map<String, String> propertyValues) {\n // Set the configurable properties\n properties.setValues(propertyValues);\n }",
"public void init(Properties props) ;",
"private static void addSettingsPropertiesToSystem(){\n \t\tProperties props;\n \t\ttry {\n \t\t\tprops = SettingsLoader.loadSettingsFile();\n \t\t\tif(props != null){\n \t\t\t\tIterator it = props.keySet().iterator();\n \t\t\t\twhile(it.hasNext()){\n \t\t\t\t\tString key = (String) it.next();\n \t\t\t\t\tString value = props.getProperty(key);\n \t\t\t\t\tSystem.setProperty(key, value);\n \t\t\t\t}\n \t\t\t}\n \t\t} catch (Exception e) {\n \t\t\tthrow new Error(e);\n \t\t}\n \t}",
"public void init(){\n\t\tif(prop==null){\r\n\t\t\tprop=new Properties();\r\n\t\t\t\r\n\t\t\ttry {\r\n\t\t\t\tFileInputStream fs = new FileInputStream(System.getProperty(\"user.dir\")+\"//src//test//resources//projectconfig.properties\");\r\n\t\t\t\tprop.load(fs);\r\n\t\t\t\t\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\t\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"private Settings() {\n prefs = NbPreferences.forModule( Settings.class );\n }",
"protected StreamsApp() {\n this.streamsConfig = new KafkaStreamsConfig().fromConfig(config);\n this.rocksDbReporter = new RocksDbMetricsReporter(this);\n }",
"public synchronized static void initConfig() {\n\t\tMap<CatPawConfigProperty, String> initialValues = new HashMap<CatPawConfigProperty, String>();\n\t\tinitConfig(initialValues);\n\t}",
"protected void init(){\n\t\n\t\tsetBounds(getControllerScreenPosition());\n\t\taddComponentListener(new ComponentListener(){\n\n\t\t\tpublic void componentResized(ComponentEvent arg0) {\n\t\t\t\t//AppLogger.debug2(arg0.toString());\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\tint w = arg0.getComponent().getWidth();\n\t\t\t\tint h = arg0.getComponent().getHeight();\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t \tProperties props = getAppSettings();\t\n\t\t\t \tprops.setProperty(PREFIX+DSC_WIN_W, String.valueOf(w));\n\t\t\t \tprops.setProperty(PREFIX+DSC_WIN_H, String.valueOf(h));\t \t\t\t\t\t\t\n\t\t\t}\n\n\t\t\tpublic void componentMoved(ComponentEvent arg0) {\n\t\t\t\t//AppLogger.debug2(arg0.toString());\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\tint x = arg0.getComponent().getX();\n\t\t\t\tint y = arg0.getComponent().getY();\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t \tProperties props = getAppSettings();\t\t\t\t \t\n\t\t\t \tprops.setProperty(PREFIX+DSC_WIN_X, String.valueOf(x));\n\t\t\t \tprops.setProperty(PREFIX+DSC_WIN_Y, String.valueOf(y));\t \t\t\n\t\t\t}\n\n\t\t\tpublic void componentShown(ComponentEvent arg0) {}\n\t\t\tpublic void componentHidden(ComponentEvent arg0) {}\n\t\t\t\n\t\t});\n\t\t\n\t\tthis.addWindowListener(new WindowAdapter(){\n\t\t\n\t\t\tpublic void windowClosing(WindowEvent evt){\n\t\t\t\tstoreAppSettings();\n\t\t\t}\n\t\t});\n\t\t\n\t}",
"public Properties(){\n\n }",
"public void init(Map<String, String> configuration);",
"private void init() {\n\t\tif ( PropertiesConfigurationFilename == null ) {\n\t\t\tlogger.info(\"config.properties is default\");\n\t\t\tconfigProp = createDefaultProperties();\n\t\t} else {\n\t\t\ttry {\n\t\t\t\tlogger.info(\"config.properties is \"+ PropertiesConfigurationFilename.getAbsolutePath());\n\t\t\t\tconfigProp = new PropertiesConfiguration();\n\t\t\t\tconfigProp.load(PropertiesConfigurationFilename);\n\t\t\t} catch (ConfigurationException e) {\n\t\t\t\tlogger.error(\"Unable to open config file: \" + PropertiesConfigurationFilename.getAbsolutePath(), e);\n\t\t\t\tlogger.info(\"config.properties is default\");\n\t\t\t\tconfigProp = createDefaultProperties();\n\t\t\t}\n\t\t}\n\n\n\t\t// Load the locale information\n\t\tString locale = configProp.getString(\"locale\");\n\n\t\tconfigProp.setProperty(\"zmMsg\", ResourceBundle.getBundle(\"ZmMsg\", new Locale(locale)));\n\n\t\tconfigProp.setProperty(\"zhMsg\", ResourceBundle.getBundle(\"ZhMsg\", new Locale(locale)));\n\n\t\tconfigProp.setProperty(\"ajxMsg\", ResourceBundle.getBundle(\"AjxMsg\", new Locale(locale)));\n\n\t\tconfigProp.setProperty(\"i18Msg\", ResourceBundle.getBundle(\"I18nMsg\", new Locale(locale)));\n\n\t\tconfigProp.setProperty(\"zsMsg\", ResourceBundle.getBundle(\"ZsMsg\", new Locale(locale)));\n\n\t}",
"public\n YutilProperties()\n {\n super(new Properties());\n }",
"public static PropertiesUtil getInstance(){\n if (instance == null) {\n synchronized (PropertiesUtil.class){\n instance = new PropertiesUtil();\n instance.loadProperties();\n }\n }\n return instance;\n }",
"private GlobalPrefs() {\n\t\tprops = new Properties();\n\t}",
"public Properties() \r\n\t{\r\n\t\tsuper();\r\n\t\tthis.port = 1234;\r\n\t\tthis.ip = \"127.0.0.1\";\r\n\t}",
"public void init() {\n ContainerProperties containerProperties = buildContainerProperties();\n this.messageListenerContainer = buildMessageListenerContainer( consumerFactory, containerProperties );\n }",
"public static ConfigFileProperties getInstance() {\n return ConfigFilePropertiesHolder.INSTANCE;\n }",
"private AuditYamlConfigurationLoader(Properties properties)\n {\n this.properties = new Properties(properties);\n }",
"private SettingsManager() {\r\n\t\tthis.loadSettings();\r\n\t}",
"public void setupProp() {\r\n\t\tprop = new Properties();\r\n\t\tInputStream in = getClass().getResourceAsStream(\"C:/Users/Marcus/git/EmailProgram/EmailProgram/resources/config.properties\");\r\n\t\ttry {\r\n\t\t\tprop.load(in);\r\n\t\t\tFileInputStream fin = new FileInputStream(\"C:/Users/Marcus/git/EmailProgram/EmailProgram/resources/config.properties\");\r\n\t\t\tObjectInputStream ois = new ObjectInputStream(fin);\r\n\t\t\tdblogic = (PatronDBLogic) ois.readObject();\r\n\t\t\tois.close();\r\n\r\n\t\t} catch (IOException | ClassNotFoundException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}",
"public Settings() {\n initComponents();\n }",
"public Settings() {\n initComponents();\n }",
"public MaintenanceWindowsProperties() {\n }",
"public ConfigsUtils() {\r\n mConfig = new Properties();\r\n try {\r\n mConfig.load(new FileInputStream(CONFIG_FILE_PATH));\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n }",
"public ConfigPanel(JavaDocSettings settings) {\n this.settings = settings;\n setLayout(new BorderLayout());\n add(panel, BorderLayout.CENTER);\n setupBorders();\n setupTemplatesPanel();\n }",
"private Settings() { }",
"private static synchronized void init() {\n if (CONFIG_VALUES != null) {\n return;\n }\n\n CONFIG_VALUES = new Properties();\n processLocalConfig();\n processIncludedConfig();\n }",
"@Test public void testConstructor() {\r\n GaeAwarePropertySource source = new GaeAwarePropertySource();\r\n assertNull(source.getProductionModeProperties());\r\n assertNull(source.getDevelopmentModeProperties());\r\n\r\n Properties baseProperties = new Properties();\r\n source.setProductionModeProperties(baseProperties);\r\n assertSame(baseProperties, source.getProductionModeProperties());\r\n\r\n Properties developmentModeProperties = new Properties();\r\n source.setDevelopmentModeProperties(developmentModeProperties);\r\n assertSame(developmentModeProperties, source.getDevelopmentModeProperties());\r\n }",
"private Configuration getConfig() {\n final Configuration config = new Configuration();\n for (final Field field : getClass().getDeclaredFields()) {\n try {\n final Field configField = Configuration.class.getDeclaredField(field.getName());\n field.setAccessible(true);\n configField.setAccessible(true);\n\n final Object value = field.get(this);\n if (value != null) {\n configField.set(config, value);\n getLog().debug(\"using \" + field.getName() + \" = \" + value);\n }\n } catch (final NoSuchFieldException nsfe) {\n // ignored\n } catch (final Exception e) {\n getLog().warn(\"can't initialize attribute \" + field.getName());\n }\n\n }\n if (containerProperties != null) {\n final Properties props = new Properties();\n props.putAll(containerProperties);\n config.setProperties(props);\n }\n if (forceJspDevelopment) {\n if (config.getProperties() == null) {\n config.setProperties(new Properties());\n }\n config.getProperties().put(\"tomee.jsp-development\", \"true\");\n }\n return config;\n }",
"private static void makeInstance(){\n\n if(settingsFile==null){\n settingsFile = new MetadataFile(SETTINGS_FILE_PATH);\n }\n\n if(!settingsFile.exists()){\n settingsFile.create();\n }\n\n if(tagListeners==null){\n tagListeners= new HashMap<>();\n }\n\n }",
"public Settings(Properties conf) {\r\n\t\tthis.settings = new HashMap<String, Object>();\r\n\t\tloadDefaults();\r\n\t\tparseProperties(conf);\r\n\t}",
"private Settings() {}",
"private Config()\n {\n try\n {\n // Load settings from file\n load();\n }\n catch(IOException e)\n {\n e.printStackTrace();\n }\n }",
"public static ConfigProperties getInstance() {\r\n\r\n if (instance==null) {\r\n instance=new ConfigProperties();\r\n }\r\n return instance;\r\n }",
"public PensionParametersDAO(Configuration properties) {\n this.properties = properties;\n\n }",
"public PropertyParser()\n\t{\n\t\tthis(System.getProperties());\n\t}",
"private TerminalProperties() {\n this(new TerminalPropertiesBuilder());\n }",
"protected HashMap createApplicationProperties(MessageContext context) {\n HashMap props = null;\n if (context.containsProperty(\n JMSConstants.JMS_APPLICATION_MSG_PROPS)) {\n props = new HashMap();\n props.putAll((Map)context.getProperty(\n JMSConstants.JMS_APPLICATION_MSG_PROPS));\n }\n return props;\n }",
"HeaderSettingsPage(SettingsContainer container)\n {\n super(container);\n initialize();\n }",
"protected StreamsApp(StreamsConfig streamsConfig) {\n this.streamsConfig = streamsConfig;\n this.rocksDbReporter = new RocksDbMetricsReporter(this);\n }",
"public PropertiesUtil() {\n\t\t// Read properties file.\n\n\t\tproperties = new Properties();\n\t\ttry {\n\t\t\tproperties.load(PropertiesUtil.class.getClassLoader().getResourceAsStream(\"variables.properties\"));\n\t\t\tlog.info(\"variables.properties file loaded successfully\");\n\t\t} catch (Exception e) {\n\t\t\tlog.error(\"variables.properties file not found: \", e);\n\t\t}\n\t}",
"public XMPPTCPConnection configureSettings(ConnectionSettings settings) {\n XMPPTCPConnectionConfiguration.Builder config = XMPPTCPConnectionConfiguration\n .builder();\n config.setSecurityMode(ConnectionConfiguration.SecurityMode.disabled);\n config.setServiceName(settings.getXmppDomain());\n config.setHost(settings.getXmppHost());\n config.setPort(settings.getXmppPort());\n config.setResource(settings.getXmppResource());\n config.setDebuggerEnabled(true);\n config.setConnectTimeout(10000);\n\n XMPPTCPConnection.setUseStreamManagementResumptiodDefault(true);\n XMPPTCPConnection.setUseStreamManagementDefault(true);\n\n setLoginUser(settings.getUserName());\n setPasswordUser(settings.getPassword());\n\n addProviders();\n\n connection = new XMPPTCPConnection(config.build());\n XMPPConnectionListener connectionListener = new XMPPConnectionListener();\n connection.addConnectionListener(connectionListener);\n setMessageReceiptListener();\n addErrorBindFilter();\n addPresenceListener();\n return new XMPPTCPConnection(config.build());\n }",
"public void init(Properties properties) throws IOException;",
"EJBContainer createEJBContainer(Map<?, ?> properties) throws EJBException;",
"WithCreate withEncryptionSettingsCollection(EncryptionSettingsCollection encryptionSettingsCollection);",
"public ProfiledApplicationBean() {}",
"@Bean\n public static PropertySourcesPlaceholderConfigurer properties(){\n PropertySourcesPlaceholderConfigurer pspc\n = new PropertySourcesPlaceholderConfigurer();\n Resource[] resources = new ClassPathResource[ ]\n { new ClassPathResource(\"app-attribute.properties\") };\n pspc.setLocations( resources );\n pspc.setIgnoreUnresolvablePlaceholders( true );\n return pspc;\n }",
"private void init(String propFilePath) {\n properties = new Properties();\n try {\n properties.load(new FileInputStream(new File(propFilePath)));\n } catch (FileNotFoundException e1) {\n logger.error(\"External properties file not found!\", e1);\n System.exit(1);\n } catch (IOException e2) {\n logger.error(\"Error while reading External properties file!\", e2);\n System.exit(1);\n }\n }",
"public FileServicePropertiesProperties() {\n }",
"public Properties init_prop() {\n\t\tprop = new Properties();\n\t\tString path = null;\n\t\tString env = null;\n\n\t\ttry {\n\n\t\t\tenv = System.getProperty(\"env\");\n\t\t\tSystem.out.println(\"Running on Envirnment: \" + env);\n\n\t\t\tif (env == null) {\n\t\t\t\tSystem.out.println(\"Default Envirnment: \" + \"PROD\");\n\t\t\t\tpath = \"D:\\\\Rupali\\\\Workspace\\\\HubSpotFramework\\\\src\\\\main\\\\java\\\\com\\\\qa\\\\hubspot\\\\config\\\\Config.prod.properties\";\n\n\t\t\t} else {\n\t\t\t\tswitch (env) {\n\t\t\t\tcase \"qa\":\n\t\t\t\t\tpath = \"D:\\\\Rupali\\\\Workspace\\\\HubSpotFramework\\\\src\\\\main\\\\java\\\\com\\\\qa\\\\hubspot\\\\config\\\\Config.qa.properties\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"dev\":\n\t\t\t\t\tpath = \"D:\\\\Rupali\\\\Workspace\\\\HubSpotFramework\\\\src\\\\main\\\\java\\\\com\\\\qa\\\\hubspot\\\\config\\\\Config.dev.properties\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"stage\":\n\t\t\t\t\tpath = \"D:\\\\Rupali\\\\Workspace\\\\HubSpotFramework\\\\src\\\\main\\\\java\\\\com\\\\qa\\\\hubspot\\\\config\\\\Config.stage.properties\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"prod\":\n\t\t\t\t\tpath = \"D:\\\\Rupali\\\\Workspace\\\\HubSpotFramework\\\\src\\\\main\\\\java\\\\com\\\\qa\\\\hubspot\\\\config\\\\Config.prod.properties\";\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tSystem.out.println(\"Please Pass the Correct Env Value...\");\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tFileInputStream finput = new FileInputStream(path);\n\t\t\tprop.load(finput);\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\treturn prop;\n\t}",
"private void initProperties()\r\n {\r\n try\r\n {\r\n properties.load(new FileInputStream(propertiesURL));\r\n }\r\n catch (IOException ex)\r\n {\r\n log.log(DEBUG,\"\"+ex);\r\n } \r\n }",
"private PropertiesLoader() {\r\n\t\t// not instantiable\r\n\t}",
"public\n YutilProperties(String argv[])\n {\n super(new Properties());\n setPropertiesDefaults(argv);\n }",
"protected CommonSettings() {\r\n port = 1099;\r\n objectName = \"library\";\r\n }",
"public AutomationConfigurator() throws IOException {\n\n try {\n input = new FileInputStream(projectpath+\"/AutomationConfigurator.properties\");\n prop.load(input);\n }catch (IOException e)\n {\n LOGGER.info(\"AutomationConfigurator.properties file doesn't exist at \"+projectpath);\n\n }finally {\n if (input != null) {\n try {\n input.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }\n\n }"
] | [
"0.6533052",
"0.6270586",
"0.57552356",
"0.5735315",
"0.5700948",
"0.5672036",
"0.5653792",
"0.56536037",
"0.5619731",
"0.55708736",
"0.5480212",
"0.54782873",
"0.5461958",
"0.54328126",
"0.5429139",
"0.5408928",
"0.53727895",
"0.5338425",
"0.53333867",
"0.529673",
"0.52884513",
"0.52784914",
"0.526338",
"0.5259013",
"0.5257706",
"0.52529246",
"0.52377176",
"0.52309567",
"0.52193666",
"0.52118635",
"0.5193742",
"0.51872915",
"0.5182486",
"0.5179071",
"0.5176177",
"0.51685834",
"0.51666766",
"0.516573",
"0.5164939",
"0.516294",
"0.5143452",
"0.51307786",
"0.51130813",
"0.51046705",
"0.5095181",
"0.5085355",
"0.50836396",
"0.5078851",
"0.50748426",
"0.5071074",
"0.50683284",
"0.5060772",
"0.50584143",
"0.5052016",
"0.5047381",
"0.5047036",
"0.5042518",
"0.5035096",
"0.5017822",
"0.50049925",
"0.4999882",
"0.49973133",
"0.49923933",
"0.49885994",
"0.49730757",
"0.49701053",
"0.49701053",
"0.4968188",
"0.4957079",
"0.4950124",
"0.49500474",
"0.4947044",
"0.49438426",
"0.49420536",
"0.49324498",
"0.492754",
"0.49203515",
"0.4906197",
"0.490077",
"0.48947516",
"0.48925158",
"0.48806188",
"0.4878045",
"0.48776144",
"0.4862275",
"0.48612228",
"0.48576608",
"0.48556808",
"0.4853383",
"0.48524585",
"0.48391026",
"0.48381937",
"0.4831868",
"0.4828006",
"0.48212773",
"0.48211354",
"0.48191592",
"0.48132646",
"0.48075783",
"0.48057687"
] | 0.66952884 | 0 |
Builds the URL prefix for an absolute URL. | private String buildUrlPrefix(String hostName, int port, String context, boolean https) {
StringBuilder urlBuilder = new StringBuilder(https ? "https://" : "http://");
int standardPort = https ? 443 : 80;
urlBuilder.append(hostName);
if (port != standardPort) {
urlBuilder.append(":");
urlBuilder.append(port);
}
urlBuilder.append(context);
return urlBuilder.toString();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"FullUriTemplateString baseUri();",
"public URL makeBase(URL startingURL);",
"private String getUrlPrefix(HttpServletRequest req) {\n StringBuffer url = new StringBuffer();\n String scheme = req.getScheme();\n int port = req.getServerPort();\n url.append(scheme);\t\t// http, https\n url.append(\"://\");\n url.append(req.getServerName());\n if ((scheme.equals(\"http\") && port != 80)\n \t || (scheme.equals(\"https\") && port != 443)) {\n url.append(':');\n url.append(req.getServerPort());\n }\n return url.toString();\n }",
"static URITranslator prefix(String source, String target) {\n return new PrefixReplacer(source, target);\n }",
"public void buildPathPartWithWebappPathPrefix(Appendable buffer, String uri) throws WebAppConfigurationException, IOException {\n buildPathPartWithWebappPathPrefix(buffer, uri, null);\n\n }",
"public UrlBuilder compileBaseUrl(HttpServletRequest request, String repositoryId) {\n String baseUrl = (String) request.getAttribute(Dispatcher.BASE_URL_ATTRIBUTE);\n if (baseUrl != null) {\n int repIdPos = baseUrl.indexOf(REPOSITORY_PLACEHOLDER);\n if (repIdPos < 0) {\n return new UrlBuilder(baseUrl);\n } else {\n return new UrlBuilder(baseUrl.substring(0, repIdPos) + repositoryId\n + baseUrl.substring(repIdPos + REPOSITORY_PLACEHOLDER.length()));\n }\n }\n\n UrlBuilder url = new UrlBuilder(request.getScheme(), request.getServerName(), request.getServerPort(), null);\n\n url.addPath(request.getContextPath());\n url.addPath(request.getServletPath());\n\n if (repositoryId != null) {\n url.addPathSegment(repositoryId);\n }\n\n return url;\n }",
"public String getUrlPrefix() {\r\n\t\treturn urlPrefix;\r\n\t}",
"public boolean isWebappPathPrefixUrlBuild() {\n return webSiteProps.isWebappPathPrefixUrlBuild();\n }",
"public String getUrlPrefix() {\r\n return urlPrefix;\r\n }",
"public void buildPathPartWithWebappPathPrefix(Appendable buffer) throws WebAppConfigurationException, IOException {\n buildPathPartWithWebappPathPrefix(buffer, null, false);\n }",
"String translateNamespacePrefixToUri(String prefix, Object element);",
"public URL standardizeURL(URL startingURL);",
"public void buildPathPartWithWebappPathPrefix(Appendable buffer, String uri, Boolean appendDirSep) throws WebAppConfigurationException, IOException {\n appendPathPart(buffer, uri, appendDirSep,\n webSiteProps.isWebappPathPrefixUrlBuild() ? webSiteProps.getWebappPathPrefix() : \"\"); // SCIPIO\n }",
"private static URL buildURL(List<String> args) throws MalformedURLException {\n\n\t\tfinal String IDList = args.stream().map(id -> id.toString() + \",\").reduce(\"\", String::concat);\n\n\t\treturn new URL(String.format(BASE_URL, IDList));\n\t}",
"public void setUrlPrefix(String urlPrefix) {\r\n\t\tthis.urlPrefix = urlPrefix;\r\n\t}",
"private String getURL() {\n String url = profileLocation.getText().toString();\n if (url == null || url.length() == 0) {\n return url;\n }\n // if it's not the last (which should be \"Raw\") choice, we'll use the prefix\n if (!url.contains(\"://\")) { // if there is no (http|jr):// prefix, we'll assume it's a http://bit.ly/ URL\n url = \"http://bit.ly/\" + url;\n }\n return url;\n }",
"URL format(ShortLink shortLink);",
"static String makeAuId(String baseUrlPath) {\n String baseUrlHost = \"import%2Elockss%2Eorg\";\n return PLUGIN_KEY + \"&base_url~http%3A%2F%2F\" + baseUrlHost + \"%2F\"\n\t+ baseUrlPath;\n }",
"public String getURIFromIncludeParent(String prefix) {\n int lastValidContext = fCurrentContext - 1;\n while (lastValidContext > 0 && !fValidContext[lastValidContext]) {\n lastValidContext--;\n }\n return getURI(prefix, lastValidContext);\n }",
"String getBaseUri();",
"@Nonnull public URL buildURL() throws MalformedURLException {\n installTrustStore();\n \n if (disableNameChecking) {\n final HostnameVerifier allHostsValid = new HostnameVerifier() {\n public boolean verify(final String hostname, final SSLSession session) {\n return true;\n }\n }; \n HttpsURLConnection.setDefaultHostnameVerifier(allHostsValid); \n }\n \n final StringBuilder builder = new StringBuilder(getURL());\n if (getPath() != null) {\n builder.append(getPath());\n }\n\n return new URL(doBuildURL(builder).toString());\n }",
"public static String getRelativeRewriteUrl(String origUrl) {\n\n if (StringUtils.isBlank(origUrl)) {\n return null;\n }\n\n // rewrite after url\n StringBuffer rewriteUrl = new StringBuffer();\n\n //url action part\n String action = origUrl;\n\n //url params part\n String params = null;\n\n if (StringUtils.indexOf(origUrl, '?') != -1) {\n\n String[] urlFragments = StringUtils.split(origUrl, \"?\");\n\n action = urlFragments[0];\n\n if (urlFragments.length > 1) {\n params = urlFragments[1];\n }\n }\n\n //get the action urlmapping\n URLMapping urlMapping = getURLMappingByValue(action, URLMappingEnum.ACTION);\n\n if (urlMapping == null) {\n return origUrl;\n// rewriteUrl.append(action);\n// if (StringUtils.isNotBlank(params)) {\n//\n// rewriteUrl.append(\"?\");\n// rewriteUrl.append(getPrefixRewriteParams(params));\n// }\n } else if (StringUtils.equals(urlMapping.getSplitKey()[2], PREFIX_DEFINITION)) {\n\n rewriteUrl.append(\"/\");\n rewriteUrl.append(urlMapping.getSplitKey()[3]);\n\n if (StringUtils.isNotBlank(params)) {\n\n rewriteUrl.append(\"?\");\n rewriteUrl.append(getPrefixRewriteParams(params));\n }\n } else {\n\n rewriteUrl.append(\"/\");\n rewriteUrl.append(urlMapping.getSplitKey()[2]);\n if (StringUtils.isNotBlank(params)) {\n\n String result = getRewriteParams(params);\n\n if (!StringUtils.startsWith(result, \"?\")) {\n rewriteUrl.append(PARAM_SEPARATOR);\n }\n rewriteUrl.append(getRewriteParams(params));\n }\n }\n\n return rewriteUrl.toString();\n }",
"private String shortPrefix(String name) {\r\n StringBuilder b = new StringBuilder();\r\n String[] splits = name.split(\"_\");\r\n for (int i = 0; i < splits.length; ++i) {\r\n if (splits[i].length() > 0) {\r\n b.append(splits[i].charAt(0));\r\n }\r\n }\r\n if (b.length() < 3) {\r\n b.append(Integer.toString(name.length() % 10));\r\n }\r\n return b.toString().toLowerCase();\r\n }",
"public String getURIDefinition(String prefix) {\n\t\treturn prefixToURIMap.get(prefix);\n\t}",
"public String prefix()\n\t {\n\t \t// create an empty string builder // \n\t \tStringBuilder sb = new StringBuilder();\n\t \t\n\t \t// fill the string builder//\n\t \tprefix(root, sb);\n\t \t\n\t \treturn sb.toString().trim();\n\t }",
"private static String getBaseUrl() {\n StringBuilder url = new StringBuilder();\n url.append(getProtocol());\n url.append(getHost());\n url.append(getPort());\n url.append(getVersion());\n url.append(getService());\n Log.d(TAG, \"url_base: \" + url.toString());\n return url.toString();\n }",
"public DIDURL build() {\n\t\t\treturn url.deepClone(true);\n\t\t}",
"private static String normalizeUrlPath(String baseUrl) {\n if (!baseUrl.matches(\".*/$\")) {\n return baseUrl + \"/\";\n }\n return baseUrl;\n }",
"public static String getBaseURI() {\n\t\treturn getIP() + \":\" + getPort();\r\n//\t\tURIBuilder builder = new URIBuilder();\r\n//\t\tbuilder.setScheme(\"http\");\r\n//\t\tbuilder.setHost(getIP());\r\n//\t\tbuilder.setPort(Integer.valueOf(getPort()));\r\n//\t\tbuilder.setPath(\"/\"+getVersion());\r\n//\t\treturn builder.toString();\r\n//\t\treturn \"http://\" + getIP() + \":\" + getPort()\r\n//\t\t\t\t+ \"/\"+getVersion();\r\n\t}",
"private static String getPrefixRewriteParams(String params) {\n\n URLMapping[] urlMappings = getParamsURLMappings(params);\n\n if (urlMappings == null) {\n return params;\n }\n\n StringBuilder sb = new StringBuilder();\n\n for (URLMapping urlMapping : urlMappings) {\n\n sb.append(urlMapping.getSplitKey()[3]);\n sb.append(\"=\");\n sb.append(urlMapping.getFinalValue());\n sb.append(\"&\");\n }\n\n return StringUtils.substring(sb.toString(), 0, sb.length() - 1);\n }",
"@Override\n\tpublic String shortenUrl(String longUrl){\n\t\tString encodedUrl = \"\";\n\t\tInteger hashKey = (int) UUID.nameUUIDFromBytes(longUrl.getBytes()).getMostSignificantBits();\n\t\tencodedUrl = Integer.toString(hashKey, 36);\n\t\treturn \"http://localhost:8080/URLShortner/short/\" +encodedUrl;\n\t}",
"private String buildUriFromId(String baseUri, String id){\n\t\treturn baseUri + \"/\" + id;\n\t}",
"private static String buildServletURL(final String applicationURL) {\n\n final String result;\n if (applicationURL.endsWith(\"/\")) {\n result =\n new StringBuffer(applicationURL.substring(0, applicationURL.length() - 1)).append(\n \"/seam/resource/rest/importer\").toString();\n } else {\n result = new StringBuffer(applicationURL).append(\"/seam/resource/rest/importer\").toString();\n }\n return result;\n }",
"URI createURI();",
"public URL makeFullUrl(String scrapedString, URL base);",
"public String urlBuilder(int year, int month, int day){\n\t\tStringBuilder url = new StringBuilder(baseUrl);\n\t\turl.append(year);\n\t\turl.append(\"/\");\n\t\tif(month<10)url.append('0');//if month is one digit we pad zero to url\n\t\turl.append(month);\n\t\turl.append(\"/\");\n\t\tif(day<10)url.append('0');//if day is one digit we pad zero to url\n\t\turl.append(day);\n\t\turl.append(\".xml\");\n\t\treturn url.toString();\n\t}",
"String constructUrl() {\n StringBuilder builder = new StringBuilder(256);\n builder.append(parts[DB_PREFIX]);\n \n if(notEmpty(parts[DB_ALT_DBNAME])) {\n builder.append(parts[DB_ALT_DBNAME]);\n builder.append('@');\n } else if(\"jdbc:oracle:thin:\".equals(parts[DB_PREFIX])) {\n builder.append('@');\n } else {\n // most formats\n builder.append(\"//\"); // NOI18N\n }\n \n builder.append(parts[DB_HOST]);\n\n if(notEmpty(parts[DB_INSTANCE_NAME])) {\n builder.append('\\\\');\n builder.append(parts[DB_INSTANCE_NAME]);\n }\n \n if(notEmpty(parts[DB_PORT])) {\n builder.append(':'); // NOI18N\n builder.append(parts[DB_PORT]);\n }\n\n if(notEmpty(parts[DB_PRIMARY_DBNAME])) {\n if(\"jdbc:oracle:thin:\".equals(parts[DB_PREFIX])) {\n builder.append(':'); // NOI18N\n } else {\n builder.append('/'); // NOI18N\n }\n builder.append(parts[DB_PRIMARY_DBNAME]);\n }\n\n char propertyInitialSeparator = ';';\n char propertySeparator = ';';\n if(\"jdbc:mysql:\".equals(parts[DB_PREFIX])) {\n propertyInitialSeparator = '?';\n propertySeparator = '&';\n } else if(\"jdbc:informix-sqli:\".equals(parts[DB_PREFIX])) {\n propertyInitialSeparator = ':';\n }\n \n Set<Map.Entry<String, String>> entries = props.entrySet();\n Iterator<Map.Entry<String, String>> entryIterator = entries.iterator();\n if(entryIterator.hasNext()) {\n builder.append(propertyInitialSeparator);\n Map.Entry<String, String> entry = entryIterator.next();\n builder.append(entry.getKey());\n String value = entry.getValue();\n if(notEmpty(value)) {\n builder.append('=');\n builder.append(value);\n }\n }\n \n while(entryIterator.hasNext()) {\n builder.append(propertySeparator);\n Map.Entry<String, String> entry = entryIterator.next();\n builder.append(entry.getKey());\n String value = entry.getValue();\n if(notEmpty(value)) {\n builder.append('=');\n builder.append(value);\n }\n }\n \n return builder.toString();\n }",
"public abstract String getBaseURL();",
"public SimpleUriGenerator(String uriPrefix) {\n this.namedGraphURIPrefix = uriPrefix;\n }",
"private String makeInitialLayerName() {\n\n\t\tStringBuffer defaultName = new StringBuffer();\n\n\t\tfinal String opName = getPrefix();\n\n\t\tdefaultName.append(opName);\n\n\t\t// checks if there is a layer with this name, then adds an integer value\n\t\t// following the sequence.\n\t\tString prefix = opName;\n\t\tSortedSet<String> layerList = new TreeSet<String>();\n\t\tfor (int i = 0; i < this.comboTargetLayer.getItemCount(); i++) {\n\n\t\t\tString item = this.comboTargetLayer.getItem(i);\n\t\t\tboolean match = Pattern.matches(prefix + \"_\" + \"\\\\p{Digit}\", item); //$NON-NLS-1$ //$NON-NLS-2$\n\t\t\tif (match) {\n\t\t\t\tlayerList.add(item);\n\t\t\t}\n\t\t}\n\n\t\tString nextNumber = null;\n\n\t\t// gets the last number generated, 1 for first\n\t\t// format: opName-Integer\n\n\t\tif (layerList.isEmpty()) {\n\t\t\tnextNumber = \"1\"; //$NON-NLS-1$\n\t\t} else {\n\t\t\tString lastLayer = layerList.last();\n\t\t\tnextNumber = computeNextNumberFor(lastLayer, SEPARATOR);\n\t\t}\n\n\t\tdefaultName.append(SEPARATOR);\n\t\tdefaultName.append(nextNumber);\n\n\t\treturn defaultName.toString();\n\t}",
"SimpleString getPrefix(SimpleString address);",
"public void setBaseURL(final String url) {\r\n String location = url;\r\n //-- remove filename if necessary:\r\n if (location != null) { \r\n int idx = location.lastIndexOf('/');\r\n if (idx < 0) idx = location.lastIndexOf('\\\\');\r\n if (idx >= 0) {\r\n int extIdx = location.indexOf('.', idx);\r\n if (extIdx > 0) {\r\n location = location.substring(0, idx);\r\n }\r\n }\r\n }\r\n \r\n try {\r\n _resolver.setBaseURL(new URL(location));\r\n } catch (MalformedURLException except) {\r\n // try to parse the url as an absolute path\r\n try {\r\n LOG.info(Messages.format(\"mapping.wrongURL\", location));\r\n _resolver.setBaseURL(new URL(\"file\", null, location));\r\n } catch (MalformedURLException except2) { }\r\n }\r\n }",
"String rewriteUrl(String originalUrl);",
"@Override\r\n public String getRootURI() {\r\n if (rootUri == null) {\r\n final StringBuilder buffer = new StringBuilder();\r\n appendRootUri(buffer, true);\r\n buffer.append(SEPARATOR_CHAR);\r\n rootUri = buffer.toString().intern();\r\n }\r\n return rootUri;\r\n }",
"private String generateUrl(List<String> codes) {\n StringBuilder builder = new StringBuilder();\n for (String code : codes) {\n builder.append(\",\");\n builder.append(recognizeType(code));\n builder.append(code);\n }\n builder = builder.delete(0, 1);\n return prefix + builder.toString();\n }",
"GetPrefix prefix(String... prefixPaths);",
"private static String shortUrlFrom(int num) {\n char[] digits = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\".toCharArray(); // 62 possible characters\n\n StringBuilder shorturl = new StringBuilder();\n\n while (num > 0) {\n shorturl.append(digits[num % 62]); // store the actual character in shortUrl\n num = num/62;\n }\n // Reverse shortURL to complete base conversion\n return shorturl.reverse().toString();\n }",
"protected abstract void calculateUiRootPath(StringBuilder... sbUrls);",
"protected abstract void calculateUiRootPath(StringBuilder... sbUrls);",
"public String getURI(String shortName)\r\n\t{\r\n\t\tString qname = ONT_MODEL.expandPrefix(shortName);\r\n\t\tif( ONT_MODEL.getOntResource(qname) != null)\r\n\t\t\treturn qname;\r\n\t\telse\r\n\t\t return BASE_NS + shortName;\r\n\t}",
"private static URL absolutize(URL baseURL, String href) \n throws MalformedURLException, BadHrefAttributeException {\n \n Element parent = new Element(\"c\");\n parent.setBaseURI(baseURL.toExternalForm());\n Element child = new Element(\"c\");\n parent.appendChild(child);\n child.addAttribute(new Attribute(\n \"xml:base\", \"http://www.w3.org/XML/1998/namespace\", href));\n URL result = new URL(child.getBaseURI());\n if (!\"\".equals(href) && result.equals(baseURL)) {\n if (! baseURL.toExternalForm().endsWith(href)) {\n throw new BadHrefAttributeException(href \n + \" is not a syntactically correct IRI\");\n }\n }\n return result;\n \n }",
"@Override\n public String getUrl() {\n StringBuilder sb = new StringBuilder(baseUrl);\n if (mUrlParams.size() > 0) {\n sb.append(\"?\");\n for (String key : mUrlParams.keySet()) {\n sb.append(key);\n sb.append(\"=\");\n sb.append(mUrlParams.get(key));\n sb.append(\"&\");\n }\n }\n String result = sb.substring(0, sb.length() - 1);\n return result;\n }",
"String getServerBaseURL();",
"public URI getBaseURI() {\n Map<String, String> map = new LinkedHashMap<>();\n map.put(\"xml\", XML_NAMESPACE);\n return getLink(\"/*/@xml:base\", map);\n }",
"private String createUrlWithPort(String gadgetUrl) {\n try {\n URL origUrl = new URL(gadgetUrl);\n URL urlWithPort = null;\n String origHost = origUrl.getHost();\n if (origUrl.getPort() <= 0 && origHost != null && origHost.length() != 0\n && !STAR.equals(origHost)) {\n if (origUrl.getProtocol().equalsIgnoreCase(HTTP)) {\n urlWithPort = new URL(origUrl.getProtocol(), origUrl.getHost(), HTTP_PORT, origUrl.getFile());\n }\n else if (origUrl.getProtocol().equalsIgnoreCase(HTTPS)) {\n urlWithPort = new URL(origUrl.getProtocol(), origUrl.getHost(), HTTPS_PORT, origUrl.getFile());\n }\n return urlWithPort == null ? origUrl.toString() : urlWithPort.toString();\n } else {\n return origUrl.toString();\n }\n } catch (MalformedURLException e) {\n return gadgetUrl;\n }\n }",
"protected String getAbsoluteURL(HttpServletRequest httpRequest, String url) {\r\n\t\t\r\n\t\tif (url == null)\r\n\t\t\treturn null;\r\n\t\tif (url.indexOf(\"://\") != -1)\t\t\t\r\n\t\t\treturn url;\r\n\r\n\t\tString scheme = httpRequest.getScheme();\r\n\t\tString serverName = httpRequest.getServerName();\r\n\t\tint port = httpRequest.getServerPort();\r\n\t\tboolean slashLeads = url.startsWith(\"/\");\r\n\r\n\t\tString absoluteURL = scheme + \"://\" + serverName;\r\n\t\t\r\n\t\tif ((scheme.equals(\"http\") && port != 80) || \r\n\t\t\t\t(scheme.equals(\"https\") && port != 443))\r\n\t\t\tabsoluteURL += \":\" + port;\r\n\t\tif (!slashLeads)\r\n\t\t\tabsoluteURL += \"/\";\r\n\r\n\t\tabsoluteURL += url;\r\n\t\t\r\n\t\treturn absoluteURL;\r\n\t}",
"String getRootServerBaseUrl();",
"private String initUrlParameter() {\n StringBuffer url = new StringBuffer();\n url.append(URL).append(initPathParameter());\n return url.toString();\n }",
"public String constructAdministrationUrl(final String uuid, final HttpServletRequest request) {\n\t\tString hostUrlContextToUse = this.hostUrlContext;\n\t\tif (StringUtils.isEmpty(hostUrlContext)) {\n\t\t\thostUrlContextToUse = generateHostContextFromRequest(request);\n\t\t}\n\n\t\tif (StringUtils.isEmpty(hostUrlContextToUse)) {\n\t\t\tthrow new IllegalStateException(\"Host URL of current server could not be retrieved\");\n\t\t}\n\n\t\tif (hostUrlContextToUse.endsWith(\"/\")) {\n\t\t\thostUrlContextToUse = StringUtils.chop(hostUrlContextToUse);\n\t\t}\n\n\t\tString adminUrlPart = RequestMappings.ADMIN_URL_PATTERN.replaceFirst(\"\\\\{\" + RequestMappings.ADMIN_URL_UUID_MARKER + \"\\\\}\", uuid);\n\t\treturn hostUrlContextToUse + adminUrlPart;\n\t}",
"protected String createUrlEntry(SitemapEntry sitemapEntry)\r\n {\r\n StringBuilder urlEntry = new StringBuilder();\r\n urlEntry.append(\"<url>\");\r\n urlEntry.append(\"<loc>\");\r\n urlEntry.append(sitemapEntry.getUrlString());\r\n urlEntry.append(\"</loc>\");\r\n if (sitemapEntry.getLastModified() != null)\r\n {\r\n urlEntry.append(\"<lastmod>\");\r\n urlEntry.append(sitemapEntry.getLastModified().getISO8601DateTime());\r\n urlEntry.append(\"</lastmod>\");\r\n }\r\n if (sitemapEntry.getChangeFreq() != null)\r\n {\r\n urlEntry.append(\"<changefreq>\");\r\n urlEntry.append(sitemapEntry.getChangeFreq().getText());\r\n urlEntry.append(\"</changefreq>\");\r\n }\r\n if (sitemapEntry.getPriority() != null)\r\n {\r\n urlEntry.append(\"<priority>\");\r\n urlEntry.append(sitemapEntry.getPriority());\r\n urlEntry.append(\"</priority>\");\r\n }\r\n urlEntry.append(\"</url>\");\r\n\r\n return urlEntry.toString();\r\n }",
"protected String createFullFieldName(final String basePrefix, final String fieldName)\n\t{\n\t\tfinal String prefix;\n\t\tif (basePrefix == null || basePrefix.isEmpty())\n\t\t{\n\t\t\tprefix = fieldName;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tprefix = basePrefix + \".\" + fieldName;\n\t\t}\n\t\treturn prefix;\n\t}",
"private String generateUrl(String code) {\n return prefix + recognizeType(code) + code;\n }",
"public abstract String getPrefix();",
"@Override\n public URI createUri(String url) {\n try {\n this.uri = new URI(url);\n } catch (URISyntaxException e) {\n e.printStackTrace();\n }\n return uri;\n }",
"public void prefix( String base ) {\r\n\t\tthis.prefix = base;\r\n\t\ts.prefix( base );\r\n\t}",
"public static String getPrefixString() {\n\n\t\tString prefix = \"PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>\"\n\t\t\t\t+ \"PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>\"\n\t\t\t\t+ \"PREFIX dbpedia: <http://dbpedia.org/property/>\"\n\t\t\t\t+ \"PREFIX skos: <http://www.w3.org/2004/02/skos/core#>\"\n\t\t\t\t+ \"PREFIX oddlinker: <http://data.linkedmdb.org/resource/oddlinker/>\"\n\t\t\t\t+ \"PREFIX db: <http://data.linkedmdb.org/resource/>\"\n\t\t\t\t+ \"PREFIX movie: <http://data.linkedmdb.org/resource/movie/>\"\n\t\t\t\t+ \"PREFIX map: <file:/C:/d2r-server-0.4/mapping.n3#>\"\n\t\t\t\t+ \"PREFIX foaf: <http://xmlns.com/foaf/0.1/>\"\n\t\t\t\t+ \"PREFIX d2r: <http://sites.wiwiss.fu-berlin.de/suhl/bizer/d2r-server/config.rdf#>\"\n\t\t\t\t+ \"PREFIX owl: <http://www.w3.org/2002/07/owl#>\"\n\t\t\t\t+ \"PREFIX dc: <http://purl.org/dc/terms/>\"\n\t\t\t\t+ \"PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>\"\n\t\t\t\t+ \"PREFIX fn: <java:facet.>\";\n\n\t\treturn prefix;\n\t}",
"private static URI getBaseURI() {\n\t\treturn UriBuilder.fromUri(\"https://api.myjson.com/bins/aeka0\").build();\n\t}",
"@Override\r\n public UriBuilder getAbsolutePathBuilder() {\n return null;\r\n }",
"public static URL buildUrl() {\n Uri builtUri = Uri.parse(CONTENT_JSON_URL).buildUpon()\n .build();\n\n URL url = null;\n try {\n url = new URL(builtUri.toString());\n } catch (MalformedURLException e) {\n e.printStackTrace();\n }\n return url;\n }",
"public URI buildUri(String name) {\n return URI.create(String.format(\"%s/%s\",\n config.getSftpListingDirectoryPath(),\n name));\n }",
"private String baseUrl() {\n return \"http://\" + xosServerAddress + \":\" +\n Integer.toString(xosServerPort) + XOSLIB + baseUri;\n }",
"public static String cleanUpPathPrefix(String prefix) {\n if (UtilValidate.isEmpty(prefix)) {\n return \"\";\n }\n\n StringBuilder cppBuff = new StringBuilder(prefix.replace('\\\\', '/'));\n\n if (cppBuff.charAt(0) != '/') {\n cppBuff.insert(0, '/');\n }\n if (cppBuff.charAt(cppBuff.length() - 1) == '/') {\n cppBuff.deleteCharAt(cppBuff.length() - 1);\n }\n return cppBuff.toString();\n }",
"public String appBaseUrl() {\n int amtToTrim = request.getServletPath().length() + request.getPathInfo().length();\n String appBase = requestURL.substring(0, requestURL.length()-amtToTrim);\n return appBase;\n }",
"public static URL buildUrl(int sorting) {\r\n String baseUrl;\r\n switch(sorting) {\r\n case(SORT_POPULAR):\r\n baseUrl = BASE_URL + POPULAR_MOVIES;\r\n break;\r\n case(SORT_TOP_RATED):\r\n baseUrl = BASE_URL + TOP_RATED_MOVIES;\r\n break;\r\n default:\r\n baseUrl = BASE_URL + POPULAR_MOVIES;\r\n }\r\n Uri builtUri = Uri.parse(baseUrl).buildUpon()\r\n .appendQueryParameter(API_PARAM, API_KEY)\r\n .build();\r\n\r\n URL url = null;\r\n try {\r\n url = new URL(builtUri.toString());\r\n } catch (MalformedURLException e) {\r\n e.printStackTrace();\r\n }\r\n\r\n return url;\r\n }",
"public static String getBaseURL(URL url) throws MalformedURLException {\n return new URL(url.getProtocol(), url.getHost(), url.getPort(), \"/\").toString();\n }",
"public String getAbsoluteUrl() throws MalformedURLException {\r\n URL webUrl = new URL(webAbsluteUrl);\r\n URL urlRequest = new URL(webUrl.toString() + url);\r\n return urlRequest.toString();\r\n }",
"private String generateTargetFileUri(String fileUri) {\n return folderName.concat(fileUri);\n }",
"private String getFullLocalURI(String uri) {\n return LOCAL_NS_PREFIX + \":\" + uri;\n }",
"private void buildBS60Url() {\n url = \"http://q.lizone.net/index/index/BSline/res/60/label/\" + dataItem.label;//API 2.0\n }",
"public PrefixMapping(String prefix, String uri) {\r\n this.prefix = (prefix != null)? prefix : \"\";\r\n this.uri = (uri != null)? uri : \"\"; \r\n }",
"protected UriComponentsBuilder getUriComponentsBuilder(String sbUrl) {\n\t\tUriComponentsBuilder uriBuilder = UriComponentsBuilder.fromUriString(sbUrl);\n\t\tif (swaggerUiConfig.isDisplayQueryParams() && StringUtils.isNotEmpty(swaggerUiConfig.getUrl())) {\n\t\t\tswaggerUiConfig.getConfigParameters().entrySet().stream()\n\t\t\t\t\t.filter(entry -> !SwaggerUiConfigProperties.CONFIG_URL_PROPERTY.equals(entry.getKey()))\n\t\t\t\t\t.filter(entry -> !entry.getKey().startsWith(SwaggerUiConfigProperties.URLS_PROPERTY))\n\t\t\t\t\t.filter(entry -> StringUtils.isNotEmpty((String) entry.getValue()))\n\t\t\t\t\t.forEach(entry -> uriBuilder.queryParam(entry.getKey(), entry.getValue()));\n\t\t} else if (swaggerUiConfig.isDisplayQueryParamsWithoutOauth2() && StringUtils.isNotEmpty(swaggerUiConfig.getUrl())) {\n\t\t\tswaggerUiConfig.getConfigParameters().entrySet().stream()\n\t\t\t\t\t.filter(entry -> !SwaggerUiConfigProperties.CONFIG_URL_PROPERTY.equals(entry.getKey()))\n\t\t\t\t\t.filter(entry -> !SwaggerUiConfigProperties.OAUTH2_REDIRECT_URL_PROPERTY.equals(entry.getKey()))\n\t\t\t\t\t.filter(entry -> !entry.getKey().startsWith(SwaggerUiConfigProperties.URLS_PROPERTY))\n\t\t\t\t\t.filter(entry -> StringUtils.isNotEmpty((String) entry.getValue()))\n\t\t\t\t\t.forEach(entry -> uriBuilder.queryParam(entry.getKey(), entry.getValue()));\n\t\t}\n\t\telse {\n\t\t\turiBuilder.queryParam(SwaggerUiConfigProperties.CONFIG_URL_PROPERTY, swaggerUiConfig.getConfigUrl());\n\t\t\tif (StringUtils.isNotEmpty(swaggerUiConfig.getLayout()))\n\t\t\t\turiBuilder.queryParam(SwaggerUiConfigProperties.LAYOUT_PROPERTY, swaggerUiConfig.getLayout());\n\t\t\tif (StringUtils.isNotEmpty(swaggerUiConfig.getFilter()))\n\t\t\t\turiBuilder.queryParam(SwaggerUiConfigProperties.FILTER_PROPERTY, swaggerUiConfig.getFilter());\n\t\t}\n\t\treturn uriBuilder;\n\t}",
"private URI makeUri(String source) throws URISyntaxException {\n if (source == null)\n source = \"\";\n\n if ((source.length()>0)&&((source.substring(source.length() - 1)).equals(\"/\") ))\n source=source.substring(0, source.length() - 1);\n\n return new URI( source.toLowerCase() );\n }",
"public static String getPrefixRegisterURI() {\n return Registry.get().getBaseURI() + PREFIX_REGISTER;\n }",
"@org.junit.Test\n public void constrCompelemBaseuri2() {\n final XQuery query = new XQuery(\n \"fn:base-uri(exactly-one((<elem xml:base=\\\"http://www.example.com\\\">{element a {}}</elem>)/a))\",\n ctx);\n try {\n result = new QT3Result(query.value());\n } catch(final Throwable trw) {\n result = new QT3Result(trw);\n } finally {\n query.close();\n }\n test(\n assertStringValue(false, \"http://www.example.com\")\n );\n }",
"public static String determineBaseUrl(String url) {\r\n\t\t// Determine the index of the first slash after the first period.\r\n\t\tint firstSub = url.indexOf(\"/\", url.indexOf(\".\"));\r\n\t\t\r\n\t\tif (firstSub == -1)\r\n\t\t\t// There were no sub directories included in the URL.\r\n\t\t\treturn url;\r\n\t\telse\r\n\t\t\treturn url.substring(0, firstSub);\r\n\t}",
"private String getUrlBaseForLocalServer() {\n\t HttpServletRequest request = ((ServletRequestAttributes) \n\t\t\t RequestContextHolder.getRequestAttributes()).getRequest();\n\t String base = \"http://\" + request.getServerName() + ( \n\t (request.getServerPort() != 80) \n\t \t\t ? \":\" + request.getServerPort() \n\t\t\t\t : \"\");\n\t return base;\n\t}",
"private String buildURL(String[] components) {\n\t\tfinal String BASE_URL = \"http://www.campusdish.com/en-US/CSMA/WilliamMary/Menus/\";\n\t\tfinal String ORG_ID = \"&OrgID=231624\";\n\t\tfinal String STATIC_PARAMS = \"&ShowPrice=False&ShowNutrition=True\";\n\t\t\n\t\tHashMap<String, String> location_map = new HashMap<String, String>();\n\t\tHashMap<String, Integer> time_map = new HashMap<String, Integer>();\n\t\t\n\t\tlocation_map.put(\"Sadler\", \"SadlerCenterRFoC.htm?LocationName=Sadler%20Center%20RFoC\");\n\t\tlocation_map.put(\"Commons\", \"CommonsFreshFoodCompany.htm?LocationName=Commons%20Fresh%20Food%20Company\");\n\t\tlocation_map.put(\"Marketplace\", \"Marketplace.htm?LocationName=Marketplace\");\n\t\ttime_map.put(\"Breakfast\", 1);\n\t\ttime_map.put(\"Lunch\", 16);\n\t\ttime_map.put(\"Dinner\", 17);\n\t\t\t\n\t\treturn BASE_URL + location_map.get(components[0]) + ORG_ID + \"&Date=\" + components[1] + \"&MealID=\" + time_map.get(components[2]) + STATIC_PARAMS;\n\t}",
"public String fixForScheme(String url) {\n\t\tStringBuffer returnUrl = new StringBuffer(url);\n\t\tif(StringUtils.contains(url, \"returnurl=\"))\n\t\t{\n\t\t\treturnUrl = new StringBuffer(StringUtils.substring(url,0, \n\t\t\t\t\tStringUtils.indexOf(url, \"returnurl=\")));\n\t\t\t\n\t\t\treturnUrl.append(\"returnurl=\");\n\t\t\tString returnurl = StringUtils.substring(url, \n\t\t\t\t\tStringUtils.indexOf(url, \"returnurl=\")+10);\n\t\t\t\n\t\t\ttry {\n\t\t\t\treturnUrl.append(URLEncoder.encode(new String(Base64.encodeBase64(returnurl.getBytes())),\"UTF-8\"));\n\t\t\t} catch (UnsupportedEncodingException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\treturn returnUrl.toString();\n\t}",
"@Test\n public void testMakeRelativeURL3() throws Exception {\n URL base = new URL(\"http://ahost.invalid/a/b/c\");\n assertEquals(new URL(\"http://host.invalid/e\"),ConversionUtils.makeRelativeURL(base ,\"http://host.invalid/e\"));\n assertEquals(new URL(\"https://host.invalid/e\"),ConversionUtils.makeRelativeURL(base ,\"https://host.invalid/e\"));\n assertEquals(new URL(\"http://host.invalid:8081/e\"),ConversionUtils.makeRelativeURL(base ,\"http://host.invalid:8081/e\"));\n assertEquals(new URL(\"https://host.invalid:8081/e\"),ConversionUtils.makeRelativeURL(base ,\"https://host.invalid:8081/e\"));\n }",
"@org.junit.Test\n public void constrCompelemBaseuri1() {\n final XQuery query = new XQuery(\n \"fn:base-uri(element elem {attribute xml:base {\\\"http://www.example.com\\\"}})\",\n ctx);\n try {\n result = new QT3Result(query.value());\n } catch(final Throwable trw) {\n result = new QT3Result(trw);\n } finally {\n query.close();\n }\n test(\n assertStringValue(false, \"http://www.example.com\")\n );\n }",
"private String getUrlHost(String url) {\n // httpx://host/.....\n\n int hostStart = url.indexOf(\"//\");\n if (hostStart == -1) {\n return \"\";\n }\n int hostEnd = url.indexOf(\"/\", hostStart + 2);\n if (hostEnd == -1) {\n return url.substring(hostStart + 2);\n } else {\n return url.substring(hostStart + 2, hostEnd);\n }\n\n }",
"String getPrefix();",
"String getPrefix();",
"String getPrefix();",
"String getPrefix();",
"static DefaultUrlBuilder from(URL baseUrl) {\n if (!baseUrl.getProtocol().equals(\"http\") && !baseUrl.getProtocol().equals(\"https\")) {\n throw new SafeIllegalArgumentException(\n \"unsupported protocol\", SafeArg.of(\"protocol\", baseUrl.getProtocol()));\n }\n if (Strings.emptyToNull(baseUrl.getQuery()) != null) {\n throw new SafeIllegalArgumentException(\n \"baseUrl query must be empty\", UnsafeArg.of(\"query\", baseUrl.getQuery()));\n }\n if (Strings.emptyToNull(baseUrl.getRef()) != null) {\n throw new SafeIllegalArgumentException(\n \"baseUrl ref must be empty\", UnsafeArg.of(\"ref\", baseUrl.getRef()));\n }\n if (Strings.emptyToNull(baseUrl.getUserInfo()) != null) {\n // the value of baseUrl.getUserInfo() may contain credential information and mustn't be logged\n throw new SafeIllegalArgumentException(\"baseUrl user info must be empty\");\n }\n return new DefaultUrlBuilder(baseUrl);\n }",
"public String fixURIPrefixIssue(String sql, Map<String, String> v2prefix) {\n\t\tString varPtn = \"CAST\\\\(CONCAT\\\\('(http[^,]*)', (((?!CHAR\\\\(8000\\\\) CHARACTER SET utf8\\\\) AS `).)*)\\\\) AS CHAR\\\\(8000\\\\) CHARACTER SET utf8\\\\) AS `([^`]*)`\";\n\t\tPattern r = Pattern.compile(varPtn);\n\t\t\n\t\tMatcher m = r.matcher(sql);\n\t\tString newSQL = \"\";\n\t\tint curPos = 0;\n\t\twhile(m.find()) {\n\t\t\tString v = m.group(4);\n\t\t\tString prefix = m.group(1);\n\t\t\tString fieldConstruct = m.group(2);\n\t\t\tif (fieldConstruct.indexOf(\",\") > 0) {\n\t\t\t\tfieldConstruct = String.format(\"concat(%s)\", fieldConstruct);\n\t\t\t}\n\t\t\tnewSQL += String.format(\"%s%s AS `%s`\", sql.substring(curPos, m.start()),\n\t\t\t\t\tfieldConstruct, v);\n\t\t\tcurPos = m.end();\n\t\t\tv2prefix.put(v, prefix);\n\t\t}\n\t\tnewSQL += sql.substring(curPos);\n\t\t_logger.info(String.format(\"[%s] converted to new SQL: [%s]\", sql, newSQL));\n\t\treturn newSQL;\n\t}",
"public static String formatUrl(String url) {\n if (!url.startsWith(\"http://\") && !url.startsWith(\"https://\")) {\n url = \"http://\" + url;\n }\n return url;\n }",
"@Nonnull protected StringBuilder doBuildURL(@Nonnull final StringBuilder builder) {\n return builder;\n }",
"private String buildSearchURL(String companyTicker) {\n Uri.Builder builder = new Uri.Builder();\n builder.scheme(\"https\")\n .authority(\"finance.google.com\")\n .appendPath(\"finance\")\n .appendPath(\"info\")\n .appendQueryParameter(\"client\", \"iq\")\n .appendQueryParameter(\"q\", companyTicker);\n String myUrl = builder.build().toString();\n return myUrl; // return a url\n }"
] | [
"0.6037446",
"0.5953948",
"0.5738791",
"0.5715133",
"0.5689611",
"0.56338394",
"0.56309396",
"0.56203765",
"0.5582681",
"0.5469872",
"0.54583204",
"0.5397205",
"0.53564847",
"0.53549576",
"0.5352269",
"0.5296129",
"0.5184275",
"0.5178189",
"0.51638865",
"0.51583046",
"0.51460516",
"0.5128961",
"0.5109529",
"0.50764036",
"0.5074516",
"0.5059707",
"0.5031213",
"0.50271523",
"0.50236607",
"0.50189066",
"0.5005878",
"0.4975234",
"0.4973023",
"0.49720424",
"0.49622816",
"0.4952472",
"0.49457505",
"0.4933647",
"0.49281782",
"0.48942193",
"0.4887288",
"0.4877108",
"0.4868957",
"0.4854083",
"0.4851466",
"0.48434222",
"0.48155165",
"0.48086697",
"0.48086697",
"0.4806891",
"0.47880667",
"0.4785867",
"0.47771385",
"0.47691026",
"0.4767683",
"0.4763316",
"0.4759534",
"0.47520846",
"0.47497848",
"0.4748513",
"0.47433943",
"0.4734758",
"0.47328344",
"0.47310248",
"0.47297502",
"0.47248283",
"0.4723518",
"0.47228336",
"0.47194168",
"0.47168562",
"0.4710424",
"0.46921057",
"0.46880713",
"0.4682658",
"0.46690434",
"0.46682242",
"0.46650833",
"0.46643883",
"0.46638593",
"0.4652834",
"0.4651929",
"0.4649094",
"0.4644453",
"0.46412736",
"0.4639705",
"0.4638552",
"0.46265888",
"0.46260595",
"0.4618436",
"0.46121368",
"0.45987046",
"0.4598461",
"0.4598461",
"0.4598461",
"0.4598461",
"0.45913216",
"0.4579871",
"0.45653716",
"0.45631716",
"0.456144"
] | 0.6043973 | 0 |
Get the decrypted value of an encrypted property. | public String getPropertyDecrypted(ApplicationConfigurationPropertyConstant key)
throws EncryptionException {
String value = properties.get(key.getKeyString());
if (StringUtils.isNotEmpty(value)) {
return EncryptionUtils.decrypt(value,
ApplicationProperty.INSTALLATION_UNIQUE_ID.getValue());
}
return value;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String getEncryptedValue() {\n\t\treturn encryptedValue;\n\t}",
"public EncryptionProperties encryption() {\n return this.encryption;\n }",
"public EncryptionProperties encryption() {\n return this.encryption;\n }",
"private String decryptAndEncryptProperty(String property) throws KeyChangeException {\n byte[] existingDataDecodedByteArray = KeyChangeCryptoUtils.base64DecodeAndDecrypt(property, oldKeyPath,\n oldKeyPass, oldKeyAlias);\n // Encrypt, encode and get the cipher text\n return KeyChangeCryptoUtils.encryptAndBase64Encode(existingDataDecodedByteArray, newKeyPath, newKeyPass,\n newKeyAlias);\n }",
"public Object encryptedCredential() {\n return this.encryptedCredential;\n }",
"public String decryptedOnly(final String value) {\n\t\tif (StringUtils.isAllBlank(value)) {\n\t\t\treturn value;\n\t\t}\n\t\ttry {\n\t\t\t// Try a decryption\n\t\t\tdecrypt(value);\n\t\t\treturn null;\n\t\t} catch (final EncryptionOperationNotPossibleException e) { // NOSONAR - Ignore raw value\n\t\t\t// Value could be encrypted, consider it as a safe value\n\t\t\treturn value;\n\t\t}\n\t}",
"String decryptHiddenField(String encrypted);",
"public String getEncryptedPassword () {\n return encryptedPassword;\n }",
"public java.lang.String getEncryptedData() {\r\n return encryptedData;\r\n }",
"public Boolean getEncrypted() {\n return this.encrypted;\n }",
"public synchronized String getDecryptedText() {\n String text;\n try {\n text = ContentCrypto.decrypt(mText, getSalt(), Passphrase.INSTANCE.getPassPhrase().toCharArray());\n } catch (Exception e) {\n e.printStackTrace();\n text = \"Bad Decrypt\";\n }\n return text;\n }",
"public Encryption getEncryption() {\n return this.encryption;\n }",
"public Encryption getEncryption() {\n return this.encryption;\n }",
"public Encryption encryption() {\n return this.encryption;\n }",
"public DecryptionCipherInterface decryptionCipher()\n {\n return this.decryptionCipher;\n }",
"public String decryptPassword(String encrypted) {\n Preconditions.checkArgument(this.encryptor.isPresent(),\n \"A master password needs to be provided for decrypting passwords.\");\n\n try {\n return this.encryptor.get().decrypt(encrypted);\n } catch (Exception e) {\n throw new RuntimeException(\"Failed to decrypt password \" + encrypted, e);\n }\n }",
"public String decryptFromPref(String prefKey) throws IOException, GeneralSecurityException {\n\t\treturn getEncryptedPrefs().getString(prefKey, null);\n\t}",
"public int getDecryptedNumber()\r\n\t{\r\n\t\treturn decryptedNumber;\r\n\t}",
"public String decryptMsg(String encryptedMsg) {\n encryptedMsg.toLowerCase(Locale.ROOT);\n\n //replace the things with the properties\n encryptedMsg = encryptedMsg.replace(\"1\", \"a\");\n encryptedMsg = encryptedMsg.replace(\"3\", \"e\");\n encryptedMsg = encryptedMsg.replace(\"5\", \"i\");\n encryptedMsg = encryptedMsg.replace(\"7\", \"o\");\n encryptedMsg = encryptedMsg.replace(\"9\", \"u\");\n\n //return the right value\n return encryptedMsg;\n }",
"public String decrypt(final String value) {\n\t\treturn encryptor.decrypt(value);\n\t}",
"@Override\n\tpublic double decrypt(String encryptedText) {\n\t\treturn cryptoProvider.decrypt(encryptedText);\n\t}",
"public String get(String key) {\n return this.properties.getProperty(key);\n }",
"public String getValue(String key) {\r\n\t\t\treturn prop.getProperty(key);\r\n\t\t}",
"public String getValue(String key) {\n\t\t\treturn properties.get(key);\n\t\t}",
"public java.lang.String getEncryptedKey() {\n\t\treturn encryptedKey;\n\t}",
"private String getValueFromProperty(String key) {\n\t\treturn properties.getProperty(key);\n\n\t}",
"public String decryptAsNeeded(final String value) {\n\t\ttry {\n\t\t\t// Try a decryption\n\t\t\treturn decrypt(value);\n\t\t} catch (final EncryptionOperationNotPossibleException ignored) {\n\t\t\t// This value could be encrypted, but was not\n\t\t\treturn value;\n\t\t}\n\t}",
"String fetchProperty(String property)\n\t{\n\t\tif(configProp==null)\n\t\t\tloadPropertiesFile();\n\t\t\n\t\treturn(configProp.getProperty(property));\n\t}",
"private String getPropertyValue() {\n return EmfPropertyHelper.getValue(itemPropertyDescriptor, eObject);\n }",
"public static String getPropertyValue(String key){\n return properties.getProperty(key);\n }",
"Property getProperty();",
"Property getProperty();",
"public String get(String key) {\n return this.properties.getProperty(key);\n }",
"@Accessor(qualifier = \"privateKey\", type = Accessor.Type.GETTER)\n\tpublic String getPrivateKey()\n\t{\n\t\treturn getPersistenceContext().getPropertyValue(PRIVATEKEY);\n\t}",
"public String get(final String name) {\r\n return (String) properties.get(name);\r\n }",
"String getProperty(String key);",
"String getProperty(String key);",
"String getProperty(String key);",
"public final String getPassword() {\n return properties.get(PASSWORD_PROPERTY);\n }",
"public final String readProperty(final String key){\n return mProperties.getProperty(key);\n }",
"@Override\n\tpublic String getEncryptedPassword() {\n\t\treturn null;\n\t}",
"public final String readProperty(@NonNull final String key){\n return mProperties.getProperty(key);\n }",
"@Override\n public void decrypt() {\n algo.decrypt();\n String cypher = vigenereAlgo(false);\n this.setValue(cypher);\n }",
"public String getProperty() {\n Object ref = property_;\n if (!(ref instanceof String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n String s = bs.toStringUtf8();\n property_ = s;\n return s;\n } else {\n return (String) ref;\n }\n }",
"public String getProperty() {\n Object ref = property_;\n if (ref instanceof String) {\n return (String) ref;\n } else {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n String s = bs.toStringUtf8();\n property_ = s;\n return s;\n }\n }",
"public static String getProp(String key) {\n try {\n Process process = Runtime.getRuntime().exec(String.format(\"getprop %s\", key));\n String value = new BufferedReader(new InputStreamReader(process.getInputStream())).readLine();\n process.destroy();\n return value;\n } catch (IOException e) {\n Log.d(\"getProp exception\", e.toString(), e);\n return null;\n }\n }",
"java.lang.String getProperty();",
"String getProperty(String property);",
"Object getProperty(String key);",
"public static String getValue(String key) {\r\n\t\tload();\r\n\t\treturn properties.getProperty(key);\r\n\t}",
"public String getPropValue(String propertyName){\n\n return pro.getProperty(propertyName);\n\n }",
"public String decrypt(String key);",
"public String getPassword() {\r\n \t\treturn properties.getProperty(KEY_PASSWORD);\r\n \t}",
"Object getProperty(String requestedProperty) {\n return properties.getProperty(requestedProperty);\n }",
"public static String getProp(PropertiesAllowedKeys key) {\n\t\ttry {\n\t\t\treturn (String) properties.get(key.toString());\n\t\t} catch (NullPointerException e) {\n\t\t\tSystem.err\n\t\t\t\t\t.println(\"You just found a bug in marabou. Marabou requested a config key from marabou.properties that is non existent.\\n\"\n\t\t\t\t\t\t\t+ \"Please file a bug report and include this messages and what you just did.\");\n\t\t\treturn \"\";\n\t\t}\n\t}",
"public String getValue(final String key) {\n final ConfigProperty cp = get(key);\n return cp != null ? cp.getValue() : null;\n }",
"public EncryptionCipherInterface encryptionCipher()\n {\n return this.encryptionCipher;\n }",
"public String getProperty();",
"public String getProp(String key) {\n\t\treturn prop.getProperty(key);\n\t}",
"public char getSecretPassage() {\n\t\treturn secretPassage; \n\t}",
"String getProperty();",
"String getProperty();",
"String getProperty();",
"<T> T getValue(Property<T> property);",
"final public Object getValue()\n {\n return getProperty(VALUE_KEY);\n }",
"public String getProperty(String key) {\n String value = properties.getProperty(key);\n return value;\n }",
"public static String getMSJProperty(String prop){\n\t\tif(propiedades.containsKey(prop)){\n\t\t\treturn propiedades.getString(prop);\t\n\t\t}else{\n\t\t\treturn \"\";\n\t\t}\t\t\t\t\n\t}",
"public static Properties newEncryptionEnabledProps() {\n Properties props;\n // for production, we expect all sensitive properties to be encrypted\n if (PRODUCTION.equals(System.getProperty(CMS_ENV))) {\n String password = System.getProperty(CMS_CRYPT_PASSWORD);\n if (isBlank(password)) {\n throw new PortalServiceConfigurationException(CMS_CRYPT_PASSWORD\n + \" is not found, please set the environment \"\n + \"variable before starting up the application in PROD mode.\");\n }\n\n StandardPBEStringEncryptor encryptor = new StandardPBEStringEncryptor();\n encryptor.setPassword(password);\n props = new EncryptableProperties(encryptor);\n } else {\n props = new Properties();\n }\n return props;\n }",
"public Object get(String propertyId)\n {\n return properties.get(propertyId);\n }",
"String encryptHiddenField(String value) throws EncryptionException;",
"public String getProperty(String key) {\n \t\tSecurityManager sm = System.getSecurityManager();\n \n \t\tif (sm != null) {\n \t\t\tsm.checkPropertyAccess(key);\n \t\t}\n \n \t\treturn (framework.getProperty(key));\n \t}",
"public String getProperty(Object obj, String key);",
"public String readPassword(String password) {\n if (!this.encryptor.isPresent()) {\n return password;\n }\n Matcher matcher = PASSWORD_PATTERN.matcher(password);\n if (matcher.find()) {\n return this.decryptPassword(matcher.group(1));\n } else {\n return password;\n }\n }",
"public long getPropertyVolume()\n {\n return iPropertyVolume.getValue();\n }",
"public String getResult(){\n MCrypt mcrypt = new MCrypt();\n try {\n String s = new String( mcrypt.decrypt( result ));\n return s;\n //return result;\n } catch (Exception e) {\n e.printStackTrace();\n return e.toString();\n }\n }",
"public String deceasedString() {\n return getString(FhirPropertyNames.PROPERTY_DECEASED_STRING);\n }",
"public String getProperty(String key) {\n if (this.ignoreCase) {\n key = key.toUpperCase();\n }\n\n return this.attributes.getProperty(key);\n }",
"public String getValueProperty() {\r\n return getAttributeAsString(\"valueProperty\");\r\n }",
"public String getProperty( String key )\n {\n List<Props.Entry> props = this.props.getEntry();\n Props.Entry keyObj = new Props.Entry();\n keyObj.setKey( key );\n\n String value = null;\n int indx = props.indexOf( keyObj );\n if ( indx != -1 )\n {\n Props.Entry entry = props.get( props.indexOf( keyObj ) );\n value = entry.getValue();\n }\n\n return value;\n }",
"public MediaEncryption getMediaEncryption();",
"public String getPassword() {\n return getProperty(PASSWORD);\n }",
"public com.google.protobuf.ByteString\n getPropertyBytes() {\n Object ref = property_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (String) ref);\n property_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }",
"public String Decrypt(String s);",
"private String decryptKey(String keyValue) {\n if (keyValue != null) {\n byte[] encryptedKey = Base64.decode(keyValue);\n AWSKMS client = AWSKMSClientBuilder.defaultClient();\n DecryptRequest request = new DecryptRequest()\n .withCiphertextBlob(ByteBuffer.wrap(encryptedKey));\n ByteBuffer plainTextKey = client.decrypt(request).getPlaintext();\n return new String(plainTextKey.array(), Charset.forName(\"UTF-8\"));\n }\n return null;\n }",
"public static String getProperty(String key) {\r\n\r\n\t\treturn getProperties(LanguageManagerUtil.getCurrentLanguage()).getString(key);\r\n\t}",
"public String getPassword() {\n return (String) getObject(\"password\");\n }",
"public static String get(String key){\n\t\tif(sys_cfg == null){\n\t\t\tsys_cfg = new Configuration(\"text.properties\");\n\t\t}\n\t\tString value = sys_cfg.getValue(key);\n\t\treturn value;\n\t}",
"public String translate() {\n\n\t\tString asp = \"\";\t\t\n\t\tif (propAssc.isModal()) {\n\t\t\tfor (int i=0; i<modes.size(); i++) {\n\t\t\t\tPropertyExpression propExpr = propAssc.valueInMode(modes.get(i));\n\t\t\t\t\n\t\t\t\tif (propExpr != null) \n\t\t\t\t\tasp += ifModeSpecificValue(propExpr, modes.get(i));\n\t\t\t}\n\t\t} else {\n\n\t\t\t// retrieve the values\n\t\t\t// TODO: consider adding inherited property values ??\n\t\t\tEList<ModalPropertyValue> values = propAssc.getOwnedValues();\n\t\t\t\n\t\t\t// TODO: check if there are properties that return multiple values (maybe records?)\n\t\t\tPropertyExpression propExpr = values.get(0).getOwnedValue();\n\t\t\t\n\t\t\tasp += ifNonModeSpecificValue(propExpr);\n\t\t}\n\t\t\n\t\t\n\t\treturn asp;\n\t}",
"public static String get(String key) {\n return properties.getProperty(key);\n }",
"private static byte[] getPropertyBytes(String key)\r\n/* 98: */ throws IOException\r\n/* 99: */ {\r\n/* 100: 95 */ String value = getProperty(key);\r\n/* 101: 96 */ return value == null ? new byte[0] : Base64Utils.base64Decode(value);\r\n/* 102: */ }",
"@Override\r\n\tpublic String get(Object key) {\r\n\t\tif (key == null) return null;\r\n\t\treturn getProperty(key.toString());\r\n\t}",
"public com.google.protobuf.ByteString\n getPropertyBytes() {\n Object ref = property_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (String) ref);\n property_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }",
"public Boolean isEncrypted() {\n return this.isEncrypted;\n }",
"public static String getProperty(String key) {\r\n\t\treturn prop.getProperty(key);\r\n\t}",
"public final SimpleStringProperty passwordProperty() {\n return password;\n }",
"public String getClave() {\n\n\t\ttry {\n\t\t\tConnection conexion = DriverManager.getConnection(\"jdbc:mysql://localhost/keyring\", \"root\" ,\"\");\n\t\t\tStatement sql = conexion.createStatement();\n\t\t\tResultSet resultado = sql.executeQuery(\"SELECT Password FROM password\");\n\t\t\tString clave;\n\n\t\t\tif (resultado.next()) {\n\t\t\t\tclave = resultado.getString(\"Password\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\tclave = \"\";\n\t\t\t}\n\n\t\t\tconexion.close();\n\t\t\treturn clave;\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t\treturn \"\";\n\t\t}\n\t}",
"public long getPropertyVolumeUnity()\n {\n return iPropertyVolumeUnity.getValue();\n }",
"public static byte[] getSecret()\r\n/* 136: */ {\r\n/* 137: */ try\r\n/* 138: */ {\r\n/* 139:122 */ return getPropertyBytes(\"secret\");\r\n/* 140: */ }\r\n/* 141: */ catch (Exception e)\r\n/* 142: */ {\r\n/* 143:124 */ log.warning(\"Error getting secret: \" + e.getMessage());\r\n/* 144: */ }\r\n/* 145:126 */ return new byte[0];\r\n/* 146: */ }",
"public Object getProperty(Object key) {\r\n\t\treturn properties.get(key);\r\n\t}",
"public static String getProperty(String key) {\n String valorPropiedad = null;\n\n valorPropiedad = getInstance().propert.getProperty(key);\n\n if (valorPropiedad != null) {\n valorPropiedad = valorPropiedad.trim();\n }\n\n return valorPropiedad;\n }"
] | [
"0.66896856",
"0.62047404",
"0.62047404",
"0.60113543",
"0.5927744",
"0.5912185",
"0.5827416",
"0.5777627",
"0.57718253",
"0.5709545",
"0.5704661",
"0.5667821",
"0.5667821",
"0.56061137",
"0.5562229",
"0.5537813",
"0.55238926",
"0.5510497",
"0.54594463",
"0.54409957",
"0.54097706",
"0.5388887",
"0.5353444",
"0.5328276",
"0.5321507",
"0.52573794",
"0.52385914",
"0.5238128",
"0.52257013",
"0.52246773",
"0.5223511",
"0.5223511",
"0.5218402",
"0.52093995",
"0.5206062",
"0.52050835",
"0.52050835",
"0.52050835",
"0.51972914",
"0.51765",
"0.5173202",
"0.5164453",
"0.5130685",
"0.51146746",
"0.5102571",
"0.5096829",
"0.5088896",
"0.5083315",
"0.5075968",
"0.5075493",
"0.5071385",
"0.5067456",
"0.50666386",
"0.50655454",
"0.50524324",
"0.50470895",
"0.5045605",
"0.50415766",
"0.5023199",
"0.502073",
"0.50153863",
"0.50153863",
"0.50153863",
"0.50061584",
"0.500426",
"0.50033885",
"0.49973553",
"0.49838427",
"0.49743035",
"0.49716654",
"0.49687308",
"0.495802",
"0.4956721",
"0.49409333",
"0.4934767",
"0.49345013",
"0.49329594",
"0.49309126",
"0.49242735",
"0.49150506",
"0.49123403",
"0.49091786",
"0.49015442",
"0.49010804",
"0.48948503",
"0.4894298",
"0.4887877",
"0.48874453",
"0.48846284",
"0.4884598",
"0.4882594",
"0.4876782",
"0.48733315",
"0.48728594",
"0.4872762",
"0.48720178",
"0.48658273",
"0.48650926",
"0.4864165",
"0.48616803"
] | 0.6748207 | 0 |
Returns all the properties for constant subset. | private Properties getSpecificProperties(ApplicationConfigurationPropertyConstant[] constants) {
Properties props = new Properties();
for (ApplicationConfigurationPropertyConstant constant : constants) {
String value = getProperty(constant);
if (value != null) {
props.setProperty(constant.getKeyString(), value);
}
}
return props;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Collection<ModuleProperty> getProperties();",
"CommonProperties getProperties();",
"Property[] getProperties();",
"public String getConstProperty() {\n return this.constProperty;\n }",
"protected List<Tuple<Operator, Property>> getPropertyFilters() {\n if (properties == null) {\n EntityDescriptor ed = getDescriptor();\n properties = filters.stream()\n .map(filter -> Tuple.create(filter.getFirst(), ed.getProperty(filter.getSecond())))\n .toList();\n }\n\n return Collections.unmodifiableList(properties);\n }",
"public abstract List<PropertyType> getBuiltInProperties();",
"StringMap getProperties();",
"@Override\n\tpublic List<Property> findAll() {\n\t\treturn pr.findAll();\n\t}",
"List<? extends T> getProperties();",
"@Override\n\tpublic List<XSOntDataProperty> getSubProperties(FlexoOntology context) {\n\t\treturn new ArrayList<XSOntDataProperty>();\n\t}",
"public abstract String GetProperty(Slice property);",
"public Set<ConfigSimpleValueDTO> getSimpleProperties() {\n \t\treturn new HashSet<ConfigSimpleValueDTO>(simpleProperties.values());\n \t}",
"public abstract List<BeanPropertyDefinition> findProperties();",
"List<Property<?>> getProperties(ProjectEntity entity);",
"@Override\n\tpublic List<Property> findBySubdivide(String uuid) {\n\t\treturn pr.findBySb_uuid(uuid);\n\t}",
"public abstract AbstractProperties getProperties();",
"@Override\n\tpublic Set<OWLEntity> getAllProperties() {\n\t\tSet<OWLEntity> result = new HashSet<OWLEntity>();\n\t\tresult.addAll(ontology.getObjectPropertiesInSignature());\n\t\treturn result;\n\t}",
"public Iterable<Map.Entry<String,Double>> getConstants() {\r\n return Collections.unmodifiableMap(constants).entrySet();\r\n }",
"@SuppressWarnings(\"unchecked\")\n\tpublic List<CustomerProperty> findAll() {\n\t\tlog.info(\"finding all CustomerProperty instances\");\n\t\ttry {\n\t\t\tfinal String queryString = \"select model from CustomerProperty model\";\n\t\t\tQuery query = getEntityManager().createQuery(queryString);\n\t\t\treturn query.getResultList();\n\t\t} catch (RuntimeException e) {\n\t\t\tlog.error(\"find all failed\", e);\n\t\t\tthrow e;\n\t\t}\n\t}",
"public Map getProperties();",
"ArrayList<PropertyMetadata> getProperties();",
"public abstract Properties getProperties();",
"public Set<String> getStringPropertyNames();",
"public List<String> getConstituencies() throws HttpNotFoundException, HttpBadRequestException, HttpForbiddenException, HttpFetchException, JsonProcessingException, IOException, URISyntaxException {\n\t\tURIBuilder url = setupUrlFor(GET_CONSTITUENCIES);\n\t\t\n\t\tfinal List<String> constituencyNames = Lists.newArrayList();\t\n\t\tfinal Iterator<JsonNode> elements = objectMapper.readTree(httpFetcher.get(url.build())).elements();\n\t\twhile(elements.hasNext()) {\n\t\t\tJsonNode next = elements.next();\n\t\t\tconstituencyNames.add(next.get(NAME).asText());\n\t\t}\t\t\n\t\treturn constituencyNames;\n\t}",
"public Iterable<String> getPropertyKeys();",
"public Set<ComplexConfigDTO> getComplexProperties() {\n \t\treturn new HashSet<ComplexConfigDTO>(complexProperties.values());\n \t}",
"public Iterable<Properties> getPropertiesSets(String key);",
"public Set<ConfigProperty> values() {\n return new HashSet<>(_properties.values());\n }",
"public List<FilterableProperty> filterableProperties() {\n return this.innerProperties() == null ? null : this.innerProperties().filterableProperties();\n }",
"public List<IConfigProperty> getConfigPropertiesList(boolean listCategoriesFirst);",
"public static Set<OntProperty> listRestrictedProperties(OntClass clazz)\n\t{\n\t\tRestrictedPropertyCollector collector = new RestrictedPropertyCollector();\n\t\tnew VisitingDecomposer(collector).decompose(clazz);\n\t\treturn collector.getProperties();\n\t}",
"final public int[] getSubset() {\n\t\treturn subset;\n\t}",
"String[] getPropertyKeys();",
"@Nonnull\n public List<C> getConstituents() {\n return constituents;\n }",
"List<PropertyKeySetting> getPropertyKeySettings();",
"@Override\n\t@SuppressWarnings(\"unchecked\")\n\t@Transactional(propagation = Propagation.SUPPORTS)\n\tpublic List<Property> findPropertyNames() \n\t{\n\t\tList<Property> details = entityManager.createNamedQuery(\"Property.readPropertyNames\").getResultList();\n\t\tlogger.info(\"Property Details are:\" + details);\n\t\treturn details;\n\t}",
"EProperties getProperties();",
"public Set getPropertyNames(){\n return this.vendorSpecificProperties;\n }",
"public Set<ConfigListDTO> getListProperties() {\n \t\treturn new HashSet<ConfigListDTO>(listProperties.values());\n \t}",
"public PropertyDescription[] getPropertiesDescriptions() {\n\t\tPropertyDescription[] pds = new PropertyDescription[3];\n\t\tpds[0] =\n\t\t\tnew PropertyDescription(\n\t\t\t\t\"binMethod\",\n\t\t\t\t\"Discretization Method\",\n\t\t\t\t\"The method to use for discretization. Select 1 to create bins\"\n\t\t\t\t\t+ \" by weight. This will create bins with an equal number of items in \"\n\t\t\t\t\t+ \"each slot. Select 0 to do uniform discretization by specifying the number of bins. \"\n\t\t\t\t\t+ \"This will result in equally spaced bins between the minimum and maximum for \"\n\t\t\t\t\t+ \"each scalar column.\");\n\t\tpds[1] =\n\t\t\tnew PropertyDescription(\n\t\t\t\t\"binWeight\",\n\t\t\t\t\"Number of Items per Bin\",\n\t\t\t\t\"When binning by weight, this is the number of items\"\n\t\t\t\t\t+ \" that will go in each bin. However, the bins may contain more or fewer values than \"\n\t\t\t\t\t+ \"weight values, depending on how many items equal the bin limits. Typically \"\n\t\t\t\t\t+ \"the last bin will contain less or equal to weight values and the rest of the \"\n\t\t\t\t\t+ \"bins will contain a number that is equal or greater to weight values.\");\n\t\tpds[2] =\n\t\t\tnew PropertyDescription(\n\t\t\t\t\"numberOfBins\",\n\t\t\t\t\"Number of Bins\",\n\t\t\t\t\"Define the number of bins absolutely. \"\n\t\t\t\t\t+ \"This will give equally spaced bins between \"\n\t\t\t\t\t+ \"the minimum and maximum for each scalar \"\n\t\t\t\t\t+ \"column.\");\n\t\treturn pds;\n\t}",
"private static HashMap<String, DefinedProperty> initDefinedProperties() {\n\t\tHashMap<String, DefinedProperty> newList = new HashMap<String, DefinedProperty>();\n\t\t// common properties\n\t\taddProperty(newList, \"name\", DefinedPropertyType.STRING, \"\", DefinedProperty.ANY, false, false);\n\t\taddProperty(newList, \"desc\", DefinedPropertyType.STRING, \"\", DefinedProperty.ANY, false, false);\n\t\t// implicit default properties\n\t\taddProperty(newList, \"donttest\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.ANY, false, false);\n\t\taddProperty(newList, \"dontcompare\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.ANY, false, false);\n\t\t// interface properties\n\t\taddProperty(newList, \"use_interface\", DefinedPropertyType.STRING, \"\", DefinedProperty.REGSET | DefinedProperty.REG |DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"use_new_interface\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.REGSET | DefinedProperty.REG |DefinedProperty.FIELD, false, false);\n\t\t// reg + regset properties\n\t\taddProperty(newList, \"js_superset_check\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.REGSET | DefinedProperty.REG, false, false);\n\t\taddProperty(newList, \"external\", DefinedPropertyType.SPECIAL, null, DefinedProperty.REGSET | DefinedProperty.REG, false, false);\n\t\taddProperty(newList, \"repcount\", DefinedPropertyType.NUMBER, \"1\", DefinedProperty.REGSET | DefinedProperty.REG, true, false); // hidden\n\t\t// regset only properties\n\t\taddProperty(newList, \"js_macro_name\", DefinedPropertyType.STRING, \"\", DefinedProperty.REGSET, false, false);\n\t\taddProperty(newList, \"js_macro_mode\", DefinedPropertyType.STRING, \"STANDARD\", DefinedProperty.REGSET, false, false);\n\t\taddProperty(newList, \"js_namespace\", DefinedPropertyType.STRING, \"\", DefinedProperty.REGSET, false, false);\n\t\taddProperty(newList, \"js_typedef_name\", DefinedPropertyType.STRING, \"\", DefinedProperty.REGSET, false, false);\n\t\taddProperty(newList, \"js_instance_name\", DefinedPropertyType.STRING, \"\", DefinedProperty.REGSET, false, false);\n\t\taddProperty(newList, \"js_instance_repeat\", DefinedPropertyType.NUMBER, \"1\", DefinedProperty.REGSET, false, false);\n\t\t// reg only properties\n\t\taddProperty(newList, \"category\", DefinedPropertyType.STRING, \"\", DefinedProperty.REG, false, false);\n\t\taddProperty(newList, \"js_attributes\", DefinedPropertyType.STRING, \"false\", DefinedProperty.REG, false, false);\n\t\taddProperty(newList, \"aliasedId\", DefinedPropertyType.STRING, \"false\", DefinedProperty.REG, true, false); // hidden\n\t\taddProperty(newList, \"regwidth\", DefinedPropertyType.NUMBER, \"32\", DefinedProperty.REG, false, false);\n\t\taddProperty(newList, \"uvmreg_is_mem\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.REG, false, false);\n\t\taddProperty(newList, \"cppmod_prune\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.REG, false, false);\n\t\taddProperty(newList, \"uvmreg_prune\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.REG, false, false);\n\t\t// signal properties\n\t\taddProperty(newList, \"cpuif_reset\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.SIGNAL, false, false);\n\t\taddProperty(newList, \"field_reset\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.SIGNAL, false, false);\n\t\taddProperty(newList, \"activehigh\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.SIGNAL, false, false);\n\t\taddProperty(newList, \"activelow\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.SIGNAL, false, false);\n\t\taddProperty(newList, \"signalwidth\", DefinedPropertyType.NUMBER, \"1\", DefinedProperty.SIGNAL, false, false);\n\t\t// fieldset only properties\n\t\taddProperty(newList, \"fieldstructwidth\", DefinedPropertyType.NUMBER, \"1\", DefinedProperty.FIELDSET, false, false);\n\t\t// field properties\n\t\taddProperty(newList, \"rset\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"rclr\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"woclr\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"woset\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"we\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"wel\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"swwe\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"swwel\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"hwset\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"hwclr\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"swmod\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"swacc\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"sticky\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"stickybit\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"intr\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"anded\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"ored\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"xored\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"counter\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"overflow\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"reset\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"fieldwidth\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"singlepulse\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"underflow\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"incr\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"decr\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"incrwidth\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"decrwidth\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"incrvalue\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"decrvalue\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"saturate\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"incrsaturate\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"decrsaturate\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"threshold\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"incrthreshold\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"decrthreshold\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"sw\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"hw\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"precedence\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"encode\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"resetsignal\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"mask\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"enable\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"haltmask\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"haltenable\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"halt\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"next\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"nextposedge\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"nextnegedge\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"maskintrbits\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false); \n\t\taddProperty(newList, \"satoutput\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"sub_category\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"rtl_coverage\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\t\n\t\t// override allowed property set if input type is jspec\n\t\tif (Ordt.hasInputType(Ordt.InputType.JSPEC)) {\n\t\t\tputProperty(newList, \"sub_category\", DefinedPropertyType.STRING, \"\", DefinedProperty.REGSET | DefinedProperty.REG | DefinedProperty.FIELDSET | DefinedProperty.FIELD, false, false);\n\t\t\tputProperty(newList, \"category\", DefinedPropertyType.STRING, \"\", DefinedProperty.REGSET | DefinedProperty.REG, false, false);\n\t\t\tputProperty(newList, \"js_attributes\", DefinedPropertyType.STRING, \"\", DefinedProperty.REGSET | DefinedProperty.REG, false, false);\n\t\t\tputProperty(newList, \"regwidth\", DefinedPropertyType.NUMBER, \"32\", DefinedProperty.REGSET | DefinedProperty.REG, false, false);\n\t\t\tputProperty(newList, \"address\", DefinedPropertyType.NUMBER, null, DefinedProperty.REGSET | DefinedProperty.REG, false, false);\n\t\t\tputProperty(newList, \"arrayidx1\", DefinedPropertyType.NUMBER, null, DefinedProperty.REGSET | DefinedProperty.REG, true, false); // hidden\n\t\t\tputProperty(newList, \"addrinc\", DefinedPropertyType.NUMBER, null, DefinedProperty.REGSET | DefinedProperty.REG, true, false); // hidden\n\t\t}\t\t\n\n\t\treturn newList;\n\t}",
"public HashMap<Integer, Object> getEffectProperties( ) {\r\n\r\n return properties;\r\n }",
"public List<String> getConstants() {\n return constants;\n }",
"Properties getProperties();",
"public String[] getPropertyNames();",
"public Note[] getProperties(Object key);",
"java.util.Enumeration getPropertyNames();",
"List<TypePatientPropertyCondition> findAll();",
"List<? extends T> getDeclaredProperties();",
"public Property getProperty() {\n\treturn commonproperty;\r\n}",
"public List<TLProperty> getElements();",
"public Iterator<String> getUserDefinedProperties();",
"public String toString() {\n return super.toString() + \" (\" + constants.size() + \" constants)\";\n }",
"java.lang.String getProperties();",
"public Set<String> getConstants(PDDLType type) {\n\t\treturn filterTypedList(constants, type);\n\t}",
"List<VarRatio> selectAll();",
"public Set<ProductSectionProperty> getProperties() {\n return properties;\n }",
"protected String getPropertyStrings() {\n\t\treturn \"Active:\" + activeProperty().getValue() + \", FromDataset:\" + isFromDataset() + \", Modified:\" + isModified();\n\t}",
"public List<ContestProperty> getAllContestProperties() throws ContestManagementException {\n return null;\r\n }",
"public List<ContestProperty> getAllContestProperties() throws ContestManagementException {\n return null;\r\n }",
"public ConstantProduct() {\n constProperty = \"constant\";\n constProperty2 = \"constant2\";\n }",
"public ArrayList<Property> getPropertyList()\r\n {\r\n return m_values;\r\n }",
"public List<NamedThing> getProperties() {\n // TODO this should be changed to AnyProperty type but it as impact everywhere\n List<NamedThing> properties = new ArrayList<>();\n List<Field> propertyFields = getAnyPropertyFields();\n for (Field f : propertyFields) {\n try {\n if (NamedThing.class.isAssignableFrom(f.getType())) {\n f.setAccessible(true);\n Object fValue = f.get(this);\n if (fValue != null) {\n NamedThing se = (NamedThing) fValue;\n properties.add(se);\n } // else not initalized but this is already handled in the initProperties that must be called\n // before the getProperties\n }\n } catch (IllegalAccessException e) {\n throw new TalendRuntimeException(CommonErrorCodes.UNEXPECTED_EXCEPTION, e);\n }\n }\n return properties;\n }",
"public String getConstProperty2() {\n return this.constProperty2;\n }",
"List<? extends T> getPropertiesLike(String name);",
"Object getOtherprops();",
"@Override\n\t\tpublic Map<String, Object> getAllProperties() {\n\t\t\treturn null;\n\t\t}",
"public List<PmPropertyBean> getProperties(Map paramter);",
"public ArrayList<Pair> getAllProperties(String filePath2, Object keyResource) {\n\t\tModel model = ModelFactory.createDefaultModel();\n\t\tmodel.read(filePath2);\n\n\t\t/*\n\t\t * String queryString =\n\t\t * \"PREFIX : <http://extbi.lab.aau.dk/ontology/business/>\\r\\n\" +\n\t\t * \"PREFIX rdfs: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>\\r\\n\" +\n\t\t * \"PREFIX afn: <http://jena.apache.org/ARQ/function#>\\r\\n\" +\n\t\t * \"SELECT ?v ?extrLabel ?o\\r\\n\" + \"WHERE\\r\\n\" +\n\t\t * \" {\t?v\ta\t:Municipality ;\\r\\n\" + \"\t?p\t?o\\r\\n\" +\n\t\t * \"\tBIND(afn:localname(?p) AS ?extrLabel)\\r\\n\" + \"}\";\n\t\t */\n\n\t\tString queryString = \"SELECT ?p ?o WHERE {?s ?p ?o. \" + \"FILTER regex(str(?s), '\" + keyResource.toString()\n\t\t\t\t+ \"')}\";\n\t\t\n\t\tQuery query = QueryFactory.create(queryString);\n\t\tQueryExecution qe = QueryExecutionFactory.create(query, model);\n\t\tResultSet results = ResultSetFactory.copyResults(qe.execSelect());\n\t\t\n\t\tArrayList<Pair> propertylist = new ArrayList<>();\n\t\t\n\t\twhile (results.hasNext()) {\n\t\t\tQuerySolution querySolution = (QuerySolution) results.next();\n\t\t\t\n\t\t\tRDFNode property = querySolution.get(\"p\");\n\t\t\tRDFNode value = querySolution.get(\"o\");\n\t\t\t\n\t\t\tString propertyString = property.toString();\n\t\t\tpropertyString = new StringBuilder(propertyString).reverse().toString();\n\t\t\t\n\t\t\tString regEx = \"(.*?)/(.*?)$\";\n\t\t\tPattern pattern = Pattern.compile(regEx);\n\t\t\tMatcher matcher = pattern.matcher(propertyString);\n\t\t\t\n\t\t\twhile (matcher.find()) {\n\t\t\t\tpropertyString = matcher.group(1);\n\t\t\t\tpropertyString = new StringBuilder(propertyString).reverse().toString();\n\t\t\t\t\n\t\t\t\tPair pair = new Pair();\n\t\t\t\tpair.setKey(propertyString);\n\t\t\t\tpair.setValue(value);\n\t\t\t\tpropertylist.add(pair);\n\t\t\t}\n\t\t}\n\t\t\n\t\tqe.close();\n\t\t\n\t\treturn propertylist;\n\t}",
"protected List getProperties() {\n return null;\n }",
"public Map getPartitionRestrictions() {\n\t\t\treturn this.partitionRestrictions;\n\t\t}",
"public Map getPartitionRestrictions() {\n\t\t\treturn this.partitionRestrictions;\n\t\t}",
"@ApiModelProperty(value = \"The customized properties that are present\")\n public List<PropertyDefinitionResource> getProperties() {\n return properties;\n }",
"public ReactorResult<java.lang.String> getAllPartOfSet_as() {\r\n\t\treturn Base.getAll_as(this.model, this.getResource(), PARTOFSET, java.lang.String.class);\r\n\t}",
"@Override\n\t\tpublic Iterable<String> getPropertyKeys() {\n\t\t\treturn null;\n\t\t}",
"public Map<String, String> getAllProperties()\n {\n return _propertyEntries;\n }",
"@Override\r\n public List<Map<String, PrimitiveTypeProvider>> getAll() {\r\n ListenableFuture<PropertiesMessage> future = this.adampro.getProperties(\r\n EntityPropertiesMessage.newBuilder().setEntity(fromBuilder.getEntity()).build());\r\n int count = 1_000;\r\n PropertiesMessage propertiesMessage;\r\n try {\r\n propertiesMessage = future.get();\r\n } catch (InterruptedException | ExecutionException e) {\r\n LOGGER.error(\"error in getAll: {}\", LogHelper.getStackTrace(e));\r\n return new ArrayList<>(0);\r\n }\r\n try {\r\n count = Integer.parseInt(propertiesMessage.getPropertiesMap().get(\"count\"));\r\n } catch (Exception e) {\r\n LOGGER.error(\"error in getAll: {}\", LogHelper.getStackTrace(e));\r\n }\r\n return preview(count);\r\n }",
"public cto.framework.service.schema.Property[] getProperty() {\r\n cto.framework.service.schema.Property[] array = new cto.framework.service.schema.Property[0];\r\n return this._propertyList.toArray(array);\r\n }",
"public Set<Property> getModifiedProperties(HasUuid entity) {\n Set<Property> toReturn = modified.get(entity);\n return toReturn == null ? Collections.<Property> emptySet() : toReturn;\n }",
"@Override\r\n\tpublic List<FicheColisageValue> getAll(){\n\t\t\r\n\t\treturn ficheColisagePersistance.getAll();\r\n\t}",
"@Override\n @NoProxy\n @NoDump\n public List<BwXproperty> getXicalProperties(final String val) {\n List<BwXproperty> res = new ArrayList<>();\n List<BwXproperty> xs = getXproperties();\n if (xs == null) {\n return res;\n }\n\n for (BwXproperty x: xs) {\n if (x == null) {\n continue;\n }\n\n if (x.getName().equals(BwXproperty.bedeworkIcalProp)) {\n List<Xpar> xpars = x.getParameters();\n\n Xpar xp = xpars.get(0);\n if (xp.getName().equals(val)) {\n res.add(x);\n }\n }\n }\n\n return res;\n }",
"public List<IPropertyDescriptor<T>> getProperties();",
"List<SubsetDefinition> getSubsetDefinitionList() {\n return this.userCollection.getSubsetDefinitions();\n }",
"public IProperties getGeneralProperties() {\n return getPropertyGroups().getProperties(PROPGROUP_GENERAL);\n }",
"public abstract Properties getProfileProperties();",
"private Object[] getSamplePropertiesAsArray()\n {\n return (swp.get(0)).getPropertyTypes().toArray();\n\n }",
"default Map<String, Object> getProperties()\r\n {\r\n return emptyMap();\r\n }",
"public final PropertyDescriptor[] getPropertyDescriptors()\n {\n try{\n final PropertyDescriptor[] res={\n prop(\"Color\", \"Color to paint highlight\"),\n prop(\"Size\", \"size to paint highlight (pixels\"),\n };\n return res;\n }\n catch(Exception e)\n {\n MWC.Utilities.Errors.Trace.trace(e);\n return super.getPropertyDescriptors();\n }\n\n }",
"public ConstantProduct setConstProperty(String constProperty) {\n this.constProperty = constProperty;\n return this;\n }",
"@Override\n\tpublic List<XSOntDataProperty> getSuperProperties() {\n\t\treturn new ArrayList<XSOntDataProperty>();\n\t}",
"public Hashtable getProperties() {\n PropertyHelper ph = PropertyHelper.getPropertyHelper(this);\n return ph.getProperties();\n }",
"public static Set<OntProperty> listRestrictedProperties(String classUri) throws SADIException\n\t{\n\t\t// TODO do we need more reasoning here?\n\t\tOntModel model = ModelFactory.createOntologyModel( OntModelSpec.OWL_MEM_MICRO_RULE_INF );\n\t\tOntClass clazz = getOntClassWithLoad( model, classUri );\n\t\treturn listRestrictedProperties( clazz );\n\t}",
"public HasDisplayableProperties getProperties();",
"public Set<ConfigMapDTO> getMapProperties() {\n \t\treturn new HashSet<ConfigMapDTO>(mapProperties.values());\n \t}",
"@Override\n public ConfigurablePropertyMap getProperties() {\n return properties;\n }",
"com.google.protobuf.ByteString\n getPropertiesBytes();",
"com.google.protobuf.ByteString\n getPropertyBytes();",
"public Set<String> getDeclaredProperties() {\n \t\tfinal Set<String> ret = new HashSet<String>();\n \t\tret.addAll(complexProperties.keySet());\n \t\tret.addAll(simpleProperties.keySet());\n \t\tret.addAll(listProperties.keySet());\n \t\tret.addAll(setProperties.keySet());\n \t\tret.addAll(mapProperties.keySet());\n \t\treturn ret;\n \t}",
"@Override\n public PropertyDescriptor[] getPropertyDescriptors() {\n return getPdescriptor();\n }",
"@Override\n public String[] getPropertyNames() {\n final String[] names = new String[this.properties.size()];\n this.properties.keySet().toArray(names);\n return names;\n }"
] | [
"0.60343444",
"0.600641",
"0.5951862",
"0.58621067",
"0.57352203",
"0.5678776",
"0.56591004",
"0.56421304",
"0.56362534",
"0.55833143",
"0.55748093",
"0.55431986",
"0.554232",
"0.5541729",
"0.5532643",
"0.5507835",
"0.545824",
"0.54257625",
"0.54206467",
"0.539816",
"0.53942895",
"0.5383979",
"0.53609985",
"0.5340277",
"0.53280383",
"0.5325731",
"0.5275217",
"0.5270937",
"0.5260905",
"0.5235179",
"0.5233316",
"0.52318496",
"0.51824445",
"0.51753485",
"0.5168734",
"0.5162543",
"0.5160053",
"0.51458937",
"0.5139106",
"0.5122964",
"0.5121305",
"0.5119356",
"0.51038545",
"0.5087666",
"0.5087291",
"0.50843495",
"0.50809824",
"0.5077934",
"0.5067921",
"0.5051743",
"0.50515133",
"0.504848",
"0.50482637",
"0.5046777",
"0.50461584",
"0.5044652",
"0.5036644",
"0.5035483",
"0.50323",
"0.50323",
"0.5024427",
"0.5017985",
"0.50149435",
"0.5014331",
"0.5006346",
"0.49886787",
"0.4978844",
"0.49759212",
"0.49663126",
"0.4965732",
"0.49651408",
"0.49651408",
"0.49592355",
"0.4954112",
"0.49536538",
"0.49530306",
"0.49527952",
"0.4950316",
"0.49502897",
"0.4947943",
"0.49443412",
"0.4941659",
"0.49396187",
"0.49395126",
"0.4926578",
"0.49249256",
"0.4924218",
"0.4923836",
"0.4915722",
"0.49131775",
"0.49097487",
"0.49060157",
"0.49027574",
"0.49008623",
"0.48991477",
"0.4896875",
"0.4894903",
"0.4891539",
"0.48841825",
"0.4883777"
] | 0.58913034 | 3 |
Returns the configured URL prefix for rendering absolute URLs with HTTP protocol. | public String getUrlPrefix() {
return urlPrefix;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String getUrlPrefix() {\r\n\t\treturn urlPrefix;\r\n\t}",
"private String getUrlPrefix(HttpServletRequest req) {\n StringBuffer url = new StringBuffer();\n String scheme = req.getScheme();\n int port = req.getServerPort();\n url.append(scheme);\t\t// http, https\n url.append(\"://\");\n url.append(req.getServerName());\n if ((scheme.equals(\"http\") && port != 80)\n \t || (scheme.equals(\"https\") && port != 443)) {\n url.append(':');\n url.append(req.getServerPort());\n }\n return url.toString();\n }",
"String getRootServerBaseUrl();",
"public String getWebappPathPrefix() {\n return webSiteProps.getWebappPathPrefix();\n }",
"public String getBaseUrl() {\n StringBuffer buf = new StringBuffer();\n buf.append(getScheme());\n buf.append(\"://\");\n buf.append(getServerName());\n if ((isSecure() && getServerPort() != 443) ||\n getServerPort() != 80) {\n buf.append(\":\");\n buf.append(getServerPort());\n }\n return buf.toString();\n }",
"private String getUrlBaseForLocalServer() {\n\t HttpServletRequest request = ((ServletRequestAttributes) \n\t\t\t RequestContextHolder.getRequestAttributes()).getRequest();\n\t String base = \"http://\" + request.getServerName() + ( \n\t (request.getServerPort() != 80) \n\t \t\t ? \":\" + request.getServerPort() \n\t\t\t\t : \"\");\n\t return base;\n\t}",
"FullUriTemplateString baseUri();",
"public String getFeedPathPrefix();",
"public static String getPrefix() {\n return getConfiguration().getPath(\"General.Prefix\").getString();\n }",
"private String buildUrlPrefix(String hostName, int port, String context, boolean https) {\r\n StringBuilder urlBuilder = new StringBuilder(https ? \"https://\" : \"http://\");\r\n int standardPort = https ? 443 : 80;\r\n urlBuilder.append(hostName);\r\n if (port != standardPort) {\r\n urlBuilder.append(\":\");\r\n urlBuilder.append(port);\r\n }\r\n urlBuilder.append(context);\r\n return urlBuilder.toString();\r\n }",
"public static String getModuleBaseUrl(HttpServletRequest request) {\n\t String requestedUri = request.getRequestURI();\n\t int contextEnd = request.getContextPath().length();\n\t int folderEnd = requestedUri.lastIndexOf('/') + 1;\n\t return requestedUri.substring(contextEnd, folderEnd);\n\t }",
"private String getURL() {\n String url = profileLocation.getText().toString();\n if (url == null || url.length() == 0) {\n return url;\n }\n // if it's not the last (which should be \"Raw\") choice, we'll use the prefix\n if (!url.contains(\"://\")) { // if there is no (http|jr):// prefix, we'll assume it's a http://bit.ly/ URL\n url = \"http://bit.ly/\" + url;\n }\n return url;\n }",
"public static String getBaseUrl(HttpServletRequest request) {\n\t\tif ((request.getServerPort() == 80) || (request.getServerPort() == 443))\n\t\t{\n\t\t\treturn request.getScheme() + \"://\" + request.getServerName();\t\n\t\t}\n\t\telse\n\t\t{\n\n\t\t\treturn request.getScheme() + \"://\" + request.getServerName() + \":\" + request.getServerPort();\n\t\t}\n\t}",
"public abstract String getBaseURL();",
"public String getPrefix() {\n return getPrefix(portletID.getPortletApplicationName(), portletID.getPortletName());\n }",
"public String appBaseUrl() {\n int amtToTrim = request.getServletPath().length() + request.getPathInfo().length();\n String appBase = requestURL.substring(0, requestURL.length()-amtToTrim);\n return appBase;\n }",
"String getServerBaseURL();",
"public boolean isWebappPathPrefixUrlBuild() {\n return webSiteProps.isWebappPathPrefixUrlBuild();\n }",
"private static String getBaseUrl() {\n StringBuilder url = new StringBuilder();\n url.append(getProtocol());\n url.append(getHost());\n url.append(getPort());\n url.append(getVersion());\n url.append(getService());\n Log.d(TAG, \"url_base: \" + url.toString());\n return url.toString();\n }",
"public String getFrontEndAddress() {\n //TODO(alown): should this really only get the first one?\n return (this.isSSLEnabled ? \"https://\" : \"http://\") + frontendAddressHolder.getAddresses().get(0);\n }",
"protected String getBaseUrl(HttpServletRequest request) {\n\t\tString retVal = \"\";\n\t\tif (request != null && request.getRequestURL() != null) {\n\t\t\tStringBuffer url = request.getRequestURL();\n\t\t\tString uri = request.getRequestURI();\n\t\t\t\n\t\t\tretVal = url.substring(0, url.length() - uri.length());\n\t\t}\n\t\t\n\t\treturn retVal;\n\t}",
"private String getRootUrl() {\n\t\treturn \"http://localhost:\" + port;\n\t}",
"private String getRootUrl() {\n\t\treturn \"http://localhost:\" + port;\n\t}",
"public static String getPrefixRegisterURI() {\n return Registry.get().getBaseURI() + PREFIX_REGISTER;\n }",
"static URITranslator prefix(String source, String target) {\n return new PrefixReplacer(source, target);\n }",
"public String getPrefix() {\n return ChatColor.translateAlternateColorCodes('&', Objects.requireNonNull(this.getConfig().getString(\"config.messages.prefix\")));\n }",
"@Override\r\n public String getRootURI() {\r\n if (rootUri == null) {\r\n final StringBuilder buffer = new StringBuilder();\r\n appendRootUri(buffer, true);\r\n buffer.append(SEPARATOR_CHAR);\r\n rootUri = buffer.toString().intern();\r\n }\r\n return rootUri;\r\n }",
"private String baseUrl() {\n return \"http://\" + xosServerAddress + \":\" +\n Integer.toString(xosServerPort) + XOSLIB + baseUri;\n }",
"public static String getBaseURI() {\n\t\treturn getIP() + \":\" + getPort();\r\n//\t\tURIBuilder builder = new URIBuilder();\r\n//\t\tbuilder.setScheme(\"http\");\r\n//\t\tbuilder.setHost(getIP());\r\n//\t\tbuilder.setPort(Integer.valueOf(getPort()));\r\n//\t\tbuilder.setPath(\"/\"+getVersion());\r\n//\t\treturn builder.toString();\r\n//\t\treturn \"http://\" + getIP() + \":\" + getPort()\r\n//\t\t\t\t+ \"/\"+getVersion();\r\n\t}",
"public void setUrlPrefix(String urlPrefix) {\r\n\t\tthis.urlPrefix = urlPrefix;\r\n\t}",
"public URI getBaseURI() {\n Map<String, String> map = new LinkedHashMap<>();\n map.put(\"xml\", XML_NAMESPACE);\n return getLink(\"/*/@xml:base\", map);\n }",
"public abstract String getPrefix();",
"public URL standardizeURL(URL startingURL);",
"String getBaseUri();",
"public static String getBaseURL()\r\n {\r\n String savedUrl = P.getChoreoServicesUrl();\r\n return savedUrl.length() > 0 ? savedUrl : Config.DEFAULT_SERVER_URL;\r\n }",
"public static String getAppURL(HttpServletRequest request) {\n\t\tStringBuffer url = new StringBuffer();\n\t\tint port = request.getServerPort();\n\t\tif (port < 0) {\n\t\t\tport = 80; // Work around java.net.URL bug\n\t\t}\n\t\tString scheme = request.getScheme();\n\t\turl.append(scheme);\n\t\turl.append(\"://\");\n\t\turl.append(request.getServerName());\n\t\tif ((scheme.equals(\"http\") && (port != 80))\n\t\t\t\t|| (scheme.equals(\"https\") && (port != 443))) {\n\t\t\turl.append(':');\n\t\t\turl.append(port);\n\t\t}\n\t\turl.append(request.getContextPath());\n\t\treturn url.toString();\n\t}",
"public String getFullHost() {\n return \"http://\" + get(HOSTNAME_KEY) + \":\" + get(PORT_KEY) + \"/\" + get(CONTEXT_ROOT_KEY) + \"/\";\n }",
"@Override\n\tprotected String getHttpBaseUrl() {\n\t\treturn this.properties.getHttpUrlBase();\n\t}",
"public static String getBaseUrl() {\r\n if (baseUrl == null) {\r\n baseUrl = Constants.HTTP_PROTOCOL + \"://\" + getBaseHost() + \":\" + getBasePort();\r\n }\r\n return baseUrl;\r\n }",
"String getPrefix();",
"String getPrefix();",
"String getPrefix();",
"String getPrefix();",
"public String getURIDefinition(String prefix) {\n\t\treturn prefixToURIMap.get(prefix);\n\t}",
"public static String getRelativeUrl() {\n return url;\n }",
"public URL makeBase(URL startingURL);",
"public String getURIFromIncludeParent(String prefix) {\n int lastValidContext = fCurrentContext - 1;\n while (lastValidContext > 0 && !fValidContext[lastValidContext]) {\n lastValidContext--;\n }\n return getURI(prefix, lastValidContext);\n }",
"String getServerUrl();",
"public String getUriString() {\n return \"mina:\" + getProtocol() + \":\" + getHost() + \":\" + getPort();\n }",
"public String getPrefix();",
"public String getPrefix();",
"public String getURL()\n {\n return getURL(\"http\");\n }",
"@Override\n public String getUrl() {\n StringBuilder sb = new StringBuilder(baseUrl);\n if (mUrlParams.size() > 0) {\n sb.append(\"?\");\n for (String key : mUrlParams.keySet()) {\n sb.append(key);\n sb.append(\"=\");\n sb.append(mUrlParams.get(key));\n sb.append(\"&\");\n }\n }\n String result = sb.substring(0, sb.length() - 1);\n return result;\n }",
"public String getBaseUrl() {\n return builder.getBaseUrl();\n }",
"public static String getLocalFilePrefix()\r\n/* 186: */ throws IOException\r\n/* 187: */ {\r\n/* 188:155 */ if (CryptoApplet.testMode) {\r\n/* 189:156 */ return \"test-mode-\";\r\n/* 190: */ }\r\n/* 191:158 */ String username = BrowserHandler.getField(BrowserHandler.getUsernameField());\r\n/* 192:159 */ String host = CryptoApplet.getHostname().replaceAll(\"https?://\", \"\").replaceAll(\":\", \"\").replaceAll(\"/\", \"\");\r\n/* 193:160 */ String prefix = username + host;\r\n/* 194:161 */ return prefix + \"-\";\r\n/* 195: */ }",
"public static String getBaseURL() {\n\t\t\n\t\treturn (ZmailURI.getBaseURI().toString());\n\t\t\n\t}",
"public String getServerUri(String namespace);",
"public String url() {\n return server.baseUri().toString();\n }",
"public String getBaseUrl() {\n return preferences.getString(PREFERENCES_BACKEND_BASE_URL, \"http://naamataulu-backend.herokuapp.com/api/v1/\");\n }",
"public String getBaseLinkUrl() {\n return (String) get(\"base_link_url\");\n }",
"public String getServerBase() {\n HttpServletRequest request = FxJsfUtils.getRequest().getRequest();\n return \"http\" + (request.isSecure() ? \"s://\" : \"://\") + FxRequestUtils.getExternalServerName(request);\n }",
"@Override\n public StringBuffer getRequestURL() {\n //StringBuffer requestURL = super.getRequestURL();\n //System.out.println(\"URL: \" + requestURL.toString());\n return this.requestURL;\n }",
"public String getOutputPrefix();",
"@Override\n\tpublic URL getBaseURL() {\n\t\tURL url = null;\n\t\tString buri = getBaseURI();\n\t\tif (buri != null) {\n\t\t\ttry {\n\t\t\t\turl = new URL(buri);\n\t\t\t} catch (MalformedURLException e) {\n\t\t\t\ttry {\n\t\t\t\t\tString docuri = document.getDocumentURI();\n\t\t\t\t\tif (docuri != null) {\n\t\t\t\t\t\tURL context = new URL(docuri);\n\t\t\t\t\t\turl = new URL(context, buri);\n\t\t\t\t\t}\n\t\t\t\t} catch (MalformedURLException e1) {\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn url;\n\t}",
"public final String getPrefix() {\n return properties.get(PREFIX_PROPERTY);\n }",
"public String getServerURI() {\n return settings.getString(\"server_url\", DEFAULT_SERVER_URL);\n }",
"public String getApplicationNamePrefix()\n {\n return applicationNamePrefix;\n }",
"public String getPrefix() {\n return getAsString(\"prefix\");\n }",
"@Nullable\n\tdefault String getUrlSuffix()\n\t{\n\t\treturn null;\n\t}",
"@Override\r\n public String getFriendlyURI() {\r\n return createURI(false, false);\r\n }",
"public String sourceAddressPrefix() {\n return this.sourceAddressPrefix;\n }",
"default HttpUrl getNodeUrl() {\n return HttpUrl.parse(getHost()).newBuilder().port(getPort()).build();\n }",
"public String getBaseUrl()\r\n {\r\n return this.url;\r\n }",
"protected String getAbsoluteURL(HttpServletRequest httpRequest, String url) {\r\n\t\t\r\n\t\tif (url == null)\r\n\t\t\treturn null;\r\n\t\tif (url.indexOf(\"://\") != -1)\t\t\t\r\n\t\t\treturn url;\r\n\r\n\t\tString scheme = httpRequest.getScheme();\r\n\t\tString serverName = httpRequest.getServerName();\r\n\t\tint port = httpRequest.getServerPort();\r\n\t\tboolean slashLeads = url.startsWith(\"/\");\r\n\r\n\t\tString absoluteURL = scheme + \"://\" + serverName;\r\n\t\t\r\n\t\tif ((scheme.equals(\"http\") && port != 80) || \r\n\t\t\t\t(scheme.equals(\"https\") && port != 443))\r\n\t\t\tabsoluteURL += \":\" + port;\r\n\t\tif (!slashLeads)\r\n\t\t\tabsoluteURL += \"/\";\r\n\r\n\t\tabsoluteURL += url;\r\n\t\t\r\n\t\treturn absoluteURL;\r\n\t}",
"public String getHandleServiceBaseUrl();",
"@Override\n\tpublic String getLiuLiangUrl() {\n\t\tLiuLiang_Url = Util.getMaiYuanConfig(\"LiuLiang_Url\");\n\t\treturn LiuLiang_Url;\n\t}",
"String fallbackBaseUrl() {\n return settings.get(FALLBACK_BASE_URL);\n }",
"public String baseUrl() {\n return baseUrl;\n }",
"public String getApplicationURL()\n\t{\n\t\tString url=pro.getProperty(\"baseURL\");\n\t\treturn url;\n\t}",
"public String prefix() {\n return this.prefix;\n }",
"public String prefix()\n\t {\n\t \t// create an empty string builder // \n\t \tStringBuilder sb = new StringBuilder();\n\t \t\n\t \t// fill the string builder//\n\t \tprefix(root, sb);\n\t \t\n\t \treturn sb.toString().trim();\n\t }",
"java.lang.String getUrl();",
"java.lang.String getUrl();",
"java.lang.String getUrl();",
"java.lang.String getUrl();",
"java.lang.String getUrl();",
"java.lang.String getUrl();",
"public String getFeedNamespacePrefix(String namespace);",
"public String getEasyCoopURI() {\r\n String uri = \"\";\r\n\r\n try {\r\n javax.naming.Context ctx = new javax.naming.InitialContext();\r\n uri = (String) ctx.lookup(\"java:comp/env/easycoopbaseurl\");\r\n //BASE_URI = uri; \r\n } catch (NamingException nx) {\r\n System.out.println(\"Error number exception\" + nx.getMessage().toString());\r\n }\r\n\r\n return uri;\r\n }",
"public String getPropertyPrefix();",
"public String getBaseURI(){\r\n\t\t \r\n\t\t String uri = properties.getProperty(\"baseuri\");\r\n\t\t if(uri != null) return uri;\r\n\t\t else throw new RuntimeException(\"baseuri not specified in the configuration.properties file.\");\r\n\t }",
"public UrlBuilder compileBaseUrl(HttpServletRequest request, String repositoryId) {\n String baseUrl = (String) request.getAttribute(Dispatcher.BASE_URL_ATTRIBUTE);\n if (baseUrl != null) {\n int repIdPos = baseUrl.indexOf(REPOSITORY_PLACEHOLDER);\n if (repIdPos < 0) {\n return new UrlBuilder(baseUrl);\n } else {\n return new UrlBuilder(baseUrl.substring(0, repIdPos) + repositoryId\n + baseUrl.substring(repIdPos + REPOSITORY_PLACEHOLDER.length()));\n }\n }\n\n UrlBuilder url = new UrlBuilder(request.getScheme(), request.getServerName(), request.getServerPort(), null);\n\n url.addPath(request.getContextPath());\n url.addPath(request.getServletPath());\n\n if (repositoryId != null) {\n url.addPathSegment(repositoryId);\n }\n\n return url;\n }",
"private String getDefaultNS() {\n\t\treturn model.getNsPrefixURI(\"\");\n\t}",
"public String getBaseUrl() {\n return (String) get(\"base_url\");\n }",
"public String determineURL(HttpServletRequest request)\n {\n String url = \"http://\"+request.getHeader(\"host\")+request.getContextPath()+\"/omserver\";\n return url;\n }",
"@Override\n\tpublic String getUrlName() {\n\t\treturn URL_NAME;\n\t}",
"public String getBaseUri() {\n\t\treturn baseUri;\n\t}",
"public String getBaseURL() {\n\n\t\treturn baseURL;\n\n\t}",
"@Override\n public String getUrl() {\n return getOriginUrl();\n }",
"public static String getRelativeRewriteUrl(String origUrl) {\n\n if (StringUtils.isBlank(origUrl)) {\n return null;\n }\n\n // rewrite after url\n StringBuffer rewriteUrl = new StringBuffer();\n\n //url action part\n String action = origUrl;\n\n //url params part\n String params = null;\n\n if (StringUtils.indexOf(origUrl, '?') != -1) {\n\n String[] urlFragments = StringUtils.split(origUrl, \"?\");\n\n action = urlFragments[0];\n\n if (urlFragments.length > 1) {\n params = urlFragments[1];\n }\n }\n\n //get the action urlmapping\n URLMapping urlMapping = getURLMappingByValue(action, URLMappingEnum.ACTION);\n\n if (urlMapping == null) {\n return origUrl;\n// rewriteUrl.append(action);\n// if (StringUtils.isNotBlank(params)) {\n//\n// rewriteUrl.append(\"?\");\n// rewriteUrl.append(getPrefixRewriteParams(params));\n// }\n } else if (StringUtils.equals(urlMapping.getSplitKey()[2], PREFIX_DEFINITION)) {\n\n rewriteUrl.append(\"/\");\n rewriteUrl.append(urlMapping.getSplitKey()[3]);\n\n if (StringUtils.isNotBlank(params)) {\n\n rewriteUrl.append(\"?\");\n rewriteUrl.append(getPrefixRewriteParams(params));\n }\n } else {\n\n rewriteUrl.append(\"/\");\n rewriteUrl.append(urlMapping.getSplitKey()[2]);\n if (StringUtils.isNotBlank(params)) {\n\n String result = getRewriteParams(params);\n\n if (!StringUtils.startsWith(result, \"?\")) {\n rewriteUrl.append(PARAM_SEPARATOR);\n }\n rewriteUrl.append(getRewriteParams(params));\n }\n }\n\n return rewriteUrl.toString();\n }"
] | [
"0.73179424",
"0.7045767",
"0.61007124",
"0.60982907",
"0.6024325",
"0.600703",
"0.5962315",
"0.59430784",
"0.5937254",
"0.59130377",
"0.5881217",
"0.585574",
"0.5847786",
"0.58290684",
"0.58161336",
"0.5797299",
"0.5793765",
"0.578044",
"0.57756966",
"0.57612133",
"0.57606924",
"0.5753059",
"0.5753059",
"0.5738044",
"0.57199",
"0.5717583",
"0.56861246",
"0.5682624",
"0.56604224",
"0.5658118",
"0.56528574",
"0.56467867",
"0.5635168",
"0.56322265",
"0.5618247",
"0.5607338",
"0.56072885",
"0.5593086",
"0.55872107",
"0.55759376",
"0.55759376",
"0.55759376",
"0.55759376",
"0.55700773",
"0.55493104",
"0.5541483",
"0.5524539",
"0.55087084",
"0.54971296",
"0.5471516",
"0.5471516",
"0.5465684",
"0.5456757",
"0.54062116",
"0.5405586",
"0.53947",
"0.5392997",
"0.53804636",
"0.5361887",
"0.53579396",
"0.5349604",
"0.5345085",
"0.53384966",
"0.5336459",
"0.53326046",
"0.53181624",
"0.53077716",
"0.5297608",
"0.52975774",
"0.5296388",
"0.5294011",
"0.5280008",
"0.52715635",
"0.5267601",
"0.52623963",
"0.525247",
"0.523779",
"0.5235884",
"0.5214718",
"0.52141804",
"0.52128416",
"0.52121586",
"0.52121586",
"0.52121586",
"0.52121586",
"0.52121586",
"0.52121586",
"0.52082807",
"0.5201682",
"0.5188624",
"0.51862764",
"0.51843715",
"0.5173635",
"0.51700395",
"0.5167949",
"0.5163724",
"0.51611114",
"0.516012",
"0.5151636",
"0.51441115"
] | 0.7224346 | 1 |
Returns the virus scanning properties. The returned value is a copy of the properties, thus modifications will not be persisted. | public Properties getVirusScanningProperties() {
// create a subset with all the VirusChecking properties
return getSpecificProperties(ApplicationPropertyVirusScanning.values());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"java.lang.String getProperties();",
"public Map<String, String> getProperties() {\n return properties;\n }",
"public Map<String, String> getDetectionProperties() {\n return detectionProperties;\n }",
"public Map<String, String> getProperties() {\n return properties;\n }",
"public Map<String, String> getProperties() {\n return properties;\n }",
"public int getVirusPPM() {\n return virusPPM;\n }",
"public Map<String, String> getProperties() {\n\t\treturn this.properties;\n\t}",
"public Vector getApplicationProperties() {\n return appProperties;\n }",
"public Map<String, Property> getProperties()\n {\n return properties;\n }",
"public static Properties getProperties() {\r\n return getProperties(false);\r\n }",
"public Map<String, String> getAllProperties()\n {\n return _propertyEntries;\n }",
"Map<String, String> properties();",
"Map<String, String> properties();",
"Properties getProperties();",
"protected java.util.Map getProperties() {\n return properties;\n }",
"public Properties getProperties();",
"public Map<String, String> properties() {\n return this.properties;\n }",
"public Properties getProperties() {\n return properties;\n }",
"public org.LexGrid.commonTypes.Properties getProperties() {\n return properties;\n }",
"public String getSystemProperties() {\n return systemProperties;\n }",
"public Set<String> getRawProperties() {\n return _rawProperties;\n }",
"public Properties getProperties() {\n return properties;\n }",
"public Properties getProperties() {\n\t\treturn this.properties;\n\t}",
"private String getSystemProperties() {\n\t\tStringWriter swriter = new StringWriter();\n\t\tPrintWriter writer = new PrintWriter(swriter);\n\t\twriter.println(\"<html>\");\n\t\twriter.println(\"<head><title>Java Properties</title></head>\");\n\t\twriter.println(\"<body>\");\n\t\twriter.println(\"<pre>\");\n\t\tProperties properties = System.getProperties();\n\t\tproperties.list(writer);\n\t\twriter.println(\"</pre>\");\n\t\twriter.println(\"</body>\");\n\t\twriter.println(\"</html>\");\n\t\twriter.flush();\n\t\treturn swriter.toString();\n\t}",
"Map<String, String> getProperties();",
"Map<String, String> getProperties();",
"public Map<String, Object> getProperties() {\n return properties;\n }",
"public java.util.Map<String,String> getProperties() {\n \n if (properties == null) {\n properties = new java.util.HashMap<String,String>();\n }\n return properties;\n }",
"public HashMap<String, String> getProperties() {\n return (HashMap<String, String>) properties.clone();\n }",
"public Map<String, Object> getProperties() {\n return properties;\n }",
"public Map<String, Object> getProperties() {\n return properties;\n }",
"public Properties getProperties()\n {\n return this.properties;\n }",
"com.google.protobuf.ByteString\n getPropertiesBytes();",
"public Properties getProperties() { return props; }",
"Map<String, Object> properties();",
"com.google.protobuf.ByteString\n getPropertyBytes();",
"public Map getProperties();",
"public Object getProperties() {\n return this.properties;\n }",
"StringMap getProperties();",
"AccountProperties properties();",
"EProperties getProperties();",
"public Hashtable getUserProperties() {\n PropertyHelper ph = PropertyHelper.getPropertyHelper(this);\n return ph.getUserProperties();\n }",
"public Properties getProperty() {\r\n return properties;\r\n }",
"com.google.protobuf.ByteString\n getPropertyBytes();",
"public abstract Properties getProperties();",
"public Properties getProperties() {\n\t\tif (isStale()) {\n\t\t\tlogger.info(\"getProperties: is stale (reloading\");\n\t\t\tload();\n\t\t}\n\t\treturn properties;\n\t}",
"public Map<String, String> getProperties() {\n\t\tif (propertiesReader == null) {\n\t\t\tpropertiesReader = new PropertyFileReader();\n\t\t}\n\t\tpropertyMap = propertiesReader.getPropertyMap();\n\t\tlog.info(\"fetched all properties\");\n\t\treturn propertyMap;\n\t}",
"private ConfigProperties getProperties() {\n return properties;\n }",
"public ArrayList<Property> getProperties() {\r\n\t\ttry {\r\n\t\t\tproperties.clear();\r\n\t\t\tFileInputStream fis = new FileInputStream(PROPERTY_FILEPATH);\r\n \tObjectInputStream ois = new ObjectInputStream(fis);\r\n \t\r\n \tProperty obj = null;\r\n \twhile ((obj=(Property)ois.readObject())!=null) {\r\n \t\tproperties.add(obj);\r\n \t}\r\n \tois.close();\r\n }\r\n\t\tcatch (EOFException e) {\r\n\t\t\tSystem.out.println(\"End of file reached.\");\r\n }\r\n catch (ClassNotFoundException e) {\r\n \te.printStackTrace();\r\n }\r\n catch (IOException e) {\r\n \te.printStackTrace();\r\n }\r\n\t\treturn properties;\r\n\t}",
"public Properties getProperties()\n {\n Properties properties = null;\n List<Props.Entry> props = this.props.getEntry();\n if ( props.size() > 0 )\n {\n properties = new Properties();\n //int size = props.size();\n for ( Props.Entry entry : props )\n {\n String key = entry.getKey();\n String val = entry.getValue();\n properties.setProperty( key, val );\n }\n }\n return properties;\n }",
"public Hashtable getProperties() {\n PropertyHelper ph = PropertyHelper.getPropertyHelper(this);\n return ph.getProperties();\n }",
"@java.lang.Override\n public java.util.Map<java.lang.String, java.lang.String> getPropertiesMap() {\n return internalGetProperties().getMap();\n }",
"Property[] getProperties();",
"@java.lang.Override\n public java.util.Map<java.lang.String, java.lang.String> getPropertiesMap() {\n return internalGetProperties().getMap();\n }",
"public Set getPropertyNames(){\n return this.vendorSpecificProperties;\n }",
"public WebIceProperties getProperties()\n\t{\n\t\treturn config;\n\t}",
"public Properties getProperties() {\n \tProperties p = new Properties(); \n if (charSet != null) {\n \t p.put(\"charSet\",charSet);\n } \n\t\n\tif (user != null) {\n \t p.put(\"user\", user);\n }\n\t\n\tif (password != null) {\n \t p.put(\"password\", password);\n }\n\t\n\tif (url != null){\n\t p.put(\"url\",url);\t\n\t}\t\n\tp.put(\"loginTimeout\",\"\"+loginTimeout);\n \treturn p; \n }",
"public Set<ConfigProperty> values() {\n return new HashSet<>(_properties.values());\n }",
"public Map<String, Object> getProperties() {\n return mProperties;\n }",
"public ArrayList<Property> getPropertyList()\r\n {\r\n return m_values;\r\n }",
"public Map<String, WorldStateProperty> getProperties ()\n\t{\n\t\treturn properties;\n\t}",
"private void getProperties() {\n\t\tProperties menu_properties = new Properties();\n\t\tInputStream input = null;\n\t\ttry {\n\t\t\tinput = new FileInputStream(PROPERTY_FILENAME);\n\t\t\tmenu_properties.load(input);\n\t\t\ttitle = menu_properties.getProperty(TITLE_PROPERTY);\n\t\t\tscreen_width = Integer.parseInt(menu_properties.getProperty(WIDTH_PROPERTY));\n\t\t\tscreen_height = Integer.parseInt(menu_properties.getProperty(HEIGHT_PROPERTY));\n\t\t} catch (IOException ex) {\n\t\t\tSystem.err.println(\"Display file input does not exist!\");\n\t\t} catch (Exception ey) {\n\t\t\tSystem.err.println(\"The properties for the display could not be retrieved completely.\");\n \t} finally {\n \t\tif (input != null) {\n \t\t\ttry {\n \t\t\t\tinput.close();\n \t\t\t} catch (IOException e) {\n \t\t\t\tSystem.err.println(\"Display file input cannot close!\");\n \t\t\t}\n \t\t}\n \t}\n }",
"public abstract Properties getProfileProperties();",
"public static Properties getProperties() {\n\t\tProperties properties = new Properties();\n\t\tproperties.setProperty(\"user\", \"root\");\n\t\tproperties.setProperty(\"password\", \"password1\");\n\t\tproperties.setProperty(\"useSSL\", \"false\");\n\n\t\treturn properties;\n\t}",
"public Dictionary<String, Object> getProperties();",
"public Map<String, Schema> getProperties() {\n\t\treturn properties;\n\t}",
"@IcalProperty(pindex = PropertyInfoIndex.VVOTER,\n vpollProperty = true\n )\n @NoProxy\n public Set<String> getVoters() {\n final List<BwXproperty> props = getXproperties(BwXproperty.pollVoter);\n\n if (Util.isEmpty(props)) {\n return null;\n }\n\n final Set<String> vals = new TreeSet<>();\n\n for (final BwXproperty p: props) {\n vals.add(p.getValue());\n }\n\n return vals;\n }",
"public Map<String, Object> getProperties()\n {\n return m_props;\n }",
"public synchronized Properties getProperties() {\n if (properties != null) {\n return properties;\n }\n Properties p = new Properties();\n if (propertiesFile != null && propertiesFile.isFile()) {\n try (InputStream in = new FileInputStream(propertiesFile)) {\n p.load(in);\n } catch (Exception e) {\n e.printStackTrace();\n // oh well!\n }\n }\n properties = p;\n return p;\n }",
"public Properties getProperties() {\n return this.serverProperties;\n }",
"public Properties getProperties() {\n Properties properties = new Properties();\n properties.setProperty(\"advice\", \"method interceptor\");\n properties.setProperty(\"scope\", \"per-instance\");\n return properties;\n }",
"public Properties getSystemProperties() {\r\n\t\tInputStream in = null;\r\n\t\tProperties p = new Properties();\r\n\t\ttry {\r\n\t\t\tExternalContext ext = FacesContext.getCurrentInstance().getExternalContext();\r\n\t\t\tURL resource = ext.getResource(\"/WEB-INF/classes/system.properties\");\r\n\t\t\tif (resource == null) {\r\n\t\t\t\tlogger.warn(\"No system.properties file found in classpath\");\r\n\t\t\t\treturn p;\r\n\t\t\t}\r\n\t\t\tin = resource.openStream();\r\n\t\t\tp.load(in);\r\n\t\t\treturn p;\r\n\t\t} catch (Exception ex) {\r\n\t\t\tlogger.error(\"Failed to read system properties\", ex);\r\n\t\t\treturn p;\r\n\t\t} finally {\r\n\t\t\tIOUtils.closeQuietly(in);\r\n\t\t}\r\n\t}",
"public List<CarPropertyConfig> getPropertyList() throws CarNotConnectedException {\n return mCarPropertyMgr.getPropertyList(mHvacPropertyIds);\n }",
"public Map<String, Object> getProfileProperties() {\n return profileProperties;\n }",
"public WorkbenchProperties getProperties() {\r\n return properties;\r\n }",
"@SuppressWarnings(\"unchecked\")\n\tpublic Hashtable getProperties() {\n\t\treturn _props;\n\t}",
"public static void viewListAllProperties() {\n\t\tArrayList<Property> prop_list = getRegControl().listOfAllProperties();\r\n\t\t// if the prop_list is empty, print out the warning message and stop the method\r\n\t\tif (prop_list.size() == 0) {\r\n\t\t\tSystem.out.println(\"Property Registry empty; no properties to display\\n\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t// loop through all found properties and print out their toString()\r\n\t\tfor (Property property : prop_list) {\r\n\t\t\tSystem.out.println(property.toString());\r\n\t\t}\r\n\t}",
"public Map getProperties() {\n HttpSession session = (HttpSession) _currentSession.get();\n if (session == null) {\n return new HashMap();\n }\n HashMap properties = new HashMap();\n Enumeration enuAttributes = session.getAttributeNames();\n while (enuAttributes.hasMoreElements()) {\n String nextAttribute = (String) enuAttributes.nextElement();\n Object value = session.getAttribute(nextAttribute);\n properties.put(nextAttribute, value);\n }\n return properties;\n }",
"protected List getProperties() {\n return null;\n }",
"public GameProperty [] getGameProperties() {\n return this.GameProperties;\n }",
"public CommandlineJava.SysProperties getSysProperties() {\r\n return getCommandLine().getSystemProperties();\r\n }",
"public native RecordingEngineProperties getProperties(long nativeHandle);",
"@Override\r\n\tpublic Properties getProperties() {\n\t\treturn null;\r\n\t}",
"@Override\n\t\tpublic Map<String, Object> getAllProperties() {\n\t\t\treturn null;\n\t\t}",
"public String getSystemProperties(String key) {\n // Whether EDGE, UMTS, etc...\n return SystemProperties.get(key);\n }",
"default Map<String, Object> getProperties()\r\n {\r\n return emptyMap();\r\n }",
"public Iterator<String> getUserDefinedProperties();",
"public final List<String> getPropertiesList()\n {\n\n List<String> allProps = new ArrayList<String>();\n Enumeration<?> e = this.fProp.propertyNames();\n\n while (e.hasMoreElements())\n {\n String key = (String) e.nextElement();\n String value = this.fProp.getProperty(key);\n allProps.add(key + \"=\" + value);\n } // end while\n\n Collections.sort(allProps);\n return allProps;\n\n }",
"public Enumeration getPropertyNames() {\r\n return properties.keys();\r\n }",
"public Iterator<String> getProperties() {\n List<String> list = Collections.emptyList();\n return list.iterator();\n }",
"public WebSiteProperties getWebSiteProperties() {\n return webSiteProps;\n }",
"public byte[] getAsBytes () {\r\n\t \r\n\t //code description\r\n\t \r\n\t Properties p = new Properties();\t\r\n\t return this.getAsBytes(p);\r\n\t \r\n }",
"public HashMap<Integer, Object> getEffectProperties( ) {\r\n\r\n return properties;\r\n }",
"Map<String, String> getConfigProperties();",
"@Override\n public ConfigurablePropertyMap getProperties() {\n return properties;\n }",
"CommonProperties getProperties();",
"public static ArrayList<String> listProps(){\n\t\tArrayList<String> props = new ArrayList<>();\n\t\tprops.add( DOCKER_IMG_VERSION );\n\t\tprops.add( SAVE_CONTAINER_ON_EXIT );\n\t\tprops.add( DOCKER_HUB_USER );\n\t\treturn props;\n\t}",
"public static String getConfigValues(String sProperty) {\n\t\tString sValue = \"\";\n\t\tInputStream input = null;\n\t\ttry {\n\t\t\tProperties prop = new Properties();\n\t\t\tinput = new FileInputStream(System.getProperty(\"user.dir\")\n\t\t\t\t\t+ \"\\\\Config\\\\Config\" + \".properties\");\n\t\t\tprop.load(input);\n\t\t\tsValue = prop.getProperty(sProperty);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn sValue;\n\t}",
"@Kroll.getProperty(name = \"properties\")\n public KrollDict getRevisionProperties() {\n return super.getRevisionProperties();\n }",
"public File getPropertiesFile() {\n return propertiesFile;\n }"
] | [
"0.60256946",
"0.59770906",
"0.59308785",
"0.5925887",
"0.5925887",
"0.5914068",
"0.5896115",
"0.58655375",
"0.5855976",
"0.58487767",
"0.5835674",
"0.58201617",
"0.58201617",
"0.581025",
"0.58029425",
"0.5777645",
"0.57764506",
"0.5776265",
"0.5761715",
"0.5759901",
"0.5755098",
"0.5754317",
"0.57485783",
"0.57343745",
"0.5729592",
"0.5729592",
"0.57214504",
"0.57190055",
"0.5681186",
"0.56785774",
"0.56785774",
"0.56564754",
"0.5624774",
"0.56027126",
"0.553377",
"0.55261374",
"0.55222315",
"0.55059034",
"0.5503161",
"0.5495176",
"0.54737085",
"0.54736084",
"0.54549557",
"0.5453672",
"0.5444284",
"0.5444001",
"0.5438842",
"0.543788",
"0.54273605",
"0.5421017",
"0.5414097",
"0.5407957",
"0.54053783",
"0.5394752",
"0.5390938",
"0.5376717",
"0.537647",
"0.53729147",
"0.53588545",
"0.5356266",
"0.535079",
"0.5330501",
"0.5329554",
"0.53150666",
"0.5308901",
"0.5303721",
"0.530091",
"0.5299422",
"0.52963305",
"0.5294464",
"0.52786285",
"0.5277422",
"0.5270509",
"0.52645564",
"0.52548593",
"0.52477324",
"0.5238233",
"0.52300936",
"0.5222379",
"0.5220529",
"0.5208668",
"0.52049357",
"0.5196452",
"0.51832265",
"0.51825994",
"0.51817346",
"0.5181162",
"0.5179741",
"0.51689893",
"0.5163938",
"0.51604056",
"0.51592803",
"0.51573235",
"0.5152226",
"0.5143107",
"0.5139586",
"0.5136475",
"0.51290774",
"0.51101434",
"0.51090664"
] | 0.86557966 | 0 |
Returns the value of the 'Id Num' attribute. If the meaning of the 'Id Num' attribute isn't clear, there really should be more of a description here... | int getIdNum(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int getNumID() {\n return numID;\n }",
"String getIdNumber();",
"public String getIdNumber() {\n return idNumber;\n }",
"public String getId_number() {\n return id_number;\n }",
"public String getIdNo() {\n return idNo;\n }",
"public String getIdNo() {\n return idNo;\n }",
"public int id() {\n return _num;\n }",
"public java.lang.String getID_NO() {\r\n return ID_NO;\r\n }",
"public int getidnumber() {\r\n return idnumber;\r\n }",
"@Override\n\tpublic Number getId() {\n\t\treturn this.id;\n\t}",
"public java.lang.String getIDNumber() {\n return IDNumber;\n }",
"public Integer getnId() {\n return nId;\n }",
"public String getNumeroId() {\r\n return NumeroId;\r\n }",
"private long getIDnumber() {\n\t\treturn IDnumber;\n\t}",
"public int getID() {\r\n\t\treturn idNumber;\r\n\t}",
"public String getIdentNo() {\n return identNo;\n }",
"public String getNum() {\r\n return num;\r\n }",
"public int getId()\n {\n return m_nId;\n }",
"public int getNum() { return Num;}",
"public String getNum() {\n return num;\n }",
"public String getNum() {\n return num;\n }",
"public static int getIdNumber() {\n return idNumber;\n }",
"public int getId() {\n\t\treturn Integer.parseInt(Id);\n\t}",
"public Number getID();",
"public int getId(){\n if (ID != null) {\n int i = Integer.parseInt(ID);\n return i;\n }\n return 0;\n }",
"public String getId()\r\n {\r\n return getAttribute(\"id\");\r\n }",
"public int charNum() {\n return myId.charNum();\n }",
"public int getNum() {\n return this.num;\n }",
"public long getId()\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(ID$6);\n if (target == null)\n {\n return 0L;\n }\n return target.getLongValue();\n }\n }",
"public String getCellIdProperty() {\r\n return getAttributeAsString(\"cellIdProperty\");\r\n }",
"public int getNum() {\n\treturn this.n;\n }",
"public BigDecimal getId() {\n return (BigDecimal) getAttributeInternal(ID);\n }",
"public int getNum() {\n\t\treturn num;\n\t}",
"public final int getId() {\n\t\treturn this.accessor.getId();\n\t}",
"@XmlAttribute\n\tpublic Long getId() {\n\t\treturn id;\n\t}",
"public int getNum() {\r\n return num;\r\n }",
"public int numericName()\n {\n return Factory.getID(this);\n }",
"@Override\n public int intValue(int numId) {\n return 0;\n }",
"public Integer getAttrId() {\n return attrId;\n }",
"public Integer getNum() {\n return num;\n }",
"public Integer getNum() {\n return num;\n }",
"public long getnNum() {\n return nNum;\n }",
"public int getID() {\r\n // Bouml preserved body begin 00040D02\r\n\t System.out.println(ID);\r\n\t return ID;\r\n // Bouml preserved body end 00040D02\r\n }",
"public int getNum()\n {\n return num;\n }",
"public int getNum()\n {\n return num;\n }",
"public String getId()\r\n\t{\n\t\treturn id.substring(2, 5);\r\n\t}",
"public String getNumber() {\n\t\treturn getValue(\"number\");\n\t}",
"public final String getIdAttribute() {\n return getAttributeValue(\"id\");\n }",
"public Number getDetailId() {\n return (Number)getAttributeInternal(DETAILID);\n }",
"public long getID()\n {\n return m_nID;\n }",
"public Number getDotaId() {\n return (Number)getAttributeInternal(DOTAID);\n }",
"public StringWithCustomFacts getRecIdNumber() {\n return recIdNumber;\n }",
"public int getIdentificationNumber() {\n return identificationNumber;\n }",
"public Number getMemArtId() {\n return (Number) getAttributeInternal(MEMARTID);\n }",
"public String getIdentificationNumber() {\n return this.identificationNumber;\n }",
"public String getNtnNo() {\n return (String)getAttributeInternal(NTNNO);\n }",
"@Override\r\n\tpublic int getID() {\n\t\treturn jID()*100+ID();\r\n\t}",
"public int getId() {\n\t\treturn this.data.getId();\n\t}",
"public int getNumber() {\n\t\t\n\t\treturn number;\n\t}",
"public Integer getId() {\n return (Integer) get(0);\n }",
"public int getNumber() {\n return field.getNumber();\n }",
"@Override\n public double numValue(int numId) {\n return 0;\n }",
"public int getId() {\n\t\t\treturn 0;\n\t\t}",
"public String getIdAttribute() {\n return idAttribute;\n }",
"@Override\r\n public final Integer getIdentifier() {\r\n return getIdent();\r\n }",
"public int getNum();",
"public long getaNum() {\n return aNum;\n }",
"public java.lang.Integer getId () {\n\t\treturn _id;\n\t}",
"public int getNumber() {\n\t\treturn 666;\n\t}",
"@DISPID(-2147417087)\n @PropGet\n java.lang.Object recordNumber();",
"public String getPropertyID()\n {\n String v = (String)this.getFieldValue(FLD_propertyID);\n return StringTools.trim(v);\n }",
"public String getNumber() {\r\n\t\treturn number;\r\n\t}",
"public java.lang.Integer getNum () {\r\n\t\treturn num;\r\n\t}",
"public String getTxtID() {\n return txtId.getText();\n }",
"@Override\n\tpublic double getId()\n\t{\n\t\treturn id;\n\t}",
"public YangString getPlmnIdValue() throws JNCException {\n return (YangString)getValue(\"plmn-id\");\n }",
"public String getId() {\n return (String)getAttributeInternal(ID);\n }",
"public String getId() {\n return (String)getAttributeInternal(ID);\n }",
"public String getNumber() {\n return this.mNumber;\n }",
"public String getNumber() \n\t{\n\t\treturn this.number;\n\t}",
"public Number getDocId() {\n return (Number)getAttributeInternal(DOCID);\n }",
"public Number getDocId() {\n return (Number)getAttributeInternal(DOCID);\n }",
"String getValueId();",
"public java.lang.String getID()\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(ID$24);\n if (target == null)\n {\n return null;\n }\n return target.getStringValue();\n }\n }",
"public int getNumber() {\r\n\t\treturn number;\r\n\t}",
"public int getId() {\n return oid ;\n }",
"public String getIntAttribute13() {\n return (String) getAttributeInternal(INTATTRIBUTE13);\n }",
"public long getId() {\n\t\treturn Long.parseLong(_id);\n\t}",
"public int getIdenti() {\r\n return identi;\r\n }",
"public java.lang.String getID()\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(ID$12);\n if (target == null)\n {\n return null;\n }\n return target.getStringValue();\n }\n }",
"public java.lang.String getID()\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(ID$12);\n if (target == null)\n {\n return null;\n }\n return target.getStringValue();\n }\n }",
"public Number getPersonId() {\n return (Number)getAttributeInternal(PERSONID);\n }",
"public int getNumber() {\n\t\treturn number;\n\t}",
"public int getNumber() {\n\t\treturn number;\n\t}",
"public int getNumber() {\n\t\treturn number;\n\t}",
"public int getNumber() {\n\t\treturn number;\n\t}",
"public long getId() {\n\t\treturn graphicFrame.getNvGraphicFramePr().getCNvPr().getId();\n\t}",
"public String getCustIdNbr()\n\t{\n\t\treturn mCustIdNbr;\t\n\t}",
"public java.lang.Integer getId () {\n\t\treturn id;\n\t}",
"public java.lang.Integer getId () {\n\t\treturn id;\n\t}"
] | [
"0.74138564",
"0.73286533",
"0.7285287",
"0.7271865",
"0.7133293",
"0.7133293",
"0.70987976",
"0.69681036",
"0.6922436",
"0.68903095",
"0.6869866",
"0.6857848",
"0.68524075",
"0.67842716",
"0.67688024",
"0.67560506",
"0.6742132",
"0.6740602",
"0.66853297",
"0.66786623",
"0.66786623",
"0.6644902",
"0.66411096",
"0.66202503",
"0.65669835",
"0.655622",
"0.6554568",
"0.6532408",
"0.6519483",
"0.6510519",
"0.6491094",
"0.64722675",
"0.64551383",
"0.64475787",
"0.6444949",
"0.64441276",
"0.64410615",
"0.6415807",
"0.6415439",
"0.6378024",
"0.6378024",
"0.6376067",
"0.6344668",
"0.6340612",
"0.6340612",
"0.6337687",
"0.6324743",
"0.63094735",
"0.62968487",
"0.62920076",
"0.62827945",
"0.6280317",
"0.62718904",
"0.6267214",
"0.62647855",
"0.62595755",
"0.6251766",
"0.624638",
"0.62374383",
"0.6236812",
"0.6233819",
"0.6231981",
"0.6214832",
"0.62114257",
"0.6209737",
"0.6199276",
"0.6199087",
"0.6193404",
"0.6188729",
"0.61853623",
"0.61740184",
"0.61625296",
"0.61600554",
"0.61550206",
"0.61475694",
"0.61470366",
"0.6145053",
"0.6145053",
"0.61446005",
"0.61388856",
"0.61357504",
"0.61357504",
"0.6134385",
"0.61322606",
"0.61278695",
"0.6126443",
"0.612517",
"0.6125123",
"0.612351",
"0.61204284",
"0.61204284",
"0.61191726",
"0.61190534",
"0.61190534",
"0.61190534",
"0.61190534",
"0.6099268",
"0.6094795",
"0.60897255",
"0.60897255"
] | 0.6797955 | 13 |
Returns the value of the 'Points' attribute. If the meaning of the 'Points' attribute isn't clear, there really should be more of a description here... | int getPoints(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Integer getPoints() {\r\n return points;\r\n }",
"public double getPoints()\r\n {\r\n return points;\r\n }",
"public String getPoints();",
"public java.math.BigDecimal getPoints() {\n return this.points;\n }",
"public int getPoints() {\n\t\treturn points;\n\t}",
"public int getPoints() {\r\n\t\treturn points;\r\n\t}",
"public int getPoints() {\n\t\treturn this.points;\n\t}",
"public int getPoints(){\r\n\t\treturn this.points;\r\n\t}",
"public int getPoints(){\r\n\t\treturn this.points;\r\n\t}",
"public int getPoints() {\n return this.points;\n }",
"public int getPoints() {\r\n\t\treturn this.points;\r\n\r\n\t}",
"@Override\r\n\tpublic int getPoints() {\r\n\t\t// TODO Auto-generated method stub\r\n\t\treturn this.points;\r\n\t}",
"public int getPoints() {\n return points;\n }",
"public int getPoints() {\n return points;\n }",
"public int getPoints() {\n return points;\n }",
"public int getPoints() {\n return points;\n }",
"public int pointValue() {\r\n return pointValue;\r\n }",
"public int getPoints() { return points; }",
"public PointsInfo[] getPointsInfo() {\n return pointsInfo;\n }",
"public Integer getPoint() {\n return point;\n }",
"public double getPoint() {\r\n return point;\r\n }",
"public double getPoint() {\r\n return point;\r\n }",
"public int getPoints();",
"@JsonGetter(\"points\")\r\n public int getPoints() {\r\n return points;\r\n }",
"public Point getPoint(){\n\t\treturn _point;\n\t}",
"public Point getPoint()\n\t{\n\t\treturn point;\n\t}",
"public Point[] getPoints()\n {\n return getPointsForAlignment(this);\n }",
"public int getPoint(){\n return point;\n }",
"public int getPoints() {\n\t\treturn oxygenPoints;\n\t}",
"@ApiModelProperty(value = \"积分\")\n\tpublic Integer getPoint() {\n\t\treturn point;\n\t}",
"public int getVal(){\n\t\treturn pointVal;\n\t}",
"public Point getPoint() {\n return point;\n }",
"public List<Point3D> getPoints() {\n return mPoints;\n }",
"public int getP1Points() {\n return p1Points;\n }",
"public int getPoints() {\r\n\t\treturn levelManager.getPoints();\r\n\t}",
"@Override\n public int getPoints(){\n\n }",
"public Point getPoint() {\n return this.mPoint;\n }",
"public int getPoints()\n {\n return (10000 - this.points);\n }",
"public abstract int getPoints();",
"public int getPointX() {\n return pointX;\n }",
"public String getPointName() {\n return pointName;\n }",
"public Vecteur[] getPoints() {\n Vecteur[] points = {this.OA, this.OB};\n return points;\n }",
"@PropertyMapped\n\tpublic int getPoint() {\n\t\treturn point;\t\t\n\t}",
"public double[] GetPointArray() {\n return PointArray;\n }",
"private int getPoints(final String name) {\n\t\treturn getValue(name, POINTS);\n\t}",
"@NotNull\n public Vector2D[] getPts() {\n return pts;\n }",
"public String getPointCode() {\n return pointCode;\n }",
"public void setPoints(Integer points) {\r\n this.points = points;\r\n }",
"public void setPoints(String points);",
"public Point3D getPoint() {\r\n\t\treturn point;\r\n\t}",
"public Integer getPointId() {\n return pointId;\n }",
"public double getX() {\n\t\treturn point[0];\n\t}",
"public long getPointsTotal()\n {\n return pointsTotal;\n }",
"public String getPointColor()\n {\n return myPointColor;\n }",
"public int getP2Points() {\n return p2Points;\n }",
"public int getNeedPoints() {\n return needPoints_;\n }",
"public int getNeedPoints() {\n return needPoints_;\n }",
"public double getPrayerPoints() {\r\n return prayerPoints;\r\n }",
"public Point2D[] getGivenPoints(){ \n return this.points; \n }",
"public java.lang.Float getPt() {\n return pt;\n }",
"public float getSetpoint() {\r\n return m_setpoint;\r\n }",
"int getNeedPoints();",
"@Override\n\tpublic int getNumberOfPoints()\n\t{\n\t\treturn afXValues.length;\n\t}",
"@java.lang.Override\n public com.google.protobuf.UInt64Value getPointsCount() {\n return pointsCount_ == null ? com.google.protobuf.UInt64Value.getDefaultInstance() : pointsCount_;\n }",
"public float getPointSize()\n {\n return myPointSize;\n }",
"public KDPoint getPoint() {\n\t\treturn new KDPoint(this.loc.lat,this.loc.lng,0.0);\n\t}",
"public double getF_NumOfPoints() {\n return f_numOfPoints;\n }",
"public LiveData<Integer> getPoints() {\n Log.d(\"berttest\", \"getPoints works\");\n return points;\n }",
"public int getPointsHealthy()\n {\n return pointsHealthy;\n }",
"public java.lang.Float getPt() {\n return pt;\n }",
"public int getNbPoints() {\n return nbPoints;\n }",
"final public int getPoints() {\r\n\t\tif (wildcard) {\r\n\t\t\treturn 20;\r\n\t\t}\r\n\t\t\r\n\t\tif (isJoker()) {\t\t\t\r\n\t\t\treturn 50;\r\n\t\t}\r\n\t\t\r\n\t\treturn face;\r\n\t}",
"public Integer getHealthPoints() {\n return healthPoints;\n }",
"public float[] getLocation() {\n return llpoints;\n }",
"private Point[] getPointArray()\n\t{\n\t\treturn this.pointArray; // This should probably be a copy, to maintain security (?)\n\t}",
"public String getPointsData() {\n\t\t\tStringBuilder pointsString = new StringBuilder(\"[\");\n\n\t\t\ttry {\n\t\t\t\tCursor pointsCursor = dbHandler\n\t\t\t\t\t\t.getEveryLatLong(Main.logged_user);\n\n\t\t\t\tif (pointsCursor != null) {\n\n\t\t\t\t\tif (pointsCursor.moveToFirst()) {\n\t\t\t\t\t\twhile (!pointsCursor.isAfterLast()) {\n\t\t\t\t\t\t\tpointsString.append(String.format(GOOGLE_MAP_POINT,\n\t\t\t\t\t\t\t\t\tpointsCursor.getDouble(LATITUDE),\n\t\t\t\t\t\t\t\t\tpointsCursor.getDouble(LONGITUDE)));\n\n\t\t\t\t\t\t\tpointsCursor.moveToNext();\n\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tpointsCursor.close();\n\t\t\t\t}\n\t\t\t} catch (Exception ex) {\n\t\t\t\tLog.e(LOG_TAB, ex.getMessage());\n\t\t\t\tpointsString.append(\"ERROR_\");\n\t\t\t}\n\n\t\t\tif(pointsString.length() > GOOGLE_MAP_POINT.length())\n\t\t\t\treturn pointsString.substring(0, pointsString.length() - 1) + \"]\";\n\t\t\telse\n\t\t\t\treturn \"NODATA\";\n\t\t}",
"public String getPointDescribe() {\n return pointDescribe;\n }",
"public java.util.List[] getPointArray()\n {\n synchronized (monitor())\n {\n check_orphaned();\n java.util.List targetList = new java.util.ArrayList();\n get_store().find_all_element_users(POINT$0, targetList);\n java.util.List[] result = new java.util.List[targetList.size()];\n for (int i = 0, len = targetList.size() ; i < len ; i++)\n result[i] = ((org.apache.xmlbeans.SimpleValue)targetList.get(i)).getListValue();\n return result;\n }\n }",
"public int getUsedPoints() {\n return usedPoints_;\n }",
"public int getUsedPoints() {\n return usedPoints_;\n }",
"public int getUsedPoints() {\n return usedPoints_;\n }",
"java.util.List<com.google.ads.googleads.v6.common.CpvBidSimulationPoint> \n getPointsList();",
"public int getNPoints() {\n\t\treturn points.size();\n\t}",
"public int getUsedPoints() {\n return usedPoints_;\n }",
"public int getUsedPoints() {\n return usedPoints_;\n }",
"public int getUsedPoints() {\n return usedPoints_;\n }",
"@Override\r\n\t\tpublic Geom_element getGeom() {\n\t\t\treturn this.point;\r\n\t\t}",
"Float getTotalPoints();",
"public List<Integer> getPointIndex() {\n\t\treturn pointIndex;\n\t}",
"public final int getHitPoints () {\n return this.currentHitPoints;\n }",
"public double GetSetpoint() {\n\t\treturn msc.GetSetpoint();\n\t}",
"public void setPoints(int points) {\n this.points = points;\n }",
"public int getPointCount() {\n return(_pts.length);\n }",
"public int getXPoint() {\r\n return this.x;\r\n }",
"public Map<String, String> getPointBindings() {\n return pointBindings;\n }",
"public ArrayList<Point> getAllPoints() {\n return allPoints;\n }",
"public Point getPos() {\n return this.pos;\n }",
"public Point getPointA() {\n return pointA;\n }",
"public int getScorePoints() {\n/* 75 */ return this.scorePoints;\n/* */ }",
"public int getHitPoints() {\n return hitPoints;\n }"
] | [
"0.7998161",
"0.7881276",
"0.77689683",
"0.7659951",
"0.7620913",
"0.7609704",
"0.7572933",
"0.7559844",
"0.7559844",
"0.75488526",
"0.75265235",
"0.7524974",
"0.7522339",
"0.7522339",
"0.7522339",
"0.7522339",
"0.749544",
"0.7494406",
"0.7438796",
"0.742668",
"0.73183006",
"0.73183006",
"0.7182399",
"0.70764446",
"0.69135237",
"0.6905977",
"0.6896957",
"0.68933874",
"0.6891648",
"0.68892854",
"0.68877584",
"0.6881875",
"0.6881522",
"0.6854377",
"0.68495744",
"0.68449754",
"0.6792131",
"0.66741437",
"0.6672613",
"0.66644394",
"0.6625313",
"0.66061205",
"0.6598739",
"0.6585141",
"0.6549197",
"0.64928365",
"0.6486149",
"0.644701",
"0.64401305",
"0.6395825",
"0.6376817",
"0.6371752",
"0.6364556",
"0.6364169",
"0.63550174",
"0.6354678",
"0.63435876",
"0.6325702",
"0.6323206",
"0.6321966",
"0.63064057",
"0.62798566",
"0.62752664",
"0.6267557",
"0.6261764",
"0.62606263",
"0.6253833",
"0.6243556",
"0.62400925",
"0.6238905",
"0.6212259",
"0.6198481",
"0.6197448",
"0.61939037",
"0.618893",
"0.6166444",
"0.61637664",
"0.6163539",
"0.6159212",
"0.6159212",
"0.6159212",
"0.6149251",
"0.61453205",
"0.6143897",
"0.6143897",
"0.6143897",
"0.61436325",
"0.61348814",
"0.61323583",
"0.6123407",
"0.6122261",
"0.61134297",
"0.6099338",
"0.60913396",
"0.60908383",
"0.60892344",
"0.607539",
"0.6064534",
"0.60601395",
"0.605762"
] | 0.7000165 | 24 |
Initializing the page method | public WorkflowsPage () {
PageFactory.initElements(driver, this);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public ProcessPage() {\n\t\tPageFactory.initElements(driver, this);\n\t\t \n\n\t}",
"public HomePage() { \n\t\t\tPageFactory.initElements(driver, this);\n\t\t}",
"public HomePage(){\n\t\t\tPageFactory.initElements(driver, this); \n\t\t}",
"protected void init() {\n PageFactory.initElements(webDriver, this);\n }",
"public HomePage() \r\n\t{\r\n\t\tPageFactory.initElements(driver, this);\r\n\t\t\r\n\t}",
"public HomePage(){\n PageFactory.initElements(driver, this);\n }",
"public HomePage(){\r\n\t\tPageFactory.initElements(driver, this);\r\n\r\n\r\n\t}",
"public HomePage(){\r\n\tPageFactory.initElements(driver, this);\t\r\n\t}",
"public HomePage(){\n\t\tPageFactory.initElements(driver, this);\n\t}",
"@Override\n protected void init(PageDto page, HttpServletRequest request, HttpServletResponse response, Model model) {\n\n }",
"public HomePage() {\n \t\tPageFactory.initElements(driver, this);\n \t}",
"protected void doAdditionalPageInitialization(IPage page) {\n }",
"public HomePage() {\r\n\t\tPageFactory.initElements(driver, this);\r\n\t}",
"private void initPages() {\n\t\tloginPage = new LoginPage(driver);\n\t\tflipkart = new FlipkartPage(driver);\n\t\t\n\t}",
"public HomePage() {\n\t\t\tPageFactory.initElements(driver, this);\n\t\t}",
"public HomePage() {\n\t\tPageFactory.initElements(driver, this);\n\t}",
"public HomePage() {\n\t\tPageFactory.initElements(driver, this);\n\t}",
"public HomePage() {\n\t\tPageFactory.initElements(driver, this);\n\t}",
"public HomePage() {\n\t\tPageFactory.initElements(driver, this);\n\t}",
"public SettingPage() {\n\t\tPageFactory.initElements(driver, this);\t\t\n\t}",
"public UserPage()\n\t{\n\t\tPageFactory.initElements(driver, this);\n\t}",
"public void init() {\n\t\tfor(int i = 0; i < 5; i++) {\n\t\t\tpageLists.add(new Page(i));\n\t\t}\n\t}",
"public Page() {\n PageFactory.initElements(getDriver(), this); //snippet to use for @FindBy\n }",
"public PersonalPage() {\n\t\tPageFactory.initElements(driver, this);\n\t}",
"public HomePage() {\n\t\tPageFactory.initElements(driver, this);\n\t\t\n\t}",
"public StartPage() {\n initComponents();\n \n }",
"public BasePageObject() {\n this.driver = BrowserManager.getInstance().getDriver();\n this.wait = BrowserManager.getInstance().getWait();\n PageFactory.initElements(driver, this);\n }",
"public HeaderSettingsPage()\n {\n initialize();\n }",
"public SearchPage() {\n\t\tPageFactory.initElements(driver, this);\n\t\t\n\t}",
"public ContactPage() {\n\t\t\t\n\t\t\t\tPageFactory.initElements(driver, this);\n\t\t\t}",
"public LoginPage()\r\n\t{\r\n\t\tPageFactory.initElements(driver,this);\r\n\t}",
"private void init() {\n setPageTransformer(true, new VerticalPageTransformer());\n setOverScrollMode(OVER_SCROLL_NEVER);\n }",
"private void init() {\n CycleViewPage page = (CycleViewPage) findViewById(R.id.main_view_page);\n page.setAdapter(new InfiniteImageAdapter(createImages()));\n page.setCurrentItem(Integer.MAX_VALUE / 2);\n page.setCycleSwitch(true);\n }",
"public LoginPage(){\n PageFactory.initElements(driver, this); //all vars in this class will be init with this driver\n }",
"public MainPage() {\n initComponents();\n \n initPage();\n }",
"public TreinamentoPage() {\r\n\t\tPageFactory.initElements(TestRule.getDriver(), this);\r\n\t}",
"public Loginpage()\n\t{\n\t\tPageFactory.initElements(driver, this);\n\t}",
"public MyProfilePage() {\n\t\tPageFactory.initElements(driver, this);\n\t}",
"@Override\n\tprotected void init() throws Exception {\n\t\toid = getParameter(\"oid\");\n\t\tif (AppUtil.isEmpty(oid)) {\n\t\t\toid = getArgument(\"oid\");\n\t\t}\n\t\tif (AppUtil.isEmpty(oid)) {\n\t\t\tsetupNewPage();\n\t\t} else {\n\t\t\tsetupEditPage();\n\t\t}\n\t}",
"private void initialize() {\r\n this.setSize(new Dimension(800,600));\r\n this.setContentPane(getJPanel());\r\n\r\n List<String> title = new ArrayList<String>();\r\n title.add(\"Select\");\r\n title.add(\"Field Id\");\r\n title.add(\"Field Name\");\r\n title.add(\"Field Type\");\r\n title.add(\"Image\");\r\n\r\n List<JComponent> componentList = new ArrayList<JComponent>();\r\n componentList.add(checkInit);\r\n componentList.add(fieldIdInit);\r\n componentList.add(filedNameInit);\r\n componentList.add(fieldTypeInit);\r\n componentList.add(imageButton);\r\n\r\n String []arrColumn = {\"SELECT\", \"FIELD_ID\", \"FIELD_NAME\", \"FIELD_TYPE\", \"FIELD_VALUE\"};\r\n String []arrTitle = {\"SELECT\", \"FIELD_ID\", \"FIELD_NAME\", \"FIELD_TYPE\", \"FIELD_VALUE\"};\r\n // init grid\r\n grid = new GridUtils(pageSheet, title, componentList, arrColumn, preButton, afterButton, 5, arrTitle);\r\n // set title\r\n grid.setPageInfo(pageInfoLbl);\r\n \r\n searchDetailList();\r\n \r\n initComboBox();\r\n \r\n setTitle(\"Page Select page\");\r\n\t}",
"public RegistrationPage() {\t\t\r\n\t\tdriver = DriverManager.getThreadSafeDriver();\r\n\t\tPageFactory.initElements(driver, this);\r\n\t}",
"public ContactsPage() {\n\t\tPageFactory.initElements(driver, this);\n\t}",
"public LandRYSettingPage() {\n initComponents();\n }",
"public DocsAppHomePO ()\n\t{\n\t\tPageFactory.initElements(driver, this);\n\t}",
"public LoginPage(){\n\t\tPageFactory.initElements(driver, this);\n\t\t\n\t}",
"public SettingsPage() {\n\t\tPageFactory.initElements(driver, this);\n\t}",
"public LoginPage(){\n\t\tPageFactory.initElements(driver, this);\n\t}",
"public LoginPage()\n{\n\tPageFactory.initElements(driver, this);\n}",
"public HomePageAustria() {\n\t\tPageFactory.initElements(driver, this);\n\t}",
"@Override\n public void PageFistLoad() {\n }",
"public void init(IPageSite pageSite) {\n \t\tsuper.init(pageSite);\n \t}",
"@Override\n\tpublic void init(IPageSite pageSite) {\n\t\tsuper.init(pageSite);\n\t}",
"public CalendarPage() {\n\t\t\n\t\tPageFactory.initElements(driver, this);\n\t}",
"public QualificationsPage(){\n PageFactory.initElements(driver, this);\n }",
"public LoginPage() {\n\t\tPageFactory.initElements(driver, this);\n\t}",
"public LoginPage() {\n\t\tPageFactory.initElements(driver, this);\n\t}",
"public PageUtil() {\n\n\t}",
"public HomePage() {\n initComponents();\n }",
"public HomePage() {\n initComponents();\n }",
"protected void construct()\n\t{\n\t\tassert(driver != null);\n\t\t// V�rification que l'on est bien sur la bonne page\n\t String sTitle = driver.getTitle();\n\t\tif(!sTitle.equals(TITLE)) {\n throw new IllegalStateException(\"This is not Login Page, current page is: \" +driver.getCurrentUrl());\n\t\t}\t\t\n\t\ttbUserName = driver.findElement(ByUserName);\n\t\ttbPassword = driver.findElement(ByPassword);\n\t\tbtnConnect = driver.findElement(ByConnect);\n\t}",
"public Homepage() {\n initComponents();\n }",
"public LoginPage() {\r\n\t\t\t\r\n\t\t\t//Initialize webElements.\r\n\t\t\tPageFactory.initElements(driver, this);\r\n\t\t}",
"@Override\n public void initialize(URL url, ResourceBundle rb) {\n // TODO\n// MemberPageTab.setResizable(false);\n setNull();\n loadDate();\n \n \n \n \n \n \n }",
"public loginPage() {\n\t\tPageFactory.initElements(driver, this);\n\t}",
"@Override\n\tprotected void initOwnPageComponents() {\n\t\tLOG.debug(\"###BtpnBasePage:initPageComponents()====> Start\");\n\t\tsuper.initOwnPageComponents();\n\t\taddSelfCarePageComponents();\n\t\tLOG.debug(\"###BtpnBasePage:initPageComponents()====> End\");\n\t}",
"@Override\n protected void init(VaadinRequest request) {\n\n // html <title> attribute\n getPage().setTitle(\"Patient Management System\");\n\n // instantiate a full screen layout and add it\n VerticalLayout layout = new VerticalLayout();\n layout.setSizeFull();\n setContent(layout);\n\n // header row\n layout.addComponent(getHeader());\n\n // main container\n HorizontalLayout main = getMainContainer();\n layout.addComponent(main);\n layout.setExpandRatio(main, 1.0f); // make main container use all available space\n main.addComponent(getNavigation());\n VerticalLayout canvas = getCanvas();\n main.addComponent(canvas);\n\n // tell the navigation to use\n navigator = new Navigator(this, canvas);\n\n // Assembles all presenters/views and adds them to the navigator\n initializeClasses();\n\n // Navigates to the startpage\n navigator.navigateTo(JournalView.NAME);\n\n }",
"public PIMPage()throws IOException\n\t{\n\t\tPageFactory.initElements(driver,this);\n\t\t\n\t}",
"public NewCZ_DPPHRProcessPage(){ super(); }",
"public GuruDepositPage() {\n\t\tPageFactory.initElements(driver, this);\n\t}",
"@Override\n public void establish() {\n logger.info(\"Opening page {}...\", pageObject);\n initializePage();\n pageObject.open();\n }",
"public TextFieldPage() {\n initView();\n }",
"@Override\n protected void init() {\n REQUEST_PERMISSION_FOR_ACTIVITY = false;\n viewModel.setNavigator(this);\n viewModel.onStart(this);\n binding.welcomePager.setAdapter(adapter);\n\n addDots(0);\n binding.welcomePager.addOnPageChangeListener(viewListener);\n\n// handlingBackground();\n }",
"public HomePageActions() {\n\t\tPageFactory.initElements(driver,HomePageObjects.class);\n\t}",
"private IndexPage initializeTest() {\n Dimension dimension = new Dimension(1920, 1080);\n driver.manage().window().setSize(dimension);\n driver.get(baseUrl);\n indexPage = new IndexPage(driver);\n return indexPage;\n }",
"public MockPageContext() {\n super();\n MockPageContext.init();\n }",
"public PageControl() {}",
"public Page1() {\n initComponents();\n }",
"private LWPageUtilities()\n {\n }",
"@Override\r\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\r\n\t\tsetContentView(new PageWidget(this));\r\n\t}",
"public AdminPage() {\n initComponents();\n }",
"public ifrmHomePage() {\n initComponents();\n }",
"public page1() {\n initComponents();\n }",
"private void init() {\n\t\tinitDesign();\n\t\tinitHandlers();\n\t}",
"public HotelsPage() {\n PageFactory.initElements(driver, this);\n }",
"public void init() {\n\t\t \r\n\t\t }",
"protected void doInit(String titlepageid) {\n if (titlepageid != null) {\n title = titlepageid;\n pageid = titlepageid;\n stringaPageIds = titlepageid;\n domain = this.getDomain();\n super.doInit();\n }// fine del blocco if\n }",
"private void inicialize() {\n\t\t\n\t\t/**\n\t\t * Labels e textField of the page:\n\t\t * Nome\n\t\t * Descrição\n\t\t */\n\n\t\tJLabel lblNome = new JLabel(\"Nome\");\n\t\tlblNome.setBounds(5, 48, 86, 28);\n\t\tlblNome.setFont(new Font(\"Dubai Light\", Font.PLAIN, 13));\n\t\tcontentPanel.add(lblNome);\n\t\t\n\t\tJLabel lblDescricao = new JLabel(\"Descrição\");\n\t\tlblDescricao.setBounds(5, 117, 86, 51);\n\t\tlblDescricao.setFont(new Font(\"Dubai Light\", Font.PLAIN, 13));\n\t\tcontentPanel.add(lblDescricao);\n\t\t\n\t\ttextFieldNome = new JTextField();\n\t\ttextFieldNome.setBounds(103, 45, 290, 35);\n\t\ttextFieldNome.setFont(new Font(\"Dubai Light\", Font.PLAIN, 13));\n\t\ttextFieldNome.setColumns(10);\n\t\tcontentPanel.add(textFieldNome);\n\t\t\n\t\ttextFieldDescricao = new JTextArea();\n\t\ttextFieldDescricao.setBackground(Color.WHITE);\n\t\ttextFieldDescricao.setLineWrap(true);\n\t\ttextFieldDescricao.setBounds(101, 118, 290, 193);\n\t\ttextFieldDescricao.setFont(new Font(\"Dubai Light\", Font.PLAIN, 13));\n\t\ttextFieldDescricao.setColumns(10);\n\t\tcontentPanel.add(textFieldDescricao);\n\n\t\t/**\n\t\t * Confirmation panel\n\t\t * Confirmation button\n\t\t * Cancellation button\n\t\t */\n\n\t\tpainelConfirmacaoSetup();\n\t}",
"@Override\r\n\tprotected void init() {\r\n\t\tsuper.init();\r\n\t\tauthorize();\r\n\t\tgetDebugSettings().setOutputComponentPath(true);\r\n\t\tgetDebugSettings().setAjaxDebugModeEnabled(false);\r\n\t\t// enable logger\r\n\t\tApplication.get().getRequestLoggerSettings()\r\n\t\t\t\t.setRequestLoggerEnabled(true);\r\n\r\n\t\t// mount pages\r\n\t\tmountPages();\r\n\r\n\t\ttry {\r\n\t\t\tnew com.aspose.cells.License().setLicense(getClass()\r\n\t\t\t\t\t.getClassLoader().getResourceAsStream(\r\n\t\t\t\t\t\t\t\"Aspose.Total.Java.lic\"));\r\n\t\t} catch (Exception e) {\r\n\t\t\t// logger.error(\"Aspose load error.\", e);\r\n\t\t}\r\n\r\n\t}",
"public HomePage (WebDriver driver1)\r\n\t\t\t{\r\n\t\t\t\tPageFactory.initElements(driver1, this);\r\n\t\t\t}",
"@SuppressLint(\"ResourceAsColor\")\n @Override\n protected void onCreate(Bundle arg0) {\n super.onCreate(arg0);\n this.setContentView(R.layout.materialactivity);\n initview();\n loadData(pageNo);\n }",
"private void viewInit() {\n }",
"public PropertyClassificationPage() {\n initComponents();\n }",
"public void init() {\n \n }",
"public void page_Initialize(ActionEvent e) throws Exception\n {\n }",
"@Override\r\n\tprotected void initPage() {\n\t\t\r\n\t\t\r\n\t\tJPanel paneLabel = new JPanel();\r\n\t\t//JPanel panelTabs = new JPanel();\r\n\t\t\r\n\t\t\r\n\t\t//pack.setVisible(false);\r\n\r\n\t\t//setlay out\r\n\t\t//panelTabs.setLayout(new GridLayout(1, 1));\r\n\t\t\r\n\t\t//add label to label panel\r\n\t\tpaneLabel.add(new JLabel(\"Please select Objects To export\"));\r\n\t\t//tabs.setLayout(new GridLayout(1, 1));\r\n\t\t\r\n\t\t//add tabs\r\n\t\ttabs.addTab(\"Packages\", null, pack, \"Packages\");\r\n\t\ttabs.addTab(\"Functions\", null, fun, \"Functions\");\r\n\t\ttabs.addTab(\"Procedures\", null, proc, \"Procedures\");\r\n\t\ttabs.addTab(\"Schemas\", null, sch, \"Schemas\");\r\n\t\t\r\n\t\t\r\n\t\ttabs.setTabPlacement(JTabbedPane.TOP);\r\n\t\t\r\n\t\t//add tabs to tabpanel panel\r\n\t\t//panelTabs.add(tabs);\r\n\t\t\r\n\t\t//add data tables to panels\r\n\t\tpackTbl = new JObjectTable(pack);\r\n\t\tfunTbl = new JObjectTable(fun);\r\n\t\tschTbl = new JObjectTable(sch);\r\n\t\tprocTbl = new JObjectTable(proc);\r\n\t\t\r\n\t\t//set layout\r\n\t\tsetLayout(new GridLayout(1,1));\r\n\t\t\r\n\t\t//add label & tabs to page panel\r\n\t\t//add(paneLabel, BorderLayout.NORTH);\r\n\t\t//add(panelTabs,BorderLayout.CENTER);\r\n\t\tadd(tabs);\r\n\t\t\r\n\t\t//init select all check boxes\r\n\t\tinitChecks();\r\n\t\t\r\n\t\t//add checks to panel\r\n\t\tpack.add(ckPack);\r\n\t\tfun.add(ckFun);\r\n\t\tsch.add(ckSchema);\r\n\t\tproc.add(ckProc);\r\n\t\t\r\n\t}",
"private void initViewPager() {\n }",
"public void init() {\r\n\r\n\t}",
"public void startPage() {\n\t\tthis.dataComposer.startPage();\n\t}",
"@Override\r\n\tpublic void mypage() {\n\t\t\r\n\t}",
"public void initialize() {\n easyButton.setOnMouseClicked(e -> {\n if (e.getButton().equals(MouseButton.PRIMARY)) {\n Generator generator = new NumberGenerator(Difficulty.EASY);\n Main.pushPage(new PronunciationPage(\"Practice - Easy\", generator));\n }\n });\n\n hardButton.setOnMouseClicked(e -> {\n if (e.getButton().equals(MouseButton.PRIMARY)) {\n Generator generator = new NumberGenerator(Difficulty.HARD);\n Main.pushPage(new PronunciationPage(\"Practice - Hard\", generator));\n }\n });\n\n // Disables hard mode if it is not unlocked yet\n hardButton.setDisable(!StatsManager.manager().practiceUnlocked());\n hardLabel.setDisable(!StatsManager.manager().practiceUnlocked());\n }"
] | [
"0.79145867",
"0.7711846",
"0.770841",
"0.7706728",
"0.7688934",
"0.7656744",
"0.7630407",
"0.7614012",
"0.75799876",
"0.7550027",
"0.75032413",
"0.74659497",
"0.74656373",
"0.74585587",
"0.74410474",
"0.7412909",
"0.7412909",
"0.7412909",
"0.7412909",
"0.74021477",
"0.7384758",
"0.7382402",
"0.73624414",
"0.7349862",
"0.7349458",
"0.73303235",
"0.7306231",
"0.72966874",
"0.7252426",
"0.7191906",
"0.7156535",
"0.71547943",
"0.7150145",
"0.7136013",
"0.71332306",
"0.71166563",
"0.70961183",
"0.7077022",
"0.70765173",
"0.70406115",
"0.7032925",
"0.7015429",
"0.7005662",
"0.70047325",
"0.6999646",
"0.6983101",
"0.69816965",
"0.69657093",
"0.69597507",
"0.6939157",
"0.69262904",
"0.6920738",
"0.69121987",
"0.68915755",
"0.68725425",
"0.68725425",
"0.6835374",
"0.6828317",
"0.6828317",
"0.6823809",
"0.68120944",
"0.6811711",
"0.68077534",
"0.68076205",
"0.6796187",
"0.6785611",
"0.6779242",
"0.6769539",
"0.6769477",
"0.6764171",
"0.6750836",
"0.6749017",
"0.67479885",
"0.67454433",
"0.67300755",
"0.67202854",
"0.6717096",
"0.6712446",
"0.6691366",
"0.6688749",
"0.6684418",
"0.6678576",
"0.6670679",
"0.66657346",
"0.66624826",
"0.6652263",
"0.66345036",
"0.6627428",
"0.6621281",
"0.6618878",
"0.66166943",
"0.6605811",
"0.6601004",
"0.6597184",
"0.65834314",
"0.6577185",
"0.65585756",
"0.6551268",
"0.6545562",
"0.65372705"
] | 0.6962075 | 48 |
TODO Autogenerated method stub | @Override
public int setIndividualObjectProPerty(String individualName_1,
String individualName_2, String relation) {
synchronized (token) {
return super.setOWLIndividualObjectProPerty(individualName_1,
individualName_2, relation);
}
} | {
"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 |
processRequest(request, response); / CategoriaDAO categoria = new CategoriaDAOImplementar(); Categoria guardar_cat = new Categoria(); guardar_cat.setNom_categoria("Bebidas Naturales"); guardar_cat.setId_categoria(5); //Modificar la categoria registrada anteriormente. guardar_cat.setEstado_categoria(1); //Estado 1. categoria.guardarCat(guardar_cat); | @Override
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
String status;
Categoria categoria = new Categoria();
//Se efectua el casting o conversión de datos porque lo ingresado en el formulario es texto.
int id_categoria = Integer.parseInt(request.getParameter("id_categoria"));
String nom_categoria = request.getParameter("txtNomCategoria");
int estado_categoria = Integer.parseInt(request.getParameter("txtEstadoCategoria"));
categoria.setId_categoria(id_categoria);
categoria.setNom_categoria(nom_categoria);
categoria.setEstado_categoria(estado_categoria);
CategoriaDAO guardarCategoria = new CategoriaDAOImplementar();
//guardarCategoria.guardarCat(categoria);
//this.listaCategorias(request, response);
boolean resultado = guardarCategoria.guardarCat(categoria);
if(resultado){
HttpSession session = request.getSession(true);
session.setAttribute("lista", guardarCategoria.Listar());
status = "ok";
}else{
status = "err";
}
response.setContentType("text/html;charset=UTF-8");
try (PrintWriter out = response.getWriter()) {
out.print(status);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void guardar(CategoriaArticuloServicio categoriaArticuloServicio)\r\n/* 19: */ {\r\n/* 20:43 */ this.categoriaArticuloServicioDao.guardar(categoriaArticuloServicio);\r\n/* 21: */ }",
"protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n response.setContentType(\"text/html;charset=UTF-8\");\n ejbCategoria = new EJBCategoria();\n if (request.getMethod().equals(\"GET\")) { \n ejbCategoria.getAll();\n request.setAttribute(\"ejbCategoria\", ejbCategoria);\n out.print(ejbCategoria.getListaCategorias().get(0).getNombre());\n request.getRequestDispatcher(\"producto/insert.jsp\").forward(request, response);\n }\n if (request.getMethod().equals(\"POST\")) {\n Integer id=Integer.valueOf(request.getParameter(\"item\"));\n ejbProducto = new EJBProducto();\n ejbCategoria = new EJBCategoria();\n ejbCategoria.getCategoria().setIdCategoria(id);\n ejbCategoria.getCategoria().setNombre(request.getParameter(\"txtcategoria\"));\n ejbProducto.getProducto().setDescripcion(request.getParameter(\"txtdescripcion\"));\n ejbProducto.getProducto().setMarca(request.getParameter(\"txtmarca\"));\n ejbProducto.getProducto().setCategoria(ejbCategoria.getCategoria());\n ejbProducto.getProducto().setPrecio(Double.parseDouble(request.getParameter(\"txtprecio\")));\n ejbProducto.getProducto().setStock(Integer.valueOf(request.getParameter(\"txtstock\")));\n boolean retorno = ejbProducto.insert();\n request.setAttribute(\"resultado\", retorno ? \"Correcto\" : \"Incorrecto\");\n request.getRequestDispatcher(\"producto/resultado.jsp\").forward(request, response);\n }\n }",
"public void crearCategoria(Categoria categoria){\n categoriaRepo.save(categoria); \n }",
"protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n int idProduto;\n JDBCProduto jp = new JDBCProduto();\n JDBCCategoria cp = new JDBCCategoria();\n Produto P = new Produto();\n Categoria cat = new Categoria();\n ProdutosCategorias prodCat = new ProdutosCategorias();\n String msg = \"\";\n String tipo = \"\";\n \n String acao = request.getParameter(\"acao\");\n if (acao.equals(\"salvar\")){\n \n P.setNome(request.getParameter(\"nome\"));\n P.setCodigo(request.getParameter(\"codigo\"));\n P.setDescricao(request.getParameter(\"descricao\"));\n String qtd = request.getParameter(\"quantidade\");\n P.setQuantidade(Integer.parseInt(qtd));\n P.setValor(Double.parseDouble(request.getParameter(\"valor\").replace(\".\", \"\").replace(\",\" , \".\")));\n P.setLocalizacao(request.getParameter(\"localizacao\"));\n \n \n if ( request.getParameter(\"id\").equals(\"0\")) {\n \n idProduto = jp.inserir(P);\n msg = \"inserido\";\n \n prodCat.setIdProduto(idProduto);\n\n String[] c = request.getParameterValues(\"cat[]\");\n \n if (!c.equals(\"\")){\n\n for(int a = 0; a < c.length; a++)\n {\n\n prodCat.setIdCategoria(Integer.parseInt(c[a]));\n\n jp.inserirCategoria(prodCat);\n }\n\n }\n \n \n } else {\n \n P.setID(Integer.parseInt(request.getParameter(\"id\")));\n \n jp.alterar(P);\n msg = \"alterado\";\n jp.excluirCat(P.getID());\n \n prodCat.setIdProduto(P.getID());\n\n String[] c = request.getParameterValues(\"cat[]\");\n\n if (c != null){\n\n for(int a = 0; a < c.length; a++)\n {\n\n prodCat.setIdCategoria(Integer.parseInt(c[a]));\n\n jp.inserirCategoria(prodCat);\n }\n\n } \n \n \n }\n \n \n response.sendRedirect(\"ProdutoServlet?acao=listar&msg=\" + msg);\n }else if(acao.equals(\"novaCat\")){\n \n cat.setDescricao(request.getParameter(\"descricao\"));\n int id = Integer.parseInt(request.getParameter(\"idProduto\"));\n cp.inserir(cat);\n if(id == 0){\n msg = \"catcad\";\n response.sendRedirect(\"ProdutoServlet?acao=novoProduto&msg=\" + msg);\n }else {\n msg = \"catcad\";\n response.sendRedirect(\"ProdutoServlet?acao=editar&id=\"+ id +\"&msg=\" + msg);\n }\n \n }else if (acao.equals(\"novoProduto\")){\n \n List<Categoria> categorias = new ArrayList<>();\n msg = request.getParameter(\"msg\");\n if(msg != null){\n if(msg.equals(\"catcad\")){\n msg = \"Categoria cadastrada com sucesso.\";\n tipo = \"alert-success\";\n request.setAttribute(\"msg\", msg);\n request.setAttribute(\"tipo\", tipo);\n }\n }\n \n categorias = cp.listar();\n request.setAttribute(\"categorias\", categorias);\n request.getRequestDispatcher(\"novoProduto.jsp\").forward(request, response);\n \n }else if (acao.equals(\"listar\")) {\n \n List<Produto> produtos = jp.listar(); \n msg = request.getParameter(\"msg\");\n if(msg != null){\n if(msg.equals(\"alterado\")){\n msg = \"Produto foi alterado com sucesso!\";\n tipo = \"alert-warning\";\n request.setAttribute(\"msg\", msg);\n request.setAttribute(\"tipo\", tipo);\n }else if(msg.equals(\"inserido\")){\n msg = \"Produto foi cadastrado com sucesso!\";\n tipo = \"alert-success\";\n request.setAttribute(\"msg\", msg);\n request.setAttribute(\"tipo\", tipo);\n }else if(msg.equals(\"deletado\")){\n msg = \"Produto foi excluído com sucesso.\";\n tipo = \"alert-danger\";\n request.setAttribute(\"msg\", msg);\n request.setAttribute(\"tipo\", tipo);\n }\n }\n \n request.setAttribute(\"produtos\", produtos);\n request.getRequestDispatcher(\"listaProdutos.jsp\").forward(request, response);\n } else if (acao.equals(\"editar\")) {\n \n int id = Integer.parseInt(request.getParameter(\"id\"));\n \n P = jp.exibir(id);\n msg = request.getParameter(\"msg\");\n if(msg != null){\n if(msg.equals(\"catcad\")){\n msg = \"Categoria cadastrada com sucesso.\";\n tipo = \"alert-success\";\n }\n request.setAttribute(\"msg\", msg);\n request.setAttribute(\"tipo\", tipo);\n }\n \n List<Categoria> categorias = new ArrayList<>();\n \n categorias = cp.listar();\n \n request.setAttribute(\"categorias\", categorias);\n request.setAttribute(\"Produto\", P);\n request.getRequestDispatcher(\"novoProduto.jsp\").forward(request, response);\n } else if (acao.equals(\"deletar\")) {\n \n int id = Integer.parseInt(request.getParameter(\"id\"));\n \n jp.excluirCat(id);\n jp.deletar(id);\n msg = \"deletado\";\n \n response.sendRedirect(\"ProdutoServlet?acao=listar\");\n \n } else if (acao.equals(\"exibir\")) {\n \n int id = Integer.parseInt(request.getParameter(\"id\"));\n \n P = jp.exibir(id);\n \n List<Categoria> categorias = new ArrayList<>();\n \n categorias = cp.listar();\n \n request.setAttribute(\"categorias\", categorias);\n \n \n request.setAttribute(\"Produto\", P);\n \n \n request.getRequestDispatcher(\"exibirProduto.jsp\").forward(request, response);\n }\n \n \n }",
"@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n request.setCharacterEncoding(\"UTF-8\");\r\n String mensagem;\r\n try {\r\n Categoria ct = new Categoria();\r\n if (!request.getParameter(\"idcategoria\").isEmpty()) {\r\n ct.setIdcategoria(Integer.parseInt(request.getParameter(\"idcategoria\")));\r\n }\r\n ct.setNome(request.getParameter(\"nome\"));\r\n CategoriaDAO ctDAO = new CategoriaDAO();\r\n if (ctDAO.gravar(ct)) {\r\n mensagem = \"Categoria gravada com sucesso!\";\r\n } else {\r\n mensagem = \"Erro ao gravar Categoria!\";\r\n }\r\n } catch (Exception e) {\r\n mensagem = \"Erro ao gravar Categoria!\";\r\n System.out.println(\"Erro ao gravar Categoria: \" + e.getMessage());\r\n }\r\n PrintWriter out = response.getWriter();\r\n out.println(\"<script type='text/javascript'>\");\r\n out.println(\"alert('\"+mensagem+\"');\");\r\n out.println(\"location.href='listar_categoria.jsp';\");\r\n out.println(\"</script>\");\r\n }",
"CategoriaDTO insertarCategoria(CategoriaDTO categoria);",
"public void actualizarCategoria(CategoriaDTO categoria);",
"private void insererCategorie(final JSONObject categorie) {\n //preparation du JSON pour le passer dans le corps de la requete HTTP\n StringEntity entityJson = null;\n try {\n entityJson = new StringEntity(categorie.toString());\n } catch (UnsupportedEncodingException e) {\n e.printStackTrace();\n }\n\n //preparation de l'URL\n String url = WebService.buildUrlForRequest(Metier.DOMAIN, Metier.NOM_MODELE_CATEGORIES, WebService.ACTION_INSERT, null);\n\n //requete pour inserer la nouvelle categorie (asynchrone)\n asyncHttpClient.post(getActivity(), url, entityJson, DATA_TYPE, new AsyncHttpResponseHandler() {\n\n @Override\n public void onSuccess(int statusCode, Header[] headers, byte[] responseBody) {\n dialogCreationCategorieBuilder\n .setMessage(getString(R.string.dialog_ajout_categorie_succes))\n .setPositiveButton(\"OK\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n dialog.dismiss();\n FormulaireCategorieFragment.this.listener.OnValidCategorie();\n }\n }).show();\n }\n\n @Override\n public void onFailure(int statusCode, Header[] headers, byte[] responseBody, Throwable error) {\n dialogCreationCategorieBuilder\n .setMessage(getString(R.string.dialog_ajout_categorie_echec))\n .setPositiveButton(\"OK\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n dialog.dismiss();\n }\n }).show();\n }\n });\n }",
"@Override\n\t@Transactional\n\n\tpublic void initCategorie() {\n\t\tStream.of(\"Action\",\"Drame\",\"Guerre\",\"Fantastique\",\"Science-fiction\",\"Thriller\").forEach(cat->{\n\t\t\tCategorie categorie=new Categorie();\n\t\t\tcategorie.setName(cat);\n\t\t\tcategorieRepository.save(categorie);\n\t\t});\n\t}",
"private void registrar(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {\n\t\tModalidadDTO obj = new ModalidadDTO();\n\t\tString descripcion = request.getParameter(\"descripcion\");\n\t\tString idcategoria = request.getParameter(\"cbocategoria\");\t\t\n\t\tString iddisciplina = request.getParameter(\"cbodisciplina\");\n\t\tString cantidad = request.getParameter(\"cantidad\");\n\t\tString nvarones = request.getParameter(\"varones\");\n\t\tString nmujeres = request.getParameter(\"mujeres\");\n\t\tString genero = request.getParameter(\"genero\");\n\t\tString validaciones = \"\";\n\t\t\n\t\tif(idcategoria.equals(\"\") && iddisciplina.equals(\"\")) {\n validaciones = \"Debe seleccionar obligatoriamente una categoría y una disciplina\";\n request.setAttribute(\"validaciones\", validaciones);\n request.getRequestDispatcher(\"app/modalidad/registrar_modalidad.jsp\").forward(request, response);\n }\n\t\t\n\t\telse if(idcategoria.equals(\"\")) {\n validaciones = \"Debe seleccionar una categoría\";\n request.setAttribute(\"validaciones\", validaciones);\n request.getRequestDispatcher(\"app/modalidad/registrar_modalidad.jsp\").forward(request, response);\n }\n\t\t\n\t\telse if(iddisciplina.equals(\"\")) {\n validaciones = \"Debe seleccionar una disciplina\";\n request.setAttribute(\"validaciones\", validaciones);\n request.getRequestDispatcher(\"app/modalidad/registrar_modalidad.jsp\").forward(request, response);\n }\n\t\t\n\t\telse if(cantidad.replaceAll(\" \", \"\").equals(\"\")) {\n validaciones = \"El campo número de jugadores no puede estar vacío\";\n request.setAttribute(\"validaciones\", validaciones);\n request.getRequestDispatcher(\"app/modalidad/registrar_modalidad.jsp\").forward(request, response);\n }\n\t\t\n\t\tint categoria = Integer.parseInt(idcategoria);\n\t\tint disciplina = Integer.parseInt(iddisciplina);\n\t\t\n\t\tboolean count = ajaxService.mismaModalidad(\"modalidad\", categoria, disciplina,genero);\n\t\t\n\t\tif(count==true) {\n \t\tvalidaciones = \"La modalidad que ha seleccionado ya existe\"; \n \t\trequest.setAttribute(\"validaciones\", validaciones);\n request.getRequestDispatcher(\"app/modalidad/registrar_modalidad.jsp\").forward(request, response);\n }\n\t\t\n\t\t\n\t\t\n\t\t\n\t\telse if(!(cantidad.matches(\"[0-9]*\"))) {\n validaciones = \"Solo debe ingresar caracteres numéricos en el campo número de jugadores\";\n request.setAttribute(\"validaciones\", validaciones);\n request.getRequestDispatcher(\"app/modalidad/registrar_modalidad.jsp\").forward(request, response);\n }\n\t\t\n\t\telse if(!(nvarones.matches(\"[0-9]*\"))) {\n validaciones = \"Solo debe ingresar caracteres numéricos en el campo número de varones\";\n request.setAttribute(\"validaciones\", validaciones);\n request.getRequestDispatcher(\"app/modalidad/registrar_modalidad.jsp\").forward(request, response);\n }\n\t\t\n\t\telse if(!(nmujeres.matches(\"[0-9]*\"))) {\n validaciones = \"Solo debe ingresar caracteres numéricos en el campo número de mujeres\";\n request.setAttribute(\"validaciones\", validaciones);\n request.getRequestDispatcher(\"app/modalidad/registrar_modalidad.jsp\").forward(request, response);\n }\n\t\t\n\t\telse if(request.getParameter(\"cantidad\") != null){\n\t\t\tcantidad = request.getParameter(\"cantidad\");\n\t\t\tobj.setNumJugadores(Integer.parseInt(cantidad));\n\t\t\t\n\t\t}\n\t\t\n\n\t\tif(request.getParameter(\"varones\") != null && request.getParameter(\"mujeres\") != null){\n\t\t\tnvarones = request.getParameter(\"varones\");\n\t\t\tnmujeres = request.getParameter(\"mujeres\");\n\t\t\t\n\t\t\tif(genero.trim().equals(\"1\")){\n\t\t\t\tobj.setNumVarones(Integer.parseInt(cantidad));\n\t\t\t} else if(nvarones!=null && !(nvarones.trim().equals(\"\"))){\n\t\t\t\tobj.setNumVarones(Integer.parseInt(nvarones));\n\t\t\t} else {\n\t\t\t\tobj.setNumVarones(0);\n\t\t\t}\n\t\t\tif(genero.trim().equals(\"2\")){\n\t\t\t\tobj.setNumMujeres(Integer.parseInt(cantidad));\n\t\t\t} else if(nmujeres!=null && !(nmujeres.trim().equals(\"\"))){\n\t\t\t\tobj.setNumMujeres(Integer.parseInt(nmujeres));\n\t\t\t} else {\n\t\t\t\tobj.setNumMujeres(0);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tint total = obj.getNumMujeres() + obj.getNumVarones();\n\t\t\n\t\t\n\t\tif(!(obj.getNumJugadores() == total)){\n\t\t\tvalidaciones = \"La cantidad de varones y mujeres no coincide con la cantidad total de jugadores\";\n\t\t\trequest.setAttribute(\"validaciones\", validaciones);\n request.getRequestDispatcher(\"app/modalidad/registrar_modalidad.jsp\").forward(request, response);\n\t\t}\n\t\t\n\t\tif(obj.getNumJugadores() == total){\n\t\t\tobj.setCodCategoria(Integer.parseInt(idcategoria));\n\t\t\tobj.setCodDisciplina(Integer.parseInt(iddisciplina));\n\t\t\tobj.setGenero(Integer.parseInt(genero));\n\t\t\tobj.setDescripcion(descripcion);\n\t\t\tint resultado = modalidadService.registrarModalidad(obj);\n\t\t\tif (resultado != -1){\n\t\t\t\tlistar(request, response);\n\t\t\t}\n\t\t}else{\n\t\t\t\n\t\t\tresponse.sendRedirect(\"error.html\");\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t}",
"public void createProductCategory(HttpServletRequest request){\n \n HttpSession session = request.getSession();\n \n DAOFactory mySqlFactory = DAOFactory.getDAOFactory();\n ProductCategoryDAO riverProductCategoryDAO = mySqlFactory.getProductCategoryDAO();\n ProductCategoryDAO productCategoryDAO = new MySQLProductCategoryDAOImpl();\n \n List productCategories = productCategoryDAO.getAllProductCategories();\n \n //productCategories\n ProductCategory tmp3 = null;\n String[][] productCategoriesMatrix = new String[productCategories.size()][2];\n\n for(int i=0; i<productCategories.size(); i++){\n\n tmp3 = (ProductCategory)productCategories.get(i);\n\n productCategoriesMatrix[i][0] = Integer.toString(tmp3.getPCID());\n productCategoriesMatrix[i][1] = tmp3.getName();\n \n }\n \n session.setAttribute(\"productCategories\", productCategoriesMatrix);\n \n }",
"public Categorias() {\n this.id = 0;\n this.categoria = \"\";\n }",
"public void librosPorCategorian() {\n\t\tJDBCTemplate mysql = MysqlConnection.getConnection();\n\t\ttry {\n\t\t\tmysql.connect();\n\t\t\tCategoriaDAO OwlDAO = new CategoriaDAO();\n\t\t\tList<LibroVO> resultado = new ArrayList();\n\t\t\tOwlDAO.actualizarCategorian(mysql);\n\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace(System.err);\n\n\t\t} finally {\n\t\t\tmysql.disconnect();\n\t\t}\n\t}",
"public interface CategorieService {\n\n /**\n * Save a categorie.\n *\n * @param categorie the entity to save\n * @return the persisted entity\n */\n Categorie save(Categorie categorie);\n\n /**\n * Get all the categories.\n * \n * @return the list of entities\n */\n List<Categorie> findAll();\n\n /**\n * Get the \"id\" categorie.\n *\n * @param id the id of the entity\n * @return the entity\n */\n Categorie findOne(Long id);\n\n /**\n * Delete the \"id\" categorie.\n *\n * @param id the id of the entity\n */\n void delete(Long id);\n}",
"public void eliminar(CategoriaArticuloServicio categoriaArticuloServicio)\r\n/* 24: */ {\r\n/* 25:53 */ this.categoriaArticuloServicioDao.eliminar(categoriaArticuloServicio);\r\n/* 26: */ }",
"@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n try {\r\n int idcategoria = Integer.parseInt(request.getParameter(\"idcategoria\"));\r\n CategoriaDAO ctDAO = new CategoriaDAO();\r\n if (request.getParameter(\"acao\").equals(\"alterar\")) {\r\n if(GerenciarLogin.verificarPermissao(request, response)){\r\n Categoria ct = ctDAO.getCategoriaPorIdcategoria(idcategoria);\r\n if (ct.getIdcategoria() > 0) {\r\n RequestDispatcher disp = getServletContext().getRequestDispatcher(\"/form_categoria.jsp\");\r\n request.setAttribute(\"ct\", ct);\r\n disp.forward(request, response);\r\n } else {\r\n PrintWriter out = response.getWriter();\r\n out.println(\"<script type='text/javascript'>\");\r\n out.println(\"alert('Categoria não encontrado!');\");\r\n out.println(\"location.href='listar_categoria.jsp';\");\r\n out.println(\"</script>\");\r\n }\r\n }else{\r\n PrintWriter out = response.getWriter();\r\n out.println(\"<script type='text/javascript'>\");\r\n out.println(\"alert('Acesso Negado!');\");\r\n out.println(\"location.href='listar_categoria.jsp';\");\r\n out.println(\"</script>\");\r\n }\r\n }\r\n if (request.getParameter(\"acao\").equals(\"excluir\")){\r\n if(GerenciarLogin.verificarPermissao(request, response)){\r\n PrintWriter out = response.getWriter();\r\n if (ctDAO.excluir(idcategoria)) {\r\n out.println(\"<script type='text/javascript'>\");\r\n out.println(\"alert('Categoria excluido com sucesso!');\");\r\n out.println(\"location.href='listar_categoria.jsp';\");\r\n out.println(\"</script>\");\r\n } else {\r\n out.println(\"<script type='text/javascript'>\");\r\n out.println(\"alert('Não foi possível excluir Categoria!');\");\r\n out.println(\"location.href='listar_categoria.jsp';\");\r\n out.println(\"</script>\");\r\n }\r\n }else{\r\n PrintWriter out = response.getWriter();\r\n out.println(\"<script type='text/javascript'>\");\r\n out.println(\"alert('Acesso Negado!');\");\r\n out.println(\"location.href='listar_categoria.jsp';\");\r\n out.println(\"</script>\");\r\n }\r\n }\r\n } catch (Exception e) {\r\n System.out.println(\"Erro ao recuperar dados!\");\r\n }\r\n }",
"protected void insert(HttpServletRequest request, HttpServletResponse response) throws IOException {\n\t\t\r\n\t\tString s1= request.getParameter(\"req1\");\r\n\t\t\r\n\t\tString id4= request.getParameter(\"countid\");\r\n\t\t//Cat r1=new Cat();\r\n\t\t//r1.setId(Long.valueOf(id2));\r\n\t\t\r\n\t\r\n\t\tCountry r=new Country();\r\n\t\t\r\n\t\tr.setCountName(s1);\r\n\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\tAdd_count cu= new Add_count();\r\n\t\tcu.insert(r);\r\n\t\tresponse.sendRedirect(\"EH_Admin/manage_count.jsp\");\r\n\r\n\t\t\r\n\t\r\n\t}",
"protected void processRequest(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n response.setContentType(\"text/html;charset=UTF-8\");\r\n DBConnection db = new DBConnection();\r\n CategoryDAO dao = new CategoryDAO(db);\r\n try (PrintWriter out = response.getWriter()) {\r\n /* TODO output your page here. You may use following sample code. */\r\n\r\n String service = request.getParameter(\"service\");\r\n // null pointer exception\r\n if (service == null) {\r\n service = \"listCategory\";\r\n }\r\n if (service.equalsIgnoreCase(\"insertCategory\")) {\r\n\r\n //getdata\r\n String catID = request.getParameter(\"catID\");\r\n String catName = request.getParameter(\"catName\");\r\n\r\n //check data\r\n //proccess: add customer\r\n Category cat = new Category(catID, catName);\r\n String sql = \"select * from category where catid='\" + catID + \"'\";\r\n ResultSet rs = db.getData(sql);\r\n if (rs.next()) {\r\n out.print(\"Category exists\");\r\n }\r\n int n = dao.insertCategory(cat);\r\n response.sendRedirect(\"CategoryController?service=listCategory\");\r\n// if (n > 0) {\r\n// out.print(\"inserted\");\r\n// }\r\n }\r\n if (service.equalsIgnoreCase(\"listCategory\")) {\r\n String sql = \"select * from Category\";\r\n ResultSet rs = db.getData(sql);\r\n request.setAttribute(\"kq\", rs);\r\n request.setAttribute(\"title\", \"Category Manager\");\r\n //call view\r\n //set view: JSP \r\n RequestDispatcher dis = request.getRequestDispatcher(\"/Server/Category.jsp\");\r\n //run\r\n dis.forward(request, response);\r\n// out.print(\" <table border=\\\"1\\\">\\n\"\r\n// + \" <caption>CategoryList</caption>\\n\"\r\n// + \" <tr>\\n\"\r\n// + \" <th>ID</th>\\n\"\r\n// + \" <th>Name</th>\\n\"\r\n// + \" <th>Status</th>\\n\"\r\n// + \" <th>Update</th>\\n\"\r\n// + \" <th>Delete</th>\\n\"\r\n// + \" <th> Change status\"\r\n// + \" </tr>\");\r\n// while (rs.next()) {\r\n// out.print(\"<tr>\");\r\n// out.print(\" <td>\" + rs.getString(1) + \"</td>\");\r\n// out.print(\" <td>\" + rs.getString(2) + \"</td>\");\r\n// out.print(\" <td>\" + (rs.getInt(3) == 1 ? \"Active\" : \"Deactive\") + \"</td>\");\r\n// out.print(\" <td><a href=CategoryController?service=preupdate&catid=\" + rs.getString(1) + \">update</a></td>\");\r\n// out.print(\" <td><a href=CategoryController?service=delete&catid=\" + rs.getString(1) + \">remove</a></td>\");\r\n// out.print(\" <td><a href=CategoryController?service=changeStatus&catid=\" + rs.getString(1) + \">Change Status</a></td>\");\r\n// out.print(\"</tr>\");\r\n// }\r\n//\r\n// out.print(\"</table>\");\r\n }\r\n if (service.equalsIgnoreCase(\"preupdate\")) {\r\n String catID = request.getParameter(\"catid\");\r\n out.print(\"<form action=\\\"CategoryController\\\" method=\\\"POST\\\">\\n\"\r\n + \"<table border=\\\"0\\\">\\n\"\r\n + \"<tr>\\n\"\r\n + \"<th>Category ID</th>\\n\"\r\n + \"<th><input type=\\\"text\\\" name=\\\"catid\\\" value=\\\"\" + catID + \"\\\" readonly /></th></tr>\\n\"\r\n + \"<tr><th>Category Name: </th><th> <input type=\\\"text\\\" name=\\\"catName\\\" id=\\\"catName\\\" > </th></tr> \"\r\n + \" <input type=\\\"hidden\\\" name=\\\"service\\\" value=\\\"updateCategory\\\">\"\r\n + \" <th><input type=\\\"submit\\\" value=\\\"Update\\\"></th>\"\r\n + \"</table></form>\");\r\n }\r\n if (service.equalsIgnoreCase(\"updateCategory\")) {\r\n String catID = request.getParameter(\"catid\");\r\n String catName = request.getParameter(\"catName\");\r\n dao.updateCategory(catID, catName);\r\n response.sendRedirect(\"CategoryController\");\r\n }\r\n if (service.equalsIgnoreCase(\"changeStatus\")) {\r\n String catID = request.getParameter(\"catid\");\r\n dao.changeStatus(catID);\r\n response.sendRedirect(\"CategoryController\");\r\n }\r\n } catch (SQLException ex) {\r\n Logger.getLogger(ProductController.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n }",
"protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n response.setContentType(\"text/html;charset=UTF-8\");\n String action = request.getParameter(\"action\");\n RequestDispatcher redirect = null;\n HttpSession sesionUsuario = request.getSession(true);\n Usuario usuario = (Usuario) sesionUsuario.getAttribute(\"usuario\");\n Empleado empleado = (Empleado) sesionUsuario.getAttribute(\"empleado\");\n\n if (action == null) {\n DaoGrupo daoGrupo = new DaoGrupo();\n ArrayList<Grupo> grupos = daoGrupo.findAll();\n request.setAttribute(\"grupos\", grupos);\n\n } else if (action.equalsIgnoreCase(\"addGrupo\")) {\n int id_grupo = Integer.parseInt(request.getParameter(\"id_grupo\"));\n\n DaoGrupo daoGrupo = new DaoGrupo();\n ArrayList<Grupo> grupos = daoGrupo.findAll();\n request.setAttribute(\"grupos\", grupos);\n\n Grupo_Tutor grupo_Tutor = new Grupo_Tutor(0, daoGrupo.findOne(id_grupo), empleado);\n DaoGrupo_Tutor daoGrupo_Tutor = new DaoGrupo_Tutor();\n daoGrupo_Tutor.add(grupo_Tutor);\n\n request.setAttribute(\"message\", \"Grupo Asignado Correctamente\");\n request.setAttribute(\"type\", \"success\");\n }\n DaoGrupo_Estudiante daoGrupo_Estudiante = new DaoGrupo_Estudiante();\n ArrayList<Grupo_Estudiante> alumnos = daoGrupo_Estudiante.grupoEstudianteAll(3);\n request.setAttribute(\"alumnos\",alumnos);\n \n redirect = request.getRequestDispatcher(\"views/profesor/grupo.jsp\");\n redirect.forward(request, response);\n }",
"private void insert(HttpServletRequest request)throws Exception {\n\t\tPedido p = new Pedido();\r\n\t\tCliente c = new Cliente();\r\n\t\tCancion ca = new Cancion();\r\n\t\tp.setCod_pedido(request.getParameter(\"codigo\"));\r\n\t\tca.setCod_cancion(request.getParameter(\"cod_cancion\"));\r\n\t\tc.setCod_cliente(request.getParameter(\"cod_cliente\"));\r\n\t\tp.setCan(ca);\r\n\t\tp.setCl(c);\r\n\t\t\r\n\t\tpdmodel.RegistrarPedido(p);\r\n\t\t\r\n\t}",
"protected void processRequest(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n response.setContentType(\"text/html;charset=UTF-8\");\r\n PrintWriter out = response.getWriter();\r\n try {\r\n String json, campo, valor;\r\n Boolean unico;\r\n PaetDiDia dia = new PaetDiDia();\r\n PAET_DI_DIA_BL diaBl = new PAET_DI_DIA_BL();\r\n\r\n String accion = request.getParameter(\"accion\");\r\n\r\n switch (accion) {\r\n case \"consultarDias\":\r\n json = new Gson().toJson(diaBl.findAll(PaetDiDia.class.getName()));\r\n out.print(json);\r\n break;\r\n case \"consultarDiaByCodigo\":\r\n //se consulta el objeto por ID\r\n dia = diaBl.findById(request.getParameter(\"diCodigo\").charAt(0));\r\n\r\n //se pasa la informacion del objeto a formato JSON\r\n json = new Gson().toJson(dia);\r\n out.print(json);\r\n break;\r\n case \"agregarDia\":\r\n case \"modificarDia\":\r\n dia.setDiCodigo(request.getParameter(\"diCodigo\").charAt(0));\r\n dia.setDiDescripcion(request.getParameter(\"diDescripcion\"));\r\n if(accion.equals(\"agregarDia\")){ //es insertar\r\n //Se guarda el objeto\r\n diaBl.save(dia);\r\n\r\n //Se imprime la respuesta con el response\r\n out.print(\"C~El día fue agregado correctamente\");\r\n \r\n }else{//es modificar \r\n //Se guarda el objeto\r\n diaBl.merge(dia);\r\n\r\n //Se imprime la respuesta con el response\r\n out.print(\"C~El día fue modificado correctamente\");\r\n }\r\n break;\r\n case \"consultaDinamica\":\r\n campo = request.getParameter(\"campo\");\r\n valor = request.getParameter(\"valor\");\r\n unico = Boolean.valueOf(request.getParameter(\"unico\"));\r\n //se consulta el objeto por el campo y el valor \r\n json = new Gson().toJson(diaBl.findDynamicFilter(campo, valor, unico, PaetDiDia.class.getName()));\r\n out.print(json);\r\n break;\r\n default:\r\n out.print(\"E~No se indico la acción que se desea realizare\");\r\n break;\r\n }\r\n\r\n } catch (NumberFormatException e) {\r\n out.print(\"E~\" + e.getMessage());\r\n } catch (Exception e) {\r\n out.print(\"E~\" + e.getMessage());\r\n }\r\n }",
"protected void processRequest(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException, DAOException {\r\n response.setContentType(\"text/html;charset=UTF-8\");\r\n String accion=request.getParameter(\"accion\");\r\n fabricate=new AutorPublicacionDAOFactory();\r\n daote=fabricate.metodoDAO();\r\n \r\n switch(accion)\r\n {\r\n case \"ObtenerTodosPorPublicacion\":ObtenerTodosPorPublicacion(request,response);\r\n break;\r\n case \"eliminarAutor\":eliminarAutor(request,response);\r\n break;\r\n case \"crearveryleer1\":crearveryleer1(request,response);\r\n break;\r\n case \"crearveryleer2\":crearveryleer2(request,response);\r\n break;\r\n case \"5\":\r\n break;\r\n case \"6\":\r\n break;\r\n case \"7\":\r\n break;\r\n case \"8\":\r\n break;\r\n }\r\n }",
"private void agregarProducto(HttpServletRequest request, HttpServletResponse response) throws SQLException {\n\t\tString codArticulo = request.getParameter(\"CArt\");\n\t\tString seccion = request.getParameter(\"seccion\");\n\t\tString nombreArticulo = request.getParameter(\"NArt\");\n\t\tSimpleDateFormat formatoFecha = new SimpleDateFormat(\"yyyy-MM-dd\");\n\t\tDate fecha = null;\n\t\ttry {\n\t\t\tfecha = formatoFecha.parse(request.getParameter(\"fecha\"));\n\t\t} catch (ParseException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\tdouble precio = Double.parseDouble(request.getParameter(\"precio\"));\n\t\tString importado = request.getParameter(\"importado\");\n\t\tString paisOrigen = request.getParameter(\"POrig\");\n\t\t// Crear un objeto del tipo producto\n\t\tProducto producto = new Producto(codArticulo, seccion, nombreArticulo, precio, fecha, importado, paisOrigen);\n\t\t// Enviar el objeto al modelo e insertar el objeto producto en la BBDD\n\t\tmodeloProductos.agregarProducto(producto);\n\t\t// Volver al listado de productos\n\t\tobtenerProductos(request, response);\n\n\t}",
"public String crearProducto(String id, String nombre, String precio, String idCategoria, \n String estado, String descripcion) {\n \n String validacion = \"\";\n if (verificarCamposVacios(id, nombre, precio, idCategoria, estado, descripcion) == false) {\n //Se crea en EntityManagerFactory con el nombre de nuestra unidad de persistencia\n EntityManagerFactory emf = Persistence.createEntityManagerFactory(\"SG-RESTPU\");\n //se crea un objeto producto y se le asignan sus atributos\n if (verificarValoresNum(id,precio,idCategoria)) {\n //Se crea el controlador de la categoria del producto\n CategoriaProductoJpaController daoCategoriaProducto = new CategoriaProductoJpaController(emf);\n CategoriaProducto categoriaProducto = daoCategoriaProducto.findCategoriaProducto(Integer.parseInt(idCategoria));\n //se crea el controlador del producto \n ProductoJpaController daoProducto = new ProductoJpaController(emf);\n Producto producto = new Producto(Integer.parseInt(id), nombre);\n producto.setPrecio(Long.parseLong(precio));\n producto.setIdCategoria(categoriaProducto);\n producto.setDescripcion(descripcion);\n producto.setFotografia(copiarImagen());\n if (estado.equalsIgnoreCase(\"Activo\")) {\n producto.setEstado(true);\n } else {\n producto.setEstado(false);\n }\n try {\n if (ExisteProducto(nombre) == false) {\n daoProducto.create(producto);\n deshabilitar();\n limpiar();\n validacion = \"El producto se agrego exitosamente\";\n } else {\n validacion = \"El producto ya existe\";\n }\n } catch (NullPointerException ex) {\n limpiar();\n } catch (Exception ex) {\n Logger.getLogger(Gui_empleado.class.getName()).log(Level.SEVERE, null, ex);\n }\n } else {\n validacion = \"El campo id, precio, idCategoria deben ser numéricos\";\n }\n } else {\n validacion = \"Llene los datos obligatorios\";\n }\n return validacion;\n }",
"@Override\n\tpublic void insert(HttpServletRequest request,HttpServletResponse response) {\n\t\tHttpSession session = request.getSession();\n\t\tRegVo regVo = (RegVo) session.getAttribute(\"RegObj\");\n\t\tString question_department=regVo.getRegistration_department();\n\t\tint question_semester=regVo.getRegistration_semester();\n\t\tString question_name=regVo.getRegistration_name();\n\t\tlong question_enrollment=regVo.getRegistration_enrollment();\n\t\tString question_title=request.getParameter(\"que_title\");\n\t\t\n\t\tDate date= new Date();\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n\t\tString question_date=sdf.format(date);\n\t\t\n\t\tQuestionVo qv=new QuestionVo(question_department, question_semester,\n\t\t\t\tquestion_name, question_enrollment,\n\t\t\t\tquestion_title,question_date);\n \tcd.insert(qv);\n\t\ttry{\n\t\tresponse.sendRedirect(request.getContextPath()+\"/CTServlet?type=question&operation=view\");\n\t\t}\n\t\tcatch(Exception e){}\n\t\t\n\t\t\n\t}",
"protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException,Exception {\n response.setContentType(\"text/html;charset=UTF-8\");\n // HttpSession sesion = request.getSession();\n String tpalabra=(String)request.getParameter(\"palabra\");\n String categori =(String)request.getParameter(\"micat\");\n try (PrintWriter out = response.getWriter()) {\n \n \n out.println(\"<!DOCTYPE html>\");\n out.println(\"<html>\");\n out.println(\"<head>\");\n out.println(\"<title>Servlet ListarPalabras</title>\"); \n out.println(\"</head>\");\n out.println(\"<body>\");\n out.println(\"<center>\");\n out.println(\"<form metohd='pos' Action='ListarPalabras'>\");\n out.println(\"<h1><input type='text' name='cati' value='\"+categori+\"'></h1>\");\n emf=Persistence.createEntityManagerFactory(\"juegoPU\");\n EntityManager em = emf.createEntityManager();\n TypedQuery<Tipos> consultaAlumnos= em.createNamedQuery(\"Tipos.findByDescripcion\",Tipos.class);\n consultaAlumnos.setParameter(\"descripcion\", categori);\n Tipos tp=(Tipos)consultaAlumnos.getSingleResult();\n //out.println(\"<h1>\"+categori+\"</h1>\");\n // out.println(\"<h1><input='number' name='clat' value='\"+categori+\"'></h1>\");\n \n /* TODO output your page here. You may use following sample code. */\n \n PalabrasJpaController controlPalabra;\n controlPalabra = new PalabrasJpaController (utx,emf);\n Palabras pal=new Palabras();\n pal.setPalabra(tpalabra);\n if(tpalabra.length()<=10){\n pal.setNivel(1);\n }else if(tpalabra.length()>10){\n pal.setNivel(2);\n }else if(tpalabra.length()>20){\n pal.setNivel(3);\n }\n pal.setTipo(tp);\n \n controlPalabra.create(pal);\n out.println(\"<td><input type='submit' name='lis' value='listar'></td>\" );\n out.println(\"</form>\");\n \n out.println(\"<form metohd='pos' Action='editpal'>\");\n out.println(\"<h1><input type='text' name='cati' value='\"+categori+\"'></h1>\");\n out.println(\"<input type='submit' name='edi' value='editar'>\" );\n out.println(\"</form>\");\n \n out.println(\"<form metohd='pos' Action='elimpal'>\");\n out.println(\"<h1><input type='text' name='cati' value='\"+categori+\"'></h1>\");\n out.println(\"<input type='submit' name='eli' value='eliminar'>\" );\n out.println(\"</form>\");\n \n out.println(\"</center\");\n out.println(\"</body>\");\n out.println(\"</html>\");\n \n \n // response.sendRedirect(\"ListarPalabras\");\n }catch(Exception e){\n \n }\n }",
"@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n String accion = request.getParameter(\"accion\");\n switch (accion) {\n case \"listar\":\n List<Producto> lista = dao.Listar();\n request.setAttribute(\"lista\", lista);\n request.getRequestDispatcher(listar).forward(request, response);\n break;\n case \"Agregar\":\n request.getRequestDispatcher(add).forward(request, response);\n break;\n case \"guardar\":\n String nombre = request.getParameter(\"nombre\");\n String Descripcion = request.getParameter(\"Descripcion\");\n double precio = Double.parseDouble(request.getParameter(\"precio\"));\n String talla = request.getParameter(\"talla\");\n String categoria = request.getParameter(\"categoria\");\n int catidad = Integer.parseInt(request.getParameter(\"cantidad\"));\n String color = request.getParameter(\"color\");\n Part part = request.getPart(\"imagen\");\n InputStream inputStream = part.getInputStream();\n p.setNombre(nombre);\n p.setDescripcion(Descripcion);\n p.setPrecio(precio);\n p.setTalla(talla);\n p.setCategoria(categoria);\n p.setCatidad(catidad);\n p.setColor(color);\n p.setImagen(inputStream);\n dao.Agregar(p);\n request.getRequestDispatcher(\"ProductoController?accion=listar\").forward(request, response);\n break;\n case \"Actualizar\":\n int id1 = Integer.parseInt(request.getParameter(\"idPer\"));\n String nombre1 = request.getParameter(\"nombre\");\n String Descripcion1 = request.getParameter(\"Descripcion\");\n double precio1 = Double.parseDouble(request.getParameter(\"precio\"));\n String talla1 = request.getParameter(\"talla\");\n String categoria1 = request.getParameter(\"categoria\");\n int catidad1 = Integer.parseInt(request.getParameter(\"cantidad\"));\n String color1 = request.getParameter(\"color\");\n Part part1 = request.getPart(\"imagen\");\n InputStream inputStream1 = part1.getInputStream();\n p.setId(id1);\n p.setNombre(nombre1);\n p.setDescripcion(Descripcion1);\n p.setPrecio(precio1);\n p.setTalla(talla1);\n p.setCategoria(categoria1);\n p.setCatidad(catidad1);\n p.setColor(color1);\n p.setImagen(inputStream1);\n System.out.println(p);\n dao.editSinImg(p);\n request.getRequestDispatcher(\"ProductoController?accion=listar\").forward(request, response);\n break;\n default:\n request.getRequestDispatcher(\"ProductoController?accion=listar\").forward(request, response);\n break;\n }\n }",
"public CategoriaArticuloServicio buscarPorId(int idCategoriaArticuloServicio)\r\n/* 29: */ {\r\n/* 30:64 */ return (CategoriaArticuloServicio)this.categoriaArticuloServicioDao.buscarPorId(Integer.valueOf(idCategoriaArticuloServicio));\r\n/* 31: */ }",
"public interface CategoriaService {\n\n Categoria cadastrarCategoria(CategoriaTO categoriaTO) throws RegraDeNegocioException;\n\n List<Categoria> buscarCategoria();\n\n List<Categoria> buscarCategoriasPrincipais();\n\n Categoria buscarCategoriaPorId(Long id);\n\n Categoria buscarPorNome(String nome);\n\n}",
"protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n\n response.setContentType(\"text/html;charset=UTF-8\");\n String pagina = null;\n ProdutoDAO dao = new ProdutoDAO();\n ProdutoBean prodBean = new ProdutoBean();\n ProdutoService service = new ProdutoService();\n String acao = request.getParameter(\"action\");\n CategoriaService categoriaService = new CategoriaService();\n\n if (null == acao || \"listar\".equals(acao)) {\n try {\n prodBean.setListaProdutos(service.listar());\n\n if (prodBean.getListaProdutos().isEmpty()) {\n throw new ErroProduto(\"Não foi possivel carregar atendimentos\");\n }\n RequestDispatcher rd = request.\n getRequestDispatcher(\"/produtosListar.jsp\");\n request.setAttribute(\"produtoBean\", prodBean);\n rd.forward(request, response);\n\n } catch (AppException e) {\n prodBean.setListaProdutos(service.listar());\n RequestDispatcher rd = request.\n getRequestDispatcher(\"/produtosListar.jsp\");\n request.setAttribute(\"produtoBean\", prodBean);\n request.setAttribute(\"msg\", e.getMsg());\n rd.forward(request, response);\n }\n }\n if (\"show\".equals(acao)) {\n try {\n String id = request.getParameter(\"id\");\n\n Produto produto = service.buscar(id);\n\n if (produto.getIdProduto() == null) {\n throw new ErroProduto(\"Produto Não Encontrado\");\n }\n\n prodBean.setCategorias(categoriaService.listar());\n prodBean.setListaProdutos(service.listar());\n RequestDispatcher rd = request.\n getRequestDispatcher(\"./produtosAlterar.jsp\");\n request.setAttribute(\"produto\", produto);\n request.setAttribute(\"produtoBean\", prodBean);\n request.setAttribute(\"mostra\", 1);\n rd.forward(request, response);\n } catch (AppException e) {\n prodBean.setListaProdutos(service.listar());\n RequestDispatcher rd = request.\n getRequestDispatcher(\"/produtosListar.jsp\");\n request.setAttribute(\"produtoBean\", prodBean);\n request.setAttribute(\"msg\", e.getMsg());\n rd.forward(request, response);\n\n }\n }\n if (\"formUpdate\".equals(acao)) {\n try {\n String id = request.getParameter(\"id\");\n Produto produto = service.buscar(id);\n\n if (produto.getIdProduto() == null) {\n throw new ErroProduto(\"Produto Não Encontrado\");\n }\n prodBean.setCategorias(categoriaService.listar());\n prodBean.setListaProdutos(service.listar());\n RequestDispatcher rd = request.\n getRequestDispatcher(\"./produtosAlterar.jsp\");\n request.setAttribute(\"produto\", produto);\n request.setAttribute(\"produtoBean\", prodBean);\n\n rd.forward(request, response);\n } catch (AppException e) {\n prodBean.setListaProdutos(service.listar());\n RequestDispatcher rd = request.\n getRequestDispatcher(\"/produtosListar.jsp\");\n request.setAttribute(\"produtoBean\", prodBean);\n request.setAttribute(\"msg\", e.getMsg());\n rd.forward(request, response);\n\n }\n\n }\n if (\"remove\".equals(acao)) {\n try {\n String id = request.getParameter(\"id\");\n\n if (!service.remover(id)) {\n throw new ErroProduto(\"Impossivel remover produto\");\n }\n\n prodBean.setListaProdutos(service.listar());\n RequestDispatcher rd = request.\n getRequestDispatcher(\"/produtosListar.jsp\");\n request.setAttribute(\"produtoBean\", prodBean);\n rd.forward(request, response);\n\n } catch (AppException e) {\n prodBean.setListaProdutos(service.listar());\n RequestDispatcher rd = request.\n getRequestDispatcher(\"/produtosListar.jsp\");\n request.setAttribute(\"produtoBean\", prodBean);\n request.setAttribute(\"msg\", e.getMsg());\n rd.forward(request, response);\n\n }\n\n }\n if (\"update\".equals(acao)) {\n try {\n Produto produto = new Produto();\n\n String id = request.getParameter(\"id\");\n\n String idCategoria = request.getParameter(\"categoria\");\n produto.setCategoria(categoriaService.buscar(idCategoria));\n produto.setIdProduto(request.getParameter(\"id\"));\n produto.setDescricao(request.getParameter(\"descricao\"));\n produto.setNomeProduto(request.getParameter(\"nome\"));\n produto.setPeso(Double.parseDouble(request.getParameter(\"peso\")));\n\n if (!(\"\".equals(id))) {\n if (!service.atualizar(produto)) {\n throw new ErroProduto(\"Erro ao atualizar produto\");\n }\n\n prodBean.setListaProdutos(service.listar());\n RequestDispatcher rd = request.\n getRequestDispatcher(\"/produtosListar.jsp\");\n request.setAttribute(\"produtoBean\", prodBean);\n rd.forward(request, response);\n\n } else {\n if (!service.inserir(produto)) {\n throw new ErroProduto(\"Erro ao inserir produto\");\n }\n prodBean.setListaProdutos(service.listar());\n RequestDispatcher rd = request.\n getRequestDispatcher(\"/produtosListar.jsp\");\n request.setAttribute(\"produtoBean\", prodBean);\n rd.forward(request, response);\n\n }\n\n } catch (AppException e) {\n prodBean.setListaProdutos(service.listar());\n RequestDispatcher rd = request.\n getRequestDispatcher(\"/produtosListar.jsp\");\n request.setAttribute(\"produtoBean\", prodBean);\n request.setAttribute(\"msg\", e.getMsg());\n rd.forward(request, response);\n }\n }\n if (\"formNew\".equals(acao)) {\n Produto produto = new Produto();\n\n prodBean.setCategorias(categoriaService.listar());\n request.setAttribute(\"produtoBean\", prodBean);\n\n RequestDispatcher rd = request.\n getRequestDispatcher(\"/produtosAlterar.jsp\");\n rd.forward(request, response);\n }\n }",
"public controladorCategorias() {\r\n }",
"private void action_insert_genre(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n try {\n TemplateResult result = new TemplateResult(getServletContext());\n if (SecurityLayer.checkSession(request) != null) {\n User user = getDataLayer().getUser(SecurityLayer.checkNumeric((request.getSession().getAttribute(\"userid\")).toString()));\n if (user.getGroup().getID() != Group.ADMIN) {\n action_error(request, response, \"Non hai i permessi per effettuare questa operazione!\");\n System.err.println(\"Errore in SeriesManagement.java, nel metodo action_insert_genre: Utente senza permessi da amministratore\");\n return;\n }\n request.setAttribute(\"where\", \"back\");\n request.setAttribute(\"user\", user);\n RESTUtility.checkNotifications(user, request, response);\n request.setAttribute(\"strip_slashes\", new SplitSlashesFmkExt());\n request.setAttribute(\"backContent_tpl\", \"insertGenre.ftl.html\");\n result.activate(\"../back/backOutline.ftl.html\", request, response);\n } else {\n //User session is no longer valid\n request.setAttribute(\"error\", \"Devi essere loggato per eseguire quest'azione!\");\n result.activate(\"logIn.ftl.html\", request, response);\n }\n } catch (NumberFormatException ex) {\n //User id is not a number\n action_error(request, response, \"Riprova di nuovo!\");\n System.err.println(\"Errore in SeriesManagement.java, nel metodo action_insert_genre NumberFormatException\");\n }\n }",
"private void action_save_genreSeries(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n try {\n TemplateResult result = new TemplateResult(getServletContext());\n if (SecurityLayer.checkSession(request) != null) {\n User user = getDataLayer().getUser(SecurityLayer.checkNumeric((request.getSession().getAttribute(\"userid\")).toString()));\n if (user.getGroup().getID() != Group.ADMIN) {\n action_error(request, response, \"Non hai i permessi per effettuare questa operazione!\");\n System.err.println(\"Errore in SeriesManagement.java, nel metodo action_save_genreSeries: Utente senza permessi da amministratore\");\n return;\n }\n request.setAttribute(\"user\", user);\n request.setAttribute(\"strip_slashes\", new SplitSlashesFmkExt());\n if (checkGenreSeriesInputData(request, response)) {\n if (SecurityLayer.checkNumeric(request.getParameter(\"genre\")) == 0) {\n request.setAttribute(\"error\", \"Non hai selezionato alcun genere\");\n action_insert_genreSeries(request, response);\n return;\n } else if (SecurityLayer.checkNumeric(request.getParameter(\"series\")) == 0) {\n request.setAttribute(\"error\", \"Non hai selezionato alcuna serie!\");\n action_insert_genreSeries(request, response);\n return;\n }\n Series s = getDataLayer().getSeries(SecurityLayer.checkNumeric(request.getParameter(\"series\")));\n Genre g = getDataLayer().getGenre(SecurityLayer.checkNumeric(request.getParameter(\"genre\")));\n if (s == null || g == null) {\n action_error(request, response, \"Riprova di nuovo!\");\n System.err.println(\"Errore in SeriesManagement.java, nel metodo action_save_genreSeries: l'ID della serie o del genere passato non corrisponde a nessuna serie o genere sul Database\");\n return;\n }\n s.addGenre(g);\n getDataLayer().storeSeries(s);\n } else {\n request.setAttribute(\"error\", \"Uno dei campi è vuoto!\");\n action_insert_genreSeries(request, response);\n return;\n }\n request.setAttribute(\"success\", \"Genere e serie associati correttamente!\");\n action_insert_genreSeries(request, response);\n } else {\n //User session is no longer valid\n request.setAttribute(\"error\", \"Devi essere loggato per eseguire quest'azione!\");\n result.activate(\"logIn.ftl.html\", request, response);\n }\n } catch (NumberFormatException ex) {\n //User id or series id or genre id is not a number\n action_error(request, response, \"Riprova di nuovo!\");\n System.err.println(\"Errore in SeriesManagement.java, nel metodo action_save_genreSeries: NumberFormatException\");\n }\n }",
"private void action_save_genre(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n try {\n TemplateResult result = new TemplateResult(getServletContext());\n if (SecurityLayer.checkSession(request) != null) {\n User user = getDataLayer().getUser(SecurityLayer.checkNumeric((request.getSession().getAttribute(\"userid\")).toString()));\n if (user.getGroup().getID() != Group.ADMIN) {\n action_error(request, response, \"Non hai i permessi per effettuare questa operazione!\");\n System.err.println(\"Errore in SeriesManagement.java, nel metodo action_save_genre: Utente senza permessi da amministratore\");\n return;\n }\n request.setAttribute(\"user\", user);\n request.setAttribute(\"strip_slashes\", new SplitSlashesFmkExt());\n Genre genre = getDataLayer().createGenre();\n if (request.getParameter(\"genreName\") != null && request.getParameter(\"genreName\").length() > 0) {\n genre.setName(request.getParameter(\"genreName\"));\n }\n getDataLayer().storeGenre(RESTSecurityLayer.addSlashes(genre));\n request.setAttribute(\"success\", \"Genere inserito correttamente!\");\n action_insert_genre(request, response);\n } else {\n //User session is no longer valid\n request.setAttribute(\"error\", \"Devi essere loggato per eseguire quest'azione!\");\n result.activate(\"logIn.ftl.html\", request, response);\n }\n } catch (NumberFormatException ex) {\n //User id is not a number\n action_error(request, response, \"Riprova di nuovo!\");\n System.err.println(\"Errore in SeriesManagement.java, nel metodo action_save_genre: NumberFormatException\");\n }\n }",
"@PostMapping(\"/categoriesfu\")\n\t@Secured({ AuthoritiesConstants.ADMIN, AuthoritiesConstants.BOSS, AuthoritiesConstants.MANAGER })\n public synchronized ResponseEntity<Category> createCategory(@Valid @RequestBody Category category) throws URISyntaxException {\n log.debug(\"REST request to save Category : {}\", category);\n \n //fu\n final String user =SecurityUtils.getCurrentUserLogin().get();\n final UserToRestaurant userToRestaurant=userToRestaurantRepository.findOneByUserLogin(user);\n final Restaurant restaurant=userToRestaurant.getRestaurant();\n category.setRestaurant(restaurant);\n \n if (category.getId() != null) {\n throw new BadRequestAlertException(\"A new category cannot already have an ID\", ENTITY_NAME, \"idexists\");\n }\n Category result = categoryRepository.save(category);\n return ResponseEntity.created(new URI(\"/api/categoriesfu/\" + result.getId()))\n .headers(HeaderUtil.createEntityCreationAlert(applicationName, true, ENTITY_NAME, result.getId().toString()))\n .body(result);\n }",
"private void gestionarCategoria(OperacionForm opForm, Operacion op){\r\n\t\r\n\t\t//MODIFICACION DE OPERACION\r\n\t\tif (opForm.getId()!=null){\r\n\t\t\t//Obtengo el usuario logado\r\n\t\t\tUser userLogado = userService.getUserById(((User) SecurityContextHolder.getContext().getAuthentication().getPrincipal()).getIdUser());\r\n\r\n\t\t\t//Obtengo la operacion a modificar con todas las categorizaciones\r\n\t\t\tOperacion opAntAllCat=operacionDao.findById(opForm.getId());\r\n\t\t\t\r\n\t\t\t//Obtengo la categorizacion anterior del usuario\r\n\t\t\tCategoria catAntUser=categoriaDao.findCategorizacionUsuarioByIdOperacion(opForm.getId(), userLogado.getIdUser());\r\n\r\n\t\t\t\r\n\t\t\t//Si antes no tenia y ahora si tiene\r\n\t\t\tif (catAntUser==null){\r\n\t\t\t\tif (opForm.getIdCategoria()!=null)\r\n\t\t\t\t\tcrearCategorizacion(opForm.getIdCategoria(), op);\r\n\t\t\t}\r\n\t\t\t//Si antes tenia categoria\r\n\t\t\telse{\r\n\t\t\t\t//Si ahora no tiene categoria\r\n\t\t\t\tif (opForm.getIdCategoria()==null)\r\n\t\t\t\t\tborrarCategorizacionAnterior(catAntUser, opAntAllCat);\t\t\t\t\r\n\t\t\t\t//Si ahora tiene una categoria diferente que antes\r\n\t\t\t\telse if(opForm.getIdCategoria().compareTo(catAntUser.getIdCategoria())!=0){\r\n\t\t\t\t\tborrarCategorizacionAnterior(catAntUser, opAntAllCat);\r\n\t\t\t\t\tcrearCategorizacion(opForm.getIdCategoria(), op);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t//CREAR NUEVA OPERACION\r\n\t\telse{\r\n\t\t\t//Si el usuario ha seleccionado una categoria para la operacion \r\n\t\t\tif (opForm.getIdCategoria()!=null)\r\n\t\t\t\tcrearCategorizacion(opForm.getIdCategoria(), op);\r\n\t\t}\r\n\t}",
"@Local\npublic interface CategoriaDao {\n\n\t/**\n\t * <b> Agrega una categoria a la base de datos. </b>\n\t * <p>\n\t * [Author: inkarri, Date: 23/11/2015]\n\t * </p>\n\t *\n\t * @param categoria\n\t * @return\n\t */\n\tCategoriaDTO insertarCategoria(CategoriaDTO categoria);\n\t\n\t/**\n\t * <b> Otiene las categorias filtadas por un estado. </b>\n\t * <p>\n\t * [Author: inkarri, Date: 1/12/2015]\n\t * </p>\n\t *\n\t * @param estado\n\t * puede ser activo o inactivo\n\t * @return categias registradas\n\t */\n\tList<CategoriaDTO> obtenerCategorias(String estado);\n\t\n\t/**\n\t\t * <b> Obtiene los ids de las categorias filtradas por el nombre y un estado determinado. </b>\n\t * <p>\n\t * [Author: inkarri, Date: 8/12/2015]\n\t * </p>\n\t *\n\t * @param nombreCategoria\n\t * nombre de la categoria a buscar\n\t * @param estado\n\t * filtra la busqueda por el estado de la categoria (1, 0)\n\t * @return codigos de las categorias que cumplan con los criterios de busqueda\n\t */\n\tpublic List<Long> obtenerIdsCategorias(String nombreCategoria, String estado);\n\t\n\t/**\n\t * <b> Actualiza datos de la categoria dependiendo de los datos que tenga el objeto que se le paa como parametro. </b>\n\t * <p>\n\t * [Author: inkarri, Date: 8/12/2015]\n\t * </p>\n\t *\n\t * @param categoria\n\t * objeto que contiene los datos que seran actualizados\n\t */\n\tpublic void actualizarCategoria(CategoriaDTO categoria);\n\n}",
"private void actualizar(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tModalidadDTO obj = new ModalidadDTO();\n\t\tString codigo = request.getParameter(\"codigo\");\n\t\tString descripcion = request.getParameter(\"descripcion\");\n\t\tString idcategoria = request.getParameter(\"cbocategoria\");\t\t\n\t\tString iddisciplina = request.getParameter(\"cbodisciplina\");\n\t\tString cantidad = request.getParameter(\"cantidad\");\n\t\tString nvarones = request.getParameter(\"varones\");\n\t\tString nmujeres = request.getParameter(\"mujeres\");\n\t\tString genero = request.getParameter(\"genero\");\n\t\tString validaciones = \"\";\n\t\t\n\t\tModalidadDTO x = modalidadService.buscarModalidad(Integer.parseInt(codigo));\n\t\t\n\t\tif(idcategoria.equals(\"\") && iddisciplina.equals(\"\")) {\n\t\t\trequest.setAttribute(\"registro\", x);\n validaciones = \"Debe seleccionar obligatoriamente una categoría y una disciplina\";\n request.setAttribute(\"validaciones\", validaciones);\n request.getRequestDispatcher(\"app/modalidad/actualizar_modalidad.jsp\").forward(request, response);\n }\n\t\t\n\t\telse if(idcategoria.equals(\"\")) {\n\t\t\trequest.setAttribute(\"registro\", x);\n validaciones = \"Debe seleccionar una categoría\";\n request.setAttribute(\"validaciones\", validaciones);\n request.getRequestDispatcher(\"app/modalidad/actualizar_modalidad.jsp\").forward(request, response);\n }\n\t\t\n\t\telse if(iddisciplina.equals(\"\")) {\n\t\t\trequest.setAttribute(\"registro\", x);\n validaciones = \"Debe seleccionar una disciplina\";\n request.setAttribute(\"validaciones\", validaciones);\n request.getRequestDispatcher(\"app/modalidad/actualizar_modalidad.jsp\").forward(request, response);\n }\n\t\t\n\t\telse if(cantidad.replaceAll(\" \", \"\").equals(\"\")) {\n\t\t\trequest.setAttribute(\"registro\", x);\n validaciones = \"El campo numero de jugadores no puede estar vacío\";\n request.setAttribute(\"validaciones\", validaciones);\n request.getRequestDispatcher(\"app/modalidad/actualizar_modalidad.jsp\").forward(request, response);\n }\n\t\t\n\t\telse if(!(cantidad.matches(\"[0-9]*\"))) {\n\t\t\trequest.setAttribute(\"registro\", x);\n validaciones = \"Solo debe ingresar carácteres numéricos en el campo número de jugadores\";\n request.setAttribute(\"validaciones\", validaciones);\n request.getRequestDispatcher(\"app/modalidad/actualizar_modalidad.jsp\").forward(request, response);\n }\n\t\t\n\t\telse if(!(nvarones.matches(\"[0-9]*\"))) {\n\t\t\trequest.setAttribute(\"registro\", x);\n validaciones = \"Solo debe ingresar carácteres numéricos en el campo número de varones\";\n request.setAttribute(\"validaciones\", validaciones);\n request.getRequestDispatcher(\"app/modalidad/actualizar_modalidad.jsp\").forward(request, response);\n }\n\t\t\n\t\telse if(!(nmujeres.matches(\"[0-9]*\"))) {\n\t\t\trequest.setAttribute(\"registro\", x);\n validaciones = \"Solo debe ingresar carácteres numéricos en el campo número de mujeres\";\n request.setAttribute(\"validaciones\", validaciones);\n request.getRequestDispatcher(\"app/modalidad/actualizar_modalidad.jsp\").forward(request, response);\n }\n\t\t\n\t\telse if(request.getParameter(\"cantidad\") != null){\n\t\t\tcantidad = request.getParameter(\"cantidad\");\n\t\t\tobj.setNumJugadores(Integer.parseInt(cantidad));\n\t\t\t\n\t\t}\n\t\t\n\n\t\tif(request.getParameter(\"varones\") != null && request.getParameter(\"mujeres\") != null){\n\t\t\tnvarones = request.getParameter(\"varones\");\n\t\t\tnmujeres = request.getParameter(\"mujeres\");\n\t\t\t\n\t\t\tif(genero.trim().equals(\"1\")){\n\t\t\t\tobj.setNumVarones(Integer.parseInt(cantidad));\n\t\t\t} else if(nvarones!=null && !(nvarones.trim().equals(\"\"))){\n\t\t\t\tobj.setNumVarones(Integer.parseInt(nvarones));\n\t\t\t} else {\n\t\t\t\tobj.setNumVarones(0);\n\t\t\t}\n\t\t\tif(genero.trim().equals(\"2\")){\n\t\t\t\tobj.setNumMujeres(Integer.parseInt(cantidad));\n\t\t\t} else if(nmujeres!=null && !(nmujeres.trim().equals(\"\"))){\n\t\t\t\tobj.setNumMujeres(Integer.parseInt(nmujeres));\n\t\t\t} else {\n\t\t\t\tobj.setNumMujeres(0);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tint total = obj.getNumMujeres() + obj.getNumVarones();\n\t\t\n\t\t\n\t\tif(!(obj.getNumJugadores() == total)){\n\t\t\trequest.setAttribute(\"registro\", x);\n\t\t\tvalidaciones = \"La cantidad de varones y mujeres no coincide con la cantidad total de jugadores\";\n\t\t\trequest.setAttribute(\"validaciones\", validaciones);\n request.getRequestDispatcher(\"app/modalidad/actualizar_modalidad.jsp\").forward(request, response);\n\t\t}\n\t\t\n\t\tif(obj.getNumJugadores() == total){\n\t\t\tobj.setCodCategoria(Integer.parseInt(idcategoria));\n\t\t\tobj.setCodDisciplina(Integer.parseInt(iddisciplina));\n\t\t\tobj.setGenero(Integer.parseInt(genero));\n\t\t\tobj.setDescripcion(descripcion);\n\t\t\tobj.setCodigo(Integer.parseInt(codigo));\n\t\t\tint resultado = modalidadService.actualizarModalidad(obj);\n\t\t\tif (resultado != -1){\n\t\t\t\tlistar(request, response);\n\t\t\t}\n\t\t}else{\n\t\t\t\n\t\t\tresponse.sendRedirect(\"error.html\");\n\t\t\t\n\t\t}\n\t}",
"@RequestMapping(value = \"/kategorien\", method = RequestMethod.POST)\n @ResponseBody\n public void kategorien(\n HttpServletResponse response) throws IOException {\n\n try {\n List<Kategorie> kategorien = kategorieDao.findRootKategorien();\n kategorien.addAll(kategorieDao.getKategorien());\n sendOk(response, mapper.writeValueAsString(kategorien));\n } catch (Exception ex) {\n java.util.logging.Logger.getLogger(BackendController.class.getName()).log(Level.SEVERE, null, ex);\n sendError(response, ex);\n }\n }",
"@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 (DAOException ex) {\r\n Logger.getLogger(AutorPublicacionController.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n }",
"private void populaObjetivoCat()\n {\n objetivoCatDAO.insert(new ObjetivoCat(\"Hipertrofia\", \"weight\"));\n objetivoCatDAO.insert(new ObjetivoCat(\"Saude\", \"apple\"));\n objetivoCatDAO.insert(new ObjetivoCat(\"Emagrecer\", \"gloves\"));\n }",
"protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException, Exception {\n response.setContentType(\"text/html;charset=UTF-8\");\n try (PrintWriter out = response.getWriter()) {\n\n br.com.CrudPizzariaPrototipo.model.Pedido oPedido = new br.com.CrudPizzariaPrototipo.model.Pedido();\n Integer tipoPedido = Integer.parseInt(request.getParameter(\"tipoPedido\"));\n if (tipoPedido == 2) {\n oPedido.setTipoPedido(tipoPedido);\n try {\n oPedido.getCliente().setIdCliente((Integer.parseInt(request.getParameter(\"cliente\"))));\n } catch (Exception ex) {\n throw new Exception(\"Cliente Inválido!\");\n }\n try {\n oPedido.getMesa().setIdMesa(Integer.parseInt(request.getParameter(\"mesa\")));\n } catch (Exception ex) {\n throw new Exception(\"Mesa Inválida!\");\n }\n } else if (tipoPedido == 1) {\n oPedido.setTipoPedido(tipoPedido);\n try {\n oPedido.getCliente().setIdCliente((Integer.parseInt(request.getParameter(\"cliente\"))));\n\n } catch (Exception ex) {\n throw new Exception(\"Cliente Inválido!\");\n }\n try {\n oPedido.getEntregador().setIdEntregador(Integer.parseInt(request.getParameter(\"entregador\")));\n\n } catch (Exception ex) {\n throw new Exception(\"Entregador Inválido!\");\n }\n }\n\n // :(\n }\n }",
"private void guardar(String opcion, String descripcion, HttpServletResponse response) {\n\t\ttry{\n\t\t\tOpcion o = new Opcion();\n\t\t\tDT_Opcion dta = new DT_Opcion();\n\t\t\to.setDescripcion(descripcion);\n\t\t\to.setOpcion(opcion);\n\t\t\tverificarResultado(datosOpcion.guardarOpcion(o), response);\n\t\t}\n\t\tcatch(Exception e){\n\t\t\te.printStackTrace();\n\t\t\tSystem.out.println(\"ERROR EN EL SERVLET: \"+e.getMessage());\n\t\t}\n\t}",
"private void listadoCategorias() {\r\n sessionProyecto.getCategorias().clear();\r\n sessionProyecto.setCategorias(itemService.buscarPorCatalogo(CatalogoEnum.CATALOGOPROYECTO.getTipo()));\r\n }",
"@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n String nombre = request.getParameter(\"nombre\");\n String descripcion = request.getParameter(\"descripcion\");\n String cantidad = request.getParameter(\"cantidad\");\n String precio = request.getParameter(\"precio\");\n String pago = request.getParameter(\"pago\");\n \n //creando objeto del costructor\n modelo.ventas venta = new modelo.ventas();\n //almacenando datos en las variables con el constructor \n venta.setNombre(nombre);\n venta.setDescripcion(descripcion);\n venta.setCantidad(Integer.parseInt(cantidad));\n venta.setPrecio(Double.parseDouble(precio));\n venta.setPago(Integer.parseInt(pago));\n \n //creando objeto para guardar cliente\n modelo.addVenta addventa = new modelo.addVenta();\n try {\n addventa.agrega(venta);\n } catch (SQLException ex) {\n Logger.getLogger(formVenta.class.getName()).log(Level.SEVERE, null, ex);\n }\n response.sendRedirect(\"ventas\");//si se guarda exitosamente se redirecciona a membresia\n }",
"@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n \r\n \r\n \r\n \r\n String accion =request.getParameter(\"accion\");\r\n \r\n switch(accion){\r\n case \"Listar\":\r\n request.getRequestDispatcher(\"ListarUsRol.jsp\").forward(request, response);\r\n \r\n break;\r\n case\"Nuevo\":\r\n request.getRequestDispatcher(\"IngresoUsRol.jsp\").forward(request, response);\r\n\r\n break;\r\n case \"Guardar\":\r\n \r\n String id=request.getParameter(\"txtid\");\r\n String idrol=request.getParameter(\"txtidrol\");\r\n String idusuario=request.getParameter(\"txtidusuario\");\r\n \r\n u.setIdUsRol(id);\r\n u.setIdRol(idrol);\r\n u.setIdUs(idusuario);\r\n \r\n \r\n dao.agregar(u);\r\n request.getRequestDispatcher(\"ControladorUsRol?accion=Listar\").forward(request, response);\r\n break;\r\n \r\n \r\ndefault:\r\n throw new AssertionError();\r\n\r\n}\r\n }",
"private void createCustomer(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\n String customerName = request.getParameter(\"CustomerName\");\n System.out.println(\"them mới id\"+ customerName);\n String customerBir = request.getParameter(\"CustomerBir\");\n String gender = request.getParameter(\"Gender\");\n int cusIdNum =Integer.parseInt(request.getParameter(\"CusIdNum\"));\n int cusTelNum = Integer.parseInt(request.getParameter(\"CusTelNum\"));\n String cusEmail = request.getParameter(\"CusEmail\");\n String address = request.getParameter(\"Address\");\n String customerTypeId = request.getParameter(\"CustomerTypeId\");\n System.out.println(\"them mới id\"+ customerName);\n Customer customer = new Customer(customerName,customerBir,gender,cusIdNum,cusTelNum,cusEmail,address, new CustomerType(customerTypeId));\n customerService.save(customer);\n showCustomerList(request,response);\n System.out.println(\"them mới\"+ customer);\n }",
"@Override\r\npublic int create(Detalle_pedido d) {\n\treturn detalle_pedidoDao.create(d);\r\n}",
"protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n response.setContentType(\"text/html;charset=UTF-8\");\n request.setCharacterEncoding(\"UTF-8\");\n try (PrintWriter out = response.getWriter()) {\n /* TODO output your page here. You may use following sample code. */\n \n Connection con = (Connection) getServletContext().getAttribute(\"Connection\");\n String SQL = \"\";\n\n String command = request.getParameter(\"command\");\n\n try {\n if (command.equals(\"Add\")) {\n String categoryTypeName = request.getParameter(\"categoryTypeName\");\n SQL = \"INSERT INTO category VALUES (?)\";\n PreparedStatement ppstm = con.prepareStatement(SQL);\n ppstm.setString(1, categoryTypeName);\n out.print(categoryTypeName);\n ppstm.executeUpdate();\n } else {\n SQL = \"DELETE FROM category WHERE cate_type = ?\";\n PreparedStatement ppstm = con.prepareStatement(SQL);\n ppstm.setString(1, command);\n ppstm.executeUpdate();\n }\n out.println(\"<script type=\\\"text/javascript\\\">\");\n out.println(\"alert('Success');\");\n out.println(\"location='viewCategory.jsp';\");\n out.println(\"</script>\");\n } catch (Exception ex) {\n out.println(\"<script type=\\\"text/javascript\\\">\");\n out.println(\"alert('Cannot Delete');\");\n out.println(\"location='viewCategory.jsp';\");\n out.println(\"</script>\");\n }\n\n// out.print(\"process : \" + command);\n }\n }",
"public void setId(Category category) {\n\t\r\n}",
"public interface DVDCategorieDAO {\n /**\n * This is the method to be used to initialize\n * database resources ie. connection.\n */\n public void setDataSource(DataSource ds);\n\n /**\n * This is the method to be used to create\n * a record in the Graduate table.\n */\n public void create(int id, DVD dvd, Categorie categorie);\n\n /**\n * This is the method to be used to list down\n * a record from the Graduate table corresponding\n * to a passed graduate id.\n */\n public DVDCategorie getDVDCategorie(int id);\n\n /**\n * This is the method to be used to list down\n * all the records from the Graduate table.\n */\n public List<DVDCategorie> listDVDCategorie();\n\n /**\n * This is the method to be used to delete\n * a record from the Graduate table corresponding\n * to a passed graduate id.\n */\n public void delete(Integer id);\n\n /**\n * This is the method to be used to update\n * a record into the Graduate table.\n */\n public void update(Integer id, DVD dvd, Categorie categorie);\n}",
"private void action_insert_genreSeries(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n try {\n TemplateResult result = new TemplateResult(getServletContext());\n if (SecurityLayer.checkSession(request) != null) {\n User user = getDataLayer().getUser(SecurityLayer.checkNumeric((request.getSession().getAttribute(\"userid\")).toString()));\n if (user.getGroup().getID() != Group.ADMIN) {\n action_error(request, response, \"Non hai i permessi per effettuare questa operazione!\");\n System.err.println(\"Errore in SeriesManagement.java, nel metodo action_insert_genreSeries: Utente senza permessi da amministratore\");\n return;\n }\n request.setAttribute(\"where\", \"back\");\n request.setAttribute(\"user\", user);\n RESTUtility.checkNotifications(user, request, response);\n request.setAttribute(\"strip_slashes\", new SplitSlashesFmkExt());\n request.setAttribute(\"genres\", getDataLayer().getGenres());\n request.setAttribute(\"series\", RESTSortLayer.sortSeriesByName(getDataLayer().getSeries()));\n request.setAttribute(\"backContent_tpl\", \"insertGenreSeries.ftl.html\");\n result.activate(\"../back/backOutline.ftl.html\", request, response);\n } else {\n //User session is no longer valid\n request.setAttribute(\"error\", \"Devi essere loggato per eseguire quest'azione!\");\n result.activate(\"logIn.ftl.html\", request, response);\n }\n } catch (NumberFormatException ex) {\n //User is not a number\n action_error(request, response, \"Riprova di nuovo!\");\n System.err.println(\"Errore in SeriesManagement.java, nel metodo action_insert_genreSeries: NumberFormatException\");\n }\n }",
"@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n String pagina = \"\";\n int option = Integer.parseInt(request.getParameter(\"option\"));\n int id_proveedor = Integer.parseInt(request.getParameter(\"proveedor\"));\n int id_pedido = Integer.parseInt(request.getParameter(\"pedido_id\"));\n \n \n switch(option) {\n case 1: {\n // CREAR\n int estado = 0;\n pagina=\"/cotizacion/crearCotizacion.jsp\";\n \n //usuarioBean usuario = (usuarioBean) request.getSession().getAttribute(\"usuario\");\n \n int id_fk_pedido = id_pedido;\n int id_fk_usuario = id_proveedor;\n String forma_pago = request.getParameter(\"forma_pago\");\n String descripcion = request.getParameter(\"descripcion\");\n float costo = 0;\n cotizacionBean objCotizacionBean=new cotizacionBean();\n objCotizacionBean.setId_fk_pedido(id_fk_pedido);\n objCotizacionBean.setId_fk_usuario(id_fk_usuario);\n objCotizacionBean.setForma_pago(forma_pago);\n objCotizacionBean.setDescripcion(descripcion);\n objCotizacionBean.setCosto(costo);\n \n cotizacionDAO objcotizacionDAO=new cotizacionDAO();\n estado = objcotizacionDAO.InsertarCotizacion(objCotizacionBean);\n \n //VALIDAR NSERCION\n if(estado == 1) {\n request.setAttribute(\"mensaje\",\"Se envio correctamente\");\n }\n else {\n request.setAttribute(\"mensaje\",\"Fallo al momento de crear\");\n }\n }\n case 3: {\n //ACTUALIZAR\n }\n case 4: {\n //ELIMINAR\n }\n }\n \n getServletContext().getRequestDispatcher(pagina).forward(request, response);\n }",
"@RequestMapping(value = \"/kategorie\", method = RequestMethod.POST)\n @ResponseBody\n public void kategorie(\n @RequestParam(value = \"id\") Integer id,\n HttpServletResponse response) throws IOException {\n\n try {\n Kategorie kategorie = kategorieDao.findKategorie(Long.parseLong(id.toString()));\n sendOk(response, mapper.writeValueAsString(kategorie));\n } catch (Exception ex) {\n java.util.logging.Logger.getLogger(BackendController.class.getName()).log(Level.SEVERE, null, ex);\n sendError(response, ex);\n }\n }",
"@PostMapping(\"/categorie/save\")\n CategorieProduitDTO saveCategorie(@RequestBody CategorieProduitDTO categorieProduitDTO) {\n return categorieProduitMetier.saveCategorie(categorieProduitDTO);\n }",
"public interface CategoryDao {\n\n /**\n * Method adds category to database\n * @param category\n */\n void addCategory(Category category);\n\n /**\n * Method updates category in database\n * @param category\n */\n void updateCategory(Category category);\n\n /**\n * Methods returns category by id\n * @param id\n * @return\n */\n Category selectCategory(long id);\n\n /**\n * Methods returns category by category name\n * @param name\n * @return category\n */\n Category selectCategory(String name);\n\n /**\n * Method returns category list\n * @return category list\n */\n List<Category> selectCategoryList();\n\n /**\n * Method deletes category by id\n * @param id\n */\n void deleteCategory(long id);\n\n /**\n * Method deletes category parameter\n * @param id\n */\n void deleteParameter(long id);\n\n /**\n * Method deletes category products\n * @param id\n */\n void deleteCategoryProducts(long id);\n\n /**\n * Method delete category parameter product details\n * @param id\n */\n void deleteCategoryParameterProductDetails(long id);\n}",
"@SuppressWarnings( value = \"unchecked\" )\n protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n\n response.setContentType(\"text/json;charset=UTF-8\");\n PrintWriter out = response.getWriter();\n ResourceBundle rs = Uteis.getBundle( request.getLocale().getLanguage() );\n\n out.print( \"{ success: \" );\n\n try {\n\n /*\n * Faz a validação do usuário.\n * Caso não seja válido, dispara uma exceção.\n * Apenas o administrador tem acesso a este servlet.\n */\n Uteis.validateUser( request, rs, TipoUsuario.A );\n\n Dao dao = ( Dao ) SpringUtil.getBean( \"dao\" );\n HibernateTemplate ht = dao.getHibernateTemplate();\n Transaction t = ht.getSessionFactory().getCurrentSession().beginTransaction();\n t.begin();\n\n String acao = request.getParameter( \"acao\" );\n String id = request.getParameter( \"id\" );\n\n if ( acao.equals( \"salvar\" ) ) {\n\n String propriedade = request.getParameter( \"propriedade\" );\n String valor = request.getParameter( \"valor\" );\n\n Configuracao c = null;\n\n if ( id.equals( \"\" ) )\n c = new Configuracao();\n else\n c = ( Configuracao ) ht.load( Configuracao.class, Long.parseLong( id ) );\n\n c.setPropriedade( propriedade );\n c.setValor( valor );\n\n ht.saveOrUpdate( c );\n t.commit();\n\n } else if ( acao.equals( \"excluir\" ) ) {\n\n Configuracao c = ( Configuracao ) ht.load( Configuracao.class, Long.parseLong( id ) );\n ht.delete( c );\n t.commit();\n\n }\n\n // recarrega atributos no contexto\n getServletContext().setAttribute( \"configs\",\n Uteis.obtemConfiguracoes() );\n\n out.print( \"true\" );\n\n } catch ( Exception exc ) {\n\n Map< String, String > configs = ( HashMap< String, String > )\n getServletContext().getAttribute( \"configs\" );\n\n /*\n * Baseado no parâmetro de debug da aplicação, cria a mensagem de\n * erro para retornar\n */\n out.print( Uteis.createErrorMessage( exc, new Boolean( configs.get( \"debug\" ) ) ) );\n\n } finally {\n out.print( \"}\" );\n out.close();\n }\n\n }",
"protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\t\n\t\tList<crime_criminalBean> crime_criminalBeanlist=new crime_criminalDao().select();\n\t\trequest.setAttribute(\"crime_criminalBeanlist\", crime_criminalBeanlist);\n\t\trequest.getRequestDispatcher(\"crime_criminal_list.jsp\").forward(request, response);\n\t\t\n\t}",
"protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n\n request.setCharacterEncoding(\"UTF-8\");\n Redirect rd = new Redirect();\n ManageSession_Parameter manageSession_Parameter = new ManageSession_Parameter(request);\n boolean session = manageSessions_actions.checkSession(manageSession_Parameter);\n\n if (!session) { //si no hay sesión\n rd.redirect(request, response, \"/Boot\");\n\n } else { //si hay alguna sesión\n\n if (manageSessions_actions.getUser(manageSession_Parameter).getIdUsuario() == 1) { // es administrador\n GuardarCiudades_Parameter guardarCiudades_Parameter = new GuardarCiudades_Parameter(request);\n guardarCiudades_Actions.insertCity(guardarCiudades_Parameter);\n rd.redirect(request, response, \"/Configuracion?metodo=ciudad\");\n\n } else {\n rd.redirect(request, response, \"Boot\");\n }\n\n }\n\n }",
"protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n response.setContentType(\"text/html;charset=UTF-8\");\n PrintWriter out = response.getWriter();\n \n String opcion = request.getParameter(\"boton\");\n String IdPedido = request.getParameter(\"txtidPedido\");\n String IdProducto = request.getParameter(\"txtidProducto\");\n String Cantidad = request.getParameter(\"Cantidad\");\n String Observacion = request.getParameter(\"Observacion\");\n String Subtotal = \"\";\n \n detallePedidoVO detPedVO = new detallePedidoVO(IdProducto, IdPedido, Cantidad, Subtotal, Observacion);\n detallePedidoDAO detPedDAO = new detallePedidoDAO(detPedVO);\n \n switch (opcion) {\n case \"Agregar\": //Registrar\n if (detPedDAO.AgregarRegistro()) {\n request.setAttribute(\"idPedido\", IdPedido);\n request.setAttribute(\"MensajeExitoDet\", \"El pedido fue registrado correctamente\");\n\n } else {\n request.setAttribute(\"idPedido\", IdPedido);\n request.setAttribute(\"MensajeErrorDet\", \"El pedido NO fue registrado correctamente\");\n\n }\n request.getRequestDispatcher(\"PedidoRegistroP.jsp\").forward(request, response);\n break;\n case \"Resta\": //Registrar\n if (detPedDAO.DisminuirCantidad()) {\n request.setAttribute(\"idPedido\", IdPedido);\n request.setAttribute(\"MensajeExitoDet\", \"El pedido fue registrado correctamente\");\n\n } else {\n request.setAttribute(\"idPedido\", IdPedido);\n request.setAttribute(\"MensajeErrorDet\", \"El pedido NO fue registrado correctamente\");\n\n }\n request.getRequestDispatcher(\"PedidoRegistroP.jsp\").forward(request, response);\n break;\n case \"Quitar\": //Registrar\n if (detPedDAO.EliminarRegistro()) {\n request.setAttribute(\"idPedido\", IdPedido);\n request.setAttribute(\"MensajeExitoDetQ\", \"Se retiró corecatemente el producto\");\n\n } else {\n request.setAttribute(\"idPedido\", IdPedido);\n request.setAttribute(\"MensajeErrorDetQ\", \"No se pudo retirar el producto\");\n\n }\n request.getRequestDispatcher(\"PedidoRegistroP.jsp\").forward(request, response);\n break;\n case \"Guardar\": //Registrar\n if (detPedDAO.Guardar()) {\n request.setAttribute(\"MensajeExitoGuard\", \"Se guardó corecatemente el pedido\");\n request.getRequestDispatcher(\"HomePedidos.jsp\").forward(request, response);\n\n } else {\n request.setAttribute(\"MensajeErrorDetG\", \"No se pudo retirar el producto\");\n request.getRequestDispatcher(\"PedidoRegistroP.jsp\").forward(request, response);\n\n }\n \n break;\n case \"ConsultaEsp\":\n detallePedidoVO detPediVO = detallePedidoDAO.ConsultaE(IdPedido);\n if (detPediVO != null) {\n request.setAttribute(\"voLlenoDet\", detPediVO);\n request.getRequestDispatcher(\"pedidos.jsp\").forward(request, response);\n } else {\n request.setAttribute(\"MensajeErrorPC\", \"No se encontro\");\n request.getRequestDispatcher(\"pedidos.jsp\").forward(request, response);\n }\n break;\n default:\n\n }\n }",
"public interface BaseDAO {\n void insertWeChat(WeChat weChat);\n\n void insertCategory(Category category);\n\n boolean isExistCategory(Integer c_id);\n}",
"Persistencia() {\n\t}",
"public Categorie addCategorie(Categorie c);",
"public interface CategoryDAO extends DAO<AbsractCategory> {\n\n /**\n * getting exactly one category specified by the given id\n *\n * @param identificaitonNumber of the category to search for\n * @return exactely one category\n * @throws PersistenceException\n */\n AbsractCategory searchByID(int identificaitonNumber) throws PersistenceException;\n\n /**\n * getting a list of all equipment categorys\n *\n * @return a list of all equipment categorys like, kurzhantel, langhantel, springschnur ...\n * @throws PersistenceException\n */\n List<EquipmentCategory> getAllEquipment() throws PersistenceException;\n\n /**\n * getting a list of all muscle groups\n *\n * @return a list of all muslce groups like, bauchmuskeln, oberschenkel, unterschenkel ...\n * @throws PersistenceException\n */\n List<MusclegroupCategory> getAllMusclegroup() throws PersistenceException;\n\n /**\n * getting a list of all trainingstypes\n *\n * @return a list of all trainingstypes: ausdauer, kraft, balance, flexibilitaet\n * @throws PersistenceException\n */\n List<TrainingsCategory> getAllTrainingstype() throws PersistenceException;\n\n}",
"public Categorie updateCategorie(Categorie c);",
"@Test\n public void testSave() throws Exception {\n ProductCategory productCategory = categoryServiceImpl.findOne(1);\n productCategory.setCategoryName(\"Lego\");\n ProductCategory category = categoryServiceImpl.save(productCategory);\n System.out.println(\"category:\" + category);\n }",
"Category saveCategory(Category category);",
"@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n GestorDB g = new GestorDB();\n\n String nombre = \"\";\n String descripcion = \"\";\n int id_comercio = 0;\n int id_rubro = 0;\n\n nombre = request.getParameter(\"nombre\");\n descripcion = request.getParameter(\"descripcion\");\n if (!(request.getParameter(\"idComercio\") == null)) {\n id_comercio = Integer.parseInt(request.getParameter(\"idComercio\"));\n }\n if (!(request.getParameter(\"id_rubro\") == null)) {\n id_rubro = Integer.parseInt(request.getParameter(\"id_rubro\"));\n }\n ArrayList<Comercio> c = g.obtenerComercioPorRubro(id_rubro);\n Rubro r = g.obtenerRubroPorId(id_rubro);\n String abmOfertas = request.getParameter(\"opcion\");\n switch (abmOfertas) {\n case \"crear\":\n if ((nombre.equals(\"\")) || (descripcion.equals(\"\")) || (id_rubro == 0)) {\n RequestDispatcher rd = getServletContext().getRequestDispatcher(\"/abmComercios.jsp\");\n request.setAttribute(\"error\", \"Error al agregar el comercio, porfavor complete todo los campos\");\n rd.forward(request, response);\n } else {\n if (g.agregarComercio(new Comercio(id_comercio, nombre, r, descripcion))) {\n RequestDispatcher rd = getServletContext().getRequestDispatcher(\"/abmComercios.jsp\");\n request.setAttribute(\"mensaje\", \"Comercio Agregado correctamente!\");\n rd.forward(request, response);\n } else {\n RequestDispatcher rd = getServletContext().getRequestDispatcher(\"/abmComercios.jsp\");\n request.setAttribute(\"error\", \"Error al agregar el comercio, intente de nuevo\");\n rd.forward(request, response);\n }\n }\n break;\n\n case \"modificar\":\n if ((nombre.equals(\"\")) || (descripcion.equals(\"\")) || (id_rubro == 0) || (id_comercio == 0)) {\n RequestDispatcher rd = getServletContext().getRequestDispatcher(\"/abmComercios.jsp\");\n request.setAttribute(\"error\", \"Error al modificar el comercio, porfavor complete todo los campos\");\n rd.forward(request, response);\n } else {\n if (g.modificarComercio(new Comercio(id_comercio, nombre, r, descripcion))) {\n RequestDispatcher rd = getServletContext().getRequestDispatcher(\"/abmComercios.jsp\");\n request.setAttribute(\"mensaje\", \"Comerico modificado correctamente!\");\n rd.forward(request, response);\n } else {\n RequestDispatcher rd = getServletContext().getRequestDispatcher(\"/abmComercios.jsp\");\n request.setAttribute(\"error\", \"Error al modificar el comercio, intente de nuevo\");\n rd.forward(request, response);\n\n }\n }\n break;\n\n case \"eliminar\":\n if (id_comercio > 0) {\n if (g.eliminarComercio(id_comercio)) {\n RequestDispatcher rd = getServletContext().getRequestDispatcher(\"/abmComercios.jsp\");\n request.setAttribute(\"mensaje\", \"Eliminado correctamente!\");\n rd.forward(request, response);\n } else {\n RequestDispatcher rd = getServletContext().getRequestDispatcher(\"/abmComercios.jsp\");\n request.setAttribute(\"error\", \"Error al eliminar el comercio, debera eliminar todos los comentarios en del comercio primero\");\n rd.forward(request, response);\n }\n }\n break;\n }\n }",
"private void buscarModalidad(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tString dato = request.getParameter(\"cod\");\n\t\tint codigo = Integer.parseInt(dato);\n\t\tModalidadDTO obj = modalidadService.buscarModalidad(codigo);\n\t\trequest.setAttribute(\"registro\", obj);\n\t\trequest.getRequestDispatcher(\"app/modalidad/actualizar_modalidad.jsp\").forward(request,\n\t\t\t\tresponse);\n\t}",
"List<CategoriaDTO> obtenerCategorias(String estado);",
"void savePerilClass(HttpServletRequest request, String userId) throws SQLException, JSONException, Exception;",
"private void populaSexoCat()\n {\n sexoCatDAO.insert(new SexoCat(\"Masculino\"));\n sexoCatDAO.insert(new SexoCat(\"Feminino\"));\n sexoCatDAO.insert(new SexoCat(\"Todos\"));\n }",
"protected void processRequest(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n response.setContentType(\"text/html;charset=UTF-8\");\r\n PrintWriter out = response.getWriter();\r\n\r\n HttpSession session = request.getSession();\r\n String accion = request.getParameter(\"accion\");\r\n Usuario objUsuario = (Usuario) session.getAttribute(\"usuario\");\r\n\r\n cFamilia objcFamilia = new cFamilia();\r\n cOtros objcOtros = new cOtros();\r\n if (accion == null) {\r\n session.removeAttribute(\"codFamiliaMantenimiento\");\r\n response.sendRedirect(\"articuloProducto/familiaMantenimiento.jsp\");\r\n } else {\r\n if (accion.equals(\"registrar\")) {\r\n try {\r\n Familia objFamilia = new Familia();\r\n objFamilia.setFamilia(request.getParameter(\"familia\"));\r\n objFamilia.setObservacion(request.getParameter(\"observacion\"));\r\n objFamilia.setRegistro(objcOtros.registro(\"1\", objUsuario.getCodUsuario().toString()));\r\n int codFamilia = objcFamilia.Crear(objFamilia);\r\n if (codFamilia != 0) {\r\n out.print(codFamilia);\r\n } else {\r\n out.print(\"Error: \" + objcFamilia.getError());\r\n }\r\n } catch (Exception e) {\r\n out.print(\"Error en parámetros.\");\r\n }\r\n }\r\n if (accion.equals(\"mantenimiento\")) {\r\n session.removeAttribute(\"codFamiliaMantenimiento\");\r\n session.setAttribute(\"codFamiliaMantenimiento\", Integer.parseInt(request.getParameter(\"codFamilia\")));\r\n response.sendRedirect(\"articuloProducto/familiaMantenimiento.jsp\");\r\n }\r\n if (accion.equals(\"editar\")) {\r\n try {\r\n Familia objFamilia = new Familia();\r\n objFamilia.setCodFamilia(Integer.parseInt(request.getParameter(\"codFamilia\")));\r\n objFamilia.setFamilia(request.getParameter(\"familia\"));\r\n objFamilia.setObservacion(request.getParameter(\"observacion\"));\r\n objFamilia.setRegistro(objcOtros.registro(\"1\", objUsuario.getCodUsuario().toString()));\r\n if (objcFamilia.actualizar(objFamilia)) {\r\n out.print(objFamilia.getCodFamilia());\r\n } else {\r\n out.print(\"Error: \" + objcFamilia.getError());\r\n }\r\n } catch (NumberFormatException e) {\r\n out.print(\"Error en parámetros.\");\r\n }\r\n }\r\n }\r\n }",
"protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n response.setContentType(\"text/html;charset=UTF-8\");\n String nivel = \"\";\n\n try (PrintWriter out = response.getWriter()) {\n System.out.println(\"ESTE ES UN BOX \" + request.getParameter(\"noticiaBox\"));\n HttpSession session = request.getSession();\n nivel = (String) session.getAttribute(\"nivel\");\n //String DRIVER = \"com.mysql.jdbc.Driver\";\n //Class.forName(DRIVER);\n java.sql.Connection con = null;\n try {\n con = new Conexion().getConnection();\n } catch (SQLException ex) {\n System.out.println(ex);\n }\n String categoria = request.getParameter(\"categoria\");\n System.out.println(\"Categoria: \" + categoria);\n String titulo = request.getParameter(\"titulo\");\n String cuerpo = request.getParameter(\"cuerpo\");\n try {\n\n con = new Conexion().getConnection();\n int usr_id = (int) (session.getAttribute(\"usr_id\"));\n Operaciones op = new Operaciones();\n boolean borrador = new Operaciones().hasBorrador(usr_id);\n\n String q = borrador ? \"UPDATE MPublicacion SET `pub_tit` = ? WHERE pub_id = \" + op.getIdBorrador()\n : \"INSERT INTO MPublicacion (`pub_tit`,`usr_id`) VALUES (?,?);\";\n\n String q2 = borrador ? \"UPDATE DPublicacion SET `typ_id` = ?, `pub_txt` = ?, `pub_dat` = CURRENT_TIMESTAMP() WHERE pub_id = ?\"\n : \"INSERT INTO DPublicacion(`typ_id`, `pub_txt`, `pub_dat`, `pub_vot`, `pub_id`) VALUES (?, ?, CURRENT_TIMESTAMP(), 1, ?);\";\n\n String q3 = borrador ? \"UPDATE DHistorial SET `hst_dat` = CURRENT_TIMESTAMP() WHERE `pub_id` = \" + op.getIdBorrador()\n : \"INSERT INTO DHistorial(`usr_id`, `pub_id`, `hst_dat`, `hst_act`) VALUES (?, ?, CURRENT_TIMESTAMP(), 1)\";\n\n String q4 = categoria == null ? \"\" : \"INSERT INTO EPublicacionetiqueta VALUES(?,?)\";\n\n ResultSet rs;\n int eti_id = 0;\n PreparedStatement ps = con.prepareStatement(q);\n PreparedStatement ps2 = con.prepareStatement(q2);\n PreparedStatement ps3 = con.prepareStatement(q3);\n PreparedStatement ps4 = con.prepareStatement(q4);\n\n ps.setString(1, titulo);\n if (!borrador) {\n ps.setInt(2, usr_id);\n }\n ps.executeUpdate();\n int id = new Operaciones().getLastPublicacion(usr_id);\n\n String tipo = request.getParameter(\"btnpost\");\n int pubtype = 0;\n switch (tipo) {\n case \"Publicar\":\n pubtype = 1;\n break;\n case \"Noticia\":\n pubtype = 2;\n break;\n case \"Guardar como borrador\":\n pubtype = 3;\n break;\n }\n\n ps2.setInt(1, pubtype);\n ps2.setString(2, cuerpo);\n ps2.setInt(3, id);\n ps2.executeUpdate();\n\n if (!borrador) {\n ps3.setInt(1, usr_id);\n ps3.setInt(2, id);\n }\n ps3.executeUpdate();\n\n if (q4 != \"\") {\n ps4.setInt(1, Integer.parseInt(categoria));\n ps4.setInt(2, id); \n ps4.executeUpdate();\n }\n con.close();\n response.sendRedirect(\"MainPage.jsp\");\n con.close();\n } catch (IOException | SQLException e) {\n System.out.println(\"Error en el Post\");\n System.err.println(e);\n e.printStackTrace();\n }finally{\n try {\n con.close();\n } catch (SQLException ex) {\n Logger.getLogger(ConsultaBD.class.getName()).log(Level.SEVERE, null, ex);\n }\n }\n } catch (ClassNotFoundException ex) {\n System.out.println(ex);\n }\n }",
"protected void processRequest(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n response.setContentType(\"text/html;charset=UTF-8\");\r\n PrintWriter out = response.getWriter();\r\n\r\n\r\n HttpSession session = request.getSession();\r\n String accion = request.getParameter(\"accionProveedor\");\r\n\r\n Usuario objUsuario = (Usuario) session.getAttribute(\"usuario\");\r\n cProveedor objcProveedor = new cProveedor();\r\n Proveedor objProveedor = new Proveedor();\r\n\r\n Integer codProveedor;\r\n String ruc;\r\n String razonSocial;\r\n String direccion;\r\n String telefono;\r\n String email;\r\n String paginaWeb;\r\n String observaciones;\r\n String logo;\r\n String registro;\r\n if (accion == null) {\r\n try {\r\n codProveedor = Integer.parseInt(\"codProveedor\");\r\n } catch (Exception e) {\r\n codProveedor = 0;\r\n }\r\n session.removeAttribute(\"codProveedorListar\");\r\n session.setAttribute(\"codProveedorListar\", codProveedor);\r\n response.sendRedirect(\"persona/proveedorListar.jsp\");\r\n } else {\r\n if (accion.equals(\"registrar\")) {\r\n ruc = request.getParameter(\"ruc\");\r\n razonSocial = request.getParameter(\"razonSocial\");\r\n direccion = request.getParameter(\"direccion\");\r\n telefono = request.getParameter(\"telefono1\");\r\n email = request.getParameter(\"email\");\r\n paginaWeb = request.getParameter(\"paginaWeb\");\r\n observaciones = request.getParameter(\"observaciones\");\r\n logo = request.getParameter(\"logo\");\r\n registro = new cOtros().registro(\"1\", objUsuario.getCodUsuario().toString());\r\n\r\n objProveedor = new Proveedor();\r\n objProveedor.setRuc(ruc);\r\n objProveedor.setRazonSocial(razonSocial);\r\n objProveedor.setDireccion(direccion);\r\n objProveedor.setTelefono(telefono);\r\n objProveedor.setEmail(email);\r\n objProveedor.setPaginaWeb(paginaWeb);\r\n objProveedor.setObservaciones(observaciones);\r\n objProveedor.setLogo(logo);\r\n objProveedor.setRegistro(registro);\r\n codProveedor = objcProveedor.Crear(objProveedor);\r\n if (codProveedor != 0) {\r\n out.print(codProveedor);\r\n } else {\r\n out.print(objcProveedor.getError());\r\n }\r\n }\r\n //editar proveedor\r\n if (accion.equals(\"editarVar\")) {\r\n try {\r\n codProveedor = Integer.parseInt(request.getParameter(\"codProveedor\"));\r\n session.removeAttribute(\"codProveedorEditar\");\r\n session.setAttribute(\"codProveedorEditar\", codProveedor);\r\n response.sendRedirect(\"persona/proveedorEditar.jsp\");\r\n } catch (Exception e) {\r\n response.sendRedirect(\"persona/proveedorListar.jsp\");\r\n return;\r\n }\r\n }\r\n //editar\r\n if (accion.equals(\"editar\")) {\r\n objProveedor.setRuc(request.getParameter(\"ruc\"));\r\n objProveedor.setRazonSocial(request.getParameter(\"razonSocial\"));\r\n objProveedor.setDireccion(request.getParameter(\"direccion\"));\r\n objProveedor.setTelefono(request.getParameter(\"telefono1\"));\r\n objProveedor.setEmail(request.getParameter(\"email\") != null ? (!request.getParameter(\"email\").equals(\"\") ? request.getParameter(\"email\") : \"Sin datos\") : \"Sin datos\");\r\n objProveedor.setPaginaWeb(request.getParameter(\"paginaWeb\") != null ? (!request.getParameter(\"paginaWeb\").equals(\"\") ? request.getParameter(\"paginaWeb\") : \"Sin datos\") : \"Sin datos\");\r\n objProveedor.setObservaciones(request.getParameter(\"observvaciones\") != null ? request.getParameter(\"Observaciones\") : \"Sin datos\");\r\n objProveedor.setLogo(request.getParameter(\"logo\") != null ? request.getParameter(\"logo\") : \"\");\r\n objProveedor.setRegistro(new cOtros().registro(\"1\", objUsuario.getCodUsuario().toString()));\r\n out.print(\"implementando\");\r\n }\r\n //eliminar proveedor\r\n if (accion.equals(\"eliminar\")) {\r\n try {\r\n codProveedor = Integer.parseInt(request.getParameter(\"codProveedor\"));\r\n } catch (Exception e) {\r\n out.print(\"Error en parámetros\");\r\n return;\r\n }\r\n if (objcProveedor.actualizar_registro(Integer.parseInt(request.getParameter(\"codProveedor\")), \"0\", objUsuario.getCodUsuario().toString())) {\r\n out.print(codProveedor);\r\n } else {\r\n out.print(\"Error al eliminar\");\r\n }\r\n }\r\n if (accion != null) {\r\n if (accion.equals(\"a\")) {\r\n codProveedor = Integer.parseInt(request.getParameter(\"codProveedor\"));\r\n session.removeAttribute(\"accionProveedor\");\r\n session.setAttribute(\"accionProveedor\", \"a\");\r\n session.removeAttribute(\"objProveedor\");\r\n session.setAttribute(\"objProveedor\", objcProveedor.leer_cod(codProveedor));\r\n response.sendRedirect(\"persona/proveedorFrm.jsp\");\r\n// response.sendRedirect(\"persona/proveedorListar.jsp\");\r\n }\r\n if (accion.equals(\"e\")) {\r\n codProveedor = Integer.parseInt(request.getParameter(\"codProveedor\"));\r\n\r\n// if (codProveedor == 0) {\r\n// response.sendRedirect(\"\");\r\n// }\r\n response.sendRedirect(\"persona/proveedorListar.jsp\");\r\n }\r\n } else {\r\n accion = (String) session.getAttribute(\"accionProveedor\");\r\n if (accion.equals(\"a\")) {\r\n objProveedor.setRuc(request.getParameter(\"ruc\"));\r\n objProveedor.setRazonSocial(request.getParameter(\"razonSocial\"));\r\n objProveedor.setDireccion(request.getParameter(\"direccion\"));\r\n objProveedor.setTelefono(request.getParameter(\"telefono1\"));\r\n objProveedor.setEmail(request.getParameter(\"email\") != null ? (!request.getParameter(\"email\").equals(\"\") ? request.getParameter(\"email\") : \"Sin datos\") : \"Sin datos\");\r\n objProveedor.setPaginaWeb(request.getParameter(\"paginaWeb\") != null ? (!request.getParameter(\"paginaWeb\").equals(\"\") ? request.getParameter(\"paginaWeb\") : \"Sin datos\") : \"Sin datos\");\r\n objProveedor.setObservaciones(request.getParameter(\"observvaciones\") != null ? request.getParameter(\"Observaciones\") : \"Sin datos\");\r\n objProveedor.setLogo(request.getParameter(\"logo\") != null ? request.getParameter(\"logo\") : \"Sin datos\");\r\n objProveedor.setRegistro(new cOtros().registro(\"1\", objUsuario.getCodUsuario().toString()));\r\n if (objcProveedor.Crear(objProveedor) != 0) {\r\n objcProveedor.actualizar_registro(Integer.parseInt(request.getParameter(\"codProveedor\")), \"0\", objUsuario.getCodUsuario().toString());\r\n session.removeAttribute(\"accionProveedor\");\r\n out.print(\"1\");\r\n } else {\r\n out.print(\"0\");\r\n }\r\n }\r\n }\r\n }\r\n }",
"protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n //obtengo un result set con todos los registros de la tabla cliente\n ClientePersistencia clientePersistencia = new ClientePersistencia();\n ResultSet resultado = (ResultSet) clientePersistencia.listar();\n \n \n //ahora que tengo todos los atributos en un objeto, agrego ese objeto al request, almaceno el bean con un id.\n //que despues lo recupero en el jsp\n request.setAttribute(\"resultado\", resultado);\n //Una vez procesada la infromacion del request redirecciono a otra pagina que muestre los datos, ya que ese solo procesa\n request.getRequestDispatcher(\"soporte/cliente/listarCliente.jsp\").forward(request, response);\n \n }",
"protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n try {\n response.setContentType(\"text/html;charset=UTF-8\");\n\n SingletonFuncionLog singletonFuncionLog5 = InitialContext.doLookup(\"java:global/ASAPLICACIONCURSOSPRACTICA1/SingletonFuncionLog\");\n this.estadisticas = InitialContext.doLookup(\"java:global/ASAPLICACIONCURSOSPRACTICA1/Estadisticas\");\n \n estadisticas.nuevoAccesoCuestionarioCommand();\n\n singletonFuncionLog5.funcionLog(\"CuestionarioCommand\", \"processRequest\");\n } catch (NamingException ex) {\n singletonFuncionLog5.funcionLog(\"CuestionarioCommand\", \"NamingException ex\");\n\n Logger.getLogger(CuestionarioCommand.class.getName()).log(Level.SEVERE, null, ex);\n }\n\n }",
"protected void processRequest(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n HttpSession session = request.getSession();\r\n String accion = request.getParameter(\"accion\");\r\n String pkeyEstudiante = request.getParameter(\"idEstudiante\");\r\n String estado = request.getParameter(\"estado\");\r\n boolean band = false;\r\n String mensaje=\"\";\r\n if(accion.equals(\"cambiarEstado\")){\r\n if(estado.equals(\"activo\")){\r\n band = true;\r\n }else if(estado.equals(\"inactivo\")){\r\n band = false;\r\n }\r\n EstudianteJDBC estuJDBC = new EstudianteJDBC();\r\n int rows = estuJDBC.updateEstado(Integer.parseInt(pkeyEstudiante), band);\r\n if(rows>0){ \r\n ArrayList<Estudiante> estudiantes = (ArrayList<Estudiante>) estuJDBC.selectEstu();\r\n session.setAttribute(\"estudiantes\", estudiantes);\r\n mensaje=\"Cambio de Estado Exitoso\";\r\n session.setAttribute(\"mensaje\", mensaje);\r\n request.getRequestDispatcher(\"cambiar_estado.jsp\").forward(request, response);\r\n }else{\r\n mensaje=\"Cambio de Estado Fallido\";\r\n session.setAttribute(\"mensaje\", mensaje);\r\n request.getRequestDispatcher(\"cambiar_estado.jsp\").forward(request, response);\r\n }\r\n }\r\n }",
"public List<Categoria> listarCategorias(){\n //este metodo devuelve una lista.\n return categoriaRepo.findAll(); \n\n }",
"protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n response.setContentType(\"text/html;charset=UTF-8\");\n response.setCharacterEncoding(\"UTF-8\");\n request.setCharacterEncoding(\"UTF-8\");\n \n String nascimento = request.getParameter(\"dataNascimento\");\n String sexo = request.getParameter(\"sexo\");\n String matricula = request.getParameter(\"matricula\");\n String rg = request.getParameter(\"rg\");\n String cpf = request.getParameter(\"cpf\");\n String nome = request.getParameter(\"nome\");\n String email = request.getParameter(\"email\");\n String telFixo = request.getParameter(\"telFixo\");\n String telCelular = request.getParameter(\"telCelular\");\n String endereco = request.getParameter(\"endereco\");\n String numero = request.getParameter(\"numero\");\n String bairro = request.getParameter(\"bairro\");\n String cidade = request.getParameter(\"cidade\");\n String estado = request.getParameter(\"estado\");\n String cep = request.getParameter(\"cep\");\n CadTecnicoAdmModel cadTecnicoAdmModel = new CadTecnicoAdmModel(nome, nascimento,sexo, matricula, rg, cpf, email, telFixo, telCelular, endereco, numero,bairro, cidade, estado, cep );\n CadTecnicoAdmDao cadTecnicoAdmDao = new CadTecnicoAdmDao();\n cadTecnicoAdmDao.salvar(cadTecnicoAdmModel);\n request.getRequestDispatcher(\"cadTecnicoAdm.jsp\").forward(request, response);\n \n }",
"protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException, NamingException, SQLException, ParserConfigurationException, org.xml.sax.SAXException {\n Map data= new HashMap();\n TrascrizioneDAOImplements t=new TrascrizioneDAOImplements();\n UtenteDAOImplements u=new UtenteDAOImplements();\n NotificaDAOImplements n=new NotificaDAOImplements();\n HttpSession s = SecurityLayer.checkSession(request);\n Database.connect();\n String email=u.getUtenteSingolo((int) s.getAttribute(\"userid\")).getEmail(); \n if (!isNull(s) && ((String)s.getAttribute(\"username\")).equals(email+\"stafftrascrittore\")) {\n Immagine image = null;\n String opera=request.getParameter(\"opera\");\n int immagine = (request.getParameter(\"npg\") == null) ? 99999 : Integer.parseInt(request.getParameter(\"npg\"));\n if(!isNull(opera) && (immagine!=99999)){\n OperaDAOImplements o=new OperaDAOImplements();\n ImmagineDAOImplements i=new ImmagineDAOImplements();\n Opera op=o.getOperaSingola(opera);\n image=i.getImmagineSingola(op.getId(), immagine);\n data.put(\"opera\",op);\n data.put(\"immagine\",image);\n data.put(\"staff\",\"Trascrizioni\");\n }\n if(!isNull(image)){model.transfer_objects.Trascrizione tr=t.getTrascrizioneImmagine(image.getId());\n if(!isNull(tr)){\n File file=new File(getServletContext().getRealPath(\"\")+\"Trascrizioni/teicontainer.xml\");\n FileUtils.writeStringToFile(file,tr.getFile(),\"UTF-8\");\n data.put(\"trascrizione\",\"\\\"Trascrizioni/teicontainer.xml\\\"\");\n }else data.put(\"trascrizione\",\"\\\"Trascrizioni/teistart.xml\\\"\");\n data.put(\"opera\",\"\\\"\"+opera+\"\\\"\");\n }\n \n //gestico ricezione ajax\n if(\"XMLHttpRequest\".equals(request.getHeader(\"X-Requested-With\"))){\n String x=request.getParameter(\"xmlString\");\n int npg=Integer.parseInt(request.getParameter(\"npg\"));\n JSONObject obj = null;\n if(validateWithIntXSDUsingDOM(x)){\n model.transfer_objects.Trascrizione tr=t.getTrascrizioneImmagine(npg);\n data.put(\"file\",x);\n t.updateTrascrizione(data,\"immagine=\"+Integer.parseInt(request.getParameter(\"img\")));\n try {\n obj = new JSONObject().put(\"success\",true);\n } catch (JSONException ex) {\n Logger.getLogger(Trascrizione.class.getName()).log(Level.SEVERE, null, ex);\n }\n try (PrintWriter out = response.getWriter()) { \n out.print(obj);\n }\n Database.close();\n return;\n }else{try {\n obj = new JSONObject().put(\"success\",false).put(\"alert\",error.replace(\"è\", \"è\").replace(\"È\",\"È\").replace(\"à\",\"à\"));\n } catch (JSONException ex) {\n Logger.getLogger(Trascrizione.class.getName()).log(Level.SEVERE, null, ex);\n }\n try (PrintWriter out = response.getWriter()) { \n out.print(obj);\n }\n Database.close();\n return;\n }\n }\n \n if(!isNull(request.getParameter(\"trascrittore\"))){\n int img=Integer.parseInt(request.getParameter(\"img\"));\n File xml=new File(getServletContext().getRealPath(\"\")+\"Trascrizioni/teistart.xml\");\n if(t.addTrascrizione(new model.transfer_objects.Trascrizione(FileUtils.readFileToString(xml, \"UTF-8\"),false,img))){\n Notifica nt=new Notifica(\n Integer.parseInt(request.getParameter(\"trascrittore\")),\n \"Trascrizione Iniziata\",\n t.getTrascrizioneImmagine(img).getId());\n n.addNotifica(\"notifiche_trascrizione\", nt);\n }}\n \n Database.close();\n \n FreeMarker.process(\"back_editor.html\", data, response, getServletContext());\n }else{ Database.close(); action_error(request,response);}\n \n }",
"CreateCategoryResponse createCategory(CreateCategoryRequest request);",
"private void action_save_castmember(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n try {\n TemplateResult result = new TemplateResult(getServletContext());\n if (SecurityLayer.checkSession(request) != null) {\n User user = getDataLayer().getUser(SecurityLayer.checkNumeric((request.getSession().getAttribute(\"userid\")).toString()));\n if (user.getGroup().getID() != Group.ADMIN) {\n action_error(request, response, \"Non hai i permessi per effettuare questa operazione!\");\n System.err.println(\"Errore in SeriesManagement.java, nel metodo action_save_castmember: Utente senza permessi da amministratore\");\n return;\n }\n request.setAttribute(\"user\", user);\n request.setAttribute(\"strip_slashes\", new SplitSlashesFmkExt());\n CastMember castMember = getDataLayer().createCastMember();\n if (checkCastMemberInputData(request, response)) {\n castMember.setName(request.getParameter(\"castMemberName\"));\n castMember.setSurname(request.getParameter(\"castMemberSurname\"));\n castMember.setCountry(request.getParameter(\"castMemberCountry\"));\n castMember.setImageURL(request.getParameter(\"castMemberImageURL\"));\n try {\n castMember.setBirthDate((SecurityLayer.checkDate(request.getParameter(\"castMemberBirthDate\"))).getTime());\n } catch (NumberFormatException ex) {\n request.setAttribute(\"error\", \"La data di nascita inserita non è valida!\");\n action_insert_castmember(request, response);\n return;\n }\n int gender = SecurityLayer.checkNumeric(request.getParameter(\"gender\"));\n\n switch (gender) {\n case 1:\n castMember.setGender(CastMember.MALE);\n break;\n case 2:\n castMember.setGender(CastMember.FEMALE);\n break;\n default:\n action_error(request, response, \"Riprova di nuovo!\");\n System.err.println(\"Errore in SeriesManagement.java, nel metodo action_save_castmember: il parametro che indica il sesso non è nè 1 (Maschio) nè 2 (Femmina)\");\n return;\n }\n getDataLayer().storeCastMember(RESTSecurityLayer.addSlashes(castMember));\n\n } else {\n request.setAttribute(\"error\", \"Uno dei campi è vuoto!\");\n action_insert_castmember(request, response);\n return;\n }\n request.setAttribute(\"success\", \"Membro del cast inserito correttamente!\");\n action_insert_castmember(request, response);\n } else {\n //User session is no longer valid\n request.setAttribute(\"error\", \"Devi essere loggato per eseguire quest'azione!\");\n result.activate(\"logIn.ftl.html\", request, response);\n }\n } catch (NumberFormatException ex) {\n //User id or gender is not a number\n action_error(request, response, \"Riprova di nuovo!\");\n System.err.println(\"Errore in SeriesManagement.java, nel metodo action_save_castmember: NumberFormatException\");\n }\n }",
"@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n Integer perfil;\n perfil = Integer.parseInt(request.getParameter(\"perfil\"));\n menusDAO menudao = new menusDAO();\n menudao.getInfoPerfil(perfil);\n menudao.getMenuPerfil();\n menuEncontrado = menudao.getMenuUsuario();\n opciondeMenu objetoOpcionMenu = new opciondeMenu();\n for (Menus opcion : menuEncontrado) {\n String padre = opcion.getIdPadre() == null ? \"#\" : \"\" + opcion.getIdPadre();\n objetoOpcionMenu.setId(\"\" + opcion.getId());\n objetoOpcionMenu.setParent(\"\" + padre);\n objetoOpcionMenu.setText(\"<a onclick=\\\"javascript:f_link('\" + opcion.getEnlace() + \"')\\\"> \" + opcion.getDescripcion() + \"</a>\");\n opcionesMenu.add(objetoOpcionMenu);\n objetoOpcionMenu = new opciondeMenu();\n }\n processRequest(request, response);\n }",
"public void setCategoriaId(Long id);",
"@Override\n\tvoid postarComentario() {\n\n\t}",
"@GetMapping(\"/home/articoli/crea\")\n\tpublic ModelAndView prepareCreateArticolo(HttpServletRequest request, HttpServletResponse response) {\n\t\tModelAndView mav = new ModelAndView(\"creaArticolo\");\n\t\tUtente utente = UtenteController.getUtenteLoggato();\n\t\tmav.addObject(\"utente\", utente);\n\t\treturn mav;\n\t}",
"protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n response.setContentType(\"text/html;charset=UTF-8\");\n try (PrintWriter out = response.getWriter()) {\n String codigo = request.getParameter(\"codigo\");\n String cedula = request.getParameter(\"cedula\");\n String nombre = request.getParameter(\"nombre\");\n String fechanacimiento = request.getParameter(\"fechaBorn\");\n String fechaingreso = request.getParameter(\"fechaIngreso\");\n String fecharetiro = request.getParameter(\"fechaRetiro\");\n \n Nomina nomina = new Nomina();\n if(nomina.insertarEmpleado(codigo, cedula, nombre, fechanacimiento, fechaingreso, fecharetiro)){\n request.getSession().setAttribute(\"nominaxd\", nomina);\n request.getRequestDispatcher(\"./JSP/exitoInsertarEmpleado.jsp\").forward(request, response);\n }else{\n request.getSession().setAttribute(\"error\", \"Ha ocurrido un error al insertar\");\n request.getRequestDispatcher(\"./JSP/ERROR/errorInsertarEmpleado.jsp\").forward(request, response);\n }\n\n } catch (Exception e) {\n }\n }",
"@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n String action = request.getParameter(\"action\");\n LogementModel model = new LogementModel();\n MaisonDAO implm = new MaisonDAO();\n AppartementDAO impla = new AppartementDAO();\n ChambreDAO implc = new ChambreDAO();\n\n request.setAttribute(\"model\", model);\n\n if (action != null) {\n if (action.equals(\"maison\")) {\n ArrayList<Maison> listm = implm.listMaisonD();\n model.setMaisons(listm);\n } else if (action.equals(\"appartement\")) {\n ArrayList<Appartement> lisa = impla.listAppartementD();\n model.setAppartements(lisa);\n } else if (action.equals(\"chambre\")) {\n ArrayList<Chambre> lista = implc.listChambreD();\n model.setChambres(lista);\n }/*else if (action.equals(\"tout\")) {\n List<Logement> logement = impl.listlogements();\n model.setLogements(logement);\n }*/\n\n }\n request.getRequestDispatcher(\"index.jsp\").forward(request,\n response);\n\n }",
"public String getSaveCategory( HttpServletRequest request, String strCategoryClassName )\r\n {\r\n ShowCategoryDTO category = null;\r\n Map<String, Object> model = new HashMap<String, Object>( );\r\n\r\n FunctionnalException fe = getErrorOnce( request );\r\n\r\n if ( fe != null )\r\n {\r\n category = (ShowCategoryDTO) fe.getBean( );\r\n model.put( BilletterieConstants.ERROR, getHtmlError( fe ) );\r\n }\r\n else\r\n {\r\n String strCategoryId = request.getParameter( PARAMETER_CATEGORY_ID );\r\n\r\n if ( strCategoryId != null )\r\n {\r\n setPageTitleProperty( PAGE_TITLE_MODIFY_CATEGORY );\r\n\r\n int nIdCategory = Integer.parseInt( strCategoryId );\r\n category = _serviceCategory.findById( nIdCategory );\r\n }\r\n else\r\n {\r\n setPageTitleProperty( PAGE_TITLE_CREATE_CATEGORY );\r\n category = new ShowCategoryDTO( );\r\n }\r\n }\r\n\r\n model.put( StockConstants.MARK_JSP_BACK, JSP_MANAGE_CATEGORYS );\r\n model.put( MARK_CATEGORY, category );\r\n\r\n if ( ( category.getId( ) != null ) && ( category.getId( ) != 0 ) )\r\n {\r\n model.put( MARK_TITLE, I18nService.getLocalizedString( PAGE_TITLE_MODIFY_CATEGORY, Locale.getDefault( ) ) );\r\n }\r\n else\r\n {\r\n model.put( MARK_TITLE, I18nService.getLocalizedString( PAGE_TITLE_CREATE_CATEGORY, Locale.getDefault( ) ) );\r\n }\r\n\r\n HtmlTemplate template = AppTemplateService.getTemplate( TEMPLATE_SAVE_CATEGORY, getLocale( ), model );\r\n\r\n return getAdminPage( template.getHtml( ) );\r\n }",
"@Override\n\tpublic void execute(HttpServletRequest request,\n\t\t\tHttpServletResponse response) throws Exception {\n\t\tint parentId = 0;\n\t\tString parentDesc = \"\";\n\t\t\n\t\tCategoryParentDAO dao = new CategoryParentDAO(); /* Instantiate DAO object */\n\n\t\tif(dao.update(new CategoryParent(parentId, parentDesc))){\n\t\t\tresponse.getWriter().write(\"Category Parent Update\"); /* Add Successful */\n\t\t}\n\t\telse{\n\t\t\tresponse.getWriter().write(\"Category Parent Updated Unsuccessfuly\"); /* Add Unsuccessful */\n\t\t}\n\t\t\n\t\t\n\t}",
"@Override\npublic boolean saveCharitCom(Long idcommande,Charite Charite) {\n\tCommande c1= commandeDao.findOne(idcommande);\n\tSet<Commande> c= new HashSet<Commande>();\n\tc.add(c1);\n\t//Events e1 = eventDAO.findOne(idcommande);\n\tCharite.setCommandeCharite(c);\n\tchariteRepository.save(Charite);\n\treturn true;\n}",
"public void guardar() {\n try {\n if (this.buscarCodApelacion()) {\n Dr_siseg_usuarioBean usuario = new Dr_siseg_usuarioBean();\n FacesContext facesContext = FacesContext.getCurrentInstance();\n usuario = (Dr_siseg_usuarioBean) facesContext.getExternalContext().getSessionMap().get(\"usuario\");\n\n ApelacionesDao apelacionesDao = new ApelacionesDao();\n apelacionesDao.INSERTA_APELACIONES(apelacionesBean); \n\n BitacoraSolicitudDao bitacoraSolicitudDao = new BitacoraSolicitudDao();//INSERTA EL MOVIMIENTO EN LA BITACORA\n BitacoraSolicitudBean bitacoraSolicitudBean = new BitacoraSolicitudBean();\n bitacoraSolicitudBean.setBit_sol_id(this.apelacionesBean.getApel_sol_numero());\n bitacoraSolicitudBean.setUsuarioBean(usuario);\n bitacoraSolicitudBean.setBit_tipo_movimiento(\"0\");\n bitacoraSolicitudBean.setBit_detalle(\"Fue insertada la apelacion\");\n bitacoraSolicitudDao.dmlDr_regt_bitacora_solicitud(bitacoraSolicitudBean);\n\n this.Listar();\n this.apelacionesBean = new ApelacionesBean();\n addMessage(\"Guadado Exitosamente\", 1);\n } else {\n addMessage(\"La solicitud de apelacion especificada no existe\", 1);\n this.Listar();\n }\n } catch (ExceptionConnection ex) {\n Logger.getLogger(ApelacionController.class.getName()).log(Level.SEVERE, null, ex);\n addMessage(\"Se produjo un error al insertar el registro, contacte al administrador del sistema\", 1);\n }\n }",
"public void create(int id, DVD dvd, Categorie categorie);",
"@Override\n\tpublic Category updateCategory(HttpServletRequest request,\n\t\t\tHttpServletResponse response) {\n\t\treturn null;\n\t}",
"protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException \r\n\t{\n ((HttpServletResponse) response).addHeader(\"Access-Control-Allow-Origin\", \"*\");\r\n \r\n try\r\n {\r\n \tString usuario_id = request.getParameter(\"usuarioid\");\r\n \tint usuarioid = 0;\r\n \ttry \r\n \t{\r\n \t\tusuarioid = Integer.parseInt(usuario_id);\r\n \t\tString observacoes = request.getParameter(\"observacoes\");\r\n \t\r\n \tSystem.out.println(usuarioid + observacoes + \"\");\r\n \t\r\n \tBudget b = BudgetDAO.Build(usuarioid, observacoes);\r\n \tBudgetDAO.Create(b);\r\n \t}\r\n \tcatch (Exception e) \r\n \t{\r\n\t\t\t\tSystem.out.println(\"Erro convertendo usuario_id\");\r\n\t\t\t}\r\n\t\t}\r\n catch (Exception e) \r\n {\r\n \tSystem.out.println(\"Erro: \" + e.getMessage());\r\n\t\t}\r\n\t}",
"protected void processRequest(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException, SQLException {\r\n response.setContentType(\"text/html;charset=UTF-8\");\r\n PrintWriter out = response.getWriter();\r\n \r\n String idUser = request.getParameter(\"idUser\");\r\n int id = Integer.parseInt(idUser);\r\n \r\n // out.println(id);\r\n \r\n String nom = request.getParameter(\"nom\");\r\n String prenom = request.getParameter(\"prenom\");\r\n String age = request.getParameter(\"age\");\r\n String adresse = request.getParameter(\"adresse\");\r\n String ville = request.getParameter(\"ville\");\r\n String login = request.getParameter(\"login\");\r\n String motdepasse = request.getParameter(\"motdepasse\");\r\n String photo = request.getParameter(\"photo\");\r\n \r\n \r\n //Modifier le profil \r\n Connection cont = connect.connectdb();\r\n Statement stmt = cont.createStatement();\r\n String queryString = \"UPDATE user SET nom = '\"+nom+\"' , prenom ='\"+prenom+\"', age = '\"+age+\"', adresse = '\"+adresse+\"' , ville = '\"+ville+\"' , login = '\"+login+\"' , motdepasse = '\"+motdepasse+\"' where id = '\"+id+\"' \";\r\n stmt.executeUpdate(queryString);\r\n stmt.close();\r\n \r\n \r\n // Rcuperation Personne de session\r\n HttpSession session = request.getSession();\r\n user personne = (user) (session.getAttribute(\"personne\"));\r\n personne.setNom(nom);\r\n personne.setPrenom(prenom);\r\n personne.setAge(age);\r\n personne.setAdresse(adresse);\r\n personne.setVille(ville);\r\n personne.setLogin(login);\r\n personne.setMotdepasse(motdepasse);\r\n \r\n session.setAttribute(\"personne\", personne); \r\n String url = \"/liste_categorie.jsp\";\r\n \r\n RequestDispatcher dispatcher =\r\n getServletContext().getRequestDispatcher(url);\r\n dispatcher.forward(request, response);\r\n \r\n }",
"private void action_save_castmemberSeries(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n try {\n TemplateResult result = new TemplateResult(getServletContext());\n if (SecurityLayer.checkSession(request) != null) {\n User user = getDataLayer().getUser(SecurityLayer.checkNumeric((request.getSession().getAttribute(\"userid\")).toString()));\n if (user.getGroup().getID() != Group.ADMIN) {\n action_error(request, response, \"Non hai i permessi per effettuare questa operazione!\");\n System.err.println(\"Errore in SeriesManagement.java, nel metodo action_save_castmemberSeries: Utente senza permessi da amministratore\");\n return;\n }\n request.setAttribute(\"strip_slashes\", new SplitSlashesFmkExt());\n request.setAttribute(\"user\", user);\n if (checkCastMemberSeriesInputData(request, response)) {\n if (SecurityLayer.checkNumeric(request.getParameter(\"castMember\")) == 0) {\n request.setAttribute(\"error\", \"Non hai selezionato alcun membro del cast!\");\n action_insert_castmemberSeries(request, response);\n return;\n } else if (SecurityLayer.checkNumeric(request.getParameter(\"series\")) == 0) {\n request.setAttribute(\"error\", \"Non hai selezionato alcuna serie!\");\n action_insert_castmemberSeries(request, response);\n return;\n }\n CastMember c = getDataLayer().getCastMember(SecurityLayer.checkNumeric(request.getParameter(\"castMember\")));\n Series s = getDataLayer().getSeries(SecurityLayer.checkNumeric(request.getParameter(\"series\")));\n if (getDataLayer().getCastMemberSeries(c, s, request.getParameter(\"role\")) != null) {\n request.setAttribute(\"error\", \"Il membro del cast in quel ruolo e la serie inseriti sono già associati!\");\n action_insert_castmemberSeries(request, response);\n return;\n }\n CastMemberSeries cms = getDataLayer().createCastMemberSeries();\n cms.setCastMember(c);\n cms.setSeries(s);\n cms.setRole(request.getParameter(\"role\"));\n\n getDataLayer().storeCastMemberSeries(cms);\n } else {\n //Error: empty field\n request.setAttribute(\"error\", \"Uno dei campi è vuoto!\");\n action_insert_castmemberSeries(request, response);\n return;\n }\n request.setAttribute(\"success\", \"Membro del cast e serie associati correttamente!\");\n action_insert_castmemberSeries(request, response);\n } else {\n //User session is no longer valid\n request.setAttribute(\"error\", \"Devi essere loggato per eseguire quest'azione!\");\n result.activate(\"logIn.ftl.html\", request, response);\n }\n } catch (NumberFormatException ex) {\n //User id or castmember id or series id is not a number\n action_error(request, response, \"Riprova di nuovo!\");\n System.err.println(\"Errore in SeriesManagement.java, nel metodo action_save_castmemberSeries: NumberFormatException\");\n }\n\n }",
"public void doPost(HttpServletRequest request, HttpServletResponse response)\r\n\t\t\tthrows ServletException, IOException {\r\n\r\n\t\trequest.setCharacterEncoding(\"UTF-8\");\r\n\t\t\r\n\t\tString id = \"\";\r\n\t\tString password = \"\";\r\n\t\tString gender = \"\";\r\n\t\tString moviecat = \"\";\r\n\t\tint age = 0;\r\n\t\tStringBuilder cat = new StringBuilder();\r\n\t\t\r\n\t\ttry {\r\n\t\t\tid = request.getParameter(\"id\");\r\n\t\t\tpassword = request.getParameter(\"password\");\r\n\t\t\tgender = request.getParameter(\"gender\");\r\n\t\t\tage = Integer.parseInt(request.getParameter(\"age\"));\r\n\t\t\r\n\t\t\tString[] categories = request.getParameterValues(\"categories\");\r\n\t\t\tfor(String s : categories) {\r\n\t\t\t\tcat = cat.append(s+\",\");\r\n\t\t\t}\r\n\t\t\tmoviecat = cat.toString();\r\n\t\t} catch(Exception ex) {\r\n\t\t\tSystem.out.println(\"注册表单出错...\");\r\n\t\t\tex.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t\tUsers u = new Users();\r\n\t\tu.setId(id);\r\n\t\tu.setPassword(password);\r\n\t\tu.setGender(gender);\r\n\t\tu.setAge(age);\r\n\t\tu.setMoviecat(moviecat);\r\n\t\t\r\n\t\tUserDAO udao = new UserDAO();\r\n\t\t\r\n\t\tif(udao.userReg(u)) {\r\n\t\t\trequest.getRequestDispatcher(\"../reg_success.jsp\").forward(request, response);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tresponse.sendRedirect(\"../reg_failure.jsp\");\r\n\t\t}\r\n\t}",
"protected void processRequest(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n response.setContentType(\"text/html;charset=UTF-8\");\r\n\r\n EntityManagerFactory emf = null;\r\n String ac = request.getParameter(\"ac\");\r\n String forward = null;\r\n try {\r\n emf = Persistence.createEntityManagerFactory(\"nutriWebPU\");\r\n request.setAttribute(\"emf\", emf);\r\n\r\n if (ac == null) {\r\n if (request.getSession().getAttribute(\"user\") != null) {\r\n User u = (User) request.getSession().getAttribute(\"user\");\r\n List<Date> listaDatas = new ConsumoDiarioJpaController(emf).findDatasByUser(u.getIduser());\r\n List<ConsumoDiario> listaconsumoDiario = null;\r\n\r\n request.setAttribute(\"ListaDatas\", listaDatas);\r\n if (request.getSession().getAttribute(\"dataFiltro\") == null) {\r\n request.getSession().setAttribute(\"dataFiltro\", listaDatas.get(0));\r\n listaconsumoDiario = new ConsumoDiarioJpaController(emf).findConsumoDiarioAlimentoByUser(u.getIduser());\r\n } else {\r\n Date dt = (Date) request.getSession().getAttribute(\"dataFiltro\");\r\n listaconsumoDiario = new ConsumoDiarioJpaController(emf).findConsumoDiarioAlimentoByUserbyData(u.getIduser(), dt);\r\n }\r\n request.setAttribute(\"ListaconsumoDiario\", listaconsumoDiario);\r\n }\r\n } else {\r\n ArrayList<String> listaError = new ArrayList<String>();\r\n request.setAttribute(\"erroMessage\", listaError);\r\n try {\r\n\r\n forward = get(ac).execute(request, response);\r\n\r\n if (forward == null) {\r\n User u = (User) request.getSession().getAttribute(\"user\");\r\n List<Date> listaDatas = new ConsumoDiarioJpaController(emf).findDatasByUser(u.getIduser());\r\n List<ConsumoDiario> listaconsumoDiario = null;\r\n\r\n request.setAttribute(\"ListaDatas\", listaDatas);\r\n if (request.getSession().getAttribute(\"dataFiltro\") == null) {\r\n request.getSession().setAttribute(\"dataFiltro\", listaDatas.get(0));\r\n listaconsumoDiario = new ConsumoDiarioJpaController(emf).findConsumoDiarioAlimentoByUser(u.getIduser());\r\n } else {\r\n Date dt = (Date) request.getSession().getAttribute(\"dataFiltro\");\r\n listaconsumoDiario = new ConsumoDiarioJpaController(emf).findConsumoDiarioAlimentoByUserbyData(u.getIduser(), dt);\r\n }\r\n request.setAttribute(\"ListaconsumoDiario\", listaconsumoDiario);\r\n }\r\n\r\n } catch (Exception ex) {\r\n listaError.add(ex.getMessage());\r\n request.setAttribute(\"erroMessage\", listaError);\r\n }\r\n }\r\n } finally {\r\n request.removeAttribute(\"emf\");\r\n if (emf != null) {\r\n emf.close();\r\n }\r\n\r\n if (ac != null && ac.contains(\"ajax\")) {\r\n request.getRequestDispatcher(\"assert/ajax/\" + forward + \".jsp\").forward(request, response);\r\n } else {\r\n if (forward != null) {\r\n request.setAttribute(\"page\", forward);\r\n }\r\n request.getRequestDispatcher(\"templateNW.jsp\").forward(request, response);\r\n }\r\n }\r\n\r\n }"
] | [
"0.7572366",
"0.69568646",
"0.6783003",
"0.6731122",
"0.65078706",
"0.649398",
"0.64861774",
"0.646153",
"0.6421336",
"0.629241",
"0.62569016",
"0.6197264",
"0.61910975",
"0.61850554",
"0.6175598",
"0.61592096",
"0.6099939",
"0.60985065",
"0.60776025",
"0.6048661",
"0.60386187",
"0.6037828",
"0.6033113",
"0.60307914",
"0.60273784",
"0.600769",
"0.600577",
"0.6005099",
"0.6003257",
"0.59697235",
"0.5948006",
"0.59375685",
"0.5933185",
"0.5928235",
"0.5926454",
"0.59051096",
"0.590426",
"0.5879375",
"0.58764964",
"0.58689857",
"0.5855801",
"0.58352375",
"0.58306515",
"0.58294755",
"0.58234835",
"0.58226395",
"0.5817637",
"0.5817079",
"0.58050525",
"0.58010024",
"0.579719",
"0.5786515",
"0.5760446",
"0.57587314",
"0.5755691",
"0.5754312",
"0.5752135",
"0.57502854",
"0.5748955",
"0.57472515",
"0.5727115",
"0.57179093",
"0.5717766",
"0.5709297",
"0.5699086",
"0.5684925",
"0.5682125",
"0.56790066",
"0.5670657",
"0.5655389",
"0.5648705",
"0.5642614",
"0.56387264",
"0.5629784",
"0.56293476",
"0.56281304",
"0.5615913",
"0.56096065",
"0.5604844",
"0.5602661",
"0.55933726",
"0.5588276",
"0.5587818",
"0.5585022",
"0.5582294",
"0.5575913",
"0.55732846",
"0.55700207",
"0.5564578",
"0.5558974",
"0.5553586",
"0.5547022",
"0.5541616",
"0.5541103",
"0.5538877",
"0.5538331",
"0.5528581",
"0.55283326",
"0.5526696",
"0.5523609"
] | 0.75753903 | 0 |
/Metodo para encontrar todos los | public List<ProveedorEntity> getProveedores(){
List<ProveedorEntity>proveedores = proveedorPersistence.findAll();
return proveedores;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@In String search();",
"private void searchFunction() {\n\t\t\r\n\t}",
"public void search() {\r\n \t\r\n }",
"void search();",
"void search();",
"public List search(Veranstaltung veranstatung) throws RuntimeException;",
"@Override\r\n\tpublic void search() {\n\r\n\t}",
"@Override\n\tpublic void search() {\n\t}",
"abstract public void search();",
"public void search() {\n listTbagendamentos\n = agendamentoLogic.findAllTbagendamentoByDataAndPacienteAndFuncionario(dataSearch, tbcliente, tbfuncionario);\n }",
"@Override\r\n\tpublic Set<Article> search(String keyworkds) {\n\t\treturn null;\r\n\t}",
"public void search() {\n }",
"public List<EspecieEntity> encontrarTodos(){\r\n Query todos =em.createQuery(\"select p from EspecieEntity p\");\r\n return todos.getResultList();\r\n }",
"List<Card> search(String searchString) throws PersistenceCoreException;",
"public List<Ve> searchVe(String maSearch);",
"List<Corretor> search(String query);",
"@Test\n public void testFindall() {\n\n System.out.println(\"findall\"); \n PrioridadRest rest = mokPrioridadRest;\n List<Prioridad> result = rest.findall();\n Prioridad prioridad = new Prioridad(1, \"1\");\n assertThat(result, CoreMatchers.hasItems(prioridad));\n }",
"public void searchAll() {\r\n\t\tconfiguracionUoDet = new ConfiguracionUoDet();\r\n\t\tidConfiguracionUoDet = null;\r\n\t\tidBarrio = null;\r\n\t\tidCiudad = null;\r\n\t\tidCpt = null;\r\n\t\tidDpto = null;\r\n\t\tmodalidadOcupacion = null;\r\n\t\tcodigoUnidOrgDep = null;\r\n\t\tdenominacion = null;\r\n\t\tllenarListado1();\r\n\t}",
"List<Card> search(String searchString, long userId) throws PersistenceCoreException;",
"List<Cemetery> search(String query);",
"List<PilotContainer> Search(String cas, String word);",
"public List<Product> search(String searchString);",
"List<DataTerm> search(String searchTerm);",
"List<T> findAll() ;",
"public List<TagPregunta> findMatchingTags(String parcial);",
"public Vector<Artista> findAllArtisti();",
"@Override\n\tpublic ArrayList<SearchItem> search(String key) {\n\t\treturn null;\n\t}",
"@Override\n\tpublic List<ServiceInfo> search(String keywords) {\n\t\treturn null;\n\t}",
"@Override\n\tpublic void find() {\n\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 List<UrlInfo> searchAllUrl() {\n\n //getSynonyms(queryKeywords);\n\n ArrayList<Long> keywordIdList = new ArrayList<Long>();\n ArrayList<Long> finalIdList = new ArrayList<Long>();\n\n String email = Secured.getUser(ctx());\n List<UrlEntry> entryIdList = UrlEntry.find()\n .select(\"entryId\")\n .where()\n .eq(\"email\", email)\n .findList();\n for (UrlEntry entry : entryIdList) {\n finalIdList.add(entry.getEntryId());\n }\n System.out.println(\"finalIdList---\" + finalIdList);\n List<UrlInfo> urlList = UrlInfo.find().select(\"url\").where().in(\"urlEntryId\", finalIdList).findList();\n /*ArrayList<String> urls = new ArrayList<String>();\n for (UrlInfo urlInfo : urlList) {\n urls.add(urlInfo.getUrl());\n }\n System.out.println(\"urls in search----\" + urls);*/\n return urlList;\n }",
"public List<Aluno> findAll(String nome, Integer idade){\n List<Aluno> alunosFiltrados = new ArrayList();\n if(nome != null && idade !=null){\n alunosFiltrados = alunos.stream()\n .filter(aluno -> aluno.getNome().contains(nome) && aluno.getIdade().equals(idade))\n .collect(Collectors.toList());\n } else if (nome!=null){\n alunosFiltrados = alunos.stream()\n .filter(aluno -> aluno.getNome().contains(nome))\n .collect(Collectors.toList());\n } else if (idade!=null){\n alunosFiltrados = alunos.stream()\n .filter(aluno -> aluno.getIdade().equals(idade))\n .collect(Collectors.toList());\n } else\n alunosFiltrados = alunos;\n\n if(alunosFiltrados.isEmpty()){\n throw new AlunoInexistenteException();\n }\n\n return alunosFiltrados;\n }",
"public List<User> listSearch(String search);",
"public List search() {\n\t\tSessionFactory sf = new Configuration().configure()\n\t\t\t\t.buildSessionFactory();\n\t\tSession s = sf.openSession();\n\t\tQuery q = s.createQuery(\"from cat_vo\");\n\t\tList ls = q.list();\n\t\treturn ls;\n\t}",
"List<OrgRelationship> searchStores(String keyword,String path,String type) ;",
"@Override\r\n\tpublic List<User> search(String name) {\n\t\treturn null;\r\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 }",
"@Override\r\n public List<Asset> findByKeyWord(Map<String, Object> params) {\n return assetDao.findByKeyWord(params);\r\n }",
"@Override\n\tpublic List<Contact> search(String str) {\n\t\treturn null;\n\t}",
"private void getPhotoList(String query){\n for(Photo p : photolist){\n for(String s : p.getLocationTaglist()){\n if(s.toLowerCase().contains(query)){\n searchResult.add(p);\n break;\n }\n }\n for(String s : p.getPersonTaglist()){\n if(s.toLowerCase().contains(query)){\n searchResult.add(p);\n break;\n }\n }\n }\n }",
"public List search(Doctor o) {\n\t\treturn dao.search(o);\n\t}",
"@Override\n\tpublic ArrayList<MemberVO> find(String keyWords) throws RemoteException {\n\t\tArrayList<MemberPO> memberList = dataService.findBySalesman(keyWords);\n\n\t\tif(memberList == null || memberList.size() == 0){\n\t\t\treturn new ArrayList<>();\n\t\t}\n\n\t\tArrayList<MemberVO> resultList = new ArrayList<>();\n\t\tfor(MemberPO member:memberList){\n\t\t\tMemberVO tem = member.toVO();\n\t\t\tresultList.add(tem);\n\t\t}\n\t\treturn resultList;\n\t}",
"@Override\n\tpublic List<T> findList(Class<T> objs) throws Exception {\n\t\treturn null;\n\t}",
"@Override\n\tpublic List<T> findListByQueryDinamic(String s) throws Exception {\n\t\treturn null;\n\t}",
"public void search() {\n try {\n for(int i = 0; i < this.queries.size(); i++){\n search(i);\n // in case of error stop\n if(!this.searchOK(i)){\n System.out.println(\"\\t\" + new Date().toString() + \" \" + db + \" Search for rest queries cancelled, because failed for query \" + i + \" : \" + this.queries.get(i));\n break;\n }\n }\n } catch (UnsupportedEncodingException ex) {\n Logger.getLogger(EntrezSearcher.class.getName()).log(Level.SEVERE, null, ex);\n }\n }",
"public Ruta[] findAll() throws RutaDaoException;",
"public java.util.List<Todo> findAll();",
"void search( RealLocalizable reference );",
"private static ArrayList<TrieNode> find(TrieNode toCheck,String[] allWords,String prefix) {\n\n\t\tif(toCheck == null) return null;\n\n\t\tint length = Math.min(allWords[toCheck.substr.wordIndex].length(), prefix.length());\n\n\t\tif (!(allWords[toCheck.substr.wordIndex].substring(0, length).contains(prefix.substring(0, length)))) {\n\n\t\t\t\tif (allWords[toCheck.substr.wordIndex].charAt(toCheck.substr.startIndex) != (prefix.charAt(toCheck.substr.startIndex))) { //add negatived\n\n\t\t\t\t\tif (toCheck.sibling != null)\n\t\t\t\t\t\treturn find(toCheck.sibling, allWords, prefix);\n\t\t\t\t\telse\n\t\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\treturn (find(toCheck.firstChild, allWords, prefix));\n\t\t\t\t}\n\n\t\t\t}\n\n\n\t\tArrayList<TrieNode> answer = new ArrayList<TrieNode>();\n\n\t\tif(toCheck.firstChild==null){\n\t\t\tanswer.add(toCheck);\n\t\t}\n\t\telse {\n\t\t\tarrCreateSibling(toCheck.firstChild, answer);\n\t\t}\n\n\t\treturn answer;\n\t}",
"@Override\n\tpublic List<Person> search(Integer id) {\n\t\treturn null;\n\t}",
"private static final String FIND_ALL() {\r\n\t\treturn \"from Shipping3VO vo \";\r\n\t}",
"public static List<FoundObject> findAll() {\n\t\treturn getPersistence().findAll();\n\t}",
"public List<User> searchUser(String searchValue);",
"public void searchAllFiles() {\n\t\t/**\n\t\t * Realizamos un pequeño algoritmo de recorrido de árboles en preorden para listar todos los\n\t\t * ebooks con un coste de 2n+1 donde n es el número de nodos.\n\t\t */\n\t\tArrayList<Entry> booksEntry = null;\n\t\ttry {\n\t\t\tString auxPath;\n\t\t\tbooksEntry = new ArrayList<DropboxAPI.Entry>();\n\t\t\tLinkedList<Entry> fifo = new LinkedList<DropboxAPI.Entry>();\n\t\t\tEntry nodo = _mApi.metadata(\"/\", 0, null, true, null);\n\t\t\tfifo.addAll(nodo.contents);\n\t\t\twhile (!fifo.isEmpty()) {\n\t\t\t\tSystem.out.println(fifo);\n\t\t\t\tnodo = fifo.getFirst();\n\t\t\t\tfifo.removeFirst();\n\t\t\t\tauxPath = nodo.path;\n\t\t\t\tif (nodo.isDir) {\n\t\t\t\t\tfifo.addAll(_mApi.metadata(auxPath, 0, null, true, null).contents);\n\t\t\t\t} else {\n\t\t\t\t\tif (isEbook(nodo))\n\t\t\t\t\t\tbooksEntry.add(nodo);\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(\"parar\");\n\t\t} catch (DropboxUnlinkedException e) {\n\t\t\t// The AuthSession wasn't properly authenticated or user unlinked.\n\t\t} catch (DropboxPartialFileException e) {\n\t\t\t// We canceled the operation\n\t\t\t_mErrorMsg = \"Download canceled\";\n\t\t} catch (DropboxServerException e) {\n\t\t\t// Server-side exception. These are examples of what could happen,\n\t\t\t// but we don't do anything special with them here.\n\t\t\tif (e.error == DropboxServerException._304_NOT_MODIFIED) {\n\t\t\t\t// won't happen since we don't pass in revision with metadata\n\t\t\t} else if (e.error == DropboxServerException._401_UNAUTHORIZED) {\n\t\t\t\t// Unauthorized, so we should unlink them. You may want to\n\t\t\t\t// automatically log the user out in this case.\n\t\t\t} else if (e.error == DropboxServerException._403_FORBIDDEN) {\n\t\t\t\t// Not allowed to access this\n\t\t\t} else if (e.error == DropboxServerException._404_NOT_FOUND) {\n\t\t\t\t// path not found (or if it was the thumbnail, can't be\n\t\t\t\t// thumbnailed)\n\t\t\t} else if (e.error == DropboxServerException._406_NOT_ACCEPTABLE) {\n\t\t\t\t// too many entries to return\n\t\t\t} else if (e.error == DropboxServerException._415_UNSUPPORTED_MEDIA) {\n\t\t\t\t// can't be thumbnailed\n\t\t\t} else if (e.error == DropboxServerException._507_INSUFFICIENT_STORAGE) {\n\t\t\t\t// user is over quota\n\t\t\t} else {\n\t\t\t\t// Something else\n\t\t\t}\n\t\t\t// This gets the Dropbox error, translated into the user's language\n\t\t\t_mErrorMsg = e.body.userError;\n\t\t\tif (_mErrorMsg == null) {\n\t\t\t\t_mErrorMsg = e.body.error;\n\t\t\t}\n\t\t} catch (DropboxIOException e) {\n\t\t\t// Happens all the time, probably want to retry automatically.\n\t\t\t_mErrorMsg = \"Network error. Try again.\";\n\t\t} catch (DropboxParseException e) {\n\t\t\t// Probably due to Dropbox server restarting, should retry\n\t\t\t_mErrorMsg = \"Dropbox error. Try again.\";\n\t\t} catch (DropboxException e) {\n\t\t\t// Unknown error\n\t\t\t_mErrorMsg = \"Unknown error. Try again.\";\n\t\t}\n\t\t_booksListEntry = booksEntry;\n\t\tcreateListBooks();\n\t}",
"private static void searchchildren(String keyword, Individual root, ListView<Individual> list) {\n\t\tif(root.getName().toLowerCase().contains(keyword.toLowerCase())){\n\t\t\t//System.out.println(root.getInfo());\n\t\t\tlist.getItems().add(root);\n\t\t\thits++;\n\t\t}\n\t\tif(root.getChildren()!=null){\n\t\t\tList<Individual> children = root.getChildren();\n\t\t\tfor(Individual e: children){\n\t\t\t\tsearchchildren(keyword, e, list);\n\t\t\t}\n\t\t}\n\t}",
"@Override\n\tpublic NodeIterator search(String queryString) throws Exception {\n\t\treturn null;\n\t}",
"public List<Product> search(String word, String codigo) {\n\t\tSession session = getSessionFactory().openSession();\n\t\treturn null;\n\t}",
"@Override\n\tpublic List<T> findListByDinamicQuery(String query, int inicio, int maximo) throws Exception {\n\t\treturn null;\n\t}",
"protected ArrayList<String> search(String key) {\n addresses = map.get(key);\n if (addresses == null) {\n return null;\n }\n return addresses;\n }",
"List<SearchResult> search(SearchQuery searchQuery);",
"private void findMatches(String key, String path, boolean caseSensitive, boolean fileName) {\n\t\tfor (String word : document) {\n\t\t\tif (contains(key, word, caseSensitive)) {\n\t\t\t\tif (fileName) {\n\t\t\t\t\tSystem.out.println(path);\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(word);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"@Override\n public List<Doctor> searchByName(String name) throws IOException, ClassNotFoundException {\n doctorList = FileSystem.readFile(file, Doctor.class);\n List<Doctor> searchList = search(doctorList, Doctor::getName, name);\n return searchList;\n }",
"@Override\n\tpublic Etape find(String search) {\n\t\treturn null;\n\t}",
"@Override\n\tpublic <T> List<T> findMany(Map<String, CustmerCriteria> params, Class<T> entityClass) throws Exception {\n\t\treturn null;\n\t}",
"List<T> findAll();",
"List<T> findAll();",
"List<T> findAll();",
"@Override\n\tpublic List<RenWutable> findPagepramo(String strwhere) {\n\t\treturn null;\n\t}",
"List<UsuarioEntity> findByCorreoAllIgnoreCase(String correo);",
"public List<Usuario> findWhere(Map<String, String> params){\n try {\n QueryBuilder<Usuario, Integer> queryBuilder = dao.queryBuilder();\n Where<Usuario, Integer> where = queryBuilder.where();\n\n for(Map.Entry<String, String> param: params.entrySet()) {\n where.eq(param.getKey(), param.getValue());\n }\n\n where.and(params.size());\n PreparedQuery<Usuario> preparedQuery = queryBuilder.prepare();\n return dao.query(preparedQuery);\n } catch (SQLException e) {\n e.printStackTrace();\n }\n return null;\n }",
"@Override\r\n\tpublic List<Post> searchInfResult(String word) {\n\t\tpostDao=new PostDaoImpl(TransactionManager.connection);\r\n\t\treturn postDao.selectPosts(word);\r\n\t}",
"private List<IUser> userSearch(IChannel root, String str) {\n List<IUser> list = new LinkedList<IUser>();\n userSearch(root, str, list);\n return list;\n }",
"@Override\r\n public Match find(Match M) {\n return null;\r\n }",
"List<Videogioco> retriveByNome(String nome);",
"public Tipo[] findByName(String nombre) throws TipoDaoException;",
"Map getAll();",
"List<Receta> getAll(String filter);",
"public List<E> findAll() ;",
"public ResultMap<BaseNode> findNodes(ObjectNode query, String searchTerm, ObjectNode traverse);",
"public ArrayList<Producto> busquedaProductos(Producto.Categoria categoria,String palabrasClave){\n try{\n ArrayList<Producto>productosFiltrados = new ArrayList<>();\n ArrayList<Producto>productosEncontrados = busquedaProductos(categoria);\n ArrayList<String>palabras = new ArrayList<>();\n StringTokenizer tokens = new StringTokenizer(palabrasClave);\n\n while(tokens.hasMoreTokens()){\n palabras.add(tokens.nextToken()); \n }\n \n if(palabras.size()>1){\n for(String cadaPalabra : palabras){\n for(Producto cadaProducto : productosEncontrados){\n String titulo=cadaProducto.getTitulo().toLowerCase();\n if(titulo.contains(cadaPalabra.toLowerCase()) && !productosFiltrados.contains(cadaProducto)){\n productosFiltrados.add(cadaProducto);\n }\n }\n }\n }else{\n for(Producto cadaProducto : productosEncontrados){\n String titulo=cadaProducto.getTitulo().toLowerCase();\n if(titulo.contains(palabrasClave.toLowerCase()) && !productosFiltrados.contains(cadaProducto)){\n productosFiltrados.add(cadaProducto);\n }\n }\n }\n ArrayList <Producto> productosFiltradosOrdenado=getProductosOrdenados(productosFiltrados, this);\n return productosFiltradosOrdenado;\n }catch(Exception e){\n System.out.println(e.getMessage());\n }\n return null;\n }",
"public List findAll() {\n\t\treturn null;\r\n\t}",
"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 }",
"public Set<SearchedItem> getAllItems(StaplerRequest req, String tokenList){\n List<Ancestor> ancestors = req.getAncestors(); \n Set<SearchedItem> searchedItems = new TreeSet<SearchedItem>();\n if(tokenList==null){\n return searchedItems;\n }\n for (int i = 0; i < ancestors.size(); i++) {\n Ancestor a = ancestors.get(i);\n if (a.getObject() instanceof SearchableModelObject) {\n SearchIndex index = ((SearchableModelObject) a.getObject()).getSearchIndex();\n //unfortunatelly the token list is protected\n String tokens[] = tokenList.split(\"(?<=\\\\s)(?=\\\\S)\");\n List<SearchItem> items = new ArrayList<SearchItem>();\n for (String token : tokens) {\n index.suggest(token, items); \n searchedItems.addAll(createSearchItems(items, a));\n }\n }\n }\n return searchedItems;\n }",
"public boolean buscar(String referencia){\n Nodo aux = inicio;\r\n // Bandera para indicar si el valor existe.\r\n boolean encontrado = false;\r\n // Recorre la lista hasta encontrar el elemento o hasta \r\n // llegar al final de la lista.\r\n while(aux != null && encontrado != true){\r\n // Consulta si el valor del nodo es igual al de referencia.\r\n if (referencia == aux.getValor()){\r\n // Canbia el valor de la bandera.\r\n encontrado = true;\r\n }\r\n else{\r\n // Avansa al siguiente. nodo.\r\n aux = aux.getSiguiente();\r\n }\r\n }\r\n // Retorna el resultado de la bandera.\r\n return encontrado;\r\n }",
"List<SongVO> searchSong(String searchText) throws Exception;",
"@SuppressWarnings(\"unused\")\n\t@Override\n\tpublic ArrayList<Object> searchUserByName(String search) {\n\t\t\n\t\tSystem.out.println(\"i am in service search looking for users\" + search.length());\n\t\t\n\t\tif(search == null){\n\t\t\t\n\t\t\tSystem.out.println(\"nothing can be find\");\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tSystem.out.println(\"its not 0000000000\");\n\t\t\n\t\tArrayList<Object> list = userRepository.findUserByName(search);\n\t\t\n\t\t//System.out.println(Arrays.toString(list));\n\t\treturn list;\n\t}",
"List<AlbumVO> searchAlbum(String searchText) throws Exception;",
"public List getList(int start, int pernum, SearchParam param);",
"public List getAll() throws FileNotFoundException, IOException;",
"List<ResultDTO> search(String query);",
"private List<FindResult> findOnPage(int page) {\n\t\t\tif (this.text == null) throw new IllegalStateException(\"text cannot be null\");\n\t\t\treturn this.parent.pdf.find(this.text, page);\n\t\t}",
"public IndexedList<Task> search() {\n\t\treturn null;\n\t}",
"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 }",
"List<Label> findAllByKey(String key);",
"List<T> findAll() throws Exception;",
"public void search() {\n\n lazyModel = new LazyDataModel<Pesquisa>() {\n private static final long serialVersionUID = -6541913048403958674L;\n\n @Override\n public List<Pesquisa> load(int first, int pageSize, String sortField, SortOrder sortOrder, Map<String, String> filters) {\n\n pesquisarBC.searhValidation(searchParam);\n\n int count = pesquisarBC.count(searchParam);\n lazyModel.setRowCount(count);\n\n if (count > 0) {\n if (first > count) {\n // Go to last page\n first = (count / pageSize) * pageSize;\n }\n SearchFilter parameters = new SearchFilter();\n parameters.setFirst(first);\n parameters.setPageSize(pageSize);\n List<Pesquisa> list = pesquisarBC.search(searchParam, parameters);\n\n logger.info(\"END: load\");\n return list;\n } else {\n return null;\n }\n }\n };\n\n }",
"@Override\n public List<Doctor> searchById(int id) throws IOException, ClassNotFoundException {\n doctorList = FileSystem.readFile(file, Doctor.class);\n List<Doctor> searchList = search(doctorList, Doctor::getId, id);\n return searchList;\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 }",
"List<ResultsView1> findByCadd(String addrs);",
"@Override\n\tpublic void searchByID() {\n\t\tcount = 0;\n\t\tif (UtilityClinic.patFile == null) {\n\t\t\ttry {\n\t\t\t\tutil.accessExistingPatJson();\n\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\tSystem.out.println(\"File not found\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tutil.readFromPatJson(UtilityClinic.patFile);\n\t\tSystem.out.println(\"Enter search.....\");\n\t\tString search = UtilityClinic.readString();\n\t\tSystem.out.println(\"Showing search result(s).......\");\n\t\tfor (int i = 0; i < UtilityClinic.patJson.size(); i++) {\n\t\t\tJSONObject jsnobj = (JSONObject) UtilityClinic.patJson.get(i);\n\t\t\tif (jsnobj.get(\"Patient's ID\").toString().equals(search))\n\t\t\t\tSystem.out.print(\n\t\t\t\t\t\t++count + \" Name:\" + jsnobj.get(\"Patient's name\") + \" ID:\" + jsnobj.get(\"Patient's ID\")\n\t\t\t\t\t\t\t\t+ \" Mobile:\" + jsnobj.get(\"Mobile\") + \" Age:\" + jsnobj.get(\"Age\"));\n\t\t}\n\t\tif (count == 0) {\n\t\t\tSystem.out.println(\"No results found.....\");\n\t\t}\n\t\tSystem.out.println();\n\t}",
"List<User> searchUsers(String searchTerm) {\n return null;\n }"
] | [
"0.68052936",
"0.6545252",
"0.64001936",
"0.63984",
"0.63984",
"0.6351062",
"0.6241086",
"0.6238257",
"0.6237144",
"0.62224674",
"0.621374",
"0.6170589",
"0.61476916",
"0.59867376",
"0.5979617",
"0.5951858",
"0.5945857",
"0.5928872",
"0.59165514",
"0.5915148",
"0.5884894",
"0.5883361",
"0.58778673",
"0.58354104",
"0.58170825",
"0.5815019",
"0.5784421",
"0.57725984",
"0.5764266",
"0.57368433",
"0.5705977",
"0.57003707",
"0.57001925",
"0.569189",
"0.56729287",
"0.5654013",
"0.56470954",
"0.564019",
"0.5637468",
"0.5630362",
"0.5629535",
"0.56268126",
"0.5623602",
"0.5618097",
"0.56151503",
"0.5611258",
"0.56003124",
"0.56000763",
"0.55979294",
"0.55933416",
"0.5593254",
"0.55913013",
"0.5588709",
"0.5588202",
"0.5577247",
"0.5575714",
"0.55753756",
"0.5569923",
"0.55611855",
"0.5560356",
"0.5556474",
"0.5544924",
"0.55417585",
"0.553994",
"0.553634",
"0.553634",
"0.553634",
"0.5535352",
"0.55293936",
"0.5515849",
"0.5505165",
"0.5502912",
"0.550259",
"0.5498233",
"0.54976475",
"0.54952157",
"0.54934007",
"0.54909",
"0.5487747",
"0.5486144",
"0.54799044",
"0.5475142",
"0.5474667",
"0.5472833",
"0.54652166",
"0.5462628",
"0.5461251",
"0.5458138",
"0.5457337",
"0.54540545",
"0.5453002",
"0.545234",
"0.54441375",
"0.5441991",
"0.5438946",
"0.54369706",
"0.542642",
"0.54251355",
"0.5423017",
"0.5415757",
"0.54129606"
] | 0.0 | -1 |
/Obtener un objeto de la tabla | public ProveedorEntity getProveedor(Long id_proveedor){
ProveedorEntity proveedor = proveedorPersistence.find(id_proveedor);
if(proveedor == null){
throw new IllegalArgumentException("El proveedor solicitado no existe");
}
return proveedor;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Tablero consultarTablero();",
"Table getTable();",
"FromTable createFromTable();",
"TableInstance createTableInstance();",
"public TableObject()\r\n {\r\n\tsuper(ObjectType.Table);\r\n\tglobal = false;\r\n }",
"public Table getTable() { return this.table; }",
"private EstabelecimentoTable() {\n\t\t\t}",
"private Object getTable() {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }",
"public Table<Integer, Integer, String> getData();",
"private TableModel getTabelaProduto() {\r\n\t\tString[] columnNames = { \"id_c\", \"nome\", \"telefone\", \"endereco\", \"cidade\", \"estado\", \"email\", \"genero\" };\r\n\r\n\t\tObject[][] dados = new Object[listacliente.size()][8];\r\n\t\tfor (int i = 0; i < listacliente.size(); i++) {\r\n\t\t\tint x = 0;\r\n\t\t\tdados[i][x++] = listacliente.get(i).getId();\r\n\t\t\tdados[i][x++] = listacliente.get(i).getNome();\r\n\t\t\tdados[i][x++] = listacliente.get(i).getTelefone();\r\n\t\t\tdados[i][x++] = listacliente.get(i).getEndereco();\r\n\t\t\tdados[i][x++] = listacliente.get(i).getCidade();\r\n\t\t\tdados[i][x++] = listacliente.get(i).getEstado().getNome();\r\n\t\t\tdados[i][x++] = listacliente.get(i).getEmail();\r\n\t\t\tdados[i][x++] = listacliente.get(i).getGenero().getNome();\r\n\t\t}\r\n\r\n\t\treturn new DefaultTableModel(dados, columnNames);\r\n\r\n\t}",
"public Row(BaseTable table) {\n this.table = table;\n }",
"public final Table getTable()\n {\n return table;\n }",
"public Table getTable() {\n return table;\n }",
"public Table getTable() {\n return table;\n }",
"public Objet getObjetById(int id){\n \n Objet ob=null;\n String query=\" select * from objet where id_objet=\"+id;\n \n try { \n Statement state = Connect.getInstance().createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);\n ResultSet res = state.executeQuery(query);\n while(res.next()) ob=new Objet(res.getInt(\"id_objet\"),res.getInt(\"id_user\"),res.getInt(\"qte\"),res.getString(\"types\"),res.getString(\"description\"));\n res.close();\n state.close();\n \n } catch (SQLException e) {\n e.printStackTrace();\n }\n \n return ob;\n }",
"public Table() {\n this.tableName = \"\";\n this.rows = new HashSet<>();\n this.columnsDefinedOrder = new ArrayList<>();\n }",
"public Object queryByID(Class<?> tableClass, Serializable id) throws Exception;",
"public TabellaModel() {\r\n lista = new Lista();\r\n elenco = new Vector<Persona>();\r\n elenco =lista.getElenco();\r\n values = new String[elenco.size()][3];\r\n Iterator<Persona> iterator = elenco.iterator();\r\n while (iterator.hasNext()) {\r\n\t\t\tfor (int i = 0; i < elenco.size(); i++) {\r\n\t\t\t\tpersona = new Persona();\r\n\t\t\t\tpersona = (Persona) iterator.next();\r\n\t\t\t\tvalues[i][0] = persona.getNome();\r\n\t\t\t\tvalues[i][1] = persona.getCognome();\r\n\t\t\t\tvalues[i][2] = persona.getTelefono();\t\r\n\t\t\t}\r\n\t\t}\r\n setDataVector(values, columnNames);\t\r\n }",
"public Table getTable() { \n\t\treturn this.table; \n\t}",
"Table createTable();",
"private Table getTable(int id) throws Exception {\n // Requete MetaData pour connaitre la table\n FakeDriver.getDriver().pushResultSet(FakeDriver.EMPTY,\n \"FakeDatabaseMetaData.getPrimaryKeys(null, null, TABLE_\" + id + \")\");\n Object[][] tableDef =\n {\n {},\n {null, null, null, \"COL_A\", new Integer(Types.NUMERIC)},\n {null, null, null, \"COL_B\", new Integer(Types.VARCHAR)},\n {null, null, null, \"COL_C\", new Integer(Types.DATE)},\n {null, null, null, \"COL_D\", new Integer(Types.BIT)},\n {null, null, null, \"COL_E\", new Integer(Types.DISTINCT)}\n };\n FakeDriver.getDriver().pushResultSet(tableDef,\n \"FakeDatabaseMetaData.getColumns(null, null, TABLE_\" + id + \", null)\");\n FakeDriver.getDriver().pushResultSet(FakeDriver.EMPTY,\n \"select * from PM_TABLE where DB_TABLE_NAME='TABLE_\" + id + \"'\");\n return testEnv.getTableHome().getTable(\"TABLE_\" + id);\n }",
"public Table getSelectedTable() {\n Integer id = (Integer)super.getSelectedItem();\n if (id == null) {\n return null;\n }\n try {\n return tableHome.getTable(id.intValue());\n }\n catch (PersistenceException ex) {\n // Cas impossible : Le model contient obligatoirement des Id valide\n ex.printStackTrace();\n return null;\n }\n }",
"public void newRow();",
"TABLE createTABLE();",
"public AbstractTableModel obtenerModeloA(JTable tabla,\n\t List<UcsawsTipoEvento> tipoEvento) {\n\tIterator<UcsawsTipoEvento> ite = tipoEvento.iterator();\n\n\t// String header[] = new String[] { \"ID\",\"Item\",\"Nro.\",\n\t// \"Desc. Evento\",\"Inicio\",\"Fin\",\"Desc. Tipo Evento\" };\n\t// model.setColumnIdentifiers(header);\n\n\tUcsawsTipoEvento aux;\n\tInteger cont = 1;\n\twhile (ite.hasNext()) {\n\t aux = ite.next();\n\n\t Object[] row = { aux.getIdTipoEvento(), cont, aux.getDescripcion() };\n\n\t // new\n\t // SimpleDateFormat(\"dd-MM-yyyy HH:mm:ss\").format((aux.getFechaNacimiento())),formatter.format(aux.getSalario())};\n\t model.tipoEvento.add(row);\n\n\t cont++;\n\n\t}\n\n\treturn model;\n }",
"public void carga_bd_empleados(){\n try {\n Connection conectar = Conexion.conectar();\n PreparedStatement pst = conectar.prepareStatement(\n \"select nombre, edad, cargo, direccion, telefono from empleados\");\n\n ResultSet rs = pst.executeQuery();\n\n table = new JTable(model);\n jScrollPane1.setViewportView(table);\n table.setBackground(Color.yellow);\n\n model.addColumn(\"Nombre\");\n model.addColumn(\"Edad\");\n model.addColumn(\"Cargo\");\n model.addColumn(\"Direccion\");\n model.addColumn(\"Telefono\");\n\n while (rs.next()) {\n Object[] fila = new Object[8];\n //material mimaterial = new material();\n\n for (int i = 0; i < 5; i++) {\n fila[i] = rs.getObject(i + 1);\n }\n\n// model.addRow(fila);\n Empleado mimaterial = this.ChangetoEmpleado(fila);\n this.AddToArrayTableEmpleado(mimaterial);\n\n }\n\n conectar.close();\n \n } catch (SQLException e) {\n System.err.println(\"Error al llenar tabla\" + e);\n JOptionPane.showMessageDialog(null, \"Error al mostrar informacion\");\n\n }\n }",
"private void loadTable() {\n model.getDataVector().removeAllElements();\n model.fireTableDataChanged();\n try {\n String sql = \"select * from tb_mahasiswa\";\n Statement n = a.createStatement();\n ResultSet rs = n.executeQuery(sql);\n while (rs.next()) {\n Object[] o = new Object[6];\n o[0] = rs.getString(\"id_mahasiswa\");\n o[1] = rs.getString(\"nama\");\n o[2] = rs.getString(\"tempat\");\n o[3] = rs.getString(\"waktu\");\n o[4] = rs.getString(\"status\");\n model.addRow(o);\n }\n } catch (Exception e) {\n }\n }",
"public String getTable()\n {\n return table;\n }",
"public TableModel GetPagineOpera (int cod, String Opera) throws SQLException {\n\t\t\n Connection dbConnection = model.connectionDataBase.ConnectionDB.Connect();\n\n // Execute the query and get the ResultSet\n PreparedStatement stmt = dbConnection.prepareStatement(\"SELECT * FROM pagine_opera INNER JOIN opera ON pagine_opera.cod_opera = opera.cod WHERE opera.cod = ? AND opera.nome = ?\");\n stmt.setInt(1, cod);\n stmt.setString(2, Opera);\n \n ResultSet rs = stmt.executeQuery();\n TableModel tm = DbUtils.resultSetToTableModel(rs);\n dbConnection.close();\n\n return tm;\n\t\t\n\t}",
"public void initTable();",
"public T caseTable(Table object) {\n\t\treturn null;\n\t}",
"public T caseTable(Table object) {\n\t\treturn null;\n\t}",
"Table getBaseTable();",
"public LeagueTableBase getEntity() {\n LeagueTableBase leagueTable = new LeagueTableBase();\n\n leagueTable.setId(new LeagueTableBasePK(getId().getLeagueSeasonId(), getId().getTeamNo(), getId().getPredicted(), getId().getWeekNo()));\n leagueTable.setGameDate(this.gameDate);\n leagueTable.setPlayed(this.played);\n leagueTable.setWon(this.won);\n leagueTable.setDrawn(this.drawn);\n leagueTable.setLost(this.lost);\n leagueTable.setGoalsFor(this.goalsFor);\n leagueTable.setGoalsAgainst(this.goalsAgainst);\n leagueTable.setPoints(this.points);\n leagueTable.setForm(this.form);\n leagueTable.setHomeWon(this.homeWon);\n leagueTable.setHomeDrawn(this.homeDrawn);\n leagueTable.setHomeLost(this.homeLost);\n leagueTable.setHomeGoalsFor(this.homeGoalsFor);\n leagueTable.setHomeGoalsAgainst(this.homeGoalsAgainst);\n leagueTable.setHomePoints(this.homePoints);\n leagueTable.setHomeForm(this.homeForm);\n leagueTable.setAwayWon(this.awayWon);\n leagueTable.setAwayDrawn(this.awayDrawn);\n leagueTable.setAwayLost(this.awayLost);\n leagueTable.setAwayGoalsFor(this.awayGoalsFor);\n leagueTable.setAwayGoalsAgainst(this.awayGoalsAgainst);\n leagueTable.setAwayPoints(this.awayPoints);\n leagueTable.setAwayForm(this.awayForm);\n leagueTable.setUpdatedDate(this.updatedDate);\n\n return leagueTable;\n }",
"private void carregarTabela() {\n try {\n\n Vector<String> cabecalho = new Vector();\n cabecalho.add(\"Id\");\n cabecalho.add(\"Nome\");\n cabecalho.add(\"Telefone\");\n cabecalho.add(\"Titular\");\n cabecalho.add(\"Data de Nascimento\");\n\n Vector detalhe = new Vector();\n\n for (Dependente dependente : new NDependente().listar()) {\n Vector<String> linha = new Vector();\n\n linha.add(dependente.getId() + \"\");\n linha.add(dependente.getNome());\n linha.add(dependente.getTelefone());\n linha.add(new NCliente().consultar(dependente.getCliente_id()).getNome());\n linha.add(dependente.getDataNascimento().toString());\n detalhe.add(linha);\n\n }\n\n tblDependentes.setModel(new DefaultTableModel(detalhe, cabecalho));\n\n } catch (Exception e) {\n JOptionPane.showMessageDialog(this, e.getMessage());\n }\n\n }",
"@SuppressWarnings(\"unchecked\")\n\tpublic synchronized Hashtable<Object,Object> loadTable() \n\t{\n\t\tHashtable<Object,Object> ht = null ;\n\t\ttry {\n\t\t\tFileInputStream fis = new FileInputStream(tableFile);\n\t\t\t\n\t\t\tObjectInputStream ois = new ObjectInputStream(fis);\n\t\t\t// Unchecked cast\n\t\t\thtRecords = (Hashtable<Object,Object>) ois.readObject();\n\t\t\tois.close();\n\t\t\tfis.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t\t// throw new DatabaseException(\"Cannot load : FileNotFoundException\",e);\n\t\t htRecords = new Hashtable<Object,Object>(); // Void Hashtable\n\t\t} catch (IOException e) {\n\t\t\tthrow new RuntimeException(\"Cannot load : IOException\",e);\n\t\t} catch (ClassNotFoundException e) {\n\t\t\tthrow new RuntimeException(\"Cannot load : ClassNotFoundException\",e);\n\t\t}\n\t\treturn ht ;\n\t}",
"public <T> T getObject(String columnLabel, Class<T> type) throws SQLException\n\t{\n\t\treturn null;\n\t}",
"public HTMLTableSectionElement getElementTablaTablero() { return this.$element_TablaTablero; }",
"public Courses getCourseTable();",
"public <T> T getObject(int columnIndex, Class<T> type) throws SQLException\n\t{\n\t\treturn null;\n\t}",
"DataTable createDataTable();",
"public TdRuspHijo() { }",
"@Override\r\n\tpublic Table getEntity(TableDTO dto) {\n\t\treturn null;\r\n\t}",
"public static MlTableModel createModel(MlObjectTable table) {\n\n MlTableModel model = null;\n switch (table.getType()) {\n case Contact:\n model = new ContactTableModel(table);\n break;\n case Task:\n model = new TaskTableModel(table);\n break;\n case Image:\n model = new ImageTableModel(table);\n break;\n case Knowlet:\n case Collection:\n case Map:\n case Container:\n case Any:\n model = new AllObjectTableModel(table);\n break;\n default:\n throw new IllegalStateException(\"No table model found for specified object class: \" + table.getType().name());\n }\n return model;\n }",
"public TableImpl() { columns = new Column[0]; }",
"Row createRow();",
"private void setDataModel() {\r\n tableData = new Object[resultSet.size()][classFields.length];\r\n // for every object from collection of objects\r\n for (int i = 0; i < resultSet.size(); i++) {\r\n // for every fields from class of object\r\n for (int j = 0; j < classFields.length; j++) {\r\n // for every method from class of object\r\n for (int x = 0; x < classMethods.length; x++) {\r\n // if class name start with 'get' and class method name\r\n // lenght is equal to field name + 3 (becouse of get word)\r\n if ((classMethods[x].getName().startsWith(\"get\"))\r\n && (classMethods[x].getName().length() == (classFields[j].getName().length() + 3))) {\r\n // if class name to lowercase ends with field name to\r\n // lower case\r\n if (classMethods[x].getName().toLowerCase().endsWith(classFields[j].getName().toLowerCase())) {\r\n // then try to invoke that getter\r\n try {\r\n tableData[i][j] = classMethods[x].invoke(resultSet.get(i));\r\n } catch (IllegalAccessException e) {\r\n // TODO Auto-generated catch block\r\n e.printStackTrace();\r\n } catch (IllegalArgumentException e) {\r\n // TODO Auto-generated catch block\r\n e.printStackTrace();\r\n } catch (InvocationTargetException e) {\r\n // TODO Auto-generated catch block\r\n e.printStackTrace();\r\n }\r\n }\r\n }\r\n }\r\n // This is alternative method for obtaining getter for field but\r\n // it will need public fields\r\n // try {\r\n // fieldValue = pola[j].get(resultSet.get(i));\r\n // data[i][j]=fieldValue;\r\n // } catch (IllegalArgumentException e) {\r\n // // TODO Auto-generated catch block\r\n // e.printStackTrace();\r\n // } catch (IllegalAccessException e) {\r\n // // TODO Auto-generated catch block\r\n // e.printStackTrace();\r\n // }\r\n }\r\n }\r\n }",
"Object getTables();",
"public Table getTable() {\n\t\treturn table;\n\t}",
"T buidEntity(ResultSet rs) throws SQLException;",
"ReturnTable(TableModel dm) {\n super(dm);\n }",
"public Object caseTable(Table object) {\r\n\t\treturn null;\r\n\t}",
"public DetalleTablaComplementario() {\r\n }",
"public StateTable_R(StateTable obj) {\n this.obj = obj;\n }",
"private void carregarTabela() {\n try {\n\n Vector<String> cabecalho = new Vector();\n cabecalho.add(\"Id\");\n cabecalho.add(\"Nome\");\n cabecalho.add(\"CPF\");\n cabecalho.add(\"Telefone\");\n cabecalho.add(\"Endereço\");\n cabecalho.add(\"E-mail\");\n cabecalho.add(\"Data de Nascimento\");\n\n Vector detalhe = new Vector();\n\n for (Cliente cliente : new NCliente().listar()) {\n Vector<String> linha = new Vector();\n\n linha.add(cliente.getId() + \"\");\n linha.add(cliente.getNome());\n linha.add(cliente.getCpf());\n linha.add(cliente.getTelefone());\n linha.add(cliente.getEndereco());\n linha.add(cliente.getEmail());\n linha.add(cliente.getData_nascimento().toString());\n detalhe.add(linha);\n\n }\n\n tblClientes.setModel(new DefaultTableModel(detalhe, cabecalho));\n\n } catch (Exception e) {\n JOptionPane.showMessageDialog(this, e.getMessage());\n }\n\n }",
"private JTable getTable(String key){\n\t\tJTable table = null;\n\t\t\n\t\ttry{\n\t\t\tObjectInputStream in = new ObjectInputStream(new FileInputStream(key+\"_Details.sce\"));\n\t\t\ttable = (JTable) in.readObject();\n\t\t\tin.close();\n\t\t}catch(IOException ex){\n\t\t\tSystem.out.println(ex.getMessage());\n\t\t}catch(ClassNotFoundException ey){\n\t\t\tSystem.out.println(ey.getMessage());\n\t\t}\n\t\t\n\t\treturn table;\n\t}",
"void initTable();",
"TableId table();",
"private void tableLoad() {\n try{\n String sql=\"SELECT * FROM salary\";\n pst = conn.prepareStatement(sql);\n rs = pst.executeQuery();\n \n table1.setModel(DbUtils.resultSetToTableModel(rs));\n \n \n }\n catch(SQLException e){\n \n }\n }",
"@Override\n\tprotected Object mapObj(ResultSet rs) throws SQLException {\n\t\tTbTravelerInfo tbTravelerInfo = new TbTravelerInfo() ;\n\t\ttbTravelerInfo.setId(rs.getInt(\"id\")) ;\n\t\ttbTravelerInfo.setIntBillId(rs.getInt(\"intBillId\")) ;\n\t\ttbTravelerInfo.setStrCountry(rs.getString(\"strCountry\")) ;\n\t\ttbTravelerInfo.setStrIndentyNumber(rs.getString(\"strIndentyNumber\")) ;\n\t\ttbTravelerInfo.setStrTravelerName(rs.getString(\"strTravelerName\")) ;\n\t\ttbTravelerInfo.setStrSex(rs.getString(\"strSex\")) ;\n\t\ttbTravelerInfo.setStrBirthday(rs.getString(\"strBirthday\")) ;\n\t\treturn tbTravelerInfo;\n\t}",
"private ArrayList<FornecedorModelo> iniciaTabela() {\n int i;\n DefaultTableModel model=(DefaultTableModel)tblFornecedor.getModel();\n // atribui 0 linhas à coluna\n model.setNumRows(0);\n // atribui um tamanho fixo a coluna codigo\n tblFornecedor.getColumnModel().getColumn(0).setPreferredWidth(2);\n ArrayList<FornecedorModelo> listaFornecedores = new ArrayList<FornecedorModelo>();\n listaFornecedores = new FornecedorControle().listarFornecedor();\n //adiciona alunos as tabelas\n for (i=0;i<=listaFornecedores.size()-1;i++){\n model.addRow(\n new Object[]{\n listaFornecedores.get(i).getCodFornecedor(),\n listaFornecedores.get(i).getNomeFantasia(),\n listaFornecedores.get(i).getRazaoSocial(),\n listaFornecedores.get(i).getEndereco(),\n listaFornecedores.get(i).getEmail(),\n listaFornecedores.get(i).getTelefone(),\n listaFornecedores.get(i).getCnpj(),\n Boolean.FALSE\n }\n );\n }\n return listaFornecedores;\n }",
"public static Row createRow() {\n\t\treturn new Row(fsco,criteria,columns);\n\t}",
"@Override\n\tpublic Curso mapRow(ResultSet rs, int rowNum) throws SQLException {\n\t\t/* Se declara e instancia el objeto Persona.*/\n\t\tCurso curso = new Curso();\n\t\t/* Se recoje el identificador de curso del result.*/\n\t\tcurso.setId(rs.getInt(\"id\"));\n\t\t/* Se recoje el codigo de curso del result.*/\n\t\tcurso.setCodigo(rs.getString(\"codigo\"));\n\t\t/* Se recoje el nombre de la curso del result.*/\n\t\tcurso.setNombre(rs.getString(\"nombre\"));\n\t\t\n\t\t\n\t\t/* Se devuelve el objeto Persona.*/\n\t\treturn curso;\n\t}",
"public void createTable() {\n try {\n tableLayout = findViewById(R.id.tabla);\n tb = new TableDinamic(tableLayout, getApplicationContext(), \"cargarDetalle\", clc, cap_1, cap_2, cap_ct, txtidReg, txtId, txtBloque, txtVariedad);\n tableLayout.removeAllViews();\n tb.addHeader(header);\n tb.addData(cargarTabla());\n tb.backgroundHeader(\n Color.parseColor(\"#20C0FF\")\n );\n tb.backgroundData(\n Color.parseColor(\"#FFFFFF\"),\n Color.parseColor(\"#81F0EDED\")\n );\n } catch (Exception e) {\n Toast.makeText(this, \"Error de la table: \" + e.toString(), Toast.LENGTH_LONG).show();\n }\n }",
"private HashMap<Long, String> getTable() {\n return table;\n }",
"public Table asTable() {\n Table table = Table.create(this.name());\n for (Column<?> column : this.columns()) {\n table.addColumns(column);\n }\n return table;\n }",
"public BeanDatosAlumno() {\r\n bo = new BoPrestamoEjemplarImpl();\r\n verEjemplares(\"ABC0001\"); \r\n numerodelibrosPrestados();\r\n }",
"BTable createBTable();",
"private DefaultTableModel getDatos3(){\n String folio = String.valueOf(venta.ns);\n //consulta sql\n String SQL_SELECT = \"SELECT p.Nombres,dv.Cantidad,dv.PrecioVenta FROM ventas v JOIN detalle_ventas dv ON v.IdVentas=dv.IdVentas JOIN producto p ON p.IdProducto=dv.IdProducto WHERE v.NumeroSerie = \"+folio+\"\";\n try {\n setTitutlos3();\n ps = con.getConnection().prepareStatement(SQL_SELECT);\n RS = ps.executeQuery();\n Object[] fila = new Object[3];\n while (RS.next()){\n fila[0] = RS.getString(1);\n fila[1] = RS.getInt(2);\n fila[2] = RS.getDouble(3);\n DT.addRow(fila);\n }\n //System.out.println(\"si hizo el desmadre\");\n } catch (SQLException e) {\n System.out.println(\"error en la tabla de ticket\");\n }\n \n return DT;\n \n }",
"private void llenar_tabla() {\n \n try {\n DefaultTableModel modelo;\n conexion cnx = new conexion();\n Connection registros = cnx.conexion();\n String[] nombre_atributos = {\"id_producto\", \"nombre\",\"id_categoria\"};\n String sql = (\"SELECT *FROM producto\");\n modelo = new DefaultTableModel(null, nombre_atributos);\n Statement st = (Statement) registros.createStatement();\n ResultSet rs = st.executeQuery(sql);\n String[] filas = new String[3];\n\n while (rs.next()) {\n filas[0] = rs.getString(\"id_producto\");\n filas[1] = rs.getString(\"nombre\");\n filas[2] = rs.getString(\"id_categoria\");\n modelo.addRow(filas);\n\n }\n jtabla.setModel(modelo);\n registros.close();\n } catch (SQLException ex) {\n Logger.getLogger(responsable.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n }",
"public DefaultTableModel cargarDatos () {\r\n DefaultTableModel modelo = new DefaultTableModel(\r\n new String[]{\"ID SALIDA\", \"IDENTIFICACIÓN CAPITÁN\", \"NÚMERO MATRICULA\", \"FECHA\", \"HORA\", \"DESTINO\"}, 0); //Creo un objeto del modelo de la tabla con los titulos cargados\r\n String[] info = new String[6];\r\n String query = \"SELECT * FROM actividad WHERE eliminar = false\";\r\n try {\r\n Statement st = con.createStatement();\r\n ResultSet rs = st.executeQuery(query);\r\n while (rs.next()) { \r\n info[0] = rs.getString(\"id_salida\");\r\n info[1] = rs.getString(\"identificacion_navegate\");\r\n info[2] = rs.getString(\"numero_matricula\");\r\n info[3] = rs.getString(\"fecha\");\r\n info[4] = rs.getString(\"hora\");\r\n info[5] = rs.getString(\"destino\");\r\n Object[] fila = new Object[]{info[0], info[1], info[2], info[3], info[4], info[5]};\r\n modelo.addRow(fila);\r\n }\r\n st.close();\r\n rs.close();\r\n } catch (SQLException ex) {\r\n Logger.getLogger(PActividad.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n return modelo;\r\n }",
"void LlenarModelo(){\n datos.addColumn(\"ID\");\n datos.addColumn(\"Descripcion\");\n datos.addColumn(\"Cantidad\");\n String []ingresar=new String[4];\n try {\n Connection con = Conexion.getConection();\n Statement estado = con.createStatement();\n //ResultSet resultado = estado.executeQuery(\"SELECT * FROM pago where codigo>=\" + SIGEPSA.IDOtrosPagosMin + \";\");\n //ResultSet resultado = estado.executeQuery(\"SELECT * FROM pago ;\");\n ResultSet resultado = estado.executeQuery(\"SELECT * FROM pago where codigo<9 or codigo>10 and activo = 1;\");\n while(resultado.next()){\n ingresar[0]=String.valueOf((String)resultado.getObject(\"CODIGO\").toString());\n ingresar[1]=String.valueOf((String)resultado.getObject(\"DESCRIPCION\").toString());\n ingresar[2]=String.valueOf((String)resultado.getObject(\"CANTIDAD\").toString());\n datos.addRow(ingresar);\n }\n }catch (Exception ex) {\n \n }\n }",
"public ExampleTable toExampleTable() { return new ExampleTableImpl(this); }",
"public TableCreation(Table table) {\n this.table = table;\n }",
"private void Table()\n{\n Object [] Kolom = {\"Nama\", \"No. Telp\", \"Kota Asal\"};\n Table = new DefaultTableModel(null, Kolom);\n Tabel.setModel(Table);\n}",
"private ByaTableModel() {\n\t}",
"public TableDefinition(Class<T> model){\n this.singleton = this;\n this.model = model;\n try {\n OBJECT = Class.forName(model.getName());\n createTableDefinition();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }",
"ExpDataClass getDataClass(int rowId);",
"public Object getTablePelanggan() {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }",
"private void pintarTabla() {\r\n ArrayList<Corredor> listCorredors = gestion.getCorredores();\r\n TableModelCorredores modelo = new TableModelCorredores(listCorredors);\r\n jTableCorredores.setModel(modelo);\r\n TableRowSorter<TableModel> elQueOrdena = new TableRowSorter<>(modelo);\r\n jTableCorredores.setRowSorter(elQueOrdena);\r\n\r\n }",
"Objet getObjetAlloue();",
"public PromocionTableModel() {\n \n //Establecemos la sentencia SQL que vamos a ejecutar\n super(\"SELECT ID_PROMOCION , NOMBRE, DESCUENTO FROM PROMOCION\");\n \n }",
"public static Alumni_data getAlumniData(int id)\n { \n List li=null; \n try{\n session=SessionFact.getSessionFact().openSession();\n li=session.createQuery(\"from Alumni_data where id=:id\").setInteger(\"id\", id).list();\n session.close();\n return (Alumni_data)li.get(0);\n }catch(Exception e){ out.print(\"Wait(AlumniCon.getAlumniData)\"); } \n return new Alumni_data();\n }",
"Rows createRows();",
"@Override\r\n\tprotected String getTable() {\n\t\treturn TABLE;\r\n\t}",
"private void load_table() {\n DefaultTableModel model = new DefaultTableModel();\n model.addColumn(\"ID\");\n model.addColumn(\"NIM\");\n model.addColumn(\"Nama\");\n model.addColumn(\"Kelamin\");\n model.addColumn(\"Phone\");\n model.addColumn(\"Agama\");\n model.addColumn(\"Status\");\n\n //menampilkan data database kedalam tabel\n try {\n String sql = \"SELECT * FROM mhs\";\n java.sql.Connection koneksi = (Connection) Koneksi.KoneksiDB();\n java.sql.Statement stm = koneksi.createStatement();\n java.sql.ResultSet res = stm.executeQuery(sql);\n\n while (res.next()) {\n model.addRow(new Object[]{res.getString(1), res.getString(2),\n res.getString(3), res.getString(4), res.getString(5),\n res.getString(6), res.getString(7)});\n }\n tabelMahasiswa.setModel(model);\n } catch (Exception e) {\n JOptionPane.showMessageDialog(this, e.getMessage());\n }\n\n }",
"public MyTable getMyTable() {\n\t\treturn myTable;\n\t}",
"public CursosTable() {\n \n \n }",
"public String getTable() {\n return table;\n }",
"private void inicializarTablero() {\n for (int i = 0; i < casillas.length; i++) {\n for (int j = 0; j < casillas[i].length; j++) {\n casillas[i][j] = new Casilla();\n }\n }\n }",
"public String getTable() {\n return table;\n }",
"public List listar() {\n ArrayList<Empleado> lista = new ArrayList<>();\r\n String sql = \"SELECT * FROM empleado\";\r\n \r\n try {\r\n con = cn.getConexion();\r\n ps = con.prepareStatement(sql); \r\n rs = ps.executeQuery();\r\n \r\n while (rs.next()) {\r\n Empleado emp = new Empleado(); \r\n emp.setId(rs.getInt(\"Id\")); //campos de la tabla\r\n emp.setNombre(rs.getString(\"Nombre\"));\r\n emp.setSalario(rs.getDouble(\"Salario\")); \r\n lista.add(emp); \r\n } \r\n } catch(Exception e) {\r\n System.out.println(e.getMessage());\r\n }\r\n \r\n return lista;\r\n }",
"Table2 selectByPrimaryKey(Integer id);",
"public VentanaEmpleado()\n\t{\n\t\tinitComponents();\n\t\tm = ( DefaultTableModel ) tblEmpleado.getModel();\n\n\t\tcargarTablaDesdeBD();\n\t}",
"public Empleado list(int id) {\n Empleado emp = new Empleado();\r\n String sql = \"SELECT * FROM empleado WHERE Id=\" + id;\r\n \r\n try {\r\n con = cn.getConexion();\r\n ps = con.prepareStatement(sql);\r\n rs = ps.executeQuery();\r\n \r\n rs.next(); //un resultset empieza fuera, me posiciono en la primera\r\n emp.setId(rs.getInt(\"Id\"));\r\n emp.setNombre(rs.getString(\"Nombre\"));\r\n emp.setSalario(rs.getDouble(\"Salario\")); \r\n } catch(Exception e) {\r\n System.out.println(e.getMessage());\r\n }\r\n \r\n return emp;\r\n }",
"public void llenarTabla(){\n pedidoMatDao.llenarTabla();\n }",
"public void llenadoDeTablas() {\n \n DefaultTableModel modelo1 = new DefaultTableModel();\n modelo1 = new DefaultTableModel();\n modelo1.addColumn(\"ID Usuario\");\n modelo1.addColumn(\"NOMBRE\");\n UsuarioDAO asignaciondao = new UsuarioDAO();\n List<Usuario> asignaciones = asignaciondao.select();\n TablaPerfiles.setModel(modelo1);\n String[] dato = new String[2];\n for (int i = 0; i < asignaciones.size(); i++) {\n dato[0] = (Integer.toString(asignaciones.get(i).getId_usuario()));\n dato[1] = asignaciones.get(i).getNombre_usuario();\n\n modelo1.addRow(dato);\n }\n }",
"private TableAccessET() {\n\n }",
"public TableRows (t_connect con, String dbTable) {\n\n\tsetDbTable(dbTable);\n \n\trows = new Vector();\n\n try {\n\t DatabaseMetaData md = con.con.getMetaData();\n\t ResultSet cols = md.getColumns(null,null,getDbTable(),\"%\");\n\t while (cols.next()) {\n\t\t rows.addElement(cols.getString(4));\n\t }\n\t this.setListData(rows);\n\t this.setSelectedIndex(0);\n\t } catch (Exception exception) {\n\t \n }\n \n }",
"public ResultSet selecionar(String tabela);",
"private void TampilData(){\n try{ //\n String sql = \"SELECT * FROM buku\"; // memanggil dari php dengan tabel buku\n stt = con.createStatement(); // membuat statement baru dengan mengkonekan ke database\n rss = stt.executeQuery(sql); \n while (rss.next()){ \n Object[] o = new Object [3]; // membuat array 3 dimensi dengan nama object\n \n o[0] = rss.getString(\"judul\"); // yang pertama dengan ketentuan judul\n o[1] = rss.getString(\"penulis\"); // yang kedua dengan ketentuan penulis\n o[2] = rss.getInt(\"harga\"); // yang ketiga dengan ketentuan harga\n model.addRow(o); // memasukkan baris dengan mengkonekan di tabel model\n } \n }catch(SQLException e){ // memanipulasi kesalahan\n System.out.println(\"ini error\"); // menampilkan pesan ini error\n }\n }"
] | [
"0.70019305",
"0.69397646",
"0.66060084",
"0.6486213",
"0.64716035",
"0.6464613",
"0.64568716",
"0.6427651",
"0.63947415",
"0.6345551",
"0.630565",
"0.63029116",
"0.62762576",
"0.6261669",
"0.625124",
"0.6236726",
"0.6231787",
"0.6203631",
"0.61999214",
"0.6186847",
"0.61801463",
"0.61794746",
"0.6167462",
"0.6164528",
"0.61331046",
"0.61120397",
"0.6109161",
"0.6089047",
"0.6061384",
"0.605559",
"0.604185",
"0.604185",
"0.6040145",
"0.6033413",
"0.6029933",
"0.6015281",
"0.600261",
"0.60022926",
"0.5999082",
"0.5997763",
"0.5995444",
"0.59824497",
"0.5981625",
"0.59732044",
"0.5966039",
"0.5963016",
"0.5957785",
"0.59557307",
"0.59477556",
"0.5945173",
"0.5941647",
"0.59410626",
"0.59401953",
"0.594011",
"0.59190506",
"0.5917168",
"0.59100425",
"0.58935606",
"0.5884188",
"0.5880783",
"0.5873476",
"0.5872853",
"0.58708733",
"0.58525455",
"0.5852407",
"0.5848641",
"0.58289963",
"0.58268464",
"0.58164877",
"0.58128434",
"0.58102244",
"0.5799709",
"0.5785241",
"0.5776877",
"0.57759106",
"0.577293",
"0.57726777",
"0.57604384",
"0.5760141",
"0.57572293",
"0.57522446",
"0.57453203",
"0.57432455",
"0.57331365",
"0.57323873",
"0.5731562",
"0.57305175",
"0.57300586",
"0.5729771",
"0.5726466",
"0.5725629",
"0.57233524",
"0.5723104",
"0.57212424",
"0.5710533",
"0.5707049",
"0.5699826",
"0.5691596",
"0.56894267",
"0.56743705",
"0.56735665"
] | 0.0 | -1 |
/ ACTUALIZACION OBJETO PROVEEDOR | public ProveedorEntity updateProveedor(Long id_pago, ProveedorEntity proveedor){
ProveedorEntity proveedorEntity = proveedorPersistence.update(proveedor);
return proveedorEntity;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"public contrustor(){\r\n\t}",
"public void realiserAcahatProduit() {\n\t\t\n\t}",
"private void limpiarDatos() {\n\t\t\n\t}",
"@Override\n\tpublic void conferenceroom() {\n\t\t\n\t}",
"public void Ordenamiento() {\n\n\t}",
"Objet getObjetAlloue();",
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"Compuesta createCompuesta();",
"private RepositorioOrdemServicoHBM() {\n\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"public void inicializar();",
"private void crearVista() {\n\t\tVista vista = Vista.getInstancia();\n\t\tvista.addObservador(this);\n\n\t}",
"public static void main(String args[]) {\nProducto p = new Producto(\"123456\", 1987.29f, 2123.10f);\r\nObservadorCodigoBarras ObsCodigo = new ObservadorCodigoBarras();\r\nObservadorCosto ObsCosto = new ObservadorCosto();\r\n// Agregando los Observadores para Producto!\r\np.addObserver(ObsCodigo);\r\np.addObserver(ObsCosto);\r\n// Crear y Manipular Cambios en el Producto.\r\nSystem.out.println(\"----Cambio de Codigo Barras---\");\r\np.setCodigoBarra(\"654321\");\r\nSystem.out.println(\"----Cambio de Costo---\");\r\np.setCosto(18879.6f);\r\n\r\n}",
"public Propuestas() {}",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n\tpublic void iniciar() {\n\t\t\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"private void remplirFabricantData() {\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"public LocalResidenciaColaborador() {\n //ORM\n }",
"@Override\n\tpublic void recreo() {\n\n\t}",
"public ordenProduccion() {\r\n initComponents();\r\n }",
"public Principal() {\n initComponents();\n empresaControlador = new EmpresaControlador();\n clienteControlador = new ClienteControlador();\n vehiculoControlador = new VehiculoControlador();\n servicioControlador = new ServicioControlador();\n archivoObjeto = new ArchivoObjeto(\"/home/diego/UPS/56/ProgramacionAplicada/Parqueadero/src/archivo/ClienteArchivo.obj\");// Ruta Absolojuta\n archivosBinarios = new ArchivosBinarios();\n archivosBinariosAleatorio = new ArchivosBinariosAleatorio(\"ServicioArchivo.dat\");//Ruta relativa\n }",
"private void reposicionarPersonajes() {\n // TODO implement here\n }",
"@Override\r\n\tpublic void inicializar() {\n\t\tproveedorDatamanager.setProveedorSearch(new Tcxpproveedor());\r\n\t\tproveedorDatamanager.getProveedorSearch().setTsyspersona(new Tsyspersona());\r\n\t\tproveedorDatamanager.setTipoIdColl(bunsysService.buscarObtenerCatalogos(proveedorDatamanager.getLoginDatamanager().getLogin().getPk().getCodigocompania(), ContenidoMessages.getInteger(\"cod_catalogo_tipoid_persona\")));\r\n\t\tproveedorDatamanager.setGrupoProvColl(bunsysService.buscarObtenerCatalogos(proveedorDatamanager.getLoginDatamanager().getLogin().getPk().getCodigocompania(), ContenidoMessages.getInteger(\"cod_catalogo_grupo_prov\")));\r\n\t\tproveedorDatamanager.setEstadoProvColl(bunsysService.buscarObtenerCatalogos(proveedorDatamanager.getLoginDatamanager().getLogin().getPk().getCodigocompania(), ContenidoMessages.getInteger(\"cod_catalogo_estado_persona\")));\r\n\t\tproveedorDatamanager.setProveedorComponente(new ProveedorComponent(proveedorDatamanager.getLoginDatamanager().getLogin().getPk().getCodigocompania()));\r\n\t}",
"public Produto() {}",
"public static void main(String[]args){\n Carataker carataker=new Carataker();\n //el originator es el creador de los mementos\n Originator originator=new Originator();\n\n ConcreteObject concreteObject;\n\n concreteObject=new ConcreteObject(\"Doc\",\"Titulo\",\"Estado1\");\n originator.setState(concreteObject);\n\n concreteObject=new ConcreteObject(\"Doc\",\"Descripcion\",\"Estado2\");\n originator.setState(concreteObject);\n carataker.addMemento(originator.createMemento()); // [0] Primer estado\n\n concreteObject=new ConcreteObject(\"Doc\",\"Resumen\",\"Estado3\");\n originator.setState(concreteObject);\n\n concreteObject=new ConcreteObject(\"Doc\",\"Conclusion\",\"Estado4\");\n originator.setState(concreteObject);\n carataker.addMemento(originator.createMemento()); //[1] Segundo estado\n\n concreteObject=new ConcreteObject(\"Doc\",\"Bibliografia\",\"Estado5\");\n originator.setState(concreteObject);\n\n //recuperando o restaurando un estado\n\n originator.restoreFromMemento(carataker.getMemento(0));\n\n }",
"public void inicia() { \r\n\t\tventana=new VentanaMuestraServicios(this);\r\n\t\tventana.abre();\r\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\n public void perish() {\n \n }",
"public principal() {\n initComponents();\n \n // Verificando si se completó el nivel\n verificar_niveles();\n \n \n }",
"public void crearPersona(){\r\n persona = new Persona();\r\n persona.setNombre(\"Jose\");\r\n persona.setCedula(12345678);\r\n }",
"public void recupera() {\n Cliente clienteActual;\n clienteActual=clienteDAO.buscaId(c.getId());\n if (clienteActual!=null) {\n c=clienteActual;\n } else {\n c=new Cliente();\n }\n }",
"Persistencia() {\n\t}",
"@Override\r\n\tpublic void voar() {\n\t\t\r\n\t}",
"public ObjetoVida getObjeto(){\r\n\t\treturn objeto;\r\n\t}",
"@Override\r\n\tprotected void agregarObjeto() {\r\n\t\t// opcion 1 es agregar nuevo justificativo\r\n\t\tthis.setTitle(\"PROCESOS - PERMISOS INDIVIDUALES (AGREGANDO)\");\r\n\t\tthis.opcion = 1;\r\n\t\tactivarFormulario();\r\n\t\tlimpiarTabla();\r\n\t\tthis.panelBotones.habilitar();\r\n\t}",
"@PostConstruct\n\tpublic void inicializar() {\n\t}",
"@Override\n protected Object[] getData() {\n return new Object[] { creator };\n }",
"public void nouveau(){\r\n try {\r\n viewEtudiantInscripEcheance = new ViewEtudiantInscriptionEcheance();\r\n echeance_etudiant = new EcoEcheanceEtudiant(); \r\n \r\n } catch (Exception e) {\r\n System.err.println(\"Erreur capturée : \"+e);\r\n }\r\n }",
"public PantallaPrincipal() {\n gestor= new Gestor();\n initComponents();\n inicializarTablaCarreras();\n inicializarTablaCorredorTotales();\n inicializarTablaCorredor();\n mostrarCarreras();\n mostrarCorredoresTotales();\n \n \n }",
"private static void getInstancia() throws IOException {\r\n if (propiedades == null) {\r\n propiedades = new PropiedadesComunicacion();\r\n }\r\n }",
"public ControladorPrueba() {\r\n }",
"protected void agregarUbicacion(){\n\n\n\n }",
"public vP() {\n initComponents();\n \n crono = new Bjj();\n \n \n \n }",
"public String limpiar()\r\n/* 103: */ {\r\n/* 104:112 */ this.motivoLlamadoAtencion = new MotivoLlamadoAtencion();\r\n/* 105:113 */ return \"\";\r\n/* 106: */ }",
"public Object getObject() ;",
"Obligacion createObligacion();",
"public Controlador() {\n\t\t// m\n\t\tdatosPrueba1 = new ListaEnlazada();\n\t\t// m\n\t\tdatosPrueba2 = new ListaEnlazada();\n\t\t// add\n\t\tdatosPrueba3 = new ListaEnlazada();\n\t\tdatosPrueba4 = new ListaEnlazada();\n\t\tprueba1 = new Estadisticas(datosPrueba1);\n\t\tprueba2 = new Estadisticas(datosPrueba2);\n\t\tprueba3 = new Estadisticas(datosPrueba3);\n\t\tprueba4 = new Estadisticas(datosPrueba4);\n\t\t// finAdd\n\t}",
"private void controladorNuevoProyecto(Controlador controlador){\n this.contCargarImagen = controlador.getCargarImagen();\n nuevoProyecto.setControlFoto(contCargarImagen);\n\n this.contNuevoProyecto = controlador.getNuevoProyecto();\n nuevoProyecto.setControlProponerProyecto(contNuevoProyecto);\n }",
"public Final_parametre() {\r\n\t}",
"@PostConstruct\r\n public void inicializar() {\r\n try {\r\n anioDeclaracion = 0;\r\n existeDedPatente = false;\r\n deducciones = false;\r\n detaleExoDedMul = new ArrayList<String>();\r\n activaBaseImponible = 0;\r\n verBuscaPatente = 0;\r\n inicializarValCalcula();\r\n datoGlobalActual = new DatoGlobal();\r\n patenteActual = new Patente();\r\n patenteValoracionActal = new PatenteValoracion();\r\n verPanelDetalleImp = 0;\r\n habilitaEdicion = false;\r\n numPatente = \"\";\r\n buscNumPat = \"\";\r\n buscAnioPat = \"\";\r\n catDetAnio = new CatalogoDetalle();\r\n verguarda = 0;\r\n verActualiza = 0;\r\n verDetDeducciones = 0;\r\n verBotDetDeducciones = 0;\r\n listarAnios();\r\n } catch (Exception ex) {\r\n LOGGER.log(Level.SEVERE, null, ex);\r\n }\r\n }",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"public void aktualisiere(PhysicalObject po){\n\t\tthis.po=po;\n\t\tKipper kipperObj= (Kipper) po;\t\t\n\t\tx = kipperObj.getX();\n\t\ty = kipperObj.getY();\n\t\tbreite=kipperObj.getBreite();\n\t\tlaenge=kipperObj.getLaenge();\n\t\twinkel=kipperObj.getWinkel();\n\t\tlkwfahrt=kipperObj.isFahrt();\t\t\n\t\tif (kipperObj.getMaterialListe().size() == 1) {\n\t\t\tmatRatio=kipperObj.getMaterialListe().get(0).getVolumen()/kipperObj.getMaxVolumen();\t\n\t\t\tif(matRatio > 1)\n\t\t\t\tmatRatio=1;\n\t\t}\t\t\n\t}",
"@Override\n public void paso0() {\n n = graph.getNodeIndices().indexOf(actual);\n nodo = graph.getNodes().get(n);\n nodo.setEstado(Node.State.CURRENT);\n nodo.pintarNodo(g);\n // comprueba si es objetivo\n if (nodo.getEsObjetivo()) {\n // establece el objetivo encontrado\n miObjetivo = nodo.toString();\n // termina con exito\n Step = 4;\n } else {\n // se prepara para explorar los sucesores\n m = nodo.maxSucesores();\n j = 0;\n // siguiente paso\n Step = 1;\n }\n }",
"public abstract Object getObservedObject();",
"public VPacientes() {\n initComponents();\n inicializar();\n }",
"@Override\r\n\tprotected void initVentajas() {\n\r\n\t}",
"public void limpiarProcesoBusqueda() {\r\n parametroEstado = 1;\r\n parametroNombre = null;\r\n parametroApellido = null;\r\n parametroDocumento = null;\r\n parametroTipoDocumento = null;\r\n parametroCorreo = null;\r\n parametroUsuario = null;\r\n parametroEstado = 1;\r\n parametroGenero = 1;\r\n listaTrabajadores = null;\r\n inicializarFiltros();\r\n }",
"@Override\n public void memoria() {\n \n }",
"private void controladorNuevoColectivo(Controlador controlador){\n this.contNuevoColectivo = controlador.getNuevoColectivo();\n nuevoColectivo.setControlCreateCollective(contNuevoColectivo);\n }",
"@Override\r\n\tpublic void iniciarSesion() {\n\t\tthis.contextoOrdenMenosUno = new Contexto();\r\n\t\t//Obtengo el orden del xml de configuración\r\n\t\tthis.orden = Constantes.ORDER_MAX_PPMC;\r\n\t\t//Creo tantos Ordenes como dice el XML\r\n\t\tthis.listaOrdenes = new ArrayList<Orden>(this.orden+1);\r\n\t\tthis.inicializarListas();\r\n\t\tthis.compresorAritmetico = new LogicaAritmetica();\r\n\t\tthis.initSession = true;\r\n\t\tthis.tiraBits = \"\";\r\n\t\tthis.bitsBuffer = new StringBuffer();\r\n\t\tthis.finalizada = false;\r\n\t\tthis.contextoPrevio = false;\r\n\t\tthis.contextoActual = new String();\r\n\t}",
"Reserva Obtener();",
"private void remplirPrestaraireData() {\n\t}",
"public GetProductoSrv() {\n\t\tsuper();\n\t\tinitializer();\n\t}",
"private void Initialized_Data() {\n\t\t\r\n\t}",
"Oracion createOracion();",
"public void limpiar()\n {\n nombre = null;\n descripcion = null;\n estado = null;\n primerNivel = true;\n }",
"public Proceso atender() {\n\t\tProceso proceso = raiz.sig;\n\t\tif (proceso == this.raiz) {\n\t\t\tSystem.out.println(\"Cola Vacia\");\n\t\t\treturn null;\n\t\t}\n\t\tProceso sig = proceso.sig;\n\t\tProceso padre = raiz;\n\t\tpadre.sig = sig;\n\t\tsig.padre = padre;\n\t\tcabeza = sig;\n\t\tthis.numProcesos--;\n\t\tthis.calcularTiemposProcesos();\n\t\treturn proceso;\n\t}",
"public void cargarProveedor() {\n\t}",
"public Composante() {\n\t\tsuper();\n\t\t// TODO Auto-generated constructor stub\n\t}",
"@Override\r\n\t\t\t\tpublic void autInitProcess() {\n\t\t\t\t\t\r\n\t\t\t\t}",
"@Override\r\n\t\t\t\tpublic void autInitProcess() {\n\t\t\t\t\t\r\n\t\t\t\t}",
"public void inizializza() {\n\n /* invoca il metodo sovrascritto della superclasse */\n super.inizializza();\n\n }",
"public Polipara() {\n // Iniciar el programa cargando el archivo de propiedades si existe.\n\n if (this.validarSerializacion()) {\n int response = JOptionPane.showConfirmDialog(null, \"Hay una versión anterior de una copa,\\n\"\n + \"¿Desea cargar esa versión? (Al seleccionar \\\"No\\\", se eliminará el avance anterior y se cargará una copa nueva.)\");\n if (response == 0) {\n this.cargarSerializacion();\n } else {\n this.iniciarCopa();\n }\n } else {\n this.iniciarCopa();\n }\n }",
"public Plato(){\n\t\t\n\t}",
"@Override public void realizarCobro(Persona persona){\n\tpersona.cuenta.retiro(120);\n }",
"public void aplicarDescuento();",
"private void remplirMaterielData() {\n\t}",
"protected void aktualisieren() {\r\n\r\n\t}",
"public Caso_de_uso () {\n }",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n\tpublic void ejecutarActividadesConProposito() {\n\t\t\n\t}",
"@Override\r\n\tpublic void crearVehiculo() {\n\t\t\r\n\t}",
"public void Data(){\n\t\t\t\t\t\t\n\t\t\t\t\t}",
"Input getObjetivo();",
"private FournisseurArboTraficService() {\r\n\t\tsuper();\r\n\t}",
"Petunia() {\r\n\t\t}",
"@Override\r\n\t\t\tpublic void autInitProcess() {\n\t\t\t\t\r\n\t\t\t}",
"@Override\r\n\t\t\tpublic void autInitProcess() {\n\t\t\t\t\r\n\t\t\t}",
"@Override\r\n\t\t\tpublic void autInitProcess() {\n\t\t\t\t\r\n\t\t\t}",
"@Override\r\n\t\t\tpublic void autInitProcess() {\n\t\t\t\t\r\n\t\t\t}",
"@Override\r\n\t\t\tpublic void autInitProcess() {\n\t\t\t\t\r\n\t\t\t}",
"private Pares(){\n\t\t\tprimero=null;\n\t\t\tsegundo=null;\n\t\t\tdistancia=0;\n\t\t}",
"@Override\r\n\tpublic Movimiento onPideDatos() {\n\t\treturn null;\r\n\t}",
"private void prepare()\n {\n Victoria victoria = new Victoria();\n addObject(victoria,190,146);\n Salir salir = new Salir();\n addObject(salir,200,533);\n Volver volver = new Volver();\n addObject(volver,198,401);\n }"
] | [
"0.6445446",
"0.6355322",
"0.6348491",
"0.63098836",
"0.6286557",
"0.62841207",
"0.6221883",
"0.6163905",
"0.6147724",
"0.6119024",
"0.60835606",
"0.60788137",
"0.6072408",
"0.59953105",
"0.5979333",
"0.5945219",
"0.5944009",
"0.5921859",
"0.5912669",
"0.58926255",
"0.5891695",
"0.58904105",
"0.58839864",
"0.5873632",
"0.58727777",
"0.5858556",
"0.58536017",
"0.58423704",
"0.58283275",
"0.581923",
"0.5811509",
"0.58074975",
"0.5803293",
"0.57984656",
"0.5795661",
"0.5790355",
"0.5788741",
"0.57791615",
"0.5775804",
"0.5765142",
"0.5759054",
"0.57367605",
"0.57316536",
"0.57253855",
"0.57181346",
"0.57172596",
"0.57138747",
"0.57137114",
"0.5709837",
"0.5708852",
"0.5707883",
"0.5704512",
"0.57011527",
"0.5692656",
"0.5688204",
"0.5684998",
"0.56842697",
"0.5682347",
"0.5670428",
"0.56673276",
"0.5666343",
"0.5664909",
"0.5658448",
"0.5656591",
"0.5656234",
"0.5653156",
"0.56480527",
"0.56423885",
"0.56419885",
"0.56419766",
"0.5641805",
"0.56334436",
"0.56304324",
"0.56304246",
"0.5622457",
"0.5618298",
"0.56113356",
"0.56113356",
"0.5610386",
"0.5608992",
"0.5603013",
"0.5602708",
"0.56014574",
"0.5601359",
"0.55989194",
"0.55974776",
"0.55959946",
"0.55958617",
"0.5595286",
"0.55913544",
"0.55908126",
"0.5588276",
"0.55824673",
"0.55685854",
"0.55685854",
"0.55685854",
"0.55685854",
"0.55685854",
"0.5564503",
"0.55632794",
"0.55619425"
] | 0.0 | -1 |
/ Eliminar un objeto proveedor | public void deleteProveedor (Long id_proveedor){
proveedorPersistence.delete(id_proveedor);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void eliminar(Object o) {\n\t\t\n\t}",
"void remover(Object o);",
"public void removeByObject()\r\n\t{\n\t}",
"@Override\r\n\t\t\tpublic void eliminar() {\n\r\n\t\t\t}",
"@Override\n\tpublic void eliminar() {\n\t\t\n\t}",
"public void eliminarPersonaje(Personaje p) {\n this.listaPersonajes.remove(p);\n // Fijo el tipo después de eliminar el personaje\n this.setTipo();\n }",
"@Override\n\tpublic void eliminar() {\n\n\t}",
"@Override\n\tpublic void remover(Parcela entidade) {\n\n\t}",
"public boolean remover(Veterinario obj) throws ClassNotFoundException, SQLException{\n VeterinarioDAO dao = new VeterinarioDAO();\n return dao.remover(obj);\n }",
"@Override\n public void eliminarElemento(Object elemento) {\n database.delete(elemento);\n }",
"Object remove();",
"public void borrarZonaObjetivoMovimiento() {\n\t\t\n\t}",
"public void removeObject(AdvObject obj) {\n\t\tobjects.remove(obj); // Replace with your code\n\t}",
"public void eliminaEdificio() {\n this.edificio = null;\n // Fijo el tipo después de eliminar el personaje\n this.setTipo();\n }",
"@Override\n public boolean delete(Revue objet) {\n return false;\n }",
"private void deletarLivro(Livro livro){\n //deletar livro\n myBooksDb.daoLivro().deletar(livro);\n\n //remover livro da lista\n remove(livro);\n }",
"private void removeObject() {\n\t\tif(this.curr_obj != null) {\n this.canvas.uRemove(this.curr_obj);\n\t\t\tthis.canvas.remove(this.transformPoints);\n this.transformPoints.clear();\n\n this.curr_obj = null;\n }\n\t}",
"public void removePerson(Person p);",
"public void remove(Ejemplar ej);",
"public void borrarZonaObjetivoAtaque() {\n\t\t\n\t}",
"@Override\n\tpublic void remove(Object o) {\n\t\t\n\t}",
"public void elimina(Long id) {\n\n final EntityManager em = getEntityManager();\n\n try {\n\n final EntityTransaction tx = em.getTransaction();\n\n tx.begin();\n\n // Busca un conocido usando su llave primaria.\n\n final Conocido modelo = em.find(Conocido.class, id);\n\n if (modelo != null) {\n\n /* Si la referencia no es nula, significa que el modelo se encontró la\n\n * referencia no es nula y se elimina. */\n\n em.remove(modelo);\n\n }\n\n tx.commit();\n\n } finally {\n\n em.close();\n\n }\n\n }",
"@Override\r\n\tpublic MensajeBean elimina(Tramite_presentan_info_impacto nuevo) {\n\t\treturn tramite.elimina(nuevo);\r\n\t}",
"void remover(Professor p)throws ProfessorNExisteException;",
"public boolean remove(objectType obj);",
"public void removeGameObj(GameObject obj){\n display.getChildren().remove(obj.getDisplay());\n }",
"public Object remove();",
"@Override\n\tpublic void quitar(Alumno alumno) {\n\t\tcomision.remove(alumno);\n\t}",
"@Override\n\tpublic void delete(Unidade obj) {\n\n\t}",
"public void eliminarProfesor(ProfesorAsignatura profesor){\n profesores.remove(profesor);\n }",
"public void eliminarCarrito(Carrito carrito){\n\t\tthis.listaCarritos.remove(carrito);\n\t\tSystem.out.println(\"Se elimino el carrito \"+carrito.getNombreCarrito()+\"!\");\n\t}",
"public void eliminar(Provincia provincia) throws BusinessErrorHelper;",
"public void eliminarcola(){\n Cola_banco actual=new Cola_banco();// se crea un metodo actual para indicar los datos ingresado\r\n actual=primero;//se indica que nuestro dato ingresado va a ser actual\r\n if(primero != null){// se usa una condiccion si nuestro es ingresado es diferente de null\r\n while(actual != null){//se usa el while que recorra la cola indicando que actual es diferente de null\r\n System.out.println(\"\"+actual.nombre);// se imprime un mensaje con los datos ingresado con los datos ingresado desde el teclado\r\n actual=actual.siguiente;// se indica que el dato actual pase a ser igual con el apuntador siguente\r\n }\r\n }else{// se usa la condicion sino se cumple la condicion\r\n System.out.println(\"\\n la cola se encuentra vacia\");// se indica al usuario que la cola esta vacia\r\n }\r\n }",
"@Override\r\n\tpublic Ngo delete(Ngo obj) {\n\t\treturn null;\r\n\t}",
"public abstract void remove(Class<?> entity, Object paramObject);",
"public void eliminar(Procedimiento procedimiento) {\n IProcedimientoDao dao = new ProcedimientoDaoImpl();\n dao.eliminarProcedimiento(procedimiento);\n }",
"void remove( ModelObject object );",
"public void removeElement(klasse o) {\n int i = indexOf(o);\n if (i < 0) return;\n O[i] = null;\n ON--;\n if (Gap < 0 || Gap > i) Gap = i;\n if (i == OLast - 1) OLast--;\n while (OLast > 0 && O[OLast - 1] == null) OLast--;\n if (Gap >= OLast) Gap = -1;\n }",
"public void removeObject(java.lang.Object object) {}",
"@Override\n\tpublic void excluir() {\n\t\t\n\t}",
"public void eliminar(DetalleArmado detallearmado);",
"@Override\r\n\tpublic void eliminar(IndicadorActividadEscala iae) {\n\r\n\t}",
"public void eliminar(TipoDocumento tpDocu) {\n try {\n boolean verificarReLaboraldEnTpDocu = servReLaboral.buscarRegistroPorTpDocumento(tpDocu);\n if (verificarReLaboraldEnTpDocu) {\n MensajesFaces.informacion(\"No se puede eliminar\", \"Existen Datos Relacionados\");\n } else {\n servtpDocumento.eliminarTipoDocumento(tpDocu);\n tipoDocumento = new TipoDocumento();\n MensajesFaces.informacion(\"Eliminado\", \"Exitoso\");\n }\n } catch (Exception e) {\n MensajesFaces.advertencia(\"Error al eliminar\", \"detalle\" + e);\n }\n }",
"@Override\n\tpublic void eliminar(Integer id) {\n\t\t\n\t}",
"@Override\n\tpublic void eliminar(Integer id) {\n\t\t\n\t}",
"public boolean remove(RealObject o);",
"void eliminar(PK id);",
"Object removeFirst();",
"public void removerInicio() {\n switch (totalElementos()) {\n case 0:\n System.out.println(\"lista esta vazia\");\n break;\n case 1:\n this.primeiro = this.ultimo = null;\n this.total--;\n break;\n default:\n this.primeiro = this.primeiro.irParaProximo();\n this.total--;\n break;\n }\n }",
"public void removeReserva(Vuelo vuelo) {\r\n\t\tvuelos.remove(vuelo);\r\n\t}",
"@Override\n\tpublic void excluir(Produto entidade) {\n\n\t}",
"public void remove(Comparable obj)\n {\n \t fixup(root, deleteNode(root, obj));\n }",
"@Test\n public void testRemove() {\n System.out.println(\"remove\");\n Repositorio repo = new RepositorioImpl();\n Persona persona = new Persona();\n persona.setNombre(\"Ismael\");\n persona.setApellido(\"González\");\n persona.setNumeroDocumento(\"4475199\");\n repo.crear(persona);\n \n Persona personaAEliminar = (Persona) repo.buscar(persona.getId());\n assertNotNull(personaAEliminar);\n \n //eliminacion\n repo.eliminar(personaAEliminar);\n Persona personaEliminada = (Persona) repo.buscar(persona.getId());\n assertNull(personaEliminada);\n }",
"public void eliminar(AplicacionOferta aplicacionOferta){\n try{\n aplicacionOfertaDao.remove(aplicacionOferta);\n }catch(Exception e){\n Logger.getLogger(AplicacionOfertaServicio.class.getName()).log(Level.SEVERE, null, e);\n }\n }",
"@Override\r\n\tpublic void eliminar() {\n\t\ttab_cuenta.eliminar();\r\n\t}",
"@Override\n\tpublic T remover(String obj) {\n\t\treturn null;\n\t}",
"public void removeCarritoDeCompras (Long compradorId) {\r\n\r\n CompradorEntity compradorEntity = compradorPersistence.find(compradorId); \r\n CarritoDeComprasEntity carroEntity = carroPersistence.find(compradorEntity.getCarritoDeCompras().getId());\r\n carroPersistence.delete(compradorEntity.getListaDeDeseos().getId());\r\n compradorEntity.setListaDeDeseos(null);\r\n carroEntity.setComprador(null);\r\n \r\n}",
"public void remove() {\n\n\t\t\tsuprimirNodo(anterior);\n\n\t\t}",
"@Override\n public Person del(Object o) {\n return myPerson;\n }",
"public void removeParam(Object obj) {\n\t\tparams.remove(obj);\n\t}",
"public void eliminar(){\n inicio = null;\r\n // Reinicia el contador de tamaño de la lista a 0.\r\n tamanio = 0;\r\n }",
"@Override\n\tpublic MensajeBean elimina(Tramite_informesem nuevo) {\n\t\treturn tramite_informesemDao.elimina(nuevo);\n\t}",
"public void EliminarElmento(int el) throws Exception{\n if (!estVacia()) {\n if (inicio == fin && el == inicio.GetDato()) {\n inicio = fin = null;\n } else if (el == inicio.GetDato()) {\n inicio = inicio.GetSiguiente();\n } else {\n NodoDoble ante, temporal;\n ante = inicio;\n temporal = inicio.GetSiguiente();\n while (temporal != null && temporal.GetDato() != el) {\n ante = ante.GetSiguiente();\n temporal = temporal.GetSiguiente();\n }\n if (temporal != null) {\n ante.SetSiguiente(temporal.GetSiguiente());\n if (temporal == fin) {\n fin = ante;\n }\n }\n }\n }else{\n throw new Exception(\"No existen datos por borrar!!!\");\n }\n }",
"@Override\n\tpublic void remove(Object entity) {\n\t\t\n\t}",
"public void removeOperador() {\r\n\t\toperadorLaboratorio=null;\r\n\t}",
"public void remove();",
"public void remove();",
"public void remove();",
"public void remove();",
"public void remove();",
"private void eliminatePlayer(Player loser){\n players.remove(loser);\n }",
"public boolean Remove_Object(Objet objet) {\n objet.On_Contenaire_Remove(this);\n return Objets.remove(objet);\n }",
"@Override\n public boolean deleteObject(Pyramid obj) {\n if(obj!=null){\n return this.deleteById(obj.getId());\n }else{\n return false;\n }\n }",
"public void removerFinal() {\n switch (totalElementos()) {\n case 0:\n System.out.println(\"lista esta vazia\");\n break;\n case 1:\n this.primeiro = this.ultimo = null;\n this.total--;\n break;\n default:\n ElementoLista elementoTemporarioAnteriorAtual = this.primeiro;\n ElementoLista elementoTemporarioAtual = this.primeiro.irParaProximo();\n for (int i = 1; i < totalElementos(); i++) {\n elementoTemporarioAnteriorAtual = elementoTemporarioAtual;\n elementoTemporarioAtual = elementoTemporarioAtual.irParaProximo();\n }\n\n this.ultimo = elementoTemporarioAnteriorAtual;\n this.ultimo.definirProximo(null);\n this.total--;\n }\n //this.ultimo = this.ultimo.irParaAnterior();\n //this.ultimo.definirProximo(null);\n }",
"public void localizarEremoverProdutoCodigo(Prateleira prat){\r\n //instacia um auxiliar para procura\r\n Produto mockup = new Produto();\r\n int Codigo = Integer.parseInt(JOptionPane.showInputDialog(null,\"Forneca o codigo do produto a ser removido\" ));\r\n mockup.setCodigo(Codigo); \r\n \r\n //informa que caso encontre o produto remova o da arraylist\r\n boolean resultado = prat.getPrateleira().remove(mockup);\r\n if(resultado){\r\n JOptionPane.showMessageDialog(null, \"Produto de codigo :\" +Codigo+ \" Removido\");\r\n }\r\n else {\r\n JOptionPane.showMessageDialog(null, \"Produto de codigo :\" +Codigo+ \" não encontrado\");\r\n }\r\n }",
"public void deletar() {\n\t\tClienteDAO Clientedao = new ClienteDAO();\t\r\n\t\tClientedao.delete(this);\r\n\t\t\r\n\t\tnovoRegistro();\r\n\t\tnotifyObservers();\r\n\t}",
"public boolean remove(Object obj);",
"public void eliminar(Producto producto) throws BusinessErrorHelper;",
"public synchronized static void borrarProduccion(String usuario){\n if(!produccion.isEmpty())\n for(Construcciones construccion : produccion){\n if(construccion.usuario.equalsIgnoreCase(usuario))\n produccion.remove(construccion);\n }\n}",
"public boolean remove(New object);",
"private void removeExemplar(Exemplar ex){\n\n /* remove from the general list */\n if(m_Exemplars == ex){\n m_Exemplars = ex.next;\n if(m_Exemplars != null)\n\tm_Exemplars.previous = null;\n\t\n } else {\n ex.previous.next = ex.next;\n if(ex.next != null){\n\tex.next.previous = ex.previous;\n }\n }\n ex.next = ex.previous = null;\n\n /* remove from the class list */\n if(m_ExemplarsByClass[(int) ex.classValue()] == ex){\n m_ExemplarsByClass[(int) ex.classValue()] = ex.nextWithClass;\n if(m_ExemplarsByClass[(int) ex.classValue()] != null)\n\tm_ExemplarsByClass[(int) ex.classValue()].previousWithClass = null;\n\t\n } else {\n ex.previousWithClass.nextWithClass = ex.nextWithClass;\n if(ex.nextWithClass != null){\n\tex.nextWithClass.previousWithClass = ex.previousWithClass;\n }\n }\n ex.nextWithClass = ex.previousWithClass = null;\n }",
"void removeChild(Object child);",
"public void remover(Usuario u) {\n listaUse.remove(u);\n\n }",
"public void removeAluno(Aluno a) {\n for (Aluno b: this.alunos) {\n if(b.getNome().equals(a.getNome()) && b.getNum() == a.getNum()){\n if(this.alunos.remove(b))\n System.out.println(\"Removido com sucesso\");\n break;\n }\n }\n }",
"@Override\n\t\tpublic void remove() {\n\t\t\t\n\t\t}",
"@Override\n\t\tpublic void remove() {\n\t\t\t\n\t\t}",
"public void cleanProposition();",
"public boolean removeElement(Object obj);",
"@Override\n\tpublic void devolucao(Livros livro) {\n\t\t\n\t}",
"void clean(Player p);",
"@Override\n\tpublic void excluir(Cliente o) {\n\t\t\n\t}",
"@Override\r\n\tpublic void eliminar() {\n\t\tLOG.info(\"Se elimino los datos del equipo\");\r\n\t}",
"public Stack pilaEliminaDatos( Stack pila )\n {\n // Verificamos que la pila no este vacia para eliminar datos\n if (!pila.isEmpty())\n {\n this.imprime(\"Se ha eliminado este elemento ->\" + pila.peek() +\"<- de la pila\");\n pila.pop();\n }\n else\n {\n this.imprime(\"La pila esta vacia, no se pueden eliminar datos\");\n }\n\n return pila;\n }",
"public void deleteObject() {\n\n\t}",
"public void removerObservador (Observer observer){\n list.remove(observer);\n }",
"@Override\r\n\tpublic boolean delete(Moteur obj) {\n\t\treturn false;\r\n\t}",
"@Override\n public void deletar(Object pacienteParametro) {\n Paciente paciente;\n paciente = (Paciente) pacienteParametro;\n EntityManagerFactory factory = Persistence.createEntityManagerFactory(\"vesaliusPU\"); \n EntityManager em = factory.createEntityManager();\n em.getTransaction().begin();\n em.remove(em.merge(paciente));\n em.getTransaction().commit();\n em.close();\n factory.close();\n }",
"@Override\r\n\tpublic void eliminar(Long idRegistro) {\n\t\t\r\n\t}",
"public void removeStep1(Object obj) {\n\t\tdao.deleteStep1(obj);\n\t}",
"@DELETE\n\t@Produces(MediaType.APPLICATION_JSON)\n\t@Path(\"eliminarPrestamo\")\n\tpublic String eliminarPrestamo(\n\t\t@QueryParam(\"idObjeto\")int idObj, \n\t\t@QueryParam(\"usuario\")String usuario) {\n\ttry {\n\t\t//objetoBL.eliminarObjeto(usuario, idObjeto);//Se llama el metodo desde objetoBL\n\t\tprestamoBL.eliminarPrestamo(idObj, usuario);\n\t}catch(ExceptionController e) {\n\t\tlog.error(\"Error al eliminar objeto\");\n\t\te.getMessage();\n\t}\n\tString json = new Gson().toJson(\"listo\");\n\treturn json;\n\t}",
"@Override\r\n\tpublic void remover(Tipo tipo) {\n String sql = \"delete from tipos_servicos where id = ?\";\r\n try {\r\n stmt = conn.prepareStatement(sql);\r\n stmt.setInt(1, tipo.getId());\r\n \r\n stmt.execute();\r\n } catch (SQLException ex) {\r\n ex.printStackTrace();\r\n }\r\n\t}"
] | [
"0.7356326",
"0.71052337",
"0.6901089",
"0.6644991",
"0.6611256",
"0.6550354",
"0.6538382",
"0.6519294",
"0.6505858",
"0.6505806",
"0.64377075",
"0.6435617",
"0.6421598",
"0.64189637",
"0.63923013",
"0.63921165",
"0.63497233",
"0.6343512",
"0.63167006",
"0.63101166",
"0.62867874",
"0.6282097",
"0.62752557",
"0.625947",
"0.62585324",
"0.6241407",
"0.6240172",
"0.6238687",
"0.62284",
"0.6199773",
"0.61926425",
"0.6176005",
"0.617204",
"0.61436325",
"0.6135802",
"0.6130414",
"0.6117795",
"0.61007744",
"0.6097733",
"0.6092395",
"0.60901314",
"0.6074619",
"0.6062739",
"0.6045319",
"0.6045319",
"0.60366094",
"0.6021411",
"0.60201406",
"0.6019306",
"0.6017129",
"0.60121113",
"0.5997385",
"0.59930706",
"0.5988787",
"0.5987193",
"0.59805346",
"0.59773463",
"0.59764314",
"0.59711367",
"0.59655184",
"0.5962269",
"0.59598523",
"0.595772",
"0.5957146",
"0.5952505",
"0.59484667",
"0.59484667",
"0.59484667",
"0.59484667",
"0.59484667",
"0.59451586",
"0.59352213",
"0.5934124",
"0.5933885",
"0.59319997",
"0.59274995",
"0.5927461",
"0.5927356",
"0.5916126",
"0.5902751",
"0.5899714",
"0.589914",
"0.5898406",
"0.58951634",
"0.5890575",
"0.5890575",
"0.5890478",
"0.58865213",
"0.5877427",
"0.58757377",
"0.5875146",
"0.5867991",
"0.5865002",
"0.5864565",
"0.5864006",
"0.585969",
"0.58586854",
"0.5855333",
"0.58538836",
"0.585363",
"0.5852529"
] | 0.0 | -1 |
Start of main method | public static void main (String [] args) {
//Start of main method
Scanner myScanner;
//Declaring my scanner
myScanner = new Scanner (System.in);
//Constructing the scanner
System.out.print("Enter the number of seconds: ");
//Prints the space for the value of the time of the
//trip in seconds
double nSeconds = myScanner.nextDouble();
System.out.print("Enter the number of counts: ");
//Prints the space for the value of the number of
//counts of the trip
int nCounts = myScanner.nextInt();
double secs=480;
//Value of the time in secs
double counts=1561;
//Value of the counts
double wheelDiameter=27.0,
//Diameter of the wheel
PI=3.14159,
//Declares the variable π which is needed
//to calculate the distance traveled
feetPerMile=5280,
//The conversion units to change the
//rotation measurements from feet to miles
inchesPerFoot=12,
//The conversion units to change the
//rotation measurements from inches to feet
secondsPerMinute=60;
//The conversion units to change the time
//from seconds to minutes
double distanceTrip=counts*wheelDiameter*PI;
//Declares the variable that represents the distance
double minutes=(secs/secondsPerMinute);
//Declares the variable that represents the time in mins
double hours=minutes/60;
//Declares the variable that represents the time in hours
distanceTrip/=inchesPerFoot*feetPerMile;
//Converts the value of the distance from inches to feet and then
//from feet to miles
System.out.println("The distance was " +
((double)((int)(distanceTrip*100))/100) +
" miles and took " +minutes+ " minutes");
//Prints out the distance in miles and the time in minutes
//with the two decimal places
System.out.println("The average mph was "
+ ((double)((int)(distanceTrip/hours*100))/100));
//Prints out the average miles per hour with only
//two decimal places
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Main() {\r\n\t\tsuper();\r\n\t\tinitialize();\r\n\r\n\t}",
"public static void main() {\n \n }",
"public static void main()\n\t{\n\t}",
"public Main() {\n\t\tsuper();\n\t}",
"private Main() {\n\n super();\n }",
"public static void main(){\n\t}",
"public Main() {\n \n \n }",
"public static void main() {\n }",
"private Main ()\n {\n super ();\n }",
"public Main() {\r\n\t}",
"public Main() {}",
"public void main(){\n }",
"public Main() {\r\n }",
"public Main() {\r\n }",
"public static void main(String[] args){\r\n\t\tstart();\r\n\t}",
"public static void main(String[] args) {\n Main main = new Main();\n main.begin();\n }",
"public Main() {\n }",
"public Main() {\n }",
"public Main() {\n }",
"private Main() {}",
"public static void main (String []args){\n }",
"public static void main(String[] args) {\n \n\n }",
"private Main() {\n }",
"public static void main(String[] args) {\n \n \n \n \n }",
"public static void main(String args[])\r\n\t{\r\n\t\tstart();\r\n\t}",
"public static void main(String... args) {\n doMain().run();\n }",
"public static void main(String[] args) {\r\n// Use for unit testing\r\n }",
"public static void main(String[] args) {\n \n \n \n\t}",
"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 init();\n\n }",
"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\t \t\n\t \t\n\t }",
"public static void main (String args[]) {\n\t\t\n }",
"public static void main(String args[]) throws Exception\n {\n \n \n \n }",
"public static void main(String[]args) {\n\t\n\t\t\n\n}",
"public main() {\n initComponents();\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){\r\n\t\t\r\n\tSystem.out.println(\"main method(-)\");\r\n\t\r\n\t}",
"public static void main(String[] args) {\n \n \n }",
"public static void main(String[] args) {\n \n \n }",
"public static void main(String[] args) {\n \r\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\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}",
"static void main(String[] args)\n {\n }",
"public static void main(String []args){\n }",
"public static void main(String []args){\n }",
"public static void main (String[] args) {\n\t\t\n\t}",
"static void main(String[] args) {\n }",
"public static void main(String[] args) {\n new Main();\n }",
"public static void main(String[] args) {}",
"public static void main(String[] args) {}",
"public static void main(String []args){\n\n }",
"public static void main(String[] args) {\r\n\t\t\r\n\t}",
"public static void main(String[] args) {\r\n\t\t\r\n\t}",
"public static void main(String[] args) {\r\n\t\t\r\n\t}",
"public static void main(String[] args) {\r\n\t\t\r\n\t}",
"public static void main(String args[]) {\n//\t (new PleaseInput()).start();\n\t (new randomNum()).start();\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}",
"public static void main(String[] args)\r\t{",
"public static void main(String[] args) {\n \n\t\t}",
"public static void main(String args[]){\n\t\t\n\t\n\t}",
"public static void main(String[] args) {\n \n }",
"public static void main(String[] args) {\n //launch it\n launch();\n }",
"public static void main(String[] args) {\n \n\t}",
"public static void main(String[] args){\n \t\n }",
"public static void main(String[] args)\r\n {\r\n \r\n \r\n \r\n }",
"public static void main(String[] args) {\n\r\n\t\t\r\n\t\t\r\n\t}",
"public static void main(String[] args) {\n new Main().run();\n }",
"public static void main(String[] args) {\r\n\t\t\r\n\t\t\r\n\t}",
"public static void main(String[] args) throws Exception {\n\t\t\t\t\t\t\n\t\t\t\t\n\t\t\t}",
"public static void main(String[] args) {\t}",
"public static void main(String[] args) {\t\n\t\t\n\t}",
"public static void main (String [] args){\n\t}",
"public static void main(String[] args)\r\n {\n \r\n \r\n }",
"public static void main (String[]args) throws IOException {\n }",
"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}",
"public static void main(String[] args) {\n\t\t\n\t}"
] | [
"0.8101513",
"0.8027417",
"0.7972776",
"0.79071075",
"0.784746",
"0.7839537",
"0.7794321",
"0.7783565",
"0.7693633",
"0.7658289",
"0.7611465",
"0.7574952",
"0.75243896",
"0.75243896",
"0.7467664",
"0.74669516",
"0.74300045",
"0.7412641",
"0.7412641",
"0.7380362",
"0.7372672",
"0.73648626",
"0.7361938",
"0.7352832",
"0.73502356",
"0.7343209",
"0.7340717",
"0.73375684",
"0.7336753",
"0.7336753",
"0.7332119",
"0.7328756",
"0.7326762",
"0.7314173",
"0.7306159",
"0.7302058",
"0.72859925",
"0.72859925",
"0.72847134",
"0.72818613",
"0.72818613",
"0.72818613",
"0.72818613",
"0.72818613",
"0.72818613",
"0.7268283",
"0.7267642",
"0.7267642",
"0.72641575",
"0.7259593",
"0.7259593",
"0.7242957",
"0.7241634",
"0.72275466",
"0.72275466",
"0.72204167",
"0.72193897",
"0.7218295",
"0.7216928",
"0.7216928",
"0.72032374",
"0.7195458",
"0.7195458",
"0.7195458",
"0.7195458",
"0.71818197",
"0.71805364",
"0.71787626",
"0.717579",
"0.71675795",
"0.71632147",
"0.7162882",
"0.71603376",
"0.7156455",
"0.71476054",
"0.7147145",
"0.714345",
"0.7140875",
"0.71379155",
"0.71360373",
"0.7135775",
"0.7134493",
"0.71293604",
"0.71248704",
"0.7120105",
"0.7118059",
"0.7118059",
"0.7118059",
"0.7118059",
"0.7118059",
"0.7118059",
"0.7118059",
"0.7118059",
"0.7118059",
"0.7118059",
"0.7118059",
"0.7118059",
"0.7118059",
"0.7118059",
"0.7118059",
"0.7118059"
] | 0.0 | -1 |
Permission function starts from here | private void RequestMultiplePermission()
{
/**
* Creating String Array with Permissions.
*/
ActivityCompat.requestPermissions(FamilyMemberActivity.this, new String[]
{
CAMERA,
WRITE_EXTERNAL_STORAGE,
READ_EXTERNAL_STORAGE
}, PERMISSION_REQUEST_CODE);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract public void getPermission();",
"@Override\n public void checkPermission(Permission perm) {\n }",
"@Override\n public void checkPermission(Permission perm, Object context) {\n }",
"void askForPermissions();",
"void permissionGranted(int requestCode);",
"private PermissionHelper() {}",
"String getPermission();",
"void requestNeededPermissions(int requestCode);",
"@Override\n public void onPermissionGranted() {\n }",
"public boolean isPermissionGranted(String permission){\n return true;\n// else\n// return false;\n }",
"@Override\n public void onPermissionGranted() {\n }",
"private void checkRunTimePermission() {\n\n if(checkPermission()){\n\n Toast.makeText(MainActivity.this, \"All Permissions Granted Successfully\", Toast.LENGTH_LONG).show();\n\n }\n else {\n\n requestPermission();\n }\n }",
"public void onPermissionGranted() {\n\n }",
"public boolean checkPermission(Permission permission);",
"int getPermissionWrite();",
"int getPermissionRead();",
"@Override\n public void onClick(View view) {\n String platform = checkPlatform();\n if (platform.equals(\"Marshmallow\")) {\n Log.d(TAG, \"Runtime permission required\");\n //Step 2. check the permission\n boolean permissionStatus = checkPermission();\n if (permissionStatus) {\n //Permission already granted\n Log.d(TAG, \"Permission already granted\");\n } else {\n //Permission not granted\n //Step 3. Explain permission i.e show an explanation\n Log.d(TAG, \"Explain permission\");\n explainPermission();\n //Step 4. Request Permissions\n Log.d(TAG, \"Request Permission\");\n requestPermission();\n }\n\n } else {\n Log.d(TAG, \"onClick: Runtime permission not required\");\n }\n\n\n }",
"@Override\n public void onPermissionsGranted(int requestCode, List<String> perms) {\n }",
"@Override\n public void onPermissionsGranted(int requestCode, List<String> perms) {\n }",
"public void askPermission() {\n try {\n if (Build.VERSION.SDK_INT >= 23) {\n //call the function to ask for permission\n try {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.READ_CONTACTS) != PackageManager.PERMISSION_GRANTED) {\n requestPermissions(new String[]{Manifest.permission.READ_CONTACTS}, 100);\n return;\n }\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n }\n catch (Exception e)\n {\n e.printStackTrace();\n }\n }",
"public void permission_check() {\n //Usage Permission\n if (!isAccessGranted()) {\n new LovelyStandardDialog(MainActivity.this)\n .setTopColorRes(R.color.colorPrimaryDark)\n .setIcon(R.drawable.ic_perm_device_information_white_48dp)\n .setTitle(getString(R.string.permission_check_title))\n .setMessage(getString(R.string.permission_check_message))\n .setPositiveButton(android.R.string.ok, new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n Intent intent = new Intent(android.provider.Settings.ACTION_USAGE_ACCESS_SETTINGS);\n startActivity(intent);\n }\n })\n .setNegativeButton(android.R.string.no, null)\n .show();\n }\n }",
"public interface PermissionListener {\n\n void onGranted(); //授权\n\n void onDenied(List<String> deniedPermission); //拒绝 ,并传入被拒绝的权限\n}",
"@TargetApi(23)\r\n public void requestPermission() {\r\n ArrayList<String> arrayList;\r\n String[] strArr = this.mPermissions;\r\n for (String str : strArr) {\r\n if (this.mActivity.checkCallingOrSelfPermission(str) != 0) {\r\n if (shouldShowRequestPermissionRationale(str) || !PermissionUtils.isNeverShowEnabled(PermissionUtils.getRequestCode(str))) {\r\n if (this.normalPermissions == null) {\r\n this.normalPermissions = new ArrayList<>(this.mPermissions.length);\r\n }\r\n arrayList = this.normalPermissions;\r\n } else {\r\n if (this.settingsPermissions == null) {\r\n this.settingsPermissions = new ArrayList<>(this.mPermissions.length);\r\n }\r\n arrayList = this.settingsPermissions;\r\n }\r\n arrayList.add(str);\r\n }\r\n }\r\n Log.d(TAG, \"requestPermission() settingsPermissions:\" + this.settingsPermissions);\r\n Log.d(TAG, \"requestPermission() normalPermissions:\" + this.normalPermissions);\r\n ArrayList<String> arrayList2 = this.normalPermissions;\r\n if (arrayList2 == null || arrayList2.size() <= 0) {\r\n ArrayList<String> arrayList3 = this.settingsPermissions;\r\n if (arrayList3 == null || arrayList3.size() <= 0) {\r\n IGrantedTask iGrantedTask = this.mTask;\r\n if (iGrantedTask != null) {\r\n iGrantedTask.doTask();\r\n }\r\n } else {\r\n Activity activity = this.mActivity;\r\n PermissionUtils.showPermissionSettingsDialog(activity, activity.getResources().getString(R.string.app_name), this.settingsPermissions, true);\r\n this.settingsPermissions = null;\r\n }\r\n finishFragment();\r\n return;\r\n }\r\n requestPermissions((String[]) this.normalPermissions.toArray(new String[this.normalPermissions.size()]), 5003);\r\n this.normalPermissions = null;\r\n }",
"@Override\n public void onPermissionGranted(PermissionGrantedResponse permissionGrantedResponse) {\n\n }",
"void requestStoragePermission();",
"public String getFloodPerm() throws PermissionDeniedException;",
"private boolean checkPermissions(HttpServletRequest request, RouteAction route) {\n\t\treturn true;\n\t}",
"public static void main(String[] args) {\n\t\n\tAccesingModifiers.hello();//heryerden accessable \n\tAccesingModifiers.hello1();\n\tAccesingModifiers.hello2();\n\t\n\t//AccesingModifiers.hello3(); not acceptable since permission is set to private\n\t\n}",
"@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n if (requestCode == REQUEST_PERMISSION_SETTING) {\n checkPermission();\n }\n }",
"void checkPermission(T request) throws AuthorizationException;",
"private void callPermission() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M\n && checkSelfPermission(Manifest.permission.ACCESS_FINE_LOCATION)\n != PackageManager.PERMISSION_GRANTED) {\n\n requestPermissions(\n new String[]{Manifest.permission.ACCESS_FINE_LOCATION},\n PERMISSIONS_ACCESS_FINE_LOCATION);\n\n } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M\n && checkSelfPermission(Manifest.permission.ACCESS_COARSE_LOCATION)\n != PackageManager.PERMISSION_GRANTED){\n\n requestPermissions(\n new String[]{Manifest.permission.ACCESS_COARSE_LOCATION},\n PERMISSIONS_ACCESS_COARSE_LOCATION);\n } else {\n isPermission = true;\n }\n }",
"@Override\n public void onRequestAllow(String permissionName) {\n }",
"@Override\n protected String requiredGetPermission() {\n return \"user\";\n }",
"private void callPermission() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M\r\n && checkSelfPermission(Manifest.permission.ACCESS_FINE_LOCATION)\r\n != PackageManager.PERMISSION_GRANTED) {\r\n\r\n requestPermissions(\r\n new String[]{Manifest.permission.ACCESS_FINE_LOCATION},\r\n PERMISSIONS_ACCESS_FINE_LOCATION);\r\n\r\n } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M\r\n && checkSelfPermission(Manifest.permission.ACCESS_COARSE_LOCATION)\r\n != PackageManager.PERMISSION_GRANTED){\r\n\r\n requestPermissions(\r\n new String[]{Manifest.permission.ACCESS_COARSE_LOCATION},\r\n PERMISSIONS_ACCESS_COARSE_LOCATION);\r\n } else {\r\n isPermission = true;\r\n }\r\n }",
"private void askPermission() {\n if (ContextCompat.checkSelfPermission(this,\n android.Manifest.permission.ACCESS_FINE_LOCATION)\n != PackageManager.PERMISSION_GRANTED) {\n ActivityCompat.requestPermissions(this,\n new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION},\n Parameters.MY_PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION);\n }\n }",
"boolean ignoresPermission();",
"@PermissionSuccess(requestCode = 100)\n public void onPermissionSuccess(){\n }",
"PermissionService getPermissionService();",
"private boolean permisos() {\n for(String permission : PERMISSION_REQUIRED) {\n if(ContextCompat.checkSelfPermission(getContext(), permission) != PackageManager.PERMISSION_GRANTED) {\n return false;\n }\n }\n return true;\n }",
"private void checkPermissions() {\n List<String> permissions = new ArrayList<>();\n String message = \"osmdroid permissions:\";\n if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n permissions.add(Manifest.permission.ACCESS_FINE_LOCATION);\n message += \"\\nLocation to show user location.\";\n }\n if (ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {\n permissions.add(Manifest.permission.WRITE_EXTERNAL_STORAGE);\n message += \"\\nStorage access to store map tiles.\";\n }\n if (ContextCompat.checkSelfPermission(this, Manifest.permission.READ_PHONE_STATE) != PackageManager.PERMISSION_GRANTED) {\n permissions.add(Manifest.permission.READ_PHONE_STATE);\n message += \"\\n access to read phone state.\";\n //requestReadPhoneStatePermission();\n }\n if (ContextCompat.checkSelfPermission(this, Manifest.permission.RECEIVE_SMS) != PackageManager.PERMISSION_GRANTED) {\n permissions.add(Manifest.permission.RECEIVE_SMS);\n message += \"\\n access to receive sms.\";\n //requestReadPhoneStatePermission();\n }\n if (ContextCompat.checkSelfPermission(this, Manifest.permission.GET_ACCOUNTS) != PackageManager.PERMISSION_GRANTED) {\n permissions.add(Manifest.permission.GET_ACCOUNTS);\n message += \"\\n access to read sms.\";\n //requestReadPhoneStatePermission();\n }\n if (!permissions.isEmpty()) {\n // Toast.makeText(this, message, Toast.LENGTH_LONG).show();\n String[] params = permissions.toArray(new String[permissions.size()]);\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n requestPermissions(params, REQUEST_CODE_ASK_MULTIPLE_PERMISSIONS);\n }\n } // else: We already have permissions, so handle as normal\n }",
"public void checkpermission()\n {\n permissionUtils.check_permission(permissions,\"Need GPS permission for getting your location\",1);\n }",
"private void authorize() {\r\n\r\n\t}",
"@Override\r\n\tprotected void verificaUtentePrivilegiato() {\n\r\n\t}",
"private void permissionChecks() {\n if(Build.VERSION.SDK_INT < 23)\n return;\n\n if (checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED || checkSelfPermission(Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {\n requestPermissions(new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.READ_EXTERNAL_STORAGE}, 0);\n }\n }",
"public interface IPermissionCallback {\n /**\n * Gets called if the permission/permissions you requested are granted successfully by the user.\n * @param requestCode - same integer is returned that you have passed when you called requestPermission();\n */\n void permissionGranted(int requestCode);\n\n /**\n * Gets called if the permission/permissions you requested are denied by the user.\n * If user denies a permission once, next time that permission comes with a check box(never ask again).\n * If user check that box and denies again, no permission dialog is shown to the user next time and permission will be denied automatically.\n * @param requestCode - same integer is returned that you have passed when you called requestPermission();\n * @param willShowCheckBoxNextTime - For a request of multiple permissions at the same time, you will always receive false.\n */\n void permissionDenied(int requestCode, boolean willShowCheckBoxNextTime);\n}",
"private void requestPermission() {\r\n\r\n if (ActivityCompat.shouldShowRequestPermissionRationale(UniformDrawer.this, android.Manifest.permission.WRITE_EXTERNAL_STORAGE)) {\r\n Toast.makeText(UniformDrawer.this, \"Write External Storage permission allows us to do store images. Please allow this permission in App Settings.\", Toast.LENGTH_LONG).show();\r\n } else {\r\n ActivityCompat.requestPermissions(UniformDrawer.this, new String[]{android.Manifest.permission.WRITE_EXTERNAL_STORAGE}, PERMISSION_REQUEST_CODE);\r\n }\r\n }",
"private void checkIfPermissionGranted() {\n\n //if user already allowed the permission, this condition will be true\n if (ContextCompat.checkSelfPermission(this, PERMISSION_CODE)\n == PackageManager.PERMISSION_GRANTED) {\n Intent launchIntent = getPackageManager().getLaunchIntentForPackage(\"com.example.a3\");\n if (launchIntent != null) {\n startActivity(launchIntent);//null pointer check in case package name was not found\n }\n }\n //if user didn't allow the permission yet, then ask for permission\n else {\n ActivityCompat.requestPermissions(this, new String[]{PERMISSION_CODE}, 0);\n }\n }",
"public void doPermissions(RunData data, Context context)\n\t{\n\t\tSessionState state = ((JetspeedRunData)data).getPortletSessionState(((JetspeedRunData)data).getJs_peid());\n\n\t\t// cancel copy if there is one in progress\n\t\tif(! Boolean.FALSE.toString().equals(state.getAttribute (STATE_COPY_FLAG)))\n\t\t{\n\t\t\tinitCopyContext(state);\n\t\t}\n\n\t\t// cancel move if there is one in progress\n\t\tif(! Boolean.FALSE.toString().equals(state.getAttribute (STATE_MOVE_FLAG)))\n\t\t{\n\t\t\tinitMoveContext(state);\n\t\t}\n\n\t\t// should we save here?\n\t\tstate.setAttribute(STATE_LIST_SELECTIONS, new TreeSet());\n\n\t\t// get the current home collection id and the related site\n\t\tString collectionId = (String) state.getAttribute (STATE_HOME_COLLECTION_ID);\n\t\tReference ref = EntityManager.newReference(ContentHostingService.getReference(collectionId));\n\t\tString siteRef = SiteService.siteReference(ref.getContext());\n\n\t\t// setup for editing the permissions of the site for this tool, using the roles of this site, too\n\t\tstate.setAttribute(PermissionsHelper.TARGET_REF, siteRef);\n\n\t\t// ... with this description\n\t\tstate.setAttribute(PermissionsHelper.DESCRIPTION, rb.getString(\"setpermis1\")\n\t\t\t\t+ SiteService.getSiteDisplay(ref.getContext()));\n\n\t\t// ... showing only locks that are prpefixed with this\n\t\tstate.setAttribute(PermissionsHelper.PREFIX, \"content.\");\n\n\t\t// get into helper mode with this helper tool\n\t\tstartHelper(data.getRequest(), \"sakai.permissions.helper\");\n\n\t}",
"@Override\n public void onClick(View v) {\n if (Build.VERSION.SDK_INT >= 23)\n {\n if (permissionUtils.checkPermissions())\n {\n Log.e(TAG, \"Permission Is Not Granted. Request For Permission\");\n permissionUtils.askPermission();\n }\n else\n {\n Log.e(TAG, \"Permission Already Granted\");\n Intent intent = new Intent(RuntimePermissionActivity.this, PermissionGrantedActivity.class);\n startActivity(intent);\n finish();\n }\n }\n else\n {\n /*\n * Pre-Marshmallow\n * If build version is less than or 23, then all permission is\n * granted at install time in google play store.\n */\n Intent intent = new Intent(RuntimePermissionActivity.this, PermissionGrantedActivity.class);\n startActivity(intent);\n finish();\n }\n }",
"private void requestPermissions(){\n Intent intent = new Intent(this.getApplication(), MainActivity.class);\r\n intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\r\n startActivity(intent);\r\n }",
"private boolean requrstpermission(){\r\n if(ContextCompat.checkSelfPermission(getActivity(), Manifest.permission.READ_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED){\r\n return true;\r\n }\r\n else {\r\n ActivityCompat.requestPermissions(getActivity(), new String[]{Manifest.permission.READ_EXTERNAL_STORAGE}, IMAGEREQUESTCODE);\r\n return false;\r\n }\r\n }",
"private void checkAndRequestForPermission() {\n if(ContextCompat.checkSelfPermission(RegisterActivity.this, Manifest.permission.READ_EXTERNAL_STORAGE)\n != PackageManager.PERMISSION_GRANTED){\n if(ActivityCompat.shouldShowRequestPermissionRationale(RegisterActivity.this,\n Manifest.permission.READ_EXTERNAL_STORAGE)){\n Toast.makeText(RegisterActivity.this, \"Please accept for required permission\",\n Toast.LENGTH_SHORT).show();\n }\n else{\n ActivityCompat.requestPermissions(RegisterActivity.this,\n new String []{Manifest.permission.READ_EXTERNAL_STORAGE},PReqCode);\n }\n }\n else{\n openGallery();\n }\n }",
"private void requestPermissionFromUser() {\n if(ActivityCompat.shouldShowRequestPermissionRationale(this,android.Manifest.permission.READ_EXTERNAL_STORAGE)){\n Toast.makeText(getApplicationContext(),\"READ STORAGE Allows Us To Upload Image From Your Gallery To The DataBase\",Toast.LENGTH_SHORT).show();\n }else{\n ActivityCompat.requestPermissions(this,new String[]{android.Manifest.permission.READ_EXTERNAL_STORAGE},PERMISSION_REQUEST_CODE);\n }\n }",
"@Override\n public boolean hasPermission(Permission permission) {\n // FacesContext context = FacesContext.getCurrentInstance();\n String imp = (String)ADFContext.getCurrent().getSessionScope().get(\"isImpersonationOn\");\n// String imp = (String)context.getExternalContext().getSessionMap().get(\"isImpersonationOn\");\n if(imp == null || !imp.equals(\"Y\")){\n return super.hasPermission(permission);\n }\n else{\n return true;\n \n }\n \n }",
"boolean isHasPermissions();",
"private void getPermissions() {\n if (ContextCompat.checkSelfPermission(this,\n Manifest.permission.WRITE_EXTERNAL_STORAGE)\n != PackageManager.PERMISSION_GRANTED) {\n\n // Should we show an explanation?\n if (ActivityCompat.shouldShowRequestPermissionRationale(this,\n Manifest.permission.WRITE_EXTERNAL_STORAGE)) {\n\n // Show an explanation to the user *asynchronously* -- don't block\n // this thread waiting for the user's response! After the user\n // sees the explanation, try again to request the permission.\n\n } else {\n\n // No explanation needed, we can request the permission.\n\n ActivityCompat.requestPermissions(this,\n new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE},\n MY_PERMISSIONS_REQUEST_READ_CONTACTS);\n\n // MY_PERMISSIONS_REQUEST_READ_CONTACTS is an\n // app-defined int constant. The callback method gets the\n // result of the request.\n }\n }\n }",
"public void runtimePermission() {\r\n if (ButtonClickedChecked == 111) {\r\n if (ContextCompat.checkSelfPermission(this, Manifest.permission.READ_CONTACTS) == PackageManager.PERMISSION_GRANTED) {\r\n selectContact();\r\n } else {\r\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\r\n if (shouldShowRequestPermissionRationale(Manifest.permission.READ_CONTACTS)) {\r\n Toast.makeText(this, \"Permission required\", Toast.LENGTH_SHORT).show();\r\n }\r\n requestPermissions(new String[]{Manifest.permission.READ_CONTACTS}, REQUEST_CODE_READ_CONTACT);\r\n } else {\r\n selectContact();\r\n }\r\n }\r\n } else if (ButtonClickedChecked == 222) {\r\n if (ContextCompat.checkSelfPermission(this, Manifest.permission.SEND_SMS) == PackageManager.PERMISSION_GRANTED) {\r\n sendSms(phoneNumberForSms, msgBodyForSms);\r\n } else {\r\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\r\n if (shouldShowRequestPermissionRationale(Manifest.permission.SEND_SMS)) {\r\n Toast.makeText(this, \"Permission required\", Toast.LENGTH_SHORT).show();\r\n }\r\n requestPermissions(new String[]{Manifest.permission.SEND_SMS}, REQUEST_CODE_SEND_SMS);\r\n } else {\r\n sendSms(phoneNumberForSms, msgBodyForSms);\r\n }\r\n }\r\n } else if (ButtonClickedChecked == 333){\r\n if (ContextCompat.checkSelfPermission(getApplicationContext(), Manifest.permission.CALL_PHONE) == PackageManager.PERMISSION_GRANTED) {\r\n makeCall(phoneNumber);\r\n }else {\r\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\r\n if (shouldShowRequestPermissionRationale(Manifest.permission.CALL_PHONE)){\r\n Toast.makeText(getApplicationContext(), \"Permission required\", Toast.LENGTH_SHORT).show();\r\n }\r\n requestPermissions(new String[]{Manifest.permission.CALL_PHONE}, REQUEST_CODE_CALL);\r\n }else{\r\n makeCall(phoneNumber);\r\n }\r\n }\r\n }\r\n }",
"private boolean checkPermission() {\r\n int result = ContextCompat.checkSelfPermission(getApplicationContext(), READ_CONTACTS);\r\n int result1 = ContextCompat.checkSelfPermission(getApplicationContext(), CAMERA);\r\n int result2 = ContextCompat.checkSelfPermission(getApplicationContext(), ACCESS_FINE_LOCATION);\r\n int result3 = ContextCompat.checkSelfPermission(getApplicationContext(), READ_EXTERNAL_STORAGE);\r\n int result4 = ContextCompat.checkSelfPermission(getApplicationContext(), WRITE_EXTERNAL_STORAGE);\r\n int result5 = ContextCompat.checkSelfPermission(getApplicationContext(), READ_PHONE_STATE);\r\n int result6 = ContextCompat.checkSelfPermission(getApplicationContext(), RECORD_AUDIO);\r\n int result7 = ContextCompat.checkSelfPermission(getApplicationContext(), SEND_SMS);\r\n //int result8 = ContextCompat.checkSelfPermission(getApplicationContext(), BLUETOOTH);\r\n\r\n return result == PackageManager.PERMISSION_GRANTED && result1 == PackageManager.PERMISSION_GRANTED && result2 == PackageManager.PERMISSION_GRANTED &&\r\n result3 == PackageManager.PERMISSION_GRANTED && result4 == PackageManager.PERMISSION_GRANTED && result5 == PackageManager.PERMISSION_GRANTED &&\r\n result6 == PackageManager.PERMISSION_GRANTED && result7 == PackageManager.PERMISSION_GRANTED/*&& result8== PackageManager.PERMISSION_GRANTED*/;\r\n }",
"public interface Permissions\r\n{\r\n\t/**\r\n\t * Tests whether a permission has been granted\r\n\t * \r\n\t * @param capability The permission (capability) to test for\r\n\t * @return Whether the given capability is allowed\r\n\t */\r\n\tboolean has(String capability);\r\n\r\n\t/**\r\n\t * @param capability The permission to get\r\n\t * @return The permission of the given name\r\n\t */\r\n\tPermission getPermission(String capability);\r\n\r\n\t/** @return All permissions associated with this Permissions object */\r\n\tPermission [] getAllPermissions();\r\n}",
"@Override\r\n\tpublic void checkPermission(String absPath, String actions)\r\n\t\t\tthrows AccessControlException, RepositoryException {\n\t\t\r\n\t}",
"private void requestPermission() {\n boolean shouldProvideRationale = ActivityCompat.shouldShowRequestPermissionRationale(this, Manifest.permission.ACCESS_FINE_LOCATION);\n\n if (shouldProvideRationale) {\n Log.i(TAG, \"requestPermission: \" + \"Displaying the permission rationale\");\n // provide a way so that user can grant permission\n\n showSnackbar(R.string.warning_txt, android.R.string.ok, new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n startLocationPermissionRequest();\n }\n });\n\n } else {\n startLocationPermissionRequest();\n }\n }",
"private void enforcePermission() {\n\t\tif (context.checkCallingPermission(\"com.marakana.permission.FIB_SLOW\") == PackageManager.PERMISSION_DENIED) {\n\t\t\tSecurityException e = new SecurityException(\"Not allowed to use the slow algorithm\");\n\t\t\tLog.e(\"FibService\", \"Not allowed to use the slow algorithm\", e);\n\t\t\tthrow e;\n\t\t}\n\t}",
"public interface PermissionCallbacks {\n /**\n * request successful list\n * @param requestCode\n * @param perms\n */\n void onPermissionsGranted(int requestCode, List<String> perms);\n\n /**\n * request denied list\n * @param requestCode\n * @param perms\n */\n void onPermissionsDenied(int requestCode, List<String> perms);\n}",
"private void requirePermission(){\n if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.M){\n String permission = Manifest.permission.WRITE_EXTERNAL_STORAGE;\n if (ActivityCompat.checkSelfPermission(MainActivity2.this, permission)\n != PackageManager.PERMISSION_GRANTED) {\n ActivityCompat.requestPermissions(MainActivity2.this, new String[]{permission},123);\n }\n }\n }",
"public String getPermission()\r\n {\r\n return permission;\r\n }",
"public interface PermissionHandlerConstants {\n\n //Permissions code\n public static final int STORAGE_PERMISSION_CODE = 1;\n public static final int CAMERA_PERMISSION_CODE = 2;\n public static final int ACCOUNTS_PERMISSION_CODE = 3;\n public static final int STORAGE_CAMERA_PERMISSION_CODE = 4; //ONE CODE CAN BE USED TO REQUEST MULTIPLE PERMISSIONS\n public static final int READ_CALENDAR_PERMISSION_CODE = 5;\n public static final int WRITE_CALENDAR_PERMISSION_CODE = 6;\n public static final int READ_CONTACTS_PERMISSION_CODE = 7;\n public static final int WRITE_CONTACTS_PERMISSION_CODE = 8;\n public static final int FINE_LOCATION_PERMISSION_CODE = 9;\n public static final int COURSE_LOCATION_PERMISSION_CODE = 10;\n public static final int RECORD_AUDIO_PERMISSION_CODE = 11;\n public static final int READ_PHONE_STATE_PERMISSION_CODE = 12;\n public static final int CALL_PHONE_PERMISSION_CODE = 13;\n public static final int READ_CALL_LOG_PERMISSION_CODE = 14;\n public static final int WRITE_CALL_LOG_PERMISSION_CODE = 15;\n public static final int ADD_VOICEMAIL_PERMISSION_CODE = 16;\n public static final int USE_SIP_PERMISSION_CODE = 17;\n public static final int PROCESS_OUTGOING_CALLS_PERMISSION_CODE = 18;\n public static final int BODY_SENSORS_PERMISSION_CODE = 19;\n public static final int SEND_SMS_PERMISSION_CODE = 20;\n public static final int RECEIVE_SMS_PERMISSION_CODE = 21;\n public static final int READ_SMS_PERMISSION_CODE = 22;\n public static final int RECEIVE_WAP_PUSH_PERMISSION_CODE = 23;\n public static final int RECEIVE_MMS_PERMISSION_CODE = 24;\n //*******************************************************************\n}",
"private void dynamicPermission() {\n if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.P) {\n Log.i(\"MainActivity\", \"android sdk <= 28 Q\");\n if (ActivityCompat.checkSelfPermission(this,\n Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED\n && ActivityCompat.checkSelfPermission(this,\n Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n String[] strings =\n {Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION};\n ActivityCompat.requestPermissions(this, strings, 1);\n }\n } else {\n // Dynamically apply for required permissions if the API level is greater than 28. The android.permission.ACCESS_BACKGROUND_LOCATION permission is required.\n if (ActivityCompat.checkSelfPermission(this,\n Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED\n && ActivityCompat.checkSelfPermission(this,\n Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED\n && ActivityCompat.checkSelfPermission(this,\n \"android.permission.ACCESS_BACKGROUND_LOCATION\") != PackageManager.PERMISSION_GRANTED) {\n String[] strings = {android.Manifest.permission.ACCESS_FINE_LOCATION,\n android.Manifest.permission.ACCESS_COARSE_LOCATION,\n \"android.permission.ACCESS_BACKGROUND_LOCATION\"};\n ActivityCompat.requestPermissions(this, strings, 2);\n }\n }\n }",
"private void requestStoragePermission(){\n requestPermissions(storagePermissions, STORAGE_REQUESTED_CODE);\n }",
"private void requestPermission(){\r\n ActivityCompat.requestPermissions(activity,new String[]{Manifest.permission.ACCESS_FINE_LOCATION},1);\r\n }",
"public interface PermissionResult {\n\n void permissionGranted();\n\n void permissionDenied();\n\n void permissionForeverDenied();\n\n}",
"public void getPermission() {\n if (ContextCompat.checkSelfPermission(this, Manifest.permission.CAMERA)\n != PackageManager.PERMISSION_GRANTED) {\n requestPermissions(permissions,\n MULTIPLE_PERMISSIONS);\n }\n }",
"private void checkPermission(int requestCode)\n {\n int permissionCheck = 0;\n\n if (requestCode == Constants.FILE_CHOOSER)\n {\n permissionCheck = ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE);\n\n if (permissionCheck != PackageManager.PERMISSION_GRANTED)\n {\n ActivityCompat.requestPermissions(\n this, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, Constants.FILE_CHOOSER);\n } else\n {\n pickImage();\n }\n } else\n {\n permissionCheck = ContextCompat.checkSelfPermission(this, Manifest.permission.CAMERA);\n\n if (permissionCheck != PackageManager.PERMISSION_GRANTED)\n {\n ActivityCompat.requestPermissions(\n this, new String[]{Manifest.permission.CAMERA}, CAMERA_PIC_REQUEST);\n } else\n {\n openCamera();\n }\n }\n }",
"private void requestPermission() {\n if (ContextCompat.checkSelfPermission(this, Manifest.permission.CAMERA) !=\n PackageManager.PERMISSION_GRANTED) {\n ActivityCompat.requestPermissions(this, new String[]{\n Manifest.permission.CAMERA}, 1);\n //if not permitted by the user ,send a message to the user to get the right\n } else {\n opencamera();\n //if permitted by the user already ,then start open the camera directly\n }\n }",
"public void requestPermission() {\n ActivityCompat.requestPermissions(MainActivity.this, new String[]{\n Manifest.permission.CAMERA,\n Manifest.permission.READ_CONTACTS\n }, RequestPermissionCode);\n }",
"private boolean validateAccess(String permission) {\n\t\tif (\"READ\".equalsIgnoreCase(permission)) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"private void checkPermission(){\n // vérification de l'autorisation d'accéder à la position GPS\n if (ContextCompat.checkSelfPermission(this,\n Manifest.permission.ACCESS_FINE_LOCATION)\n != PackageManager.PERMISSION_GRANTED) {\n\n// // l'autorisation n'est pas acceptée\n// if (ActivityCompat.shouldShowRequestPermissionRationale(this,\n// Manifest.permission.ACCESS_FINE_LOCATION)) {\n// // l'autorisation a été refusée précédemment, on peut prévenir l'utilisateur ici\n// } else {\n // l'autorisation n'a jamais été réclamée, on la demande à l'utilisateur\n ActivityCompat.requestPermissions(this,\n new String[]{Manifest.permission.ACCESS_FINE_LOCATION},\n FINE_LOCATION_REQUEST);\n\n // MY_PERMISSIONS_REQUEST_READ_CONTACTS is an\n // app-defined int constant. The callback method gets the\n // result of the request.\n // }\n } else {\n // TODO : autorisation déjà acceptée, on peut faire une action ici\n initLocation();\n }\n }",
"public boolean addPermission(Permission permission);",
"private void checkMethodPermission(HandlerMethod handlerMethod) {\n RequirePermission annotation = handlerMethod.getMethodAnnotation(RequirePermission.class);\n String str = annotation.value();\n System.out.println(\"-----+++++++\");\n }",
"public Enumeration permissions();",
"@Override\n public void onGranted() {\n }",
"private Boolean checkRuntimePermission() {\n List<String> permissionsNeeded = new ArrayList<String>();\n\n final List<String> permissionsList = new ArrayList<String>();\n if (!addPermission(permissionsList, Manifest.permission.READ_EXTERNAL_STORAGE))\n permissionsNeeded.add(\"Storage\");\n if (!addPermission(permissionsList, Manifest.permission.CAMERA))\n permissionsNeeded.add(\"Camera\");\n /* if (!addPermission(permissionsList, Manifest.permission.WRITE_CONTACTS))\n permissionsNeeded.add(\"Write Contacts\");*/\n\n if (permissionsList.size() > 0) {\n if (permissionsNeeded.size() > 0) {\n // Need Rationale\n String message = \"You need to grant access to \" + permissionsNeeded.get(0);\n for (int i = 1; i < permissionsNeeded.size(); i++)\n message = message + \", \" + permissionsNeeded.get(i);\n showMessageOKCancel(message,\n new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n requestPermissions(permissionsList.toArray(new String[permissionsList.size()]),\n REQUEST_CODE_ASK_MULTIPLE_PERMISSIONS);\n }\n }\n });\n return false;\n }\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n requestPermissions(permissionsList.toArray(new String[permissionsList.size()]),\n REQUEST_CODE_ASK_MULTIPLE_PERMISSIONS);\n }\n return false;\n }\n return true;\n }",
"private void checkPermissions() {\n if (ContextCompat.checkSelfPermission(this,\n Manifest.permission.WRITE_EXTERNAL_STORAGE)\n != PackageManager.PERMISSION_GRANTED ||\n ContextCompat.checkSelfPermission(this,\n Manifest.permission.READ_EXTERNAL_STORAGE)\n != PackageManager.PERMISSION_GRANTED ||\n ContextCompat.checkSelfPermission(this,\n Manifest.permission.ACCESS_COARSE_LOCATION)\n != PackageManager.PERMISSION_GRANTED ||\n ContextCompat.checkSelfPermission(this,\n Manifest.permission.ACCESS_FINE_LOCATION)\n != PackageManager.PERMISSION_GRANTED ||\n ContextCompat.checkSelfPermission(this,\n Manifest.permission.CAMERA)\n != PackageManager.PERMISSION_GRANTED){\n\n ActivityCompat.requestPermissions(this,\n new String[]{android.Manifest.permission.WRITE_EXTERNAL_STORAGE,\n Manifest.permission.READ_EXTERNAL_STORAGE,\n Manifest.permission.ACCESS_COARSE_LOCATION,\n Manifest.permission.ACCESS_FINE_LOCATION,\n Manifest.permission.CAMERA}, 56);\n }\n }",
"boolean isWritePermissionGranted();",
"@Override\n public void checkRunTimePermission(AppBaseActivity activity, String permission) {\n if (ContextCompat.checkSelfPermission(activity, permission)\n != PackageManager.PERMISSION_GRANTED) {\n // Should we show an explanation?\n if (ActivityCompat.shouldShowRequestPermissionRationale(activity, permission)) {\n // Show an explanation to the user *asynchronously* -- don't block\n // this thread waiting for the user's response! After the user\n // sees the explanation, try again to request the permission.\n\n } else {\n // No explanation needed, we can request the permission.\n ActivityCompat.requestPermissions(activity,\n new String[]{permission},\n REQUEST_PERMISSIONS_REQUEST_CODE);\n // REQUEST_PERMISSIONS_REQUEST_CODE is an\n // app-defined int constant. The callback method gets the\n // result of the request.\n }\n } else {\n\n }\n }",
"private boolean runtime_permissions() {\n if(Build.VERSION.SDK_INT >= 23 && ContextCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ContextCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED){\n\n requestPermissions(new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION, android.Manifest.permission.ACCESS_COARSE_LOCATION},100);\n\n return true;\n }\n return false;\n }",
"public void checkPermission() {\n Log.e(\"checkPermission\", \"checkPermission\");\n\n // Here, thisActivity is the current activity\n if (ContextCompat.checkSelfPermission(RegisterActivity.this,\n Manifest.permission.ACCESS_FINE_LOCATION)\n != PackageManager.PERMISSION_GRANTED) {\n\n // Should we show an explanation?\n if (ActivityCompat.shouldShowRequestPermissionRationale(RegisterActivity.this,\n Manifest.permission.ACCESS_FINE_LOCATION)) {\n ActivityCompat.requestPermissions(RegisterActivity.this,\n new String[]{Manifest.permission.ACCESS_FINE_LOCATION},\n MY_PERMISSIONS_REQUEST_READ_CONTACTS);\n // Show an expanation to the user *asynchronously* -- don't block\n // this thread waiting for the user's response! After the user\n // sees the explanation, try again to request the permission.\n\n } else {\n\n // No explanation needed, we can request the permission.\n\n ActivityCompat.requestPermissions(RegisterActivity.this,\n new String[]{Manifest.permission.ACCESS_FINE_LOCATION},\n MY_PERMISSIONS_REQUEST_READ_CONTACTS);\n\n // MY_PERMISSIONS_REQUEST_READ_CONTACTS is an\n // app-defined int constant. The callback method gets the\n // result of the request.\n }\n }\n\n\n }",
"private void getPermissions(){\n // Check READ storage permission\n if (ContextCompat.checkSelfPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE)\n != PackageManager.PERMISSION_GRANTED) {\n Log.i(\"STORAGE PERMISSION\", \"request READ_EXTERNAL_STORAGE\");\n ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.READ_EXTERNAL_STORAGE},\n REQUEST_READ_EXTERNAL_STORAGE);\n } else {\n Log.i(\"STORAGE PERMISSION\", \"READ_EXTERNAL_STORAGE already granted\");\n read_external_storage_granted = true;\n }\n\n // Check WRITE storage permission\n if (ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE)\n != PackageManager.PERMISSION_GRANTED) {\n Log.i(\"STORAGE PERMISSION\", \"request WRITE_EXTERNAL_STORAGE\");\n ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE},\n REQUEST_WRITE_EXTERNAL_STORAGE);\n } else {\n Log.i(\"STORAGE PERMISSION\", \"WRITE_EXTERNAL_STORAGE already granted\");\n write_external_storage_granted = true;\n }\n\n // Check camera permission\n if (ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE)\n != PackageManager.PERMISSION_GRANTED){\n Log.i(\"CAMERA PERMISSION\", \"request CAMERA permission\");\n ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.CAMERA},\n REQUEST_CAMERA);\n } else {\n Log.i(\"CAMERA PERMISSION\", \"CAMERA permission already granted\");\n camera_permission_granted = true;\n }\n\n }",
"void mo26168a(Activity activity, String[] strArr, IPermissionCallback nVar);",
"public boolean accesspermission()\n {\n AppOpsManager appOps = (AppOpsManager) context.getSystemService(Context.APP_OPS_SERVICE);\n int mode = 0;\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {\n mode = appOps.checkOpNoThrow(AppOpsManager.OPSTR_GET_USAGE_STATS,\n Process.myUid(),context.getPackageName());\n }\n if (mode == AppOpsManager.MODE_ALLOWED) {\n\n return true;\n }\n return false;\n\n }",
"private void requestPermissions() {\n if (ContextCompat.checkSelfPermission(this,\n Manifest.permission.CAMERA)\n != PackageManager.PERMISSION_GRANTED) {\n\n // Permission is not granted\n // Should we show an explanation?\n if (!ActivityCompat.shouldShowRequestPermissionRationale(this,\n Manifest.permission.CAMERA)) {\n // Show an explanation to the user *asynchronously* -- don't block\n // this thread waiting for the user's response! After the user\n // sees the explanation, try again to request the permission.\n } else {\n // No explanation needed; request the permission\n ActivityCompat.requestPermissions(this,\n new String[]{Manifest.permission.CAMERA},\n 1);\n\n // MY_PERMISSIONS_REQUEST_READ_CONTACTS is an\n // app-defined int constant. The callback method gets the\n // result of the request.\n }\n } else {\n // Permission has already been granted\n }\n }",
"static boolean checkPermissionAllowed(Context context, String permission) {\n if (android.os.Build.VERSION.SDK_INT >= 23) {\n boolean hasPermission = false;\n try {\n // Invoke checkSelfPermission method from Android 6 (API 23 and UP)\n java.lang.reflect.Method methodCheckPermission = Activity.class.getMethod(\"checkSelfPermission\", java.lang.String.class);\n Object resultObj = methodCheckPermission.invoke(context, permission);\n int result = Integer.parseInt(resultObj.toString());\n hasPermission = (result == PackageManager.PERMISSION_GRANTED);\n } catch (Exception ex) {\n\n }\n\n return hasPermission;\n } else {\n return true;\n }\n }",
"public void doFolder_permissions(RunData data, Context context)\n\t{\n\t\tSessionState state = ((JetspeedRunData)data).getPortletSessionState(((JetspeedRunData)data).getJs_peid());\n\t\tParameterParser params = data.getParameters();\n\n\t\t// cancel copy if there is one in progress\n\t\tif(! Boolean.FALSE.toString().equals(state.getAttribute (STATE_COPY_FLAG)))\n\t\t{\n\t\t\tinitCopyContext(state);\n\t\t}\n\n\t\t// cancel move if there is one in progress\n\t\tif(! Boolean.FALSE.toString().equals(state.getAttribute (STATE_MOVE_FLAG)))\n\t\t{\n\t\t\tinitMoveContext(state);\n\t\t}\n\n\t\t// get the current collection id and the related site\n\t\tString collectionId = params.getString(\"collectionId\"); //(String) state.getAttribute (STATE_COLLECTION_ID);\n\t\tString title = \"\";\n\t\ttry\n\t\t{\n\t\t\ttitle = ContentHostingService.getProperties(collectionId).getProperty(ResourceProperties.PROP_DISPLAY_NAME);\n\t\t}\n\t\tcatch (PermissionException e)\n\t\t{\n\t\t\taddAlert(state, rb.getString(\"notread\"));\n\t\t}\n\t\tcatch (IdUnusedException e)\n\t\t{\n\t\t\taddAlert(state, rb.getString(\"notfindfol\"));\n\t\t}\n\n\t\t// the folder to edit\n\t\tReference ref = EntityManager.newReference(ContentHostingService.getReference(collectionId));\n\t\tstate.setAttribute(PermissionsHelper.TARGET_REF, ref.getReference());\n\n\t\t// use the folder's context (as a site) for roles\n\t\tString siteRef = SiteService.siteReference(ref.getContext());\n\t\tstate.setAttribute(PermissionsHelper.ROLES_REF, siteRef);\n\n\t\t// ... with this description\n\t\tstate.setAttribute(PermissionsHelper.DESCRIPTION, rb.getString(\"setpermis\") + \" \" + title);\n\n\t\t// ... showing only locks that are prpefixed with this\n\t\tstate.setAttribute(PermissionsHelper.PREFIX, \"content.\");\n\n\t\t// get into helper mode with this helper tool\n\t\tstartHelper(data.getRequest(), \"sakai.permissions.helper\");\n\n\t}",
"public void checkRequestPermission(){\n\n\n hasPermission = (ActivityCompat.checkSelfPermission(this, Manifest.permission.VIBRATE)\n == PackageManager.PERMISSION_GRANTED &&\n ActivityCompat.checkSelfPermission(this, Manifest.permission.CAMERA)\n == PackageManager.PERMISSION_GRANTED &&\n ActivityCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE)\n == PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE)\n == PackageManager.PERMISSION_GRANTED );\n//check group permissons\n if (!hasPermission){\n ActivityCompat.requestPermissions(this,\n new String[]{\n Manifest.permission.VIBRATE,\n Manifest.permission.CAMERA,\n Manifest.permission.WRITE_EXTERNAL_STORAGE,\n Manifest.permission.READ_EXTERNAL_STORAGE\n\n },\n REQUEST_NETWORK_ACCESS);\n }\n }",
"@Override\n\tpublic boolean can(String permission)\n\t{\n\t\treturn this.auth() != null && this.auth().getRole() != null && this.auth().getRole().getPermissions().parallelStream().filter(p -> Pattern.compile(p.getName()).matcher(permission).groupCount() == 0).count() != 0;\n\t}",
"public boolean checkPermissions(String check)\n {\n Log.d(TAG,\"check single PErmission\");\n int permissionRequest= ActivityCompat.checkSelfPermission(UploadActivity.this,check);\n if(permissionRequest!= PackageManager.PERMISSION_GRANTED)\n {\n Log.d(TAG,\"check PErmission\\nPermission was not granted for:\"+check);\n return false;\n }\n else\n {\n Log.d(TAG,\"check PErmission\\nPermission was granted for:\"+check);\n return true;\n }\n\n }",
"@Override\r\n protected void mayProceed() throws InsufficientPermissionException {\n if (ub.isSysAdmin() || ub.isTechAdmin()) {\r\n return;\r\n }\r\n// if (currentRole.getRole().equals(Role.STUDYDIRECTOR) || currentRole.getRole().equals(Role.COORDINATOR)) {// ?\r\n// ?\r\n// return;\r\n// }\r\n\r\n addPageMessage(respage.getString(\"no_have_correct_privilege_current_study\") + respage.getString(\"change_study_contact_sysadmin\"));\r\n throw new InsufficientPermissionException(Page.MENU_SERVLET, resexception.getString(\"not_allowed_access_extract_data_servlet\"), \"1\");// TODO\r\n // above copied from create dataset servlet, needs to be changed to\r\n // allow only admin-level users\r\n\r\n }",
"public int getPermission(Integer resourceId);",
"private boolean checkPermission() {\r\n int result = ContextCompat.checkSelfPermission(UniformDrawer.this, android.Manifest.permission.WRITE_EXTERNAL_STORAGE);\r\n if (result == PackageManager.PERMISSION_GRANTED) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }",
"public boolean checkPermissions(String permission) {\r\n Log.d(TAG, \"checkPermissions: checking permission: \" + permission);\r\n\r\n int permissionRequest = ActivityCompat.checkSelfPermission(EditProfileActivity.this, permission);\r\n\r\n if (permissionRequest != PackageManager.PERMISSION_GRANTED) {\r\n Log.d(TAG, \"checkPermissions: \\n Permission was not granted for: \" + permission);\r\n Toast.makeText(this, \"Permissions not granted to access camera,\\n\" +\r\n \"please give permissions to GetAplot\", Toast.LENGTH_SHORT).show();\r\n return false;\r\n } else {\r\n Log.d(TAG, \"checkPermissions: \\n Permission was granted for: \" + permission);\r\n return true;\r\n }\r\n }",
"public void checkPermission(String permission, int requestCode)\n {\n if (ContextCompat.checkSelfPermission(this, permission) == PackageManager.PERMISSION_DENIED) {\n // Requesting the permission\n ActivityCompat.requestPermissions(this, new String[] { permission }, requestCode);\n }\n else {\n Toast.makeText(this, \"Permission already granted\", Toast.LENGTH_SHORT).show();\n }\n }",
"public void setPermission(String permission)\r\n {\r\n this.permission = permission;\r\n }"
] | [
"0.80680794",
"0.7928635",
"0.77439773",
"0.7689333",
"0.7578518",
"0.75305897",
"0.749642",
"0.7467543",
"0.74531186",
"0.74082625",
"0.7399815",
"0.7363955",
"0.728091",
"0.72677654",
"0.71864325",
"0.7108778",
"0.70717734",
"0.6996582",
"0.6996582",
"0.6946087",
"0.691678",
"0.69163984",
"0.685284",
"0.68400085",
"0.68324554",
"0.68300205",
"0.68296707",
"0.6808131",
"0.68058074",
"0.6766031",
"0.67461264",
"0.67333907",
"0.67146915",
"0.6714196",
"0.6713275",
"0.6695731",
"0.66905296",
"0.6668917",
"0.66665405",
"0.6658952",
"0.6658484",
"0.66220605",
"0.6609824",
"0.6607051",
"0.65993696",
"0.6594167",
"0.6591319",
"0.6589597",
"0.65873575",
"0.6573616",
"0.65705556",
"0.6552583",
"0.6542537",
"0.6533891",
"0.65292484",
"0.6523914",
"0.65050405",
"0.65010273",
"0.64993465",
"0.6498523",
"0.64985174",
"0.6482108",
"0.64814353",
"0.64763004",
"0.64760315",
"0.6473718",
"0.64665484",
"0.64658433",
"0.64461756",
"0.6444809",
"0.6437622",
"0.64361066",
"0.64343816",
"0.64262474",
"0.6424907",
"0.6419503",
"0.6418964",
"0.6418044",
"0.6411456",
"0.64067096",
"0.6405734",
"0.63979036",
"0.63966334",
"0.6395138",
"0.63893443",
"0.6389048",
"0.6383896",
"0.637178",
"0.6369795",
"0.6369778",
"0.63648885",
"0.63568187",
"0.63566697",
"0.6352214",
"0.63506836",
"0.63480645",
"0.63477725",
"0.6339835",
"0.63364446",
"0.6334012",
"0.63325906"
] | 0.0 | -1 |
Checking permission is enabled or not | public boolean CheckingPermissionIsEnabledOrNot()
{
int CameraPermissionResult = ContextCompat.checkSelfPermission(getApplicationContext(), CAMERA);
int WriteStoragePermissionResult = ContextCompat.checkSelfPermission(getApplicationContext(), WRITE_EXTERNAL_STORAGE);
int ReadStoragePermissionResult = ContextCompat.checkSelfPermission(getApplicationContext(), READ_EXTERNAL_STORAGE);
return CameraPermissionResult == PackageManager.PERMISSION_GRANTED &&
WriteStoragePermissionResult == PackageManager.PERMISSION_GRANTED &&
ReadStoragePermissionResult == PackageManager.PERMISSION_GRANTED;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"boolean isHasPermissions();",
"public void permission_check() {\n //Usage Permission\n if (!isAccessGranted()) {\n new LovelyStandardDialog(MainActivity.this)\n .setTopColorRes(R.color.colorPrimaryDark)\n .setIcon(R.drawable.ic_perm_device_information_white_48dp)\n .setTitle(getString(R.string.permission_check_title))\n .setMessage(getString(R.string.permission_check_message))\n .setPositiveButton(android.R.string.ok, new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n Intent intent = new Intent(android.provider.Settings.ACTION_USAGE_ACCESS_SETTINGS);\n startActivity(intent);\n }\n })\n .setNegativeButton(android.R.string.no, null)\n .show();\n }\n }",
"public boolean accesspermission()\n {\n AppOpsManager appOps = (AppOpsManager) context.getSystemService(Context.APP_OPS_SERVICE);\n int mode = 0;\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {\n mode = appOps.checkOpNoThrow(AppOpsManager.OPSTR_GET_USAGE_STATS,\n Process.myUid(),context.getPackageName());\n }\n if (mode == AppOpsManager.MODE_ALLOWED) {\n\n return true;\n }\n return false;\n\n }",
"public boolean checkPermission(Permission permission);",
"@RequiresApi(api = Build.VERSION_CODES.M)\n private boolean arePermissionsEnabled(){\n for(String permission : mPermissions){\n if(checkSelfPermission(permission) != PackageManager.PERMISSION_GRANTED)\n return false;\n }\n return true;\n }",
"public boolean isPermissionGranted(String permission){\n return true;\n// else\n// return false;\n }",
"private boolean checkDeviceSettings()\n {\n List<String> listPermissionNeeded= new ArrayList<>();\n boolean ret = true;\n for(String perm : permission)\n {\n if(ContextCompat.checkSelfPermission(this,perm)!= PackageManager.PERMISSION_GRANTED)\n listPermissionNeeded.add(perm);\n }\n if(!listPermissionNeeded.isEmpty())\n {\n ActivityCompat.requestPermissions(this,listPermissionNeeded.toArray(new String[listPermissionNeeded.size()]),REQUEST_PERMISSION);\n ret = false;\n }\n\n return ret;\n }",
"public boolean isAccessGranted() {\n try {\n PackageManager packageManager = getPackageManager();\n ApplicationInfo applicationInfo = packageManager.getApplicationInfo(getPackageName(), 0);\n AppOpsManager appOpsManager = (AppOpsManager) getSystemService(Context.APP_OPS_SERVICE);\n int mode;\n assert appOpsManager != null;\n mode = appOpsManager.checkOpNoThrow(AppOpsManager.OPSTR_GET_USAGE_STATS,\n applicationInfo.uid, applicationInfo.packageName);\n return (mode == AppOpsManager.MODE_ALLOWED);\n\n } catch (PackageManager.NameNotFoundException e) {\n return false;\n }\n }",
"public boolean hasPerms()\n {\n return ContextCompat.checkSelfPermission(itsActivity, itsPerm) ==\n PackageManager.PERMISSION_GRANTED;\n }",
"private boolean permisos() {\n for(String permission : PERMISSION_REQUIRED) {\n if(ContextCompat.checkSelfPermission(getContext(), permission) != PackageManager.PERMISSION_GRANTED) {\n return false;\n }\n }\n return true;\n }",
"private void checkRunTimePermission() {\n\n if(checkPermission()){\n\n Toast.makeText(MainActivity.this, \"All Permissions Granted Successfully\", Toast.LENGTH_LONG).show();\n\n }\n else {\n\n requestPermission();\n }\n }",
"public void checkPermission() {\n if (ContextCompat.checkSelfPermission(this,\n Manifest.permission.RECORD_AUDIO) +\n ContextCompat.checkSelfPermission(this, Manifest.permission.MODIFY_AUDIO_SETTINGS)\n != PackageManager.PERMISSION_GRANTED) {\n\n ActivityCompat.requestPermissions(this, perms, permsRequestCode);\n permissionGranted = false;\n } else {\n permissionGranted = true;\n }\n }",
"private boolean checkPermission() {\n int result = ContextCompat.checkSelfPermission(getApplicationContext(), Manifest.permission.READ_PHONE_STATE);\n\n if (result == PackageManager.PERMISSION_GRANTED) {\n return true;\n } else {\n return false;\n }\n }",
"private boolean checkPermission() {\r\n int result = ContextCompat.checkSelfPermission(getApplicationContext(), READ_CONTACTS);\r\n int result1 = ContextCompat.checkSelfPermission(getApplicationContext(), CAMERA);\r\n int result2 = ContextCompat.checkSelfPermission(getApplicationContext(), ACCESS_FINE_LOCATION);\r\n int result3 = ContextCompat.checkSelfPermission(getApplicationContext(), READ_EXTERNAL_STORAGE);\r\n int result4 = ContextCompat.checkSelfPermission(getApplicationContext(), WRITE_EXTERNAL_STORAGE);\r\n int result5 = ContextCompat.checkSelfPermission(getApplicationContext(), READ_PHONE_STATE);\r\n int result6 = ContextCompat.checkSelfPermission(getApplicationContext(), RECORD_AUDIO);\r\n int result7 = ContextCompat.checkSelfPermission(getApplicationContext(), SEND_SMS);\r\n //int result8 = ContextCompat.checkSelfPermission(getApplicationContext(), BLUETOOTH);\r\n\r\n return result == PackageManager.PERMISSION_GRANTED && result1 == PackageManager.PERMISSION_GRANTED && result2 == PackageManager.PERMISSION_GRANTED &&\r\n result3 == PackageManager.PERMISSION_GRANTED && result4 == PackageManager.PERMISSION_GRANTED && result5 == PackageManager.PERMISSION_GRANTED &&\r\n result6 == PackageManager.PERMISSION_GRANTED && result7 == PackageManager.PERMISSION_GRANTED/*&& result8== PackageManager.PERMISSION_GRANTED*/;\r\n }",
"static boolean checkPermissionAllowed(Context context, String permission) {\n if (android.os.Build.VERSION.SDK_INT >= 23) {\n boolean hasPermission = false;\n try {\n // Invoke checkSelfPermission method from Android 6 (API 23 and UP)\n java.lang.reflect.Method methodCheckPermission = Activity.class.getMethod(\"checkSelfPermission\", java.lang.String.class);\n Object resultObj = methodCheckPermission.invoke(context, permission);\n int result = Integer.parseInt(resultObj.toString());\n hasPermission = (result == PackageManager.PERMISSION_GRANTED);\n } catch (Exception ex) {\n\n }\n\n return hasPermission;\n } else {\n return true;\n }\n }",
"private boolean checkAndRequestPermissions() {\n List<String> listPermissionsNeeded = new ArrayList<>();\n for (String pem : appPermissions){\n if (ContextCompat.checkSelfPermission(this, pem) != PackageManager.PERMISSION_GRANTED){\n listPermissionsNeeded.add(pem);\n }\n }\n\n //ask for non-granted permissions\n if (!listPermissionsNeeded.isEmpty()) {\n ActivityCompat.requestPermissions(this, listPermissionsNeeded.toArray(new String[listPermissionsNeeded.size()]), PERMISSION_REQUEST_CODE);\n return false;\n }\n return true;\n }",
"boolean isWritePermissionGranted();",
"@Override\n\tpublic boolean can(String permission)\n\t{\n\t\treturn this.auth() != null && this.auth().getRole() != null && this.auth().getRole().getPermissions().parallelStream().filter(p -> Pattern.compile(p.getName()).matcher(permission).groupCount() == 0).count() != 0;\n\t}",
"private static boolean isPermissionGranted(Context context, String permission) {\n if (ContextCompat.checkSelfPermission(context, permission)\n == PackageManager.PERMISSION_GRANTED) {\n Log.i(TAG, permission + \" granted\");\n return true;\n }\n Log.i(TAG, permission + \" not granted yet\");\n return false;\n }",
"public boolean isAllGranted(){\n //PackageManager.PERMISSION_GRANTED\n return false;\n }",
"private boolean checkPermissions() {\n if (!read_external_storage_granted ||\n !write_external_storage_granted ||\n !write_external_storage_granted) {\n Toast.makeText(getApplicationContext(), \"Die App braucht Zugang zur Kamera und zum Speicher.\", Toast.LENGTH_SHORT).show();\n return false;\n }\n return true;\n }",
"private boolean checkPermission() {\n\n if ((ContextCompat.checkSelfPermission(this, Manifest.permission.CAMERA)\n != PackageManager.PERMISSION_GRANTED) &&\n (ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE)\n != PackageManager.PERMISSION_GRANTED) &&\n (ContextCompat.checkSelfPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE)\n != PackageManager.PERMISSION_GRANTED) &&\n (ContextCompat.checkSelfPermission(this,\n Manifest.permission.RECORD_AUDIO) != PackageManager.PERMISSION_GRANTED)\n\n ) {\n\n // Permission is not granted\n return false;\n\n }\n return true;\n }",
"private boolean checkPermission() {\n if (Build.VERSION.SDK_INT >= 23 &&\n ContextCompat.checkSelfPermission(this,\n Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n // Permission is not granted\n return false;\n } else {\n return true;// Permission has already been granted }\n }\n }",
"public boolean CheckingPermissionIsEnabledOrNot() {\n int FirstPermissionResult = ContextCompat.checkSelfPermission(getApplicationContext(), INTERNET);\n int SecondPermissionResult = ContextCompat.checkSelfPermission(getApplicationContext(), ACCESS_NETWORK_STATE);\n int ThirdPermissionResult = ContextCompat.checkSelfPermission(getApplicationContext(), WRITE_EXTERNAL_STORAGE);\n int ForthPermissionResult = ContextCompat.checkSelfPermission(getApplicationContext(), READ_EXTERNAL_STORAGE);\n int FifthPermissionResult = ContextCompat.checkSelfPermission(getApplicationContext(), ACCESS_COARSE_LOCATION);\n int SixthPermissionResult = ContextCompat.checkSelfPermission(getApplicationContext(), ACCESS_FINE_LOCATION);\n int SeventhPermissionResult = ContextCompat.checkSelfPermission(getApplicationContext(), VIBRATE);\n// int EighthPermissionResult = ContextCompat.checkSelfPermission(getApplicationContext(), CALL_PHONE);\n// int NinethPermissionResult = ContextCompat.checkSelfPermission(getApplicationContext(), SEND_SMS);\n\n return FirstPermissionResult == PackageManager.PERMISSION_GRANTED &&\n SecondPermissionResult == PackageManager.PERMISSION_GRANTED &&\n ThirdPermissionResult == PackageManager.PERMISSION_GRANTED &&\n ForthPermissionResult == PackageManager.PERMISSION_GRANTED &&\n FifthPermissionResult == PackageManager.PERMISSION_GRANTED &&\n SixthPermissionResult == PackageManager.PERMISSION_GRANTED &&\n SeventhPermissionResult == PackageManager.PERMISSION_GRANTED;\n// EighthPermissionResult == PackageManager.PERMISSION_GRANTED &&\n// NinethPermissionResult == PackageManager.PERMISSION_GRANTED;\n }",
"@Override\n public void checkPermission(Permission perm) {\n }",
"private void chkPermission() {\n permissionStatus = getSharedPreferences(\"permissionStatus\", MODE_PRIVATE);\n\n if (ActivityCompat.checkSelfPermission(LoginActivity.this, permissionsRequired[0]) != PackageManager.PERMISSION_GRANTED\n || ActivityCompat.checkSelfPermission(LoginActivity.this, permissionsRequired[1]) != PackageManager.PERMISSION_GRANTED) {\n if (ActivityCompat.shouldShowRequestPermissionRationale(LoginActivity.this, permissionsRequired[0])\n || ActivityCompat.shouldShowRequestPermissionRationale(LoginActivity.this, permissionsRequired[1])) {\n //Show Information about why you need the permission\n ActivityCompat.requestPermissions(LoginActivity.this, permissionsRequired, PERMISSION_CALLBACK_CONSTANT);\n\n } else if (permissionStatus.getBoolean(permissionsRequired[0], false)) {\n //Previously Permission Request was cancelled with 'Dont Ask Again',\n // Redirect to Settings after showing Information about why you need the permission\n sentToSettings = true;\n Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);\n Uri uri = Uri.fromParts(\"package\", getPackageName(), null);\n intent.setData(uri);\n startActivityForResult(intent, REQUEST_PERMISSION_SETTING);\n Toast.makeText(getBaseContext(), \"Go to Permissions to Grant Camera, Phone and Storage\", Toast.LENGTH_LONG).show();\n\n } else {\n //just request the permission\n ActivityCompat.requestPermissions(LoginActivity.this, permissionsRequired, PERMISSION_CALLBACK_CONSTANT);\n }\n\n //txtPermissions.setText(\"Permissions Required\");\n\n SharedPreferences.Editor editor = permissionStatus.edit();\n editor.putBoolean(permissionsRequired[0], true);\n editor.commit();\n } else {\n //You already have the permission, just go ahead.\n //proceedAfterPermission();\n }\n\n }",
"protected boolean checkEnabledPermission() {\r\n ClientSecurityManager manager = ApplicationManager.getClientSecurityManager();\r\n if (manager != null) {\r\n if (this.enabledPermission == null) {\r\n if ((this.buttonKey != null) && (this.parentForm != null)) {\r\n this.enabledPermission = new FormPermission(this.parentForm.getArchiveName(), \"enabled\",\r\n this.buttonKey, true);\r\n }\r\n }\r\n try {\r\n // Checks to show\r\n if (this.enabledPermission != null) {\r\n manager.checkPermission(this.enabledPermission);\r\n }\r\n this.restricted = false;\r\n return true;\r\n } catch (Exception e) {\r\n this.restricted = true;\r\n if (e instanceof NullPointerException) {\r\n ToggleButton.logger.error(null, e);\r\n }\r\n if (ApplicationManager.DEBUG_SECURITY) {\r\n ToggleButton.logger.debug(this.getClass().toString() + \": \" + e.getMessage(), e);\r\n }\r\n return false;\r\n }\r\n } else {\r\n return true;\r\n }\r\n }",
"private boolean checkAndRequestPermissions() {\n\n List<String> listPermissionsNeeded = new ArrayList<>();\n /*if (camera != PackageManager.PERMISSION_GRANTED) {\n listPermissionsNeeded.add(android.Manifest.permission.CAMERA);\n }\n\n if (wstorage != PackageManager.PERMISSION_GRANTED) {\n listPermissionsNeeded.add(android.Manifest.permission.WRITE_EXTERNAL_STORAGE);\n }\n\n if (rstorage != PackageManager.PERMISSION_GRANTED) {\n listPermissionsNeeded.add(Manifest.permission.READ_EXTERNAL_STORAGE);\n }\n if (rphoneState != PackageManager.PERMISSION_GRANTED)\n {\n listPermissionsNeeded.add(Manifest.permission.READ_PHONE_STATE);\n }*/\n\n// if(cLocation != PackageManager.PERMISSION_GRANTED){\n// listPermissionsNeeded.add(Manifest.permission.ACCESS_COARSE_LOCATION);\n// }\n//\n// if(fLocation != PackageManager.PERMISSION_GRANTED){\n// listPermissionsNeeded.add(Manifest.permission.ACCESS_FINE_LOCATION);\n// }\n\n if (!listPermissionsNeeded.isEmpty()) {\n ActivityCompat.requestPermissions(this, listPermissionsNeeded.toArray\n (new String[listPermissionsNeeded.size()]), REQUEST_ID_MULTIPLE_PERMISSIONS);\n return false;\n }\n success();\n return true;\n }",
"boolean ignoresPermission();",
"private Boolean checkRuntimePermission() {\n List<String> permissionsNeeded = new ArrayList<String>();\n\n final List<String> permissionsList = new ArrayList<String>();\n if (!addPermission(permissionsList, Manifest.permission.READ_EXTERNAL_STORAGE))\n permissionsNeeded.add(\"Storage\");\n if (!addPermission(permissionsList, Manifest.permission.CAMERA))\n permissionsNeeded.add(\"Camera\");\n /* if (!addPermission(permissionsList, Manifest.permission.WRITE_CONTACTS))\n permissionsNeeded.add(\"Write Contacts\");*/\n\n if (permissionsList.size() > 0) {\n if (permissionsNeeded.size() > 0) {\n // Need Rationale\n String message = \"You need to grant access to \" + permissionsNeeded.get(0);\n for (int i = 1; i < permissionsNeeded.size(); i++)\n message = message + \", \" + permissionsNeeded.get(i);\n showMessageOKCancel(message,\n new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n requestPermissions(permissionsList.toArray(new String[permissionsList.size()]),\n REQUEST_CODE_ASK_MULTIPLE_PERMISSIONS);\n }\n }\n });\n return false;\n }\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n requestPermissions(permissionsList.toArray(new String[permissionsList.size()]),\n REQUEST_CODE_ASK_MULTIPLE_PERMISSIONS);\n }\n return false;\n }\n return true;\n }",
"public boolean checkPermissions(String permission) {\r\n Log.d(TAG, \"checkPermissions: checking permission: \" + permission);\r\n\r\n int permissionRequest = ActivityCompat.checkSelfPermission(EditProfileActivity.this, permission);\r\n\r\n if (permissionRequest != PackageManager.PERMISSION_GRANTED) {\r\n Log.d(TAG, \"checkPermissions: \\n Permission was not granted for: \" + permission);\r\n Toast.makeText(this, \"Permissions not granted to access camera,\\n\" +\r\n \"please give permissions to GetAplot\", Toast.LENGTH_SHORT).show();\r\n return false;\r\n } else {\r\n Log.d(TAG, \"checkPermissions: \\n Permission was granted for: \" + permission);\r\n return true;\r\n }\r\n }",
"public Boolean isPermissions() {\n return (Boolean) get(\"permissions\");\n }",
"public boolean checkPerms()\n {\n boolean perms = hasPerms();\n if (!perms) {\n ActivityCompat.requestPermissions(\n itsActivity, new String[] { itsPerm }, itsPermsRequestCode);\n }\n return perms;\n }",
"public boolean CheckPermissions() {\n int result = ContextCompat.checkSelfPermission(getApplicationContext(), WRITE_EXTERNAL_STORAGE);\r\n int result1 = ContextCompat.checkSelfPermission(getApplicationContext(), RECORD_AUDIO);\r\n return result == PackageManager.PERMISSION_GRANTED && result1 == PackageManager.PERMISSION_GRANTED;\r\n }",
"private void checkEnabled() {\n }",
"public boolean notificationPermissionEnabled() throws android.os.RemoteException;",
"private boolean isReadStorageAllowed() {\n //Getting the permission status\n int result = ContextCompat.checkSelfPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE);\n\n //If permission is granted returning true\n if (result == PackageManager.PERMISSION_GRANTED)\n return true;\n\n //If permission is not granted returning false\n return false;\n }",
"private boolean checkPermission() {\n Log.d(\"TAG\", \"checkPermission()\");\n // Ask for permission if it wasn't granted yet\n return (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED );\n }",
"@Override\n public boolean hasPermission(Permission permission) {\n // FacesContext context = FacesContext.getCurrentInstance();\n String imp = (String)ADFContext.getCurrent().getSessionScope().get(\"isImpersonationOn\");\n// String imp = (String)context.getExternalContext().getSessionMap().get(\"isImpersonationOn\");\n if(imp == null || !imp.equals(\"Y\")){\n return super.hasPermission(permission);\n }\n else{\n return true;\n \n }\n \n }",
"public void checkpermission()\n {\n permissionUtils.check_permission(permissions,\"Need GPS permission for getting your location\",1);\n }",
"public void checkPermissions(){\n //Check if some of the core permissions are not already granted\n if ((ContextCompat.checkSelfPermission(LoginActivity.this, Manifest.permission.ACCESS_FINE_LOCATION)!= PackageManager.PERMISSION_GRANTED)\n || (ContextCompat.checkSelfPermission(LoginActivity.this,Manifest.permission.CAMERA)!= PackageManager.PERMISSION_GRANTED)\n || (ContextCompat.checkSelfPermission(LoginActivity.this,Manifest.permission.WRITE_EXTERNAL_STORAGE)!= PackageManager.PERMISSION_GRANTED)) {\n Toast.makeText(this, \"Some permissions are not granted. Please enable them.\", Toast.LENGTH_SHORT).show();\n\n //If so, request the activation of this permissions\n ActivityCompat.requestPermissions(LoginActivity.this,\n new String[]{\n Manifest.permission.ACCESS_FINE_LOCATION,\n Manifest.permission.CAMERA,\n Manifest.permission.WRITE_EXTERNAL_STORAGE},\n REQUEST_CODE_ASK_PERMISSIONS);\n }\n else{\n //Permissions already granted\n }\n }",
"private boolean validateAccess(String permission) {\n\t\tif (\"READ\".equalsIgnoreCase(permission)) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"private boolean isReadStorageAllowed() {\n int result = ContextCompat.checkSelfPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE);\n int write = ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE);\n\n //If permission is granted returning true\n if (result == PackageManager.PERMISSION_GRANTED && write == PackageManager.PERMISSION_DENIED) {\n return true;\n } else {\n\n //If permission is not granted returning false\n return false;\n }\n }",
"int getPermissionRead();",
"private boolean checkPermission() {\n Log.d(TAG, \"checkPermission()\");\n // Ask for permission if it wasn't granted yet\n return (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION)\n == PackageManager.PERMISSION_GRANTED);\n }",
"private void checkPermission() {\n if (ContextCompat.checkSelfPermission(this, Manifest.permission.RECORD_AUDIO)\n != PackageManager.PERMISSION_GRANTED) {\n\n AlertDialog.Builder builder = new AlertDialog.Builder(this)\n .setMessage(getString(R.string.can_not_handle_calls))\n .setCancelable(false)\n .setPositiveButton(R.string.text_ok, (dialog, id) -> {\n requestPermission();\n });\n\n builder.create().show();\n } else {\n presenter.gotPermissions = true;\n }\n }",
"public boolean checkPermissions() {\n if (ContextCompat.checkSelfPermission(this,\n Manifest.permission.ACCESS_FINE_LOCATION)\n != PackageManager.PERMISSION_GRANTED) {\n\n // Should we show an explanation?\n if (ActivityCompat.shouldShowRequestPermissionRationale(this,\n Manifest.permission.ACCESS_FINE_LOCATION)) {\n\n // Show an explanation to the user *asynchronously* -- don't block\n // this thread waiting for the user's response! After the user\n // sees the explanation, try again to request the permission.\n new AlertDialog.Builder(this)\n .setTitle(\"TITLE\")\n .setMessage(\"TEXT\")\n .setPositiveButton(\"OKAY\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialogInterface, int i) {\n //Prompt the user once explanation has been shown\n ActivityCompat.requestPermissions(MapsActivity.this,\n new String[]{\n Manifest.permission.ACCESS_FINE_LOCATION},\n PERMISSION_REQ_LOC);\n }\n })\n .create()\n .show();\n\n\n } else {\n // No explanation needed, we can request the permission.\n ActivityCompat.requestPermissions(this,\n new String[]{\n Manifest.permission.ACCESS_FINE_LOCATION},\n PERMISSION_REQ_LOC);\n }\n return false;\n } else {\n return true;\n }\n }",
"public boolean checkForPermission() {\r\n int permissionCAMERA = ContextCompat.checkSelfPermission(this, Manifest.permission.CAMERA);\r\n int storagePermission = ContextCompat.checkSelfPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE);\r\n int accessCoarseLocation = ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION);\r\n int accessFineLocation = ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION);\r\n\r\n List<String> listPermissionsNeeded = new ArrayList<>();\r\n if (storagePermission != PackageManager.PERMISSION_GRANTED) {\r\n listPermissionsNeeded.add(Manifest.permission.READ_EXTERNAL_STORAGE);\r\n }\r\n if (permissionCAMERA != PackageManager.PERMISSION_GRANTED) {\r\n listPermissionsNeeded.add(Manifest.permission.CAMERA);\r\n }\r\n if (accessCoarseLocation != PackageManager.PERMISSION_GRANTED) {\r\n listPermissionsNeeded.add(Manifest.permission.ACCESS_COARSE_LOCATION);\r\n }\r\n if (accessFineLocation != PackageManager.PERMISSION_GRANTED) {\r\n listPermissionsNeeded.add(Manifest.permission.ACCESS_FINE_LOCATION);\r\n }\r\n if (!listPermissionsNeeded.isEmpty()) {\r\n ActivityCompat.requestPermissions(this,\r\n listPermissionsNeeded.toArray(new String[listPermissionsNeeded.size()]), MY_PERMISSIONS_REQUEST);\r\n return false;\r\n }\r\n\r\n return true;\r\n }",
"private boolean checkPermissions() {\n int permissionState1 = ActivityCompat.checkSelfPermission(this,\n android.Manifest.permission.ACCESS_FINE_LOCATION);\n\n int permissionState2 = ActivityCompat.checkSelfPermission(this,\n Manifest.permission.ACCESS_COARSE_LOCATION);\n return permissionState1 == PackageManager.PERMISSION_GRANTED && permissionState2 == PackageManager.PERMISSION_GRANTED;\n }",
"@Override\n public boolean notificationPermissionEnabled() throws android.os.RemoteException {\n android.os.Parcel _data = android.os.Parcel.obtain();\n android.os.Parcel _reply = android.os.Parcel.obtain();\n boolean _result;\n try {\n _data.writeInterfaceToken(DESCRIPTOR);\n boolean _status = mRemote.transact(\n Stub.TRANSACTION_notificationPermissionEnabled, _data, _reply, 0);\n _reply.readException();\n _result = (0 != _reply.readInt());\n } finally {\n _reply.recycle();\n _data.recycle();\n }\n return _result;\n }",
"public boolean checkPermissions(String check)\n {\n Log.d(TAG,\"check single PErmission\");\n int permissionRequest= ActivityCompat.checkSelfPermission(UploadActivity.this,check);\n if(permissionRequest!= PackageManager.PERMISSION_GRANTED)\n {\n Log.d(TAG,\"check PErmission\\nPermission was not granted for:\"+check);\n return false;\n }\n else\n {\n Log.d(TAG,\"check PErmission\\nPermission was granted for:\"+check);\n return true;\n }\n\n }",
"boolean hasEnabled();",
"private boolean checkPermissions() {\n int permissionState = ActivityCompat.checkSelfPermission(\n this, Manifest.permission.ACCESS_FINE_LOCATION\n );\n return permissionState == PackageManager.PERMISSION_GRANTED;\n }",
"private boolean checkPermissions() {\n boolean hasPermission = true;\n\n int result = ContextCompat.checkSelfPermission(\n this,\n Manifest.permission.ACCESS_FINE_LOCATION\n );\n if (result == PERMISSION_DENIED) {\n hasPermission = false;\n }\n\n // ACCESS_BACKGROUND_LOCATION is only required on API 29 and higher\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {\n result = ContextCompat.checkSelfPermission(\n this,\n Manifest.permission.ACCESS_BACKGROUND_LOCATION\n );\n if (result == PERMISSION_DENIED) {\n hasPermission = false;\n }\n }\n\n return hasPermission;\n }",
"private boolean hasPermission(String permission) {\n if (canMakeSmores()) {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n return (checkSelfPermission(permission) == PackageManager.PERMISSION_GRANTED);\n }\n }\n return true;\n }",
"private boolean isReadStorageAllowed() {\n int result = ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE);\n\n //If permission is granted returning true\n if (result == PackageManager.PERMISSION_GRANTED)\n return true;\n\n //If permission is not granted returning false\n return false;\n }",
"private boolean checkPermissions() {\r\n int permissionState = ActivityCompat.checkSelfPermission(this,\r\n Manifest.permission.ACCESS_FINE_LOCATION);\r\n return permissionState == PackageManager.PERMISSION_GRANTED;\r\n }",
"private boolean checkPermissionFromDevice(int permissions) {\n\n switch (permissions) {\n case RECORD_AUDIO_PERMISSION_CODE: {\n // int variables will be 0 if permissions are not granted already\n int write_external_storage_result =\n ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE);\n int record_audio_result =\n ContextCompat.checkSelfPermission(this, Manifest.permission.RECORD_AUDIO);\n\n // returns true if both permissions are already granted\n return write_external_storage_result == PackageManager.PERMISSION_GRANTED &&\n record_audio_result == PackageManager.PERMISSION_GRANTED;\n }\n default:\n return false;\n }\n }",
"@Override\n public void checkPermission(Permission perm, Object context) {\n }",
"private boolean checkAndRequestPermissions() {\n int locationPermission = ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION);\n List<String> listPermissionsNeeded = new ArrayList<>();\n if (locationPermission != PackageManager.PERMISSION_GRANTED) {\n listPermissionsNeeded.add(Manifest.permission.ACCESS_FINE_LOCATION);\n }\n// if (permissionSendMessage != PackageManager.PERMISSION_GRANTED) {\n// listPermissionsNeeded.add(Manifest.permission.SEND_SMS);\n// }\n if (!listPermissionsNeeded.isEmpty()) {\n ActivityCompat.requestPermissions(this, listPermissionsNeeded.toArray(new String[listPermissionsNeeded.size()]), REQUEST_ID_MULTIPLE_PERMISSIONS);\n return false;\n }\n return true;\n }",
"private boolean checkPermissionStorage() {\n\n boolean isPermissionGranted = true;\n\n int permissionStorage = ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE);\n\n if (permissionStorage != PackageManager.PERMISSION_GRANTED)\n {\n isPermissionGranted = false;\n }\n\n return isPermissionGranted;\n }",
"private boolean checkPermissions() {\n int permissionState = ActivityCompat.checkSelfPermission(this,\n Manifest.permission.ACCESS_FINE_LOCATION);\n return permissionState == PackageManager.PERMISSION_GRANTED;\n }",
"private boolean checkPermissions() {\n int permissionState = ActivityCompat.checkSelfPermission(this,\n Manifest.permission.ACCESS_FINE_LOCATION);\n return permissionState == PackageManager.PERMISSION_GRANTED;\n }",
"private boolean isWriteStorageAllowed() {\n int result = ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE);\n\n //If permission is granted returning true\n if (result == PackageManager.PERMISSION_GRANTED)\n return true;\n\n //If permission is not granted returning false\n return false;\n }",
"private boolean checkPermissions() {\n int res = ContextCompat.checkSelfPermission(getApplicationContext(),android.Manifest.permission.READ_EXTERNAL_STORAGE);\n if (res == PackageManager.PERMISSION_GRANTED)\n return true;\n else\n return false;\n }",
"private boolean checkPermission() {\n return (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION)\n == PackageManager.PERMISSION_GRANTED );\n }",
"private boolean isReadAudioAllowed() {\n int result = ContextCompat.checkSelfPermission(this, Manifest.permission.RECORD_AUDIO);\n\n //If permission is granted returning true\n if (result == PackageManager.PERMISSION_GRANTED)\n return true;\n\n //If permission is not granted returning false\n return false;\n }",
"private boolean isLocationAllowed() {\n int result = ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION);\r\n\r\n //If permission is granted returning true\r\n if (result == PackageManager.PERMISSION_GRANTED)\r\n return true;\r\n\r\n //If permission is not granted returning false\r\n return false;\r\n }",
"private boolean checkPermission() {\n int fineLocation = ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION);\n\n if (fineLocation != PackageManager.PERMISSION_GRANTED) {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n ActivityCompat.requestPermissions(this,\n new String[]{Manifest.permission.ACCESS_FINE_LOCATION},\n PERMISSION_REQUEST_CODE_FINE_LOCATION);\n }\n return false;\n } else {\n return true;\n }\n }",
"public boolean granted(){\n\t\treturn this.granted;\n\t}",
"private boolean checkPermissions() {\n if (ContextCompat.checkSelfPermission(this, android.Manifest.permission.READ_EXTERNAL_STORAGE)\n != PackageManager.PERMISSION_GRANTED && ContextCompat.checkSelfPermission(this,\n android.Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {\n return false;\n\n } else {\n return true;\n }\n }",
"public boolean validatePermissions()\r\n\t{\n\t\treturn true;\r\n\t}",
"private void checkIfPermissionGranted() {\n\n //if user already allowed the permission, this condition will be true\n if (ContextCompat.checkSelfPermission(this, PERMISSION_CODE)\n == PackageManager.PERMISSION_GRANTED) {\n Intent launchIntent = getPackageManager().getLaunchIntentForPackage(\"com.example.a3\");\n if (launchIntent != null) {\n startActivity(launchIntent);//null pointer check in case package name was not found\n }\n }\n //if user didn't allow the permission yet, then ask for permission\n else {\n ActivityCompat.requestPermissions(this, new String[]{PERMISSION_CODE}, 0);\n }\n }",
"@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n if (requestCode == REQUEST_PERMISSION_SETTING) {\n checkPermission();\n }\n }",
"public void checkPermission(){\n Log.d(\"BluetoothLeService\", \"initialize is \" + mBluetoothManager);\n if (mBluetoothManager == null) {\n mBluetoothManager = (BluetoothManager) this.getSystemService(Context.BLUETOOTH_SERVICE);\n if (mBluetoothManager == null) {\n Log.e(TAG, \"Unable to initialize BluetoothManager.\");\n return;\n }\n }\n\n mBluetoothAdapter = mBluetoothManager.getAdapter();\n if (mBluetoothAdapter == null) {\n Log.e(TAG, \"Unable to obtain a BluetoothAdapter.\");\n return;\n }\n\n if (!mBluetoothAdapter.isEnabled()) mBluetoothAdapter.enable();\n\n int PERMISSION_ALL = 1;\n /*\n String[] PERMISSIONS = {\n Manifest.permission.ACCESS_COARSE_LOCATION,\n Manifest.permission.WRITE_EXTERNAL_STORAGE,\n Manifest.permission.READ_EXTERNAL_STORAGE,\n Manifest.permission.GET_ACCOUNTS};\n */\n String[] PERMISSIONS = {\n Manifest.permission.ACCESS_COARSE_LOCATION\n };\n\n if (!hasPermissions(this, PERMISSIONS)) {\n ActivityCompat.requestPermissions( this, PERMISSIONS, PERMISSION_ALL);\n }\n }",
"private boolean checkPermissions() {\n boolean permissionGrant = false;\n if (Build.VERSION.SDK_INT >= 23 && checkSelfPermission(Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n ActivityCompat.requestPermissions((Activity) this, new String[]{Manifest.permission.ACCESS_COARSE_LOCATION,\n Manifest.permission.ACCESS_FINE_LOCATION},\n PERMISSION_REQUEST_CODE_ACCESS_COARSE_LOCATION);\n } else {\n permissionGrant = true;\n }\n return permissionGrant;\n\n }",
"boolean hasPermission(final Player sniper, final String permission);",
"private boolean checkPermissions() {\n return PackageManager.PERMISSION_GRANTED == ActivityCompat.checkSelfPermission(this,\n Manifest.permission.ACCESS_FINE_LOCATION);\n }",
"void askForPermissions();",
"private boolean checkPermissions(String permissionStr, int requestCode) {\n // Check to see if we have permission to access something,\n // such like the microphone.\n int permission = ActivityCompat.checkSelfPermission(\n HotwordDetectionActivity.this,\n permissionStr);\n\n if (permission != PackageManager.PERMISSION_GRANTED) {\n // We can not access it, request authorization from the user.\n ActivityCompat.requestPermissions(\n HotwordDetectionActivity.this,\n new String[] {permissionStr},\n requestCode\n );\n return false;\n } else {\n return true;\n }\n }",
"int getPermissionWrite();",
"private boolean checkForPermission() {\n\n int permissionCode = ContextCompat.checkSelfPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE);\n\n if(permissionCode == PackageManager.PERMISSION_GRANTED) return true;\n else return false;\n }",
"private boolean checkPermission() {\r\n int result = ContextCompat.checkSelfPermission(UniformDrawer.this, android.Manifest.permission.WRITE_EXTERNAL_STORAGE);\r\n if (result == PackageManager.PERMISSION_GRANTED) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }",
"public static boolean m45181a() {\n Context b = m45183b();\n if (b != null) {\n try {\n PackageManager packageManager = b.getPackageManager();\n if (packageManager == null) {\n return true;\n }\n String[] strArr = packageManager.getPackageInfo(b.getPackageName(), 4096).requestedPermissions;\n if (strArr == null) {\n return false;\n }\n String[] strArr2 = f31382a;\n for (String str : strArr2) {\n boolean a = m45182a(strArr, str);\n f31383b.put(str, Boolean.valueOf(a));\n if (!a) {\n TLogger.m45340ee(\"PermissionChecker\", \"The required permission of <\" + str + \"> does not found!\");\n return false;\n }\n }\n return true;\n } catch (Throwable th) {\n TLogger.m45339e(\"PermissionChecker\", \"check required permissins exception.\", th);\n return false;\n }\n } else {\n throw new IllegalArgumentException(\"The context parameter can not be null!\");\n }\n }",
"private boolean checkReadWritePermission() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n if (checkSelfPermission(Manifest.permission.READ_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED\n && checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED) {\n return true;\n } else {\n ActivityCompat.requestPermissions(PanAadharResultActivity.this, new String[]{Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE}, 111);\n return false;\n }\n }\n\n return false;\n }",
"@Test\n public void testCheckExistsPermission() throws Exception\n {\n permission = permissionManager.getPermissionInstance(\"OPEN_OFFICE\");\n permissionManager.addPermission(permission);\n assertTrue(permissionManager.checkExists(permission));\n Permission permission2 = permissionManager.getPermissionInstance(\"CLOSE_OFFICE\");\n assertFalse(permissionManager.checkExists(permission2));\n }",
"private void askForPermission(){\n if (ContextCompat.checkSelfPermission(MainActivity.this,\n Manifest.permission.ACCESS_NOTIFICATION_POLICY)\n != PackageManager.PERMISSION_GRANTED) {\n Log.i(TAG,\"don't have permission\");\n // Permission is not granted\n // Should we show an explanation?\n if (ActivityCompat.shouldShowRequestPermissionRationale(MainActivity.this,\n Manifest.permission.ACCESS_NOTIFICATION_POLICY)) {\n Log.i(TAG,\"Asking for permission with explanation\");\n // Show an explanation to the user *asynchronously* -- don't block\n // this thread waiting for the user's response! After the user\n // sees the explanation, try again to request the permission.\n ActivityCompat.requestPermissions(this,\n new String[]{Manifest.permission.ACCESS_NOTIFICATION_POLICY},\n MY_PERMISSIONS_MODIFY_AUDIO_SETTINGS);\n\n } else {\n Log.i(TAG,\"Asking for permission without explanation\");\n // No explanation needed; request the permission\n ActivityCompat.requestPermissions(this,\n new String[]{Manifest.permission.ACCESS_NOTIFICATION_POLICY},\n MY_PERMISSIONS_MODIFY_AUDIO_SETTINGS);\n\n // MY_PERMISSIONS_REQUEST_READ_CONTACTS is an\n // app-defined int constant. The callback method gets the\n // result of the request.\n }\n } else {\n // Permission has already been granted\n Log.i(TAG,\"Already had permission\");\n }\n\n }",
"public static boolean isReadCallAllowed(FragmentActivity act) {\n //Getting the permission status\n int result = ContextCompat.checkSelfPermission(act, Manifest.permission.CALL_PHONE);\n\n //If permission is granted returning true\n if (result == PackageManager.PERMISSION_GRANTED)\n return true;\n\n //If permission is not granted returning false\n return false;\n }",
"protected boolean hasMonitoringPermissions() {\r\n\t\tfinal Jenkins jenkins = Jenkins.getInstance();\r\n\t\treturn jenkins != null && jenkins.hasPermission(Jenkins.ADMINISTER);\r\n\t}",
"public void verifyAppPermissions() {\n boolean hasAll = true;\n mHasBluetoothPermissions = ActivityCompat.checkSelfPermission(this, Manifest.permission.BLUETOOTH) == PackageManager.PERMISSION_GRANTED;\n mHasBluetoothAdminPermissions = ActivityCompat.checkSelfPermission(this, Manifest.permission.BLUETOOTH_ADMIN) == PackageManager.PERMISSION_GRANTED;\n hasAll &= ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED;\n hasAll &= ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED;\n\n if (!hasAll) {\n // We don't have permission so prompt the user\n ActivityCompat.requestPermissions(\n this,\n APP_PERMISSIONS,\n REQUEST_PERMISSIONS\n );\n }\n }",
"boolean needsStoragePermission();",
"public static boolean hasModule() {\n\t\ttry {\n\t\t\tPackageManager packageManager = AppMain.getContext().getPackageManager();\n\t\t\tIntent intent = new Intent(\"android.settings.USAGE_ACCESS_SETTINGS\");\n\t\t\tList<ResolveInfo> list = packageManager.queryIntentActivities(intent,\n\t\t\t\tPackageManager.MATCH_DEFAULT_ONLY);\n\t\t\treturn list.size() > 0;\n\t\t} catch (RuntimeException e) {\n\t\t\t// 在某个三星的设备上出现过安全异常\n\t\t\t// 在某个ZTE的设备上出现过RuntimeException\n\t\t\treturn false;\n\t\t}\n\t}",
"public boolean checkDrawOverlayPermission() {\r\n if (Build.VERSION.SDK_INT >= 23) {\r\n if (!Settings.canDrawOverlays(activity)) {\r\n /** if not construct intent to request permission */\r\n Intent intent = new Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION,\r\n Uri.parse(\"package:\" + activity.getPackageName()));\r\n /** request permission via start activity for result */\r\n activity.startActivityForResult(intent, SETTINGS_REQUEST_CODE);\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n } else {\r\n return true;\r\n }\r\n\r\n\r\n }",
"private void checkPermission(){\n // vérification de l'autorisation d'accéder à la position GPS\n if (ContextCompat.checkSelfPermission(this,\n Manifest.permission.ACCESS_FINE_LOCATION)\n != PackageManager.PERMISSION_GRANTED) {\n\n// // l'autorisation n'est pas acceptée\n// if (ActivityCompat.shouldShowRequestPermissionRationale(this,\n// Manifest.permission.ACCESS_FINE_LOCATION)) {\n// // l'autorisation a été refusée précédemment, on peut prévenir l'utilisateur ici\n// } else {\n // l'autorisation n'a jamais été réclamée, on la demande à l'utilisateur\n ActivityCompat.requestPermissions(this,\n new String[]{Manifest.permission.ACCESS_FINE_LOCATION},\n FINE_LOCATION_REQUEST);\n\n // MY_PERMISSIONS_REQUEST_READ_CONTACTS is an\n // app-defined int constant. The callback method gets the\n // result of the request.\n // }\n } else {\n // TODO : autorisation déjà acceptée, on peut faire une action ici\n initLocation();\n }\n }",
"private void checkPermissions() {\n List<String> permissions = new ArrayList<>();\n String message = \"osmdroid permissions:\";\n if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n permissions.add(Manifest.permission.ACCESS_FINE_LOCATION);\n message += \"\\nLocation to show user location.\";\n }\n if (ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {\n permissions.add(Manifest.permission.WRITE_EXTERNAL_STORAGE);\n message += \"\\nStorage access to store map tiles.\";\n }\n if (ContextCompat.checkSelfPermission(this, Manifest.permission.READ_PHONE_STATE) != PackageManager.PERMISSION_GRANTED) {\n permissions.add(Manifest.permission.READ_PHONE_STATE);\n message += \"\\n access to read phone state.\";\n //requestReadPhoneStatePermission();\n }\n if (ContextCompat.checkSelfPermission(this, Manifest.permission.RECEIVE_SMS) != PackageManager.PERMISSION_GRANTED) {\n permissions.add(Manifest.permission.RECEIVE_SMS);\n message += \"\\n access to receive sms.\";\n //requestReadPhoneStatePermission();\n }\n if (ContextCompat.checkSelfPermission(this, Manifest.permission.GET_ACCOUNTS) != PackageManager.PERMISSION_GRANTED) {\n permissions.add(Manifest.permission.GET_ACCOUNTS);\n message += \"\\n access to read sms.\";\n //requestReadPhoneStatePermission();\n }\n if (!permissions.isEmpty()) {\n // Toast.makeText(this, message, Toast.LENGTH_LONG).show();\n String[] params = permissions.toArray(new String[permissions.size()]);\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n requestPermissions(params, REQUEST_CODE_ASK_MULTIPLE_PERMISSIONS);\n }\n } // else: We already have permissions, so handle as normal\n }",
"private void checkpermission() {\n permissionUtils = new PermissionUtils(context, this);\n permissions.add(Manifest.permission.ACCESS_FINE_LOCATION);\n permissions.add(Manifest.permission.ACCESS_COARSE_LOCATION);\n permissionUtils.check_permission(permissions, \"Need GPS permission for getting your location\", LOCATION_REQUEST_CODE);\n }",
"private boolean mayRequestStoragePermission() {\r\n\r\n if(Build.VERSION.SDK_INT < Build.VERSION_CODES.M)\r\n return true;\r\n\r\n if((checkSelfPermission(WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED) &&\r\n (checkSelfPermission(CAMERA) == PackageManager.PERMISSION_GRANTED))\r\n return true;\r\n\r\n if((shouldShowRequestPermissionRationale(WRITE_EXTERNAL_STORAGE)) || (shouldShowRequestPermissionRationale(CAMERA))){\r\n Snackbar.make(mRlView, \"Los permisos son necesarios para poder usar la aplicación\",\r\n Snackbar.LENGTH_INDEFINITE).setAction(android.R.string.ok, new View.OnClickListener() {\r\n @TargetApi(Build.VERSION_CODES.M)\r\n @Override\r\n public void onClick(View v) {\r\n requestPermissions(new String[]{WRITE_EXTERNAL_STORAGE, CAMERA}, MY_PERMISSIONS);\r\n }\r\n });\r\n }else{\r\n requestPermissions(new String[]{WRITE_EXTERNAL_STORAGE, CAMERA}, MY_PERMISSIONS);\r\n }\r\n\r\n return false;\r\n }",
"private boolean checkPermissions() {\n int permissionState = ActivityCompat.checkSelfPermission(this,\n Manifest.permission.ACCESS_COARSE_LOCATION);\n return permissionState == PackageManager.PERMISSION_GRANTED;\n }",
"private boolean checkPermissions(Activity activity) {\n String[] permissions = getRequiredAndroidPermissions();\n return handler.areAllPermissionsGranted(activity, permissions);\n }",
"public boolean checkPermission() {\n int cameraPermissionResult = ContextCompat.checkSelfPermission(getApplicationContext(), Manifest.permission.CAMERA);\n int readContactPermissionResult = ContextCompat.checkSelfPermission(getApplicationContext(), Manifest.permission.READ_CONTACTS);\n return cameraPermissionResult == PackageManager.PERMISSION_GRANTED && readContactPermissionResult == PackageManager.PERMISSION_GRANTED;\n }"
] | [
"0.79228884",
"0.7818504",
"0.777076",
"0.7680193",
"0.7677216",
"0.7660879",
"0.7560006",
"0.75595945",
"0.74988437",
"0.7468714",
"0.74060744",
"0.73480904",
"0.72318697",
"0.72205585",
"0.7188427",
"0.71649307",
"0.71549696",
"0.7140592",
"0.71000373",
"0.7088373",
"0.7087934",
"0.70869267",
"0.7078107",
"0.70586807",
"0.7022319",
"0.700075",
"0.69780445",
"0.6970925",
"0.69619256",
"0.6955975",
"0.69420755",
"0.6938215",
"0.6926535",
"0.6888297",
"0.6880934",
"0.68693167",
"0.68633103",
"0.6858482",
"0.68531984",
"0.6846256",
"0.68360305",
"0.68268",
"0.68062407",
"0.6802516",
"0.67900276",
"0.6786353",
"0.6782566",
"0.6781299",
"0.6779729",
"0.6777283",
"0.67576194",
"0.6757516",
"0.675704",
"0.6755574",
"0.6751561",
"0.6744662",
"0.67436033",
"0.6743493",
"0.6735285",
"0.6730681",
"0.6719818",
"0.67195946",
"0.67195946",
"0.67081183",
"0.6694123",
"0.6675078",
"0.66719675",
"0.6658888",
"0.66557574",
"0.6641317",
"0.66363096",
"0.6628353",
"0.66282916",
"0.6627897",
"0.6609999",
"0.66064054",
"0.6605582",
"0.6591602",
"0.65885144",
"0.6588016",
"0.65793866",
"0.6560801",
"0.65537727",
"0.6527805",
"0.6522143",
"0.6521649",
"0.65188545",
"0.65184015",
"0.65128756",
"0.6510742",
"0.6504499",
"0.6503202",
"0.648703",
"0.6480452",
"0.6465856",
"0.64573216",
"0.64513665",
"0.64484626",
"0.64470744",
"0.6446831"
] | 0.7288013 | 12 |
ib_delete.setVisibility(View.GONE); layout_loading.setVisibility(View.GONE); Toast.makeText(getApplicationContext(), "Failed to Upload", Toast.LENGTH_LONG).show(); | @Override
public void run()
{
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n public void onFailure(@NonNull Exception e) {\n Toast.makeText(MainActivity.this, \"Error\", Toast.LENGTH_SHORT).show();\r\n hideProgress();\r\n }",
"private void hideLoadingAndUpdate() {\n image.setVisibility(View.VISIBLE);\n loadingBar.setVisibility(View.INVISIBLE);\n shareBtn.setVisibility(shareBtnVisibility);\n\n }",
"@Override\n public void onErrorResponse(VolleyError volleyError) {\n loading.dismiss();\n //Showing toast\n //Toast.makeText(getActivity(), volleyError.getMessage().toString(), Toast.LENGTH_LONG).show();\n Toast.makeText(AdQuestionActivity.this, \"Upload Error! \"+volleyError.getMessage().toString(), Toast.LENGTH_LONG).show();\n }",
"@Override\n public void onErrorResponse(VolleyError volleyError) {\n loading.dismiss();\n\n //Showing toast\n Toast.makeText(imageUpload.this, \"Silakan cek koneksi anda\", Toast.LENGTH_LONG).show();\n }",
"@Override\n public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {\n progressDialog.hide();\n Toast.makeText(UserInfoForm.this, \"Upload Successful\", Toast.LENGTH_SHORT).show();\n }",
"@Override\n public void onErrorResponse(VolleyError error) {\n Log.e(\"response is:\", error.toString());\n progressBar.setVisibility(View.GONE);\n }",
"@Override\n public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {\n progressDialog.dismiss();\n\n //and displaying a success toast\n Toast.makeText(getApplicationContext(), \"File Uploaded \", Toast.LENGTH_LONG).show();\n // picup =true;\n }",
"@Override\n public void onFailure(@NonNull Exception exception) {\n progressDialog.dismiss();\n\n //and displaying error message\n Toast.makeText(getApplicationContext(), exception.getMessage(), Toast.LENGTH_LONG).show();\n }",
"@Override\n public void onFailure(@NonNull Exception exception) {\n progressDialog.dismiss();\n\n //and displaying error message\n Toast.makeText(getApplicationContext(), exception.getMessage(), Toast.LENGTH_LONG).show();\n }",
"@Override\n public void onFailure(@NonNull Exception exception) {\n progressDialog.dismiss();\n\n //and displaying error message\n Toast.makeText(getApplicationContext(), exception.getMessage(), Toast.LENGTH_LONG).show();\n }",
"@Override\n public void onFailure(@NonNull Exception exception) {\n progressDialog.dismiss();\n\n //and displaying error message\n Toast.makeText(getApplicationContext(), exception.getMessage(), Toast.LENGTH_LONG).show();\n }",
"@Override\n public void onFailure(@NonNull Exception exception) {\n progressDialog.dismiss();\n\n //and displaying error message\n Toast.makeText(getApplicationContext(), exception.getMessage(), Toast.LENGTH_LONG).show();\n }",
"private void showNothing(){\n errorTextView.setVisibility(View.INVISIBLE);\n errorButton.setVisibility(View.INVISIBLE);\n errorButton.setEnabled(false);\n recyclerView.setVisibility(View.INVISIBLE);\n progressBar.setVisibility(View.INVISIBLE);\n noFavoriteMoviesTextView.setVisibility(View.INVISIBLE);\n }",
"public void showProgress(){\n loadMainActivity.setVisibility(View.VISIBLE);\n recyclerView.setVisibility(View.INVISIBLE);\n }",
"@Override\n public void onFailure(@NonNull Exception exception) {\n progressDialog.dismiss();\n //and displaying error message\n Toast.makeText(getApplicationContext(), exception.getMessage(), Toast.LENGTH_LONG).show();\n }",
"@Override\r\n public void onFailure(@NonNull Exception exception) {\n progressDialog.dismiss();\r\n\r\n //and displaying error message\r\n Toast.makeText(getApplicationContext(), exception.getMessage(), Toast.LENGTH_LONG).show();\r\n }",
"@Override\n public void onFailure(@NonNull Exception exception) {\n progressDialog.dismiss();\n\n Toast.makeText(getApplicationContext(), exception.getMessage(), Toast.LENGTH_LONG).show();\n }",
"private void uploadingProgressBarInit() {\n uploadingProgressBar.setVisibility(VISIBLE);\n uploadingProgressBar.setProgress(0);\n }",
"@Override\n public void onFailure(@NonNull Exception exception) {\n progressDialog.dismiss();\n Toast.makeText(StudententryActivity.this, \"Image Not Set. Please Try Again....\", Toast.LENGTH_SHORT).show();\n\n }",
"@Override\n public void onClick(View v) {\n\n if(checkbutts != 0) {\n if (imgPath != null && !imgPath.isEmpty()) {\n prgDialog = new ProgressDialog(TabLayout.this);\n prgDialog.setMessage(\"Uploading Image\");\n prgDialog.show();\n // Convert image to String using Base64\n encodeImagetoString();\n // When Image is not selected from Gallery\n } else {\n Toast.makeText(\n getApplicationContext(),\n \"You must select image from gallery before you try to upload\",\n Toast.LENGTH_LONG).show();\n }\n }else{\n Toast.makeText(TabLayout.this, \"Photo must be cropped before uploading\", Toast.LENGTH_LONG)\n .show();\n }\n }",
"@Override\n public void onResponse(JSONArray response) {\n Toast.makeText(getApplicationContext(), \"Berhasil tambah data\" + response, Toast.LENGTH_SHORT).show();\n mProgressBar.setVisibility(View.INVISIBLE);\n }",
"@Override\n protected void onPreExecute() {\n mProgressBar.setVisibility(View.VISIBLE);\n }",
"@Override\n public void hideLoading() {\n if (progressDialog!=null && progressDialog.isShowing()){\n progressDialog.dismiss();\n }\n }",
"@Override\n protected void onPreExecute() {\n super.onPreExecute();\n loading = ProgressDialog.show(AddNewProduct.this, \"Uploading Image\", \"Please wait...\", true, true);\n }",
"@Override\n public void onClick(View view) {\n clearDisplay();\n table.setVisibility(View.INVISIBLE);\n saveButton.setVisibility(View.INVISIBLE);\n cancelButton.setVisibility(View.INVISIBLE);\n Snackbar snackbar = Snackbar.make(view, R.string.cancelled, Snackbar.LENGTH_SHORT);\n snackbar.show();\n }",
"public void onFinish() {\n\n imageView_gif_confeti.setVisibility(View.INVISIBLE);\n }",
"@Override\n public void esconderBarraProgresso(){\n progressbar.setVisibility(View.GONE);\n listView.setVisibility(View.VISIBLE);\n }",
"private void hideProgress() {\n\n if(null != mErrorTextView) {\n mErrorTextView.setVisibility(View.GONE);\n }\n }",
"@Override\n public void onClick(View v) {\n try {\n // new UploadFileToServer().execute();\n\n\t\t\t\t\t\tdialog = ProgressDialog.show(UploadActivity.this, \"\", \"Uploading file...\", true);\n\t\t\t\t\t\tnew Thread(new Runnable() {\n\t\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\t\trunOnUiThread(new Runnable() {\n\t\t\t\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\t\t\t\t//tv.setText(\"uploading started.....\");\n\n\t\t\t\t\t\t\t\t\t\ttxtdescr.setText(\"Uploading Started\");\n\n\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\tint response= uploadFile(\"/sdcard/android_1.png\");\n\t\t\t\t\t\t\t\tSystem.out.println(\"RES : \" + response);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}).start();\n\t\t\t\t\t\t//dialog.setCancelable(true);\n\n\t\t\t\t\t} catch (Exception e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n }",
"public void hideProgressDialog() {\r\n\t\trunOnUiThread(new Runnable() {\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\tif (progress.isShowing())\r\n\t\t\t\t\t\tprogress.dismiss();\r\n\t\t\t\t} catch (Throwable e) {\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}",
"@Override\n public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {\n progressDialog.dismiss();\n\n //and displaying a success toast\n Toast.makeText(getApplicationContext(), \"File Uploaded \", Toast.LENGTH_LONG).show();\n }",
"protected void hideLoader() {\n\n if (progressBar != null) {\n progressBar.setVisibility(View.INVISIBLE);\n }\n if(getActivity()!=null) {\n getActivity().getWindow().clearFlags(WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE);\n }\n\n }",
"@Override\n public void onErrorResponse(VolleyError error) {\n progressDialog.dismiss();\n Toast.makeText(getActivity(), \"An error occured\", Toast.LENGTH_SHORT).show();\n }",
"@Override\n protected void onPreExecute() {\n mProgressbar.setVisibility(View.VISIBLE);\n }",
"@Override\n public void onFailure(@NonNull Exception e) {\n progressDialog.dismiss();\n Toast.makeText(UserProfile.this, \"Error updating Image..\", Toast.LENGTH_SHORT).show();\n\n }",
"public void onTaskComplete(){\n findViewById(R.id.downloadend).setVisibility(View.VISIBLE);\n findViewById(R.id.finito).setBackgroundResource(R.drawable.ok);\n }",
"@Override\r\n public void onPreResponse() {\r\n findViewById(R.id.loader).setVisibility(View.VISIBLE);\r\n findViewById(R.id.mainContainer).setVisibility(View.GONE);\r\n findViewById(R.id.errorText).setVisibility(View.GONE);\r\n\r\n }",
"@Override\n public void onErrorResponse(VolleyError volleyError) {\n loading.dismiss();\n\n //Showing toast\n Toast.makeText(MainActivity.this, volleyError.getMessage().toString(), Toast.LENGTH_LONG).show();\n }",
"@Override\n public void onLoadingComplete(String paramString, View paramView, Bitmap paramBitmap) {\n downloadBookImage.setImageBitmap(paramBitmap);\n downloadBookName.setVisibility(View.GONE);\n }",
"@Override\r\n public void onClick(View v) {\n mPhotoImage.setVisibility(View.GONE);\r\n mCameraButton.setVisibility(View.VISIBLE);\r\n mGallaryButton.setVisibility(View.VISIBLE);\r\n mCameraButton.setEnabled(true);\r\n mGallaryButton.setEnabled(true);\r\n mConfirmButton.setEnabled(false);\r\n mPhotoframeText.setText(R.string.upload_photo_label);\r\n }",
"public void goneProgress(){\n mProgressBar.setVisibility(View.GONE);\n }",
"@Override\n protected void onPreExecute() {\n mLytContainerLayout.setVisibility(View.GONE);\n mToolbar.setVisibility(View.GONE);\n mPrgLoading.setVisibility(View.VISIBLE);\n }",
"@Override\n public void onSuccess(\n UploadTask.TaskSnapshot taskSnapshot) {\n progressDialog.dismiss();\n Toast.makeText(ProfileActivity.this, \"Image Uploaded!!\", Toast.LENGTH_SHORT).show();\n\n }",
"@Override\r\n public void onErrorResponse(VolleyError error) {\n heading.setText(\"Try Again\");\r\n swipeRefreshLayout.setRefreshing(false);\r\n progressBar.setVisibility(View.INVISIBLE);\r\n\r\n rl.setVisibility(View.INVISIBLE);\r\n recyclerView.setVisibility(View.INVISIBLE);\r\n// clearData();\r\n\r\n }",
"@Override\n public void hideProgressBar() {\n if (getActivity() != null) {\n getActivity().runOnUiThread(() -> {\n if (progressBarLayout != null && progressBar != null) {\n progressBar.setVisibility(View.GONE);\n progressBarLayout.setVisibility(View.GONE);\n }\n });\n }\n }",
"public void infoProgressOff (){\n runOnUiThread(new Runnable() {\n @Override\n public void run() {\n if (tabTourInfoBinding.tourInfoProgress.getVisibility() != View.GONE) {\n tabTourInfoBinding.tourInfoProgress.setVisibility(View.GONE);\n }\n if (tabTourInfoBinding.tourInfoLayout.getVisibility() != View.VISIBLE) {\n tabTourInfoBinding.tourInfoLayout.setVisibility(View.VISIBLE);\n }\n }\n });\n }",
"@Override\n\t\t\tpublic void onLoadingCancelled(String imageUri, View view) {\n\t\t\t\tif (progressbar != null)\n\t\t\t\t\tprogressbar.setVisibility(View.GONE);\n\t\t\t}",
"@Override\n protected void onPostExecute(String result) {\n super.onPostExecute(result);\n\n spinner.setVisibility(View.VISIBLE);\n // dialog.dismiss();\n // Do things like hide the progress bar or change a TextView\n }",
"@Override\n public void onSuccess(Void aVoid) {\n pd.setMessage(\"File Deleted ... \");\n Toast.makeText(AddNewNoticeActivity.this, \"Deleted File !!\", Toast.LENGTH_LONG).show();\n\n pd.dismiss();\n\n }",
"@Override\n protected void onPreExecute() {\n if(progressBar != null) progressBar.setProgress(0);\n if(refreshImageButton != null) refreshImageButton.setVisibility(View.INVISIBLE);\n super.onPreExecute();\n }",
"@Override\n protected void onPreExecute() {\n pd = ProgressDialog. show(Evento.this, \"Eliminar Evento\", \"ESPERE UN MOMENTO\");\n pd.setCancelable( false);\n }",
"private void showErrorMessage(){\n mErrorMessageDisplay.setVisibility(View.VISIBLE);\n mGridView.setVisibility(View.INVISIBLE);\n }",
"public void mapImageProgressOff (){\n runOnUiThread(new Runnable() {\n @Override\n public void run() {\n if (tabTourMapImageBinding.tourMapImageProgress.getVisibility() != View.GONE) {\n tabTourMapImageBinding.tourMapImageProgress.setVisibility(View.GONE);\n }\n if (tabTourMapImageBinding.tourMapImageLayout.getVisibility() != View.VISIBLE) {\n tabTourMapImageBinding.tourMapImageLayout.setVisibility(View.VISIBLE);\n }\n }\n });\n }",
"@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tProfile.this.infolay.setVisibility(View.INVISIBLE);\n\t\t\t\tProfile.this.otherlay.setVisibility(View.VISIBLE);\n\t\t\t\tpd = ProgressDialog.show(Profile.this, \"dowloading\", \"dowloading,please wait……\");\n\n\t\t\t\t new Thread(runnableloadportf).start();\n\n\t\t\t\tsm.toggle();\n\t\t\t\t\n\t\t\t}",
"@Override\n\t\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\t\tprogressBar.setVisibility(View.GONE);\n\t\t\t\t\t\t\t}",
"@Override\n\t\t\tpublic void onLoadingFailed(String imageUri, View view, FailReason failReason) {\n\t\t\t\tif (progressbar != null)\n\t\t\t\t\tprogressbar.setVisibility(View.GONE);\n\t\t\t}",
"@Override\n public void hideProgressBar() {\n MainActivity.sInstance.hideProgressBar();\n }",
"@Override\n public void onFailure(@NonNull Exception e) {\n dialog.dismiss();\n //Display err toast msg\n Toast.makeText(getApplicationContext(), e.getMessage(), Toast.LENGTH_SHORT).show();\n }",
"@Override\n public void onLoadingCancelled(String arg0, View arg1) {\n holder.imageView.setVisibility(View.GONE);\n }",
"private void showError() {\n errorTextView.setVisibility(View.VISIBLE);\n errorButton.setVisibility(View.VISIBLE);\n errorButton.setEnabled(true);\n recyclerView.setVisibility(View.INVISIBLE);\n progressBar.setVisibility(View.INVISIBLE);\n noFavoriteMoviesTextView.setVisibility(View.INVISIBLE);\n }",
"private void handleExternalStorageState() {\n\t\tfinal TextView externalStorageGoneView = (TextView) findViewById(R.id.TextViewExternalStorageInaccessible);\n\t\tif (ExternalStorageState.getInstance().isExternalStorageReadable()) {\n\t\t\texternalStorageGoneView.setVisibility(View.GONE);\n\t\t} else {\n\t\t\texternalStorageGoneView.setVisibility(View.VISIBLE);\n\t\t}\n\t}",
"@Override\n public void onCompleted(Exception e,\n String result) {\n\n if (result.contains(\"-1\")) {\n filename_server = \"-1\";\n bar.setVisibility(View.GONE);\n Toast.makeText(context, \"Error Uploading File\", Toast.LENGTH_LONG).show();\n }\n else {\n\n Toast.makeText(context, \"File Uploaded\", Toast.LENGTH_LONG).show();\n bar.setVisibility(View.GONE);\n filename_server = result;\n\n\n String type = \"\", title = \"\", qari_id = \"\", desc = \"\", tags = \"\", surahs = \"\", download, atype = \"2\", ayahto = \"\", ayahfrom = \"\";\n CheckBox ck = (CheckBox) rootView.findViewById(R.id.is_downloadable);\n if (ck.isChecked()) {\n download = \"down\";\n } else {\n download = \"1\";\n }\n EditText et = (EditText) rootView.findViewById(R.id.et_file_name);\n title = et.getText().toString();\n et = (EditText) rootView.findViewById(R.id.et_upload_file_description);\n desc = et.getText().toString();\n et = (EditText) rootView.findViewById(R.id.et_upload_file_tags);\n tags = et.getText().toString();\n Spinner sp = (Spinner) rootView.findViewById(R.id.select_qari_to_upload);\n qari_id = reciters.get(sp.getSelectedItemPosition()).getId();\n\n RadioButton rb = (RadioButton) rootView.findViewById(R.id.Quran);\n if (rb.isChecked()) {\n type = \"3\";\n }\n rb = (RadioButton) rootView.findViewById(R.id.ayah);\n if (rb.isChecked()) {\n type = \"6\";\n }\n rb = (RadioButton) rootView.findViewById(R.id.surah);\n if (rb.isChecked()) {\n type = \"1\";\n }\n rb = (RadioButton) rootView.findViewById(R.id.juzz);\n if (rb.isChecked()) {\n type = \"4\";\n }\n if (!type.equals(\"3\") && selected.size() == 0) {\n new GenericDialogBox(context, \"Please Select Verse/Surah/Juz for the uploaded file.\", \"\", \"Alert\");\n b1.setEnabled(true);\n return;\n }\n if (!type.equals(\"3\")) {\n StringBuilder sb = new StringBuilder();\n StringBuilder sb1 = new StringBuilder();\n StringBuilder sb2 = new StringBuilder();\n for (int i = 0; i < selected.size(); i++) {\n if (i == selected.size() - 1) {\n if (type.equals(\"6\")) {\n sb1.append(selected_ayah_from.get(i));\n sb2.append(selected_ayah_to.get(i));\n }\n sb.append(selected.get(i));\n\n } else {\n if (type.equals(\"6\")) {\n sb1.append(selected_ayah_from.get(i)).append(\",\");\n sb2.append(selected_ayah_to.get(i)).append(\",\");\n }\n\n sb.append(selected.get(i)).append(\",\");\n }\n }\n int size = UploadFragment.selected.size();\n for (int i = 0; i < size; i++) {\n selected.remove(0);\n if (type.equals(\"6\")) {\n selected_ayah_from.remove(0);\n selected_ayah_to.remove(0);\n }\n }\n surahs = sb.toString();\n ayahfrom = sb1.toString();\n ayahto = sb2.toString();\n }\n\n if (!StringValidator.lengthValidator(context, title, 0,500, \"Title\")) {\n b1.setEnabled(true);\n return;\n }\n if (!StringValidator.lengthValidator(context, desc, 0, 500, \"Description\")) {\n b1.setEnabled(true);\n return;\n }\n if (!StringValidator.lengthValidator(context, tags, 0, 100, \"Tags\")) {\n b1.setEnabled(true);\n return;\n }\n ASyncRequest obj = new ASyncRequest(context, \"addTrackEntry\");\n try {\n List<BasicNameValuePair> params = new ArrayList<BasicNameValuePair>();\n params.add(new BasicNameValuePair(\"type\", type));\n params.add(new BasicNameValuePair(\"title\", title));\n params.add(new BasicNameValuePair(\"qari\", qari_id));\n params.add(new BasicNameValuePair(\"tags\", tags));\n params.add(new BasicNameValuePair(\"desc\", desc));\n params.add(new BasicNameValuePair(\"downloadable\", download));\n params.add(new BasicNameValuePair(\"path\", filename_server));\n if (selectedImageUri != null && imagepath_server != null && !imagepath_server.isEmpty()) {\n params.add(new BasicNameValuePair(\"image\", imagepath_server));\n } else {\n params.add(new BasicNameValuePair(\"image\", \"default.gif\"));\n }\n params.add(new BasicNameValuePair(\"duration\", \"00:11:00\"));\n params.add(new BasicNameValuePair(\"surah\", surahs));\n if (type.equals(\"6\")) {\n params.add(new BasicNameValuePair(\"atype\", atype));\n params.add(new BasicNameValuePair(\"ayah_from\", ayahfrom));\n params.add(new BasicNameValuePair(\"ayah_to\", ayahto));\n }\n String res = obj.execute(params).get();\n if (res.equals(\"1\")) {\n new GenericDialogBox(context, \"Uploaded File Saved.\", \"\", \"Alert\");\n mng.popBackStack();\n } else {\n new GenericDialogBox(context, \"There was an error saving file.\", \"\", \"Alert\");\n mng.popBackStack();\n }\n } catch (InterruptedException e1) {\n // TODO Auto-generated catch\n // block\n e1.printStackTrace();\n } catch (ExecutionException e1) {\n // TODO Auto-generated catch\n // block\n e1.printStackTrace();\n }\n }\n\n // //////////////////////////////\n\n\n }",
"protected void dismissLoading()\n {\n progressBar.dismiss();\n }",
"@Override\n public void onSuccess(Void aVoid) {\n progressDialog.dismiss();\n Toast.makeText(UserProfile.this, \"Image Updated..\", Toast.LENGTH_SHORT).show();\n }",
"@Override\r\n public void onErrorResponse(VolleyError error) {\n progressBar.setVisibility(View.INVISIBLE);\r\n Toast.makeText(getApplicationContext(),\"EMAIL NOT REGISTERED\", Toast.LENGTH_LONG).show();\r\n }",
"@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tProfile.this.infolay.setVisibility(View.INVISIBLE);\n\t\t\t\tProfile.this.otherlay.setVisibility(View.VISIBLE);\n\t\t\t\tpd = ProgressDialog.show(Profile.this, \"dowloading\", \"dowloading,please wait……\");\n\n\t\t\t\t new Thread(runnableplaylist).start();\n\n\t\t\t\t\n\t\t\t\tsm.toggle();\n\t\t\t\t\n\t\t\t}",
"private void displayLoader() {\n pDialog = new ProgressDialog(AddReviewActivity.this);\n pDialog.setMessage(\"Adding Review...Please wait...\");\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n\n }",
"@Override\n\t\tprotected void onPreExecute() {\n\t\t\tloadingView.setVisibility(View.VISIBLE);\n\t\t}",
"@Override\n public void onErrorResponse(VolleyError volleyError) {\n loading.dismiss();\n\n //Showing toast\n //Toast.makeText(PreviewActivity.this, volleyError.getMessage().toString(), Toast.LENGTH_LONG).show();\n Toast.makeText(PreviewActivity.this, \"Error\", Toast.LENGTH_LONG).show();\n }",
"@Override\n\t\t\t\t\tpublic void onError(VolleyError error) {\n\t\t\t\t\t\tToast.makeText(getActivity(), \"加载数据失败!\",Toast.LENGTH_SHORT).show();\n\t\t\t\t\t\tnodata.setVisibility(View.VISIBLE);\n\t\t\t\t\t\tlistview.setVisibility(View.GONE);\n\t\t\t\t\t\tcustomProgressDialog.dismiss();\n\t\t\t\t\t}",
"@Override\n protected void onPreExecute() {\n examsActivity.findViewById(R.id.pbLoadingExamsList).setVisibility(View.VISIBLE);\n examsActivity.findViewById(R.id.btnAddExam).setVisibility(View.GONE);\n examsActivity.findViewById(R.id.lvExams).setVisibility(View.GONE);\n }",
"@Override\n public void onErrorResponse(VolleyError error) {\n loading.dismiss();\n Toast.makeText(feeds.this,\"An unexpected error occurred\",Toast.LENGTH_LONG).show();\n\n }",
"@Override\n public void hiddenLoading() {\n Log.i(Tag, \"hiddenLoading\");\n }",
"@Override\n public void onCancelled(DatabaseError databaseError) {\n DialogManager.hideProgress();\n\n }",
"public void infoProgressOn (){\n runOnUiThread(new Runnable() {\n @Override\n public void run() {\n if (tabTourInfoBinding.tourInfoProgress.getVisibility() != View.VISIBLE) {\n tabTourInfoBinding.tourInfoProgress.setVisibility(View.VISIBLE);\n }\n if (tabTourInfoBinding.tourInfoLayout.getVisibility() != View.GONE) {\n tabTourInfoBinding.tourInfoLayout.setVisibility(View.GONE);\n }\n }\n });\n }",
"private void showNoFavoriteMoviesTextView(){\n errorTextView.setVisibility(View.INVISIBLE);\n errorButton.setVisibility(View.INVISIBLE);\n errorButton.setEnabled(false);\n recyclerView.setVisibility(View.INVISIBLE);\n progressBar.setVisibility(View.INVISIBLE);\n noFavoriteMoviesTextView.setVisibility(View.VISIBLE);\n }",
"@Override\n\t\t\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tll.setDrawingCacheEnabled(true);\n\t\t\t\t\t\t\t\tBitmap b = ll.getDrawingCache();\n\t\t\t\t\t\t\t\tb.compress(\n\t\t\t\t\t\t\t\t\t\tCompressFormat.JPEG,\n\t\t\t\t\t\t\t\t\t\t95,\n\t\t\t\t\t\t\t\t\t\tnew FileOutputStream(\n\t\t\t\t\t\t\t\t\t\t\t\tEnvironment\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getExternalStoragePublicDirectory(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tEnvironment.DIRECTORY_PICTURES)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getPath()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ File.separator\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ \"image.jpg\"));\n\t\t\t\t\t\t\t\tfile=new File(Environment\n\t\t\t\t\t\t\t\t\t\t.getExternalStoragePublicDirectory(\n\t\t\t\t\t\t\t\t\t\t\t\tEnvironment.DIRECTORY_PICTURES)\n\t\t\t\t\t\t\t\t\t\t.getPath()\n\t\t\t\t\t\t\t\t\t\t+ File.separator\n\t\t\t\t\t\t\t\t\t\t+ \"image.jpg\");\n\t\t\t\t\t\t\t\tdialog.dismiss();\n\t\t\t\t\t\t\t\t pd = ProgressDialog.show(getActivity(), \"Working..\", \"Uploading Item\", true,\n\t\t\t\t false);\n\t\t\t\t\t\t\t\t try\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t entity=new MultipartEntity();\n\t\t\t\t\t\t\t\t\tentity.addPart(\"days\",new StringBody( days.getText().toString()));\n\t\t\t\t\t\t\t\t\tentity.addPart(\"id\", new StringBody( idItems.get(spinner2.getSelectedItemPosition())));\n\t\t\t\t\t\t\t\t\tentity.addPart(\"title\", new StringBody(title.getText().toString()));\n\t\t\t\t\t\t\t\t\tentity.addPart(\"desc\", new StringBody(desc.getText().toString()));\n\t\t\t\t\t\t\t\t\tentity.addPart(\"advertype\", new StringBody(B2BUtils.getUser().getUsertype()));\n\t\t\t\t\t\t\t\t\tentity.addPart(\"catid\", new StringBody(B2BUtils.categoryId.get(B2BUtils.categoryNames.indexOf(spinner1.getSelectedItem().toString().toUpperCase(Locale.getDefault())))));\n\t\t\t\t\t\t\t\t\tSystem.out.println((B2BUtils.categoryId.get(B2BUtils.categoryNames.indexOf(spinner1.getSelectedItem().toString().toUpperCase(Locale.getDefault())))));\n\t\t\t\t\t\t\t\t\tThread t=new Uploader(file, url, handler, entity);\n\t\t\t\t\t\t\t\t\tt.start();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tcatch(Exception e)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tLog.d(\"Error\", e.toString());\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\t\t\tSystem.out.println(e);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}",
"private void hideProgressIndicator() {\n setProgressBarIndeterminateVisibility(false);\n setProgressBarIndeterminate(false);\n }",
"@Override\n\t\t\tpublic void onLoadingComplete(String imageUri, View view, Bitmap loadedImage) {\n\t\t\t\tif (progressbar != null)\n\t\t\t\t\tprogressbar.setVisibility(View.GONE);\n\t\t\t}",
"private void hideSave() {\n\t\tButton saveButton = (Button) findViewById(R.id.b_recipeSave);\n\t\tsaveButton.setVisibility(4);\n\t}",
"@Override\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\tprogressBar.setVisibility(View.GONE);\n\t\t\t\t\t}",
"@Override\n public void run() {\n confirmImage.setVisibility(View.GONE);\n activity.replaceFragment(new Fragment_Buyer_Orders());\n\n }",
"private void hideEditDelete() {\n\t\tButton editButton = (Button) findViewById(R.id.b_recipeEdit);\n\t\tButton deleteButton = (Button) findViewById(R.id.b_recipeDelete);\n\t\teditButton.setVisibility(4);\n\t\tdeleteButton.setVisibility(4);\n\t}",
"public void hideProgress() {\n search_progress.setVisibility(View.GONE);\n img_left_action.setAlpha(0.0f);\n img_left_action.setVisibility(View.VISIBLE);\n ObjectAnimator.ofFloat(img_left_action, \"alpha\", 0.0f, 1.0f).start();\n }",
"@Override\n protected void onPreExecute() {\n pb.setVisibility(View.VISIBLE);\n }",
"@Override\n public void onClick(View v) {\n\n dialog = ProgressDialog.show(MainActivity.this, \"\", \"Uploading file...\", true);\n new Thread(new Runnable() {\n public void run() {\n\n uploadFile(pictureFile.getAbsolutePath());\n\n }\n }).start();\n\n }",
"@Override\n\t \t\tprotected void onPostExecute(Void result) {\n\t \t\t\tlistView.setVisibility(View.INVISIBLE);\n\t \t\t\tToast.makeText(getActivity(),\n\t \t\t\t\t\tgetResources().getString(R.string.saved),\n\t \t\t\t\t\tToast.LENGTH_LONG).show();\n\t \t\t\tupdate.setVisibility(View.VISIBLE);\n\t \t\t\tupdate.setText(getResources().getString(R.string.saved));\n\t \t\t\tmProgressDialog.dismiss();\n\t \t\t}",
"public void stopLoadAnim() {\n avi.smoothToHide();\n loadTv.setVisibility(View.INVISIBLE);\n loginContainer.setVisibility(View.VISIBLE);\n }",
"private void startProgressBar() {\n\t b_buscar.setVisibility(View.GONE);\n\t // wi_progreso.setVisibility(View.VISIBLE);\n\t ly_progreso.setVisibility(View.VISIBLE);\n\t}",
"private void showLoading() {\n hideNoNetwork();\n mRecipesBinding.fragmentRecipesProgressBar.setVisibility(View.VISIBLE);\n }",
"@Override\r\n\tprotected void onPreExecute() {\r\n\t\t// TODO Auto-generated method stub\r\n\t\tsuper.onPreExecute();\r\n\r\n\t\tif (this.ti != null) {\r\n\t\t\t\r\n\t\t\t// debug\r\n\t\t\tToast.makeText(actv, \"Uploading file: \" + ti.getFile_name(), Toast.LENGTH_LONG).show();\r\n\t\t\t\r\n\t\t} else {//if (this.ti != null)\r\n\r\n\t\t\t// debug\r\n\t\t\tToast.makeText(actv, \"Uploading file\", Toast.LENGTH_LONG).show();\r\n\t\t\t\r\n\t\t}//if (this.ti != null)\r\n\t\t\r\n\t}",
"private void hideLoading()\n {\n relLoadingPanel.setVisibility(View.GONE);\n ViewHelper.setViewGroupEnabled(scrMainContainer, true);\n }",
"@Override\n public void onFailure(@NonNull Exception e) {\n Toast.makeText(getApplicationContext(), e.getMessage(), Toast.LENGTH_SHORT).show();\n pd.dismiss();\n }",
"public void showUpload(){\n\n }",
"public void mapImageProgressOn (){\n runOnUiThread(new Runnable() {\n @Override\n public void run() {\n if (tabTourMapImageBinding.tourMapImageProgress.getVisibility() != View.VISIBLE) {\n tabTourMapImageBinding.tourMapImageProgress.setVisibility(View.VISIBLE);\n }\n if (tabTourMapImageBinding.tourMapImageLayout.getVisibility() != View.GONE) {\n tabTourMapImageBinding.tourMapImageLayout.setVisibility(View.GONE);\n }\n }\n });\n }",
"@Override\r\n public void beforeTaskComplete() {\r\n if (recyclerView.getChildCount() < 1) {\r\n recyclerView.setVisibility(View.GONE);\r\n }\r\n progressBar.setVisibility(View.VISIBLE);\r\n }",
"public void hideDownloadProgressDialog()\n {\n if(mDownloadProgress != null)\n {\n mDownloadProgress.dismiss();\n }\n mDownloadProgress = null;\n }",
"@Override\n protected void onPreExecute() {\n mRecyclerView.startAnimation(fade_out);\n mRecyclerView.setVisibility(View.INVISIBLE);\n progressBar.startAnimation(fade_in2);\n progressBar.setVisibility(View.VISIBLE);\n }",
"private void showIndicator() {\n mProgressBarHolder.setVisibility(View.VISIBLE);\n mEmailView.setFocusableInTouchMode(false);\n mEmailView.setFocusable(false);\n mEmailView.setEnabled(false);\n mPasswordView.setFocusableInTouchMode(false);\n mPasswordView.setFocusable(false);\n mPasswordView.setEnabled(false);\n mRegister.setEnabled(false);\n mEmailSignInButton.setEnabled(false);\n }",
"@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\t//progreso.setVisibility(View.VISIBLE);\n\t\t\tsetProgressBarIndeterminateVisibility(true);\n\t\t}",
"@Override\n\t protected void onPreExecute() {\n\t super.onPreExecute();\n\t //this method will be running on UI thread\n\t mProgressBar.setVisibility(View.VISIBLE);\n\t }"
] | [
"0.7263892",
"0.70255786",
"0.69648653",
"0.6918108",
"0.69139844",
"0.68907183",
"0.67849517",
"0.67284185",
"0.67284185",
"0.67284185",
"0.67284185",
"0.67284185",
"0.6712109",
"0.6695342",
"0.66833395",
"0.668025",
"0.6636928",
"0.662521",
"0.66181517",
"0.6608308",
"0.65817624",
"0.65609056",
"0.6518369",
"0.6491599",
"0.6490994",
"0.64746606",
"0.6473261",
"0.64705247",
"0.64612377",
"0.64493644",
"0.6439466",
"0.6425504",
"0.6423545",
"0.6421279",
"0.6420618",
"0.6385704",
"0.63847786",
"0.63738304",
"0.6370316",
"0.6357787",
"0.6350464",
"0.63496166",
"0.6346445",
"0.6298499",
"0.6292591",
"0.6289623",
"0.6280883",
"0.62750554",
"0.6271165",
"0.62682366",
"0.6268064",
"0.6266056",
"0.6249258",
"0.6241903",
"0.6236762",
"0.6230274",
"0.6220697",
"0.62166804",
"0.62069523",
"0.62068623",
"0.62038827",
"0.61977315",
"0.6196268",
"0.6190181",
"0.6189636",
"0.6174834",
"0.61714804",
"0.61696213",
"0.61674786",
"0.6165243",
"0.6161048",
"0.6160505",
"0.61531043",
"0.61508197",
"0.61501825",
"0.61487544",
"0.61471415",
"0.613982",
"0.6138762",
"0.6137255",
"0.6135633",
"0.61349815",
"0.6125653",
"0.61241937",
"0.6121984",
"0.6115282",
"0.6112171",
"0.6109103",
"0.610475",
"0.6100461",
"0.6098972",
"0.6098119",
"0.60979414",
"0.60938305",
"0.6090454",
"0.6089321",
"0.6087934",
"0.6085437",
"0.6085021",
"0.6083786",
"0.60836816"
] | 0.0 | -1 |
layout_loading.setVisibility(View.GONE); Toast.makeText(getApplicationContext(), "Upload Cancelled", Toast.LENGTH_LONG).show(); | @Override
public void run()
{
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n public void onFailure(@NonNull Exception e) {\n Toast.makeText(MainActivity.this, \"Error\", Toast.LENGTH_SHORT).show();\r\n hideProgress();\r\n }",
"private void hideLoadingAndUpdate() {\n image.setVisibility(View.VISIBLE);\n loadingBar.setVisibility(View.INVISIBLE);\n shareBtn.setVisibility(shareBtnVisibility);\n\n }",
"@Override\n protected void onPreExecute() {\n mProgressBar.setVisibility(View.VISIBLE);\n }",
"@Override\n\t\tprotected void onPreExecute() {\n\t\t\tloadingView.setVisibility(View.VISIBLE);\n\t\t}",
"@Override\n public void hideLoading() {\n if (progressDialog!=null && progressDialog.isShowing()){\n progressDialog.dismiss();\n }\n }",
"@Override\n protected void onPreExecute() {\n mProgressbar.setVisibility(View.VISIBLE);\n }",
"public void showProgress(){\n loadMainActivity.setVisibility(View.VISIBLE);\n recyclerView.setVisibility(View.INVISIBLE);\n }",
"protected void hideLoader() {\n\n if (progressBar != null) {\n progressBar.setVisibility(View.INVISIBLE);\n }\n if(getActivity()!=null) {\n getActivity().getWindow().clearFlags(WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE);\n }\n\n }",
"@Override\n public void onErrorResponse(VolleyError error) {\n Log.e(\"response is:\", error.toString());\n progressBar.setVisibility(View.GONE);\n }",
"@Override\n public void onErrorResponse(VolleyError volleyError) {\n loading.dismiss();\n //Showing toast\n //Toast.makeText(getActivity(), volleyError.getMessage().toString(), Toast.LENGTH_LONG).show();\n Toast.makeText(AdQuestionActivity.this, \"Upload Error! \"+volleyError.getMessage().toString(), Toast.LENGTH_LONG).show();\n }",
"@Override\n protected void onPreExecute() {\n mLytContainerLayout.setVisibility(View.GONE);\n mToolbar.setVisibility(View.GONE);\n mPrgLoading.setVisibility(View.VISIBLE);\n }",
"@Override\r\n public void onPreResponse() {\r\n findViewById(R.id.loader).setVisibility(View.VISIBLE);\r\n findViewById(R.id.mainContainer).setVisibility(View.GONE);\r\n findViewById(R.id.errorText).setVisibility(View.GONE);\r\n\r\n }",
"@Override\n public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {\n progressDialog.hide();\n Toast.makeText(UserInfoForm.this, \"Upload Successful\", Toast.LENGTH_SHORT).show();\n }",
"@Override\n public void onErrorResponse(VolleyError volleyError) {\n loading.dismiss();\n\n //Showing toast\n Toast.makeText(imageUpload.this, \"Silakan cek koneksi anda\", Toast.LENGTH_LONG).show();\n }",
"@Override\n\t\t\tpublic void onLoadingCancelled(String imageUri, View view) {\n\t\t\t\tif (progressbar != null)\n\t\t\t\t\tprogressbar.setVisibility(View.GONE);\n\t\t\t}",
"private void uploadingProgressBarInit() {\n uploadingProgressBar.setVisibility(VISIBLE);\n uploadingProgressBar.setProgress(0);\n }",
"@Override\n\tprotected void onPreExecute() {\n\t\tprogressBar.setVisibility(View.VISIBLE);\n\t\ttv.setVisibility(View.VISIBLE);\n\t\tsuper.onPreExecute();\n\t}",
"private void showNothing(){\n errorTextView.setVisibility(View.INVISIBLE);\n errorButton.setVisibility(View.INVISIBLE);\n errorButton.setEnabled(false);\n recyclerView.setVisibility(View.INVISIBLE);\n progressBar.setVisibility(View.INVISIBLE);\n noFavoriteMoviesTextView.setVisibility(View.INVISIBLE);\n }",
"private void displayLoader() {\n pDialog = new ProgressDialog(AddReviewActivity.this);\n pDialog.setMessage(\"Adding Review...Please wait...\");\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n\n }",
"@Override\n public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {\n progressDialog.dismiss();\n\n //and displaying a success toast\n Toast.makeText(getApplicationContext(), \"File Uploaded \", Toast.LENGTH_LONG).show();\n // picup =true;\n }",
"private void hideLoading()\n {\n relLoadingPanel.setVisibility(View.GONE);\n ViewHelper.setViewGroupEnabled(scrMainContainer, true);\n }",
"@Override\n protected void onPreExecute() {\n super.onPreExecute();\n settLoadingScr.setVisibility(View.VISIBLE);\n\n }",
"@Override\n protected void onPreExecute() {\n super.onPreExecute();\n settLoadingScr.setVisibility(View.VISIBLE);\n\n }",
"private void hideProgress() {\n\n if(null != mErrorTextView) {\n mErrorTextView.setVisibility(View.GONE);\n }\n }",
"protected void showLoader() {\n if (progressBar != null) {\n progressBar.setVisibility(View.VISIBLE);\n }\n if(getActivity()!=null) {\n getActivity().getWindow().setFlags(WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE,\n WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE);\n }\n }",
"@Override\n public void onFailure(@NonNull Exception exception) {\n progressDialog.dismiss();\n\n //and displaying error message\n Toast.makeText(getApplicationContext(), exception.getMessage(), Toast.LENGTH_LONG).show();\n }",
"@Override\n public void onFailure(@NonNull Exception exception) {\n progressDialog.dismiss();\n\n //and displaying error message\n Toast.makeText(getApplicationContext(), exception.getMessage(), Toast.LENGTH_LONG).show();\n }",
"@Override\n public void onFailure(@NonNull Exception exception) {\n progressDialog.dismiss();\n\n //and displaying error message\n Toast.makeText(getApplicationContext(), exception.getMessage(), Toast.LENGTH_LONG).show();\n }",
"@Override\n public void onFailure(@NonNull Exception exception) {\n progressDialog.dismiss();\n\n //and displaying error message\n Toast.makeText(getApplicationContext(), exception.getMessage(), Toast.LENGTH_LONG).show();\n }",
"@Override\n public void onFailure(@NonNull Exception exception) {\n progressDialog.dismiss();\n\n //and displaying error message\n Toast.makeText(getApplicationContext(), exception.getMessage(), Toast.LENGTH_LONG).show();\n }",
"@Override\n\t\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\t\tprogressBar.setVisibility(View.GONE);\n\t\t\t\t\t\t\t}",
"@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\t//progreso.setVisibility(View.VISIBLE);\n\t\t\tsetProgressBarIndeterminateVisibility(true);\n\t\t}",
"protected void dismissLoading()\n {\n progressBar.dismiss();\n }",
"public void onFinish() {\n\n imageView_gif_confeti.setVisibility(View.INVISIBLE);\n }",
"@Override\n public void onFailure(@NonNull Exception exception) {\n progressDialog.dismiss();\n //and displaying error message\n Toast.makeText(getApplicationContext(), exception.getMessage(), Toast.LENGTH_LONG).show();\n }",
"@Override\n protected void onPreExecute() {\n super.onPreExecute();\n showProgressDialog(R.string.please_wait);\n //showDialog(progress_bar_type);\n }",
"@Override\n protected void onPreExecute() {\n pDialog = new ProgressDialog(getActivity());\n pDialog.setMessage(\"Please wait...\");\n pDialog.setCancelable(false);\n pDialog.setIndeterminate(false);\n pDialog.setMax(100);\n pDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);\n pDialog.show();\n// progressBar.setVisibility(View.VISIBLE);\n// progressBar.setProgress(0);\n super.onPreExecute();\n }",
"public void hideProgressDialog() {\r\n\t\trunOnUiThread(new Runnable() {\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\tif (progress.isShowing())\r\n\t\t\t\t\t\tprogress.dismiss();\r\n\t\t\t\t} catch (Throwable e) {\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}",
"@Override\n protected void onPreExecute() {\n pb.setVisibility(View.VISIBLE);\n }",
"@Override\n public void onErrorResponse(VolleyError volleyError) {\n loading.dismiss();\n\n //Showing toast\n Toast.makeText(MainActivity.this, volleyError.getMessage().toString(), Toast.LENGTH_LONG).show();\n }",
"@Override\r\n public void onFailure(@NonNull Exception exception) {\n progressDialog.dismiss();\r\n\r\n //and displaying error message\r\n Toast.makeText(getApplicationContext(), exception.getMessage(), Toast.LENGTH_LONG).show();\r\n }",
"private void showLoading() {\n hideNoNetwork();\n mRecipesBinding.fragmentRecipesProgressBar.setVisibility(View.VISIBLE);\n }",
"@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\t//\t\t\tmProgress.setVisibility(View.VISIBLE);\n\t\t}",
"@Override\n protected void onPreExecute() {\n super.onPreExecute();\n\n /*mProgress.setMessage(\"Please Wait\");\n mProgress.show();\n mProgress.setCancelable(false);*/\n }",
"public void goneProgress(){\n mProgressBar.setVisibility(View.GONE);\n }",
"public void showLoading() {\n loadingLayout.setVisibility(View.VISIBLE);\n mapView.setVisibility(View.GONE);\n errorLayout.setVisibility(View.GONE);\n }",
"@Override\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\tprogressBar.setVisibility(View.GONE);\n\t\t\t\t\t}",
"@Override\n public void hideProgressBar() {\n if (getActivity() != null) {\n getActivity().runOnUiThread(() -> {\n if (progressBarLayout != null && progressBar != null) {\n progressBar.setVisibility(View.GONE);\n progressBarLayout.setVisibility(View.GONE);\n }\n });\n }\n }",
"private void displayLoader() {\n pDialog = new ProgressDialog(RegisterActivity.this);\n pDialog.setMessage(\"Signing Up.. Please wait...\");\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n\n }",
"@Override\n\t protected void onPreExecute() {\n\t super.onPreExecute();\n\t //this method will be running on UI thread\n\t mProgressBar.setVisibility(View.VISIBLE);\n\t }",
"@Override\n protected void onPreExecute() {\n progressDialog= new ProgressDialog(getActivity());\n progressDialog.setMessage(\"loading..\");\n progressDialog.setIndeterminate(false);\n progressDialog.show();\n }",
"@Override\n protected void onPreExecute() {\n super.onPreExecute();\n loading = ProgressDialog.show(AddNewProduct.this, \"Uploading Image\", \"Please wait...\", true, true);\n }",
"private void showLoading()\n {\n relLoadingPanel.setVisibility(View.VISIBLE);\n ViewHelper.setViewGroupEnabled(scrMainContainer, false);\n }",
"@Override\n protected void onPreExecute() {\n super.onPreExecute();\n progress.setVisibility(ProgressBar.VISIBLE);\n }",
"@Override\n protected void onPreExecute() {\n super.onPreExecute();\n\n /* mProgress.setMessage(\"Please Wait\");\n mProgress.setCancelable(false);\n mProgress.show();*/\n String msg = \"Please Wait....\";\n cd.showProgressDialog(msg);\n }",
"@Override\n protected void onPreExecute() {\n if(progressBar != null) progressBar.setProgress(0);\n if(refreshImageButton != null) refreshImageButton.setVisibility(View.INVISIBLE);\n super.onPreExecute();\n }",
"@Override\n public void hiddenLoading() {\n Log.i(Tag, \"hiddenLoading\");\n }",
"public void onTaskComplete(){\n findViewById(R.id.downloadend).setVisibility(View.VISIBLE);\n findViewById(R.id.finito).setBackgroundResource(R.drawable.ok);\n }",
"@Override\n public void onFailure(@NonNull Exception exception) {\n progressDialog.dismiss();\n\n Toast.makeText(getApplicationContext(), exception.getMessage(), Toast.LENGTH_LONG).show();\n }",
"@Override\n\t\t\tpublic void onLoadingComplete(String imageUri, View view, Bitmap loadedImage) {\n\t\t\t\tif (progressbar != null)\n\t\t\t\t\tprogressbar.setVisibility(View.GONE);\n\t\t\t}",
"@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\tprogressLayout.setVisibility(View.VISIBLE);\n\n\t\t}",
"private void showProgressDialog(){\n progressDialog=ProgressDialog.show(context,\"\",\"Loading...Please wait...\");\n\n\n }",
"@Override\n\t\t\tpublic void onLoadingFailed(String imageUri, View view, FailReason failReason) {\n\t\t\t\tif (progressbar != null)\n\t\t\t\t\tprogressbar.setVisibility(View.GONE);\n\t\t\t}",
"@Override\n protected void onStartLoading() {\n progressBar.setVisibility(View.VISIBLE);\n forceLoad();\n }",
"@Override\n protected void onPostExecute(String result) {\n super.onPostExecute(result);\n\n spinner.setVisibility(View.VISIBLE);\n // dialog.dismiss();\n // Do things like hide the progress bar or change a TextView\n }",
"@Override\n protected void onPreExecute() {\n super.onPreExecute();\n mLoadingIndicator.setVisibility(View.VISIBLE);\n }",
"private void showProgressIndicator() {\n setProgressBarIndeterminateVisibility(true);\n setProgressBarIndeterminate(true);\n }",
"@Override\n protected void onPreExecute() {\n showLoadingProgressDialog();\n }",
"@Override\n protected void onPreExecute() {\n showLoadingProgressDialog();\n }",
"public void stopLoadAnim() {\n avi.smoothToHide();\n loadTv.setVisibility(View.INVISIBLE);\n loginContainer.setVisibility(View.VISIBLE);\n }",
"private void hideProgressIndicator() {\n setProgressBarIndeterminateVisibility(false);\n setProgressBarIndeterminate(false);\n }",
"private void showIndicator() {\n mProgressBarHolder.setVisibility(View.VISIBLE);\n mEmailView.setFocusableInTouchMode(false);\n mEmailView.setFocusable(false);\n mEmailView.setEnabled(false);\n mPasswordView.setFocusableInTouchMode(false);\n mPasswordView.setFocusable(false);\n mPasswordView.setEnabled(false);\n mRegister.setEnabled(false);\n mEmailSignInButton.setEnabled(false);\n }",
"private void startProgressBar() {\n\t b_buscar.setVisibility(View.GONE);\n\t // wi_progreso.setVisibility(View.VISIBLE);\n\t ly_progreso.setVisibility(View.VISIBLE);\n\t}",
"public void showCustomLoadingDialog() {\n\n //..show gif\n viewDialog.showDialog();\n final Handler handler = new Handler();\n handler.postDelayed(new Runnable() {\n @Override\n public void run() {\n //...here i'm waiting 5 seconds before hiding the custom dialog\n //...you can do whenever you want or whenever your work is done\n viewDialog.hideDialog();\n }\n }, 1000);\n }",
"@Override\n\t\tprotected void onPreExecute() {\n\t\t\tlinlaHeaderProgress.setVisibility(View.VISIBLE);\n\t\t}",
"private void displayLoader() {\n pDialog = new ProgressDialog(DangKyActivity.this);\n pDialog.setMessage(\"Vui lòng đợi trong giây lát...\");\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n\n }",
"private void showLoading() {\n mRecycleView.setVisibility(View.INVISIBLE);\n /* Finally, show the loading indicator */\n mLoadingIndicator.setVisibility(View.VISIBLE);\n }",
"@Override\n\t\tprotected void onPreExecute() {\n\t\t\tloadingAlert.show();\n\t\t}",
"private void displayProgressDialog() {\n pDialog.setMessage(\"Logging in.. Please wait...\");\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n\n }",
"@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tProfile.this.infolay.setVisibility(View.INVISIBLE);\n\t\t\t\tProfile.this.otherlay.setVisibility(View.VISIBLE);\n\t\t\t\tpd = ProgressDialog.show(Profile.this, \"dowloading\", \"dowloading,please wait……\");\n\n\t\t\t\t new Thread(runnableloadportf).start();\n\n\t\t\t\tsm.toggle();\n\t\t\t\t\n\t\t\t}",
"@Override\n public void onFailure(@NonNull Exception exception) {\n progressDialog.dismiss();\n Toast.makeText(StudententryActivity.this, \"Image Not Set. Please Try Again....\", Toast.LENGTH_SHORT).show();\n\n }",
"@Override\n\tprotected void onPreExecute() {\n\t\tsuper.onPreExecute();\n\t\tmDialog = new ProgressDialog(mContext);\n\t\tmDialog.setTitle(\"Please wait\");\n\t\tmDialog.setMessage(\"Uploading prescription image..\");\n\t\tmDialog.setCancelable(false);\n\t\tmDialog.show();\n\t}",
"@Override\n protected void onPreExecute() {\n\n pd.setMessage(\"Please Wait....\");\n pd.show();\n pd.setCancelable(false);\n\n }",
"@Override\n public void onLoadingComplete(String paramString, View paramView, Bitmap paramBitmap) {\n downloadBookImage.setImageBitmap(paramBitmap);\n downloadBookName.setVisibility(View.GONE);\n }",
"@Override\n public void onErrorResponse(VolleyError error) {\n progressDialog.dismiss();\n Toast.makeText(getActivity(), \"An error occured\", Toast.LENGTH_SHORT).show();\n }",
"public void infoProgressOff (){\n runOnUiThread(new Runnable() {\n @Override\n public void run() {\n if (tabTourInfoBinding.tourInfoProgress.getVisibility() != View.GONE) {\n tabTourInfoBinding.tourInfoProgress.setVisibility(View.GONE);\n }\n if (tabTourInfoBinding.tourInfoLayout.getVisibility() != View.VISIBLE) {\n tabTourInfoBinding.tourInfoLayout.setVisibility(View.VISIBLE);\n }\n }\n });\n }",
"@Override\n\t\tprotected void onPreExecute() {\n\t\t\tshowLoadingProgressDialog();\n\t\t}",
"@Override\n public void hideProgressBar() {\n MainActivity.sInstance.hideProgressBar();\n }",
"@Override\n public void onResponse(JSONArray response) {\n Toast.makeText(getApplicationContext(), \"Berhasil tambah data\" + response, Toast.LENGTH_SHORT).show();\n mProgressBar.setVisibility(View.INVISIBLE);\n }",
"public void showLoading() {\n }",
"@Override\n public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {\n progressDialog.dismiss();\n\n //and displaying a success toast\n Toast.makeText(getApplicationContext(), \"File Uploaded \", Toast.LENGTH_LONG).show();\n }",
"protected void showLoading()\n {\n progressBar = new ProgressDialog(this);\n progressBar.setTitle(\"Loading\");\n progressBar.setMessage(\"Wait while loading...\");\n progressBar.setCancelable(false); // disable dismiss by tapping outside of the dialog\n progressBar.show();\n }",
"public void infoProgressOn (){\n runOnUiThread(new Runnable() {\n @Override\n public void run() {\n if (tabTourInfoBinding.tourInfoProgress.getVisibility() != View.VISIBLE) {\n tabTourInfoBinding.tourInfoProgress.setVisibility(View.VISIBLE);\n }\n if (tabTourInfoBinding.tourInfoLayout.getVisibility() != View.GONE) {\n tabTourInfoBinding.tourInfoLayout.setVisibility(View.GONE);\n }\n }\n });\n }",
"@Override\n protected void onPreExecute() {\n\n super.onPreExecute();\n // Show progress overlay (with animation):\n// AndroidUtils.animateView(progressOverlay, View.VISIBLE, 0.4f, 200);\n\n }",
"public final void showLoadingIndicator(boolean z) {\n if (z) {\n ProgressBar progressBar = (ProgressBar) _$_findCachedViewById(C2723R.C2726id.pbReviewPayment);\n Intrinsics.checkExpressionValueIsNotNull(progressBar, \"pbReviewPayment\");\n progressBar.setVisibility(0);\n return;\n }\n ProgressBar progressBar2 = (ProgressBar) _$_findCachedViewById(C2723R.C2726id.pbReviewPayment);\n Intrinsics.checkExpressionValueIsNotNull(progressBar2, \"pbReviewPayment\");\n progressBar2.setVisibility(8);\n }",
"@Override\n public void onClick(View v) {\n\n if(checkbutts != 0) {\n if (imgPath != null && !imgPath.isEmpty()) {\n prgDialog = new ProgressDialog(TabLayout.this);\n prgDialog.setMessage(\"Uploading Image\");\n prgDialog.show();\n // Convert image to String using Base64\n encodeImagetoString();\n // When Image is not selected from Gallery\n } else {\n Toast.makeText(\n getApplicationContext(),\n \"You must select image from gallery before you try to upload\",\n Toast.LENGTH_LONG).show();\n }\n }else{\n Toast.makeText(TabLayout.this, \"Photo must be cropped before uploading\", Toast.LENGTH_LONG)\n .show();\n }\n }",
"private void displayProgressDialog() {\n pDialog.setMessage(\"Logging In.. Please wait...\");\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n }",
"@Override\n\tprotected void onPreExecute() {\n\t\t\n\t\t pDialog = new ProgressDialog(context);\n\t\t\ttry{\n\t\t\t\tthis.pDialog.setMessage(\"Please wait ...\");\n\t\t this.pDialog.setIndeterminateDrawable(context.getResources().getDrawable(R.drawable.red_progress));\n\t\t this.pDialog.setIndeterminate(false);\n\t\t this.pDialog.setCancelable(false);\n\t\t this.pDialog.show();\n\t\t\t}\n\t\t\tcatch(Exception e)\n\t\t\t{\n\t\t\t\te.getMessage();\n\t\t\t}\n\t}",
"@Override\n protected void onPreExecute() {\n super.onPreExecute();\n pd = new ProgressDialog(activity);\n pd.setMessage(\"Loading, Please Wait.....\");\n pd.setCancelable(false);\n pd.show();\n }",
"@Override\n\t\tprotected void onPostExecute(Object result) {\n\t\t\tView rootView =(View)result;\n\t\t\ttry {\n\t\t\t\tThread.sleep(400);\n\t\t\t} catch (InterruptedException e) {\t\t\t\t\n\t\t\t}\n\t\t\tsetContentView(rootView);\t\t\t\n\t\t\tgetProgressDialog().hide();\n\t\t}",
"@Override\n public void esconderBarraProgresso(){\n progressbar.setVisibility(View.GONE);\n listView.setVisibility(View.VISIBLE);\n }"
] | [
"0.7503468",
"0.73959273",
"0.7243807",
"0.7154695",
"0.71237093",
"0.7097877",
"0.7096616",
"0.7075899",
"0.7070861",
"0.7024818",
"0.7021526",
"0.70096433",
"0.6952594",
"0.69437593",
"0.68782604",
"0.68648744",
"0.685895",
"0.6835517",
"0.68306357",
"0.68273914",
"0.68211395",
"0.681874",
"0.681874",
"0.6816132",
"0.68015563",
"0.6797021",
"0.6797021",
"0.6797021",
"0.6797021",
"0.6797021",
"0.67939866",
"0.67866963",
"0.67845505",
"0.6784247",
"0.67814505",
"0.67796576",
"0.6778173",
"0.67760086",
"0.67692673",
"0.67688847",
"0.6749318",
"0.67406356",
"0.67344767",
"0.673405",
"0.6708115",
"0.670655",
"0.6704947",
"0.67033374",
"0.6699757",
"0.6697035",
"0.6696774",
"0.6696084",
"0.6693273",
"0.6690187",
"0.6680456",
"0.66758144",
"0.6664549",
"0.66644853",
"0.66548365",
"0.6649972",
"0.66497874",
"0.6649399",
"0.6646572",
"0.6624806",
"0.66188407",
"0.6609565",
"0.6599245",
"0.6576437",
"0.6576437",
"0.6569663",
"0.6559011",
"0.6557369",
"0.65485394",
"0.65420973",
"0.6541345",
"0.65312505",
"0.6528977",
"0.651378",
"0.64984864",
"0.64978915",
"0.64917403",
"0.6489238",
"0.6485403",
"0.64832866",
"0.6483024",
"0.648133",
"0.6477547",
"0.6476199",
"0.6474174",
"0.64727086",
"0.6471857",
"0.64664096",
"0.6459393",
"0.6458812",
"0.6458348",
"0.6455748",
"0.64431196",
"0.64408386",
"0.6439158",
"0.6437938",
"0.6432823"
] | 0.0 | -1 |
C R E A T | @Override
public boolean create(Pontuacao pontuacao) {
Connection conexao = mysql.getConnection();
try {
PreparedStatement stm = conexao.prepareStatement(createSQL);
stm.setInt(1, pontuacao.getIdcodigo());
stm.setString(2, pontuacao.getData());
stm.setInt(3, pontuacao.getP_rodada());
stm.setInt(4, pontuacao.getS_rodada());
stm.setInt(5, pontuacao.getT_rodada());
stm.setInt(6, pontuacao.getTotal());
int registros = stm.executeUpdate();
return registros > 0 ? true : false;
} catch (final SQLException ex) {
System.out.println("Falha de conexão com a base de dados!");
ex.printStackTrace();
} catch (final Exception ex) {
ex.printStackTrace();
} finally {
try {
conexao.close();
} catch (final Exception ex) {
ex.printStackTrace();
}
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private static void cajas() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"public void mo21795T() {\n }",
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void coba() {\n\t\t\n\t}",
"T mo26439a();",
"public void Tyre() {\n\t\t\r\n\t}",
"public void mo21878t() {\n }",
"@Override\n\tprotected void interr() {\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 }",
"public void gored() {\n\t\t\n\t}",
"public abstract void mo27385c();",
"@Override\n\tpublic void ccc() {\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\tpublic void trabajar() {\n\n\t}",
"public void mo38117a() {\n }",
"void mo16691c(T t);",
"private USI_TRLT() {}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"private void kk12() {\n\n\t}",
"@Override\n public void co() {\n Object object;\n int n;\n object = this.mw;\n // MONITORENTER : object\n this.tV = gi.submit(this.tU);\n // MONITOREXIT : object\n try {\n object = this.tV.get(60000, TimeUnit.MILLISECONDS);\n n = -2;\n }\n catch (TimeoutException var2_2) {\n gs.W(\"Timed out waiting for native ad.\");\n n = 2;\n object = null;\n }\n catch (ExecutionException var2_3) {\n n = 0;\n object = null;\n }\n catch (InterruptedException var2_4) {\n object = null;\n n = -1;\n }\n catch (CancellationException var2_5) {\n object = null;\n n = -1;\n }\n if (object == null) {\n object = this.r(n);\n }\n gr.wC.post(new Runnable((fz)object){\n final /* synthetic */ fz ts;\n\n @Override\n public void run() {\n fn.this.tm.a(this.ts);\n }\n });\n }",
"@Override\r\n\t\tprotected void run() {\n\t\t\t\r\n\t\t}",
"public void baocun() {\n\t\t\n\t}",
"void mo57278c();",
"public void mo21877s() {\n }",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"public void mo21793R() {\n }",
"private stendhal() {\n\t}",
"public int getProT() {\n/* 78 */ return this.proT;\n/* */ }",
"public void mo4359a() {\n }",
"public abstract C mo29734a();",
"public void mo21794S() {\n }",
"@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}",
"private TMCourse() {\n\t}",
"void mo67924c();",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void runn() {\n\t\t\r\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"public abstract void mo70713b();",
"public static void c0() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"protected boolean func_70814_o() { return true; }",
"private void m50366E() {\n }",
"@Override\n\tpublic void anular() {\n\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}",
"public final void mo51373a() {\n }",
"@Override\r\n\tprotected void func03() {\n\t\t\r\n\t}",
"abstract public T getInfo();",
"@Override\r\n\tprotected void compute() {\n\t\t\r\n\t}",
"private void getStatus() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void run() {\n\n\t\t\t}",
"public void mo21792Q() {\n }",
"public void mo21825b() {\n }",
"public void mo12628c() {\n }",
"protected void h() {}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"private void comerComestible(Celda c) {\n // TODO implement here\n }",
"public abstract void t3();",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void jugar() {\n\t\t\n\t}",
"public void mo21779D() {\n }",
"public abstract void mo53562a(C18796a c18796a);",
"void mo17012c();",
"void mo88524c();",
"public abstract void mo56925d();",
"public abstract void mo30696a();",
"public static void c3() {\n\t}",
"public void mo97906c() {\n }",
"private final void i() {\n }",
"@Override\r\n\tprotected void doF8() {\n\t\t\r\n\t}",
"void mo21072c();",
"public void mo3376r() {\n }",
"@Override\n\tprotected void getExras() {\n\n\t}",
"public void mo21787L() {\n }",
"public void mo21791P() {\n }",
"public void mo21780E() {\n }",
"abstract String mo1748c();",
"void kiemTraThangHopLi() {\n }",
"void mo80457c();",
"public abstract C7982k4<E> m39518y();",
"public void smell() {\n\t\t\n\t}",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void get() {\n\t\t\r\n\t}",
"public void mo21783H() {\n }",
"public void mo56167c() {\n }",
"void mo57277b();",
"public contrustor(){\r\n\t}",
"public void mo21782G() {\n }",
"public void mo21785J() {\n }",
"@Override\n\tpublic void nghe() {\n\n\t}",
"public void mo21879u() {\n }",
"@Override\n\t\tpublic void run() {\n\t\t\t\n\t\t}",
"@Override\n\t\tpublic void run() {\n\t\t\t\n\t\t}",
"public void mo9848a() {\n }",
"protected abstract T mo2623i();"
] | [
"0.6374067",
"0.6059683",
"0.5879428",
"0.5863829",
"0.58267254",
"0.5747797",
"0.5738669",
"0.5660013",
"0.56502336",
"0.5639168",
"0.557893",
"0.55314666",
"0.5529348",
"0.55080324",
"0.5489212",
"0.5472078",
"0.5472078",
"0.5464106",
"0.54635495",
"0.5455908",
"0.5454338",
"0.54285103",
"0.5414426",
"0.54033804",
"0.54006916",
"0.5398935",
"0.5398006",
"0.53916985",
"0.5375311",
"0.53750396",
"0.5367266",
"0.5360819",
"0.53459805",
"0.5345226",
"0.53400975",
"0.5329957",
"0.5329957",
"0.53198403",
"0.5308287",
"0.53069735",
"0.52956194",
"0.5294844",
"0.52933496",
"0.5290292",
"0.52874964",
"0.5286534",
"0.5286147",
"0.5280039",
"0.5275427",
"0.5275427",
"0.52752477",
"0.5268592",
"0.52651685",
"0.5261383",
"0.5254544",
"0.52544147",
"0.5252228",
"0.52506495",
"0.52480876",
"0.52466494",
"0.52357185",
"0.5231916",
"0.52319014",
"0.5219885",
"0.5219842",
"0.52188444",
"0.5217706",
"0.5216681",
"0.5216593",
"0.52154744",
"0.5213469",
"0.5211237",
"0.5211096",
"0.52052796",
"0.5201799",
"0.51964915",
"0.5195518",
"0.51944757",
"0.51900846",
"0.5189711",
"0.51806873",
"0.51795524",
"0.5175258",
"0.5174837",
"0.5169658",
"0.5168864",
"0.5164053",
"0.5157774",
"0.5157201",
"0.515074",
"0.51409376",
"0.5138655",
"0.5137164",
"0.51360923",
"0.5133588",
"0.5132144",
"0.51308936",
"0.5128567",
"0.5128567",
"0.51229876",
"0.51191914"
] | 0.0 | -1 |
D E L E T E | @Override
public boolean delete(int opc) {
Connection conexao = mysql.getConnection();
try {
PreparedStatement stm = conexao.prepareStatement(deleteSQL);
stm.setInt(1, opc);
int registros = stm.executeUpdate();
return registros > 0 ? true : false;
} catch (final SQLException ex) {
System.out.println("Falha de conexão com a base de dados!");
ex.printStackTrace();
} catch (final Exception ex) {
ex.printStackTrace();
} finally {
try {
conexao.close();
} catch (final Exception ex) {
ex.printStackTrace();
}
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"public void Tyre() {\n\t\t\r\n\t}",
"public abstract void mo56925d();",
"public void mo21795T() {\n }",
"private static void cajas() {\n\t\t\n\t}",
"private USI_TRLT() {}",
"long getTimeBoltHBoltE();",
"public void gored() {\n\t\t\n\t}",
"public void mo21878t() {\n }",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"private void m50366E() {\n }",
"public void mo21779D() {\n }",
"private stendhal() {\n\t}",
"public abstract long mo9229aD();",
"long getTimeSpoutBoltA();",
"public void stg() {\n\n\t}",
"public int getET()\n {\n return exTime;\n }",
"public void mo21877s() {\n }",
"public abstract C17954dh<E> mo45842a();",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"public abstract String mo41079d();",
"@Override\n\tpublic void trabajar() {\n\n\t}",
"public void dbE() {\n }",
"@Test\n public void testORMUsageToretrieveTbsPatternSavedEntity() throws DataloadGeneratorException {\n List<TbsPatternSavedTEntity> tbsPatternSavedTEntities = getTbsPatternSavedTEntityList(TBS_SELF_SOLUTION);\n\n for(TbsPatternSavedTEntity tbsPatternSavedTEntity : tbsPatternSavedTEntities){\n if(\"td_admin\".equalsIgnoreCase(tbsPatternSavedTEntity.getOperator()))\n System.out.println(\"Operator : \" + tbsPatternSavedTEntity.getOperator() +\" -- Dataload Name\" +tbsPatternSavedTEntity.getSegment() + \"Intermediate File : \" + tbsPatternSavedTEntity.getIntermediateXml());\n }\n assertNotNull(tbsPatternSavedTEntities);\n }",
"long getTimeSpoutBoltF();",
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"public void mo21780E() {\n }",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"private void strin() {\n\n\t}",
"@Override\n\tpublic void dibuja() {\n\t\t\n\t}",
"public void mo21783H() {\n }",
"public abstract void mo27386d();",
"public int getTID();",
"IEmpleado next();",
"T mo26439a();",
"public int E() {\n \treturn E;\n }",
"int getD();",
"@Override\r\n\tpublic void runn() {\n\t\t\r\n\t}",
"public void generTirarDados() {\n\r\n\t}",
"public void mo97908d() {\n }",
"abstract C0451h mo1607e();",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"public void mo21794S() {\n }",
"Reserva Obtener();",
"public void mo38117a() {\n }",
"public abstract EUT eut();",
"public String toString(){\n\t\treturn \"E\"+\" \";\n\t}",
"public void mo21792Q() {\n }",
"@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}",
"public void mo21787L() {\n }",
"private final boolean e() {\n /*\n r15 = this;\n r2 = 0\n r1 = 0\n dtd r0 = r15.m // Catch:{ all -> 0x008e }\n if (r0 != 0) goto L_0x000d\n dtd r0 = new dtd // Catch:{ all -> 0x008e }\n r0.<init>() // Catch:{ all -> 0x008e }\n r15.m = r0 // Catch:{ all -> 0x008e }\n L_0x000d:\n int r0 = r15.k // Catch:{ all -> 0x008e }\n dtd r3 = r15.m // Catch:{ all -> 0x008e }\n int r3 = r3.a // Catch:{ all -> 0x008e }\n int r0 = r0 - r3\n if (r0 <= 0) goto L_0x039e\n dvk r3 = r15.g // Catch:{ all -> 0x008e }\n if (r3 == 0) goto L_0x0356\n byte[] r3 = r15.h // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n if (r3 == 0) goto L_0x0025\n int r3 = r15.i // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n byte[] r4 = r15.h // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r4 = r4.length // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n if (r3 != r4) goto L_0x0032\n L_0x0025:\n r3 = 2097152(0x200000, float:2.938736E-39)\n int r3 = java.lang.Math.min(r0, r3) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n byte[] r3 = new byte[r3] // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r15.h = r3 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r3 = 0\n r15.i = r3 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n L_0x0032:\n byte[] r3 = r15.h // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r3 = r3.length // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r4 = r15.i // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r3 = r3 - r4\n int r6 = java.lang.Math.min(r0, r3) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvk r7 = r15.g // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n byte[] r8 = r15.h // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r9 = r15.i // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n boolean r0 = r7.i // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n if (r0 != 0) goto L_0x00ac\n r0 = 1\n L_0x0047:\n java.lang.String r3 = \"GzipInflatingBuffer is closed\"\n defpackage.cld.b(r0, r3) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r3 = 0\n r0 = 1\n r5 = r3\n L_0x004f:\n if (r0 == 0) goto L_0x02ef\n int r3 = r6 - r5\n if (r3 <= 0) goto L_0x02ef\n dvm r0 = r7.h // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = r0.ordinal() // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n switch(r0) {\n case 0: goto L_0x00ae;\n case 1: goto L_0x0148;\n case 2: goto L_0x0171;\n case 3: goto L_0x01d7;\n case 4: goto L_0x01fc;\n case 5: goto L_0x0221;\n case 6: goto L_0x0256;\n case 7: goto L_0x0289;\n case 8: goto L_0x02a2;\n case 9: goto L_0x02e9;\n default: goto L_0x005e;\n } // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n L_0x005e:\n java.lang.AssertionError r0 = new java.lang.AssertionError // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvm r3 = r7.h // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n java.lang.String r3 = java.lang.String.valueOf(r3) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n java.lang.String r4 = java.lang.String.valueOf(r3) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r4 = r4.length() // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r4 = r4 + 15\n java.lang.StringBuilder r5 = new java.lang.StringBuilder // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r5.<init>(r4) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n java.lang.String r4 = \"Invalid state: \"\n java.lang.StringBuilder r4 = r5.append(r4) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n java.lang.StringBuilder r3 = r4.append(r3) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n java.lang.String r3 = r3.toString() // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r0.<init>(r3) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n throw r0 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n L_0x0087:\n r0 = move-exception\n java.lang.RuntimeException r3 = new java.lang.RuntimeException // Catch:{ all -> 0x008e }\n r3.<init>(r0) // Catch:{ all -> 0x008e }\n throw r3 // Catch:{ all -> 0x008e }\n L_0x008e:\n r0 = move-exception\n if (r2 <= 0) goto L_0x00ab\n dxe r3 = r15.a\n r3.a(r2)\n dxh r3 = r15.j\n dxh r4 = defpackage.dxh.BODY\n if (r3 != r4) goto L_0x00ab\n dvk r3 = r15.g\n if (r3 == 0) goto L_0x03c9\n dzo r2 = r15.d\n long r4 = (long) r1\n r2.d(r4)\n int r2 = r15.r\n int r1 = r1 + r2\n r15.r = r1\n L_0x00ab:\n throw r0\n L_0x00ac:\n r0 = 0\n goto L_0x0047\n L_0x00ae:\n dvl r0 = r7.c // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = r0.b() // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r3 = 10\n if (r0 >= r3) goto L_0x00ba\n r0 = 0\n goto L_0x004f\n L_0x00ba:\n dvl r0 = r7.c // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = r0.c() // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r3 = 35615(0x8b1f, float:4.9907E-41)\n if (r0 == r3) goto L_0x00d4\n java.util.zip.ZipException r0 = new java.util.zip.ZipException // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n java.lang.String r3 = \"Not in GZIP format\"\n r0.<init>(r3) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n throw r0 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n L_0x00cd:\n r0 = move-exception\n java.lang.RuntimeException r3 = new java.lang.RuntimeException // Catch:{ all -> 0x008e }\n r3.<init>(r0) // Catch:{ all -> 0x008e }\n throw r3 // Catch:{ all -> 0x008e }\n L_0x00d4:\n dvl r0 = r7.c // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = r0.a() // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r3 = 8\n if (r0 == r3) goto L_0x00e6\n java.util.zip.ZipException r0 = new java.util.zip.ZipException // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n java.lang.String r3 = \"Unsupported compression method\"\n r0.<init>(r3) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n throw r0 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n L_0x00e6:\n dvl r0 = r7.c // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = r0.a() // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r7.j = r0 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvl r4 = r7.c // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r0 = 6\n dvk r3 = r4.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r3 = r3.f // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvk r10 = r4.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r10 = r10.e // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r3 = r3 - r10\n if (r3 <= 0) goto L_0x03d9\n r0 = 6\n int r0 = java.lang.Math.min(r3, r0) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvk r3 = r4.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n java.util.zip.CRC32 r3 = r3.b // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvk r10 = r4.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n byte[] r10 = r10.d // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvk r11 = r4.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r11 = r11.e // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r3.update(r10, r11, r0) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvk r3 = r4.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n defpackage.dvk.a(r3, r0) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = 6 - r0\n r3 = r0\n L_0x0118:\n if (r3 <= 0) goto L_0x013b\n r0 = 512(0x200, float:7.175E-43)\n byte[] r10 = new byte[r0] // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r0 = 0\n L_0x011f:\n if (r0 >= r3) goto L_0x013b\n int r11 = r3 - r0\n r12 = 512(0x200, float:7.175E-43)\n int r11 = java.lang.Math.min(r11, r12) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvk r12 = r4.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dtd r12 = r12.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r13 = 0\n r12.a(r10, r13, r11) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvk r12 = r4.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n java.util.zip.CRC32 r12 = r12.b // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r13 = 0\n r12.update(r10, r13, r11) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = r0 + r11\n goto L_0x011f\n L_0x013b:\n dvk r0 = r4.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r3 = 6\n defpackage.dvk.b(r0, r3) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvm r0 = defpackage.dvm.HEADER_EXTRA_LEN // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r7.h = r0 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r0 = 1\n goto L_0x004f\n L_0x0148:\n int r0 = r7.j // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r0 = r0 & 4\n r3 = 4\n if (r0 == r3) goto L_0x0156\n dvm r0 = defpackage.dvm.HEADER_NAME // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r7.h = r0 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r0 = 1\n goto L_0x004f\n L_0x0156:\n dvl r0 = r7.c // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = r0.b() // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r3 = 2\n if (r0 >= r3) goto L_0x0162\n r0 = 0\n goto L_0x004f\n L_0x0162:\n dvl r0 = r7.c // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = r0.c() // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r7.k = r0 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvm r0 = defpackage.dvm.HEADER_EXTRA // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r7.h = r0 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r0 = 1\n goto L_0x004f\n L_0x0171:\n dvl r0 = r7.c // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = r0.b() // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r3 = r7.k // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n if (r0 >= r3) goto L_0x017e\n r0 = 0\n goto L_0x004f\n L_0x017e:\n dvl r10 = r7.c // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r4 = r7.k // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvk r0 = r10.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = r0.f // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvk r3 = r10.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r3 = r3.e // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = r0 - r3\n if (r0 <= 0) goto L_0x03d6\n int r0 = java.lang.Math.min(r0, r4) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvk r3 = r10.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n java.util.zip.CRC32 r3 = r3.b // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvk r11 = r10.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n byte[] r11 = r11.d // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvk r12 = r10.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r12 = r12.e // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r3.update(r11, r12, r0) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvk r3 = r10.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n defpackage.dvk.a(r3, r0) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = r4 - r0\n r3 = r0\n L_0x01a8:\n if (r3 <= 0) goto L_0x01cb\n r0 = 512(0x200, float:7.175E-43)\n byte[] r11 = new byte[r0] // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r0 = 0\n L_0x01af:\n if (r0 >= r3) goto L_0x01cb\n int r12 = r3 - r0\n r13 = 512(0x200, float:7.175E-43)\n int r12 = java.lang.Math.min(r12, r13) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvk r13 = r10.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dtd r13 = r13.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r14 = 0\n r13.a(r11, r14, r12) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvk r13 = r10.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n java.util.zip.CRC32 r13 = r13.b // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r14 = 0\n r13.update(r11, r14, r12) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = r0 + r12\n goto L_0x01af\n L_0x01cb:\n dvk r0 = r10.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n defpackage.dvk.b(r0, r4) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvm r0 = defpackage.dvm.HEADER_NAME // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r7.h = r0 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r0 = 1\n goto L_0x004f\n L_0x01d7:\n int r0 = r7.j // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r0 = r0 & 8\n r3 = 8\n if (r0 != r3) goto L_0x01f5\n dvl r0 = r7.c // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n L_0x01e1:\n int r3 = r0.b() // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n if (r3 <= 0) goto L_0x01f3\n int r3 = r0.a() // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n if (r3 != 0) goto L_0x01e1\n r0 = 1\n L_0x01ee:\n if (r0 != 0) goto L_0x01f5\n r0 = 0\n goto L_0x004f\n L_0x01f3:\n r0 = 0\n goto L_0x01ee\n L_0x01f5:\n dvm r0 = defpackage.dvm.HEADER_COMMENT // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r7.h = r0 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r0 = 1\n goto L_0x004f\n L_0x01fc:\n int r0 = r7.j // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r0 = r0 & 16\n r3 = 16\n if (r0 != r3) goto L_0x021a\n dvl r0 = r7.c // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n L_0x0206:\n int r3 = r0.b() // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n if (r3 <= 0) goto L_0x0218\n int r3 = r0.a() // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n if (r3 != 0) goto L_0x0206\n r0 = 1\n L_0x0213:\n if (r0 != 0) goto L_0x021a\n r0 = 0\n goto L_0x004f\n L_0x0218:\n r0 = 0\n goto L_0x0213\n L_0x021a:\n dvm r0 = defpackage.dvm.HEADER_CRC // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r7.h = r0 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r0 = 1\n goto L_0x004f\n L_0x0221:\n int r0 = r7.j // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r0 = r0 & 2\n r3 = 2\n if (r0 != r3) goto L_0x024f\n dvl r0 = r7.c // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = r0.b() // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r3 = 2\n if (r0 >= r3) goto L_0x0234\n r0 = 0\n goto L_0x004f\n L_0x0234:\n java.util.zip.CRC32 r0 = r7.b // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n long r10 = r0.getValue() // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = (int) r10 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r3 = 65535(0xffff, float:9.1834E-41)\n r0 = r0 & r3\n dvl r3 = r7.c // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r3 = r3.c() // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n if (r0 == r3) goto L_0x024f\n java.util.zip.ZipException r0 = new java.util.zip.ZipException // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n java.lang.String r3 = \"Corrupt GZIP header\"\n r0.<init>(r3) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n throw r0 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n L_0x024f:\n dvm r0 = defpackage.dvm.INITIALIZE_INFLATER // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r7.h = r0 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r0 = 1\n goto L_0x004f\n L_0x0256:\n java.util.zip.Inflater r0 = r7.g // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n if (r0 != 0) goto L_0x027e\n java.util.zip.Inflater r0 = new java.util.zip.Inflater // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r3 = 1\n r0.<init>(r3) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r7.g = r0 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n L_0x0262:\n java.util.zip.CRC32 r0 = r7.b // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r0.reset() // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = r7.f // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r3 = r7.e // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = r0 - r3\n if (r0 <= 0) goto L_0x0284\n java.util.zip.Inflater r3 = r7.g // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n byte[] r4 = r7.d // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r10 = r7.e // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r3.setInput(r4, r10, r0) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvm r0 = defpackage.dvm.INFLATING // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r7.h = r0 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n L_0x027b:\n r0 = 1\n goto L_0x004f\n L_0x027e:\n java.util.zip.Inflater r0 = r7.g // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r0.reset() // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n goto L_0x0262\n L_0x0284:\n dvm r0 = defpackage.dvm.INFLATER_NEEDS_INPUT // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r7.h = r0 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n goto L_0x027b\n L_0x0289:\n int r0 = r9 + r5\n int r0 = r7.a(r8, r0, r3) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r3 = r5 + r0\n dvm r0 = r7.h // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvm r4 = defpackage.dvm.TRAILER // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n if (r0 != r4) goto L_0x029e\n boolean r0 = r7.a() // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r5 = r3\n goto L_0x004f\n L_0x029e:\n r0 = 1\n r5 = r3\n goto L_0x004f\n L_0x02a2:\n java.util.zip.Inflater r0 = r7.g // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n if (r0 == 0) goto L_0x02c7\n r0 = 1\n L_0x02a7:\n java.lang.String r3 = \"inflater is null\"\n defpackage.cld.b(r0, r3) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = r7.e // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r3 = r7.f // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n if (r0 != r3) goto L_0x02c9\n r0 = 1\n L_0x02b3:\n java.lang.String r3 = \"inflaterInput has unconsumed bytes\"\n defpackage.cld.b(r0, r3) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dtd r0 = r7.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = r0.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r3 = 512(0x200, float:7.175E-43)\n int r0 = java.lang.Math.min(r0, r3) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n if (r0 != 0) goto L_0x02cb\n r0 = 0\n goto L_0x004f\n L_0x02c7:\n r0 = 0\n goto L_0x02a7\n L_0x02c9:\n r0 = 0\n goto L_0x02b3\n L_0x02cb:\n r3 = 0\n r7.e = r3 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r7.f = r0 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dtd r3 = r7.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n byte[] r4 = r7.d // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r10 = r7.e // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r3.a(r4, r10, r0) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n java.util.zip.Inflater r3 = r7.g // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n byte[] r4 = r7.d // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r10 = r7.e // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r3.setInput(r4, r10, r0) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvm r0 = defpackage.dvm.INFLATING // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r7.h = r0 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r0 = 1\n goto L_0x004f\n L_0x02e9:\n boolean r0 = r7.a() // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n goto L_0x004f\n L_0x02ef:\n if (r0 == 0) goto L_0x0301\n dvm r0 = r7.h // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvm r3 = defpackage.dvm.HEADER // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n if (r0 != r3) goto L_0x0334\n dvl r0 = r7.c // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = r0.b() // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r3 = 10\n if (r0 >= r3) goto L_0x0334\n L_0x0301:\n r0 = 1\n L_0x0302:\n r7.n = r0 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvk r0 = r15.g // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r3 = r0.l // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r4 = 0\n r0.l = r4 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r2 = r2 + r3\n dvk r0 = r15.g // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r3 = r0.m // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r4 = 0\n r0.m = r4 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r1 = r1 + r3\n if (r5 != 0) goto L_0x0342\n if (r2 <= 0) goto L_0x0332\n dxe r0 = r15.a\n r0.a(r2)\n dxh r0 = r15.j\n dxh r3 = defpackage.dxh.BODY\n if (r0 != r3) goto L_0x0332\n dvk r0 = r15.g\n if (r0 == 0) goto L_0x0336\n dzo r0 = r15.d\n long r2 = (long) r1\n r0.d(r2)\n int r0 = r15.r\n int r0 = r0 + r1\n r15.r = r0\n L_0x0332:\n r0 = 0\n L_0x0333:\n return r0\n L_0x0334:\n r0 = 0\n goto L_0x0302\n L_0x0336:\n dzo r0 = r15.d\n long r4 = (long) r2\n r0.d(r4)\n int r0 = r15.r\n int r0 = r0 + r2\n r15.r = r0\n goto L_0x0332\n L_0x0342:\n dtd r0 = r15.m // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n byte[] r3 = r15.h // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r4 = r15.i // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dxv r3 = defpackage.dxw.a(r3, r4, r5) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r0.a(r3) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = r15.i // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = r0 + r5\n r15.i = r0 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n goto L_0x000d\n L_0x0356:\n dtd r3 = r15.n // Catch:{ all -> 0x008e }\n int r3 = r3.a // Catch:{ all -> 0x008e }\n if (r3 != 0) goto L_0x0386\n if (r2 <= 0) goto L_0x0378\n dxe r0 = r15.a\n r0.a(r2)\n dxh r0 = r15.j\n dxh r3 = defpackage.dxh.BODY\n if (r0 != r3) goto L_0x0378\n dvk r0 = r15.g\n if (r0 == 0) goto L_0x037a\n dzo r0 = r15.d\n long r2 = (long) r1\n r0.d(r2)\n int r0 = r15.r\n int r0 = r0 + r1\n r15.r = r0\n L_0x0378:\n r0 = 0\n goto L_0x0333\n L_0x037a:\n dzo r0 = r15.d\n long r4 = (long) r2\n r0.d(r4)\n int r0 = r15.r\n int r0 = r0 + r2\n r15.r = r0\n goto L_0x0378\n L_0x0386:\n dtd r3 = r15.n // Catch:{ all -> 0x008e }\n int r3 = r3.a // Catch:{ all -> 0x008e }\n int r0 = java.lang.Math.min(r0, r3) // Catch:{ all -> 0x008e }\n int r2 = r2 + r0\n dtd r3 = r15.m // Catch:{ all -> 0x008e }\n dtd r4 = r15.n // Catch:{ all -> 0x008e }\n dxv r0 = r4.a(r0) // Catch:{ all -> 0x008e }\n dtd r0 = (defpackage.dtd) r0 // Catch:{ all -> 0x008e }\n r3.a(r0) // Catch:{ all -> 0x008e }\n goto L_0x000d\n L_0x039e:\n if (r2 <= 0) goto L_0x03ba\n dxe r0 = r15.a\n r0.a(r2)\n dxh r0 = r15.j\n dxh r3 = defpackage.dxh.BODY\n if (r0 != r3) goto L_0x03ba\n dvk r0 = r15.g\n if (r0 == 0) goto L_0x03bd\n dzo r0 = r15.d\n long r2 = (long) r1\n r0.d(r2)\n int r0 = r15.r\n int r0 = r0 + r1\n r15.r = r0\n L_0x03ba:\n r0 = 1\n goto L_0x0333\n L_0x03bd:\n dzo r0 = r15.d\n long r4 = (long) r2\n r0.d(r4)\n int r0 = r15.r\n int r0 = r0 + r2\n r15.r = r0\n goto L_0x03ba\n L_0x03c9:\n dzo r1 = r15.d\n long r4 = (long) r2\n r1.d(r4)\n int r1 = r15.r\n int r1 = r1 + r2\n r15.r = r1\n goto L_0x00ab\n L_0x03d6:\n r3 = r4\n goto L_0x01a8\n L_0x03d9:\n r3 = r0\n goto L_0x0118\n */\n throw new UnsupportedOperationException(\"Method not decompiled: defpackage.dxd.e():boolean\");\n }",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tvoid geraDados() {\n\n\t}",
"public int getTime() { return _time; }",
"public abstract String mo9239aw();",
"public void mo3749d() {\n }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n public String getData() {\n return \"T \" + super.getData();\n }",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"public void dor(){\n }",
"@Override\n\tpublic void teclaCorrigeDigitada() {\n\t\t\n\t}",
"public abstract long mo9755t();",
"@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}",
"public void mo2471e() {\n }",
"@Override\r\n\t\tprotected void run() {\n\t\t\t\r\n\t\t}",
"protected void h() {}",
"public void mo21879u() {\n }",
"public static void main(String[] args) {\n\t\tEmpleado E1 = new Empleado (\"Jessica\");\n\t\tDirectivo D1 = new Directivo (\"Samanta\");\n\t\tOperario OP1 = new Operario (\"Edson\");\n\t\tOficial OF1 = new Oficial (\"Emilio\");\n\t\tTecnico T1 = new Tecnico (\"Daniela\");\n\t\t\n\t\t// polimorfismo la clase padre puede acceder a elementos de las clases hijas sin tenerlas declaradas\n\t\tEmpleado E2 = new Tecnico (\"Jessica\");\n\t\t\n\t\tSystem.out.println(\" \");\n\t\tSystem.out.println(E1.toString());\n\t\tSystem.out.println(\" \");\n\t\tSystem.out.println(D1);\n\t\tSystem.out.println(\" \");\n\t\tSystem.out.println(OP1);\n\t\tSystem.out.println(\" \");\n\t\tSystem.out.println(OF1);\n\t\tSystem.out.println(\" \");\n\t\tSystem.out.println(T1);\n\t\tSystem.out.println(\" \");\n\t\tSystem.out.println(E2);\n\t\tSystem.out.println(\" \");\n\t\n\t}",
"int getE();",
"public void run() {\n\t\t\t\t\n\t\t\t}",
"public abstract long mo24412e();",
"public void mo3376r() {\n }",
"@Override\n\tprotected void getExras() {\n\n\t}",
"T getEventTime();",
"Datty getDatty();",
"public abstract int mo123246e();",
"public void Ordenamiento() {\n\n\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"public int edad(){\n return edad;\n }",
"public abstract boolean mo9230aE();",
"private Ente gestioneEnte() {\n\t\tList<Ente> enti = enteDad.getEntiByCodiceAndCodiceSistemaEsterno(req.getCodiceEnte(), SistemaEsterno.FEL);\n\t\tif(enti == null || enti.isEmpty()) {\n\t\t\tthrow new UnmappedEnteException(ErroreCore.ENTITA_NON_TROVATA.getErrore(\"Ente\", \"codice \" + req.getCodiceEnte()));\n\t\t}\n\t\t// Dovrebbe essercene solo uno. Per sicurezza prendo solo il primo\n\t\treturn enti.get(0);\n\t}",
"abstract String mo1748c();",
"@Override\n public void perish() {\n \n }",
"public abstract String mo13682d();",
"public String toString() {\n\t\treturn \"T\";\n\t}",
"public void mo21793R() {\n }",
"@Test\n public void testDigTrans() {\n // Conditions initiales\n screen.init(10, 5); screen.setNature(6, 1, Cell.PLT);\n // Opération\n screen.dig(6, 1);\n // Oracle: vérifié par contrat\n }",
"@Override\n\tpublic void e() {\n\n\t}",
"public abstract String getEndl();",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }"
] | [
"0.56175655",
"0.54284286",
"0.5348516",
"0.5244629",
"0.5236484",
"0.5167207",
"0.51668787",
"0.5141312",
"0.5121238",
"0.509219",
"0.5083362",
"0.50781924",
"0.50714725",
"0.5052994",
"0.5048336",
"0.5044844",
"0.5036105",
"0.50350606",
"0.501184",
"0.5006396",
"0.500487",
"0.5004197",
"0.49987572",
"0.49914852",
"0.4981528",
"0.49777025",
"0.49679518",
"0.49646544",
"0.49495643",
"0.49358162",
"0.4915535",
"0.49103326",
"0.4906447",
"0.49044067",
"0.49039015",
"0.4898697",
"0.48939392",
"0.48889035",
"0.4887427",
"0.4885941",
"0.48716974",
"0.48684692",
"0.4865754",
"0.48596552",
"0.48595163",
"0.4854451",
"0.48466662",
"0.48463994",
"0.48435855",
"0.4839118",
"0.4834249",
"0.48336336",
"0.48328066",
"0.4831123",
"0.48275933",
"0.48247927",
"0.48221093",
"0.48157465",
"0.4812793",
"0.48106015",
"0.48058212",
"0.47955716",
"0.47894803",
"0.47894803",
"0.47861427",
"0.47821692",
"0.4777765",
"0.47762015",
"0.47744244",
"0.4773016",
"0.4773016",
"0.47710937",
"0.47683",
"0.476653",
"0.4764185",
"0.47622046",
"0.47577497",
"0.4755301",
"0.47474667",
"0.47446552",
"0.47445303",
"0.47424948",
"0.4737555",
"0.47370157",
"0.47307152",
"0.47272947",
"0.47266737",
"0.47250724",
"0.47221428",
"0.47198656",
"0.47174877",
"0.47168475",
"0.47163057",
"0.47147208",
"0.4713582",
"0.47130555",
"0.4702885",
"0.47017533",
"0.47012866",
"0.47012866",
"0.47012866"
] | 0.0 | -1 |
U P D A T E | @Override
public boolean update(Pontuacao pontuacao) {
Connection conexao = mysql.getConnection();
try {
PreparedStatement stm = conexao.prepareStatement(updateSQL);
stm.setString(1, pontuacao.getData());
stm.setInt(2, pontuacao.getP_rodada());
stm.setInt(3, pontuacao.getS_rodada());
stm.setInt(4, pontuacao.getT_rodada());
stm.setInt(5, pontuacao.getTotal());
stm.setInt(6, pontuacao.getIdcodigo());
int registros = stm.executeUpdate();
return registros > 0 ? true : false;
} catch (final SQLException ex) {
System.out.println("Falha de conexão com a base de dados!");
ex.printStackTrace();
} catch (final Exception ex) {
ex.printStackTrace();
} finally {
try {
conexao.close();
} catch (final Exception ex) {
ex.printStackTrace();
}
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void getTDP(){\n TDP = KalkulatorUtility.getTDP_ADDB(DP,biayaAdmin,polis,tenor, bungaADDB.size());\n LogUtility.logging(TAG,LogUtility.infoLog,\"getTDP\",\"TDP\",JSONProcessor.toJSON(TDP));\n }",
"public String getPuntoEmision()\r\n/* 124: */ {\r\n/* 125:207 */ return this.puntoEmision;\r\n/* 126: */ }",
"Petunia() {\r\n\t\t}",
"public abstract EUT eut();",
"@Test\n public void getTarjetaPrepagoTest()\n {\n TarjetaPrepagoEntity entity = data.get(0);\n TarjetaPrepagoEntity resultEntity = tarjetaPrepagoLogic.getTarjetaPrepago(entity.getId());\n Assert.assertNotNull(resultEntity);\n Assert.assertEquals(entity.getId(), resultEntity.getId());\n Assert.assertEquals(entity.getNumTarjetaPrepago(), resultEntity.getNumTarjetaPrepago());\n Assert.assertEquals(entity.getSaldo(), resultEntity.getSaldo(), 0.001);\n Assert.assertEquals(entity.getPuntos(), resultEntity.getPuntos(),0.001);\n }",
"@Override\n public void cantidad_Punteria(){\n punteria=69.5+05*nivel+aumentoP;\n }",
"@Override\n public void pp(){\n PP=3+2*nivel;\n }",
"PaulEigon() {\n\treadCurrentPingisState();\n\tscanState();\n\tprintResult();\n }",
"@Override\n\tpublic void estourada(Participante p) {\n\t\t\n\t}",
"private void getTDPPrepaid(){\n TDPPrepaid = KalkulatorUtility.getTDP_ADDM(DP,biayaAdminADDM,polis,installment2Prepaid,premiAmountSumUp,\n \"ONLOAN\",tenor,bungaADDM.size());\n LogUtility.logging(TAG,LogUtility.infoLog,\"TDPPrepaid\",\"TDPPrepaid\",JSONProcessor.toJSON(TDPPrepaid));\n }",
"public void Tyre() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"public void mo21795T() {\n }",
"public void mo21879u() {\n }",
"private String tulostuksenApu(){\r\n String apu = \"Rivitiedosto: \";\r\n for(int i = 0; i<rivitiedot.length; i++){\r\n apu = apu + i+\": \";\r\n for(int k = 1; k <= rivitiedot[i].getKoko(); k++){\r\n apu = apu + \" \"+rivitiedot[i].get(k);\r\n }\r\n apu = apu + \" \";\r\n }\r\n\r\n return apu;\r\n }",
"public void primerPunto() {\n\t\tp = new PuntoAltaPrecision(this.xCoord, this.yCoord);\n\t\t// Indicamos la trayectoria por la que va la pelota\n\t\tt = new TrayectoriaRecta(1.7f, p, false);\n\t}",
"public int getProT() {\n/* 78 */ return this.proT;\n/* */ }",
"@Override\n\tpublic void parada(Participante p) {\n\t\t\n\t}",
"private void doPoint()\n\t{\n\t\tubisenseData = new UbisenseMockupData();\n\n\t\telapsedTime = 0;\n\t\t\n\t\tubisenseData.setTagID(Helper.DEFAULT_TAG_ID);\n\t\tubisenseData.setUnit(Helper.UBISENSE_UNIT);\n\t\tubisenseData.setOntology(Helper.LP_ONTOLOGY_URL);\n\t\tubisenseData.setVersion(Helper.UBISENSE_VERSION);\n\t\tubisenseData.setId(\"\");\n\t\tubisenseData.setSendTime(sendTime);\n\t\tubisenseData.setPosition(new Point3D(\tx1/100,\n\t\t\t\t\t\t\t\t\t\t\t\ty1/100,\n\t\t\t\t\t\t\t\t\t\t\t\t1.6));\n\t\tlong millis = startDate.getMillis();\n\t\tmillis += offset.toStandardDuration().getMillis();\n//\t\tmillis += parentOffset.toStandardDuration().getMillis();\n\n\t\twhile (elapsedTime < toolDuration && !this.terminate)\n\t\t{\n\t\t\tubisenseData.setId(String.valueOf(Helper.getRandomInt()));\n\t\t\tubisenseData.setTime(millis + (long)(elapsedTime*SLEEP_INTERVAL));\n\t\t\tEntryEvent event = new EntryEvent(this);\n\t\t\tthis.notifyListeners(event);\n\t\t\telapsedTime++;\n\t\t\ttry\n\t\t\t{\n\t\t\t\tif (speed > 0)\n\t\t\t\t\tThread.sleep(SLEEP_INTERVAL/speed);\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}",
"public Pojazd dostepDoPojazdu()\n\t{\n\t\treturn pojazd;\n\t}",
"private Pares(PLoc p, PLoc s, int d){\n\t\t\tprimero=p;\n\t\t\tsegundo=s;\n\t\t\tdistancia=d;\n\t\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n\tpublic String parler() {\n\t\treturn \"Je suis un Orc\";\n\t}",
"private void poetries() {\n\n\t}",
"Uom getUom();",
"@Override\n\tpublic void visitTdetree(Tdetree p) {\n\n\t}",
"public abstract void mo20899UO();",
"@Override\n public void perish() {\n \n }",
"@Override\n\tpublic void pausaParaComer() {\n\n\t}",
"static void pontipo(String t){\r\n\t\tStruct s=new Struct(t,0);\r\n\t\tStruct auxt=buscaT(s);\r\n\t\t/*He encontrado el tipo q tengo q insertar*/\r\n\t\tif(aux==null){\r\n\t\t\t//Parse.SemError(1);\r\n\t\t\tSystem.out.println(\"ERROR TIPO NO ENCONTRADO!!\");\r\n\t\t}else{\r\n\t\t\tObj aux2=aux;\r\n\t\t\twhile (aux2 != null){\r\n\t\t\t\taux2.type=auxt;\r\n\t\t\t\taux2=aux2.next;\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public void mo21791P() {\n }",
"public void pgr_U_First(ActionEvent e) throws Exception\n\t{\n\t\tpgr_D_First(e);\n\t}",
"public void mo4359a() {\n }",
"@Override\n public void antidote(Player p) {\n LOG.wtf(this.getClass().getSimpleName(), \"ANTIDOTE SET TO \" + p.toString());\n }",
"public final String deu() {\n String str;\n AppMethodBeat.i(26738);\n String str2 = \"\";\n synchronized (this) {\n try {\n if (this.iPr == null || this.iPr.size() <= 0) {\n str = \"\";\n } else {\n int i = 0;\n while (i < this.iPr.size()) {\n com.tencent.mm.plugin.wenote.model.a.c cVar = (com.tencent.mm.plugin.wenote.model.a.c) this.iPr.get(i);\n switch (cVar.getType()) {\n case -1:\n str = str2 + \"<hr/>\";\n break;\n case 1:\n i iVar = (i) cVar;\n if (!bo.isNullOrNil(iVar.content)) {\n str2 = str2 + iVar.content;\n if (i + 1 < this.iPr.size() && ((com.tencent.mm.plugin.wenote.model.a.c) this.iPr.get(i + 1)).getType() == 1 && !bo.isNullOrNil(((i) this.iPr.get(i + 1)).content)) {\n str = str2 + \"<br/>\";\n break;\n }\n }\n str = str2 + \"<br/>\";\n break;\n case 2:\n str = str2 + dO(((f) cVar).uOo, 2);\n break;\n case 3:\n str = str2 + dO(((g) cVar).uOo, 3);\n break;\n case 4:\n l lVar = (l) cVar;\n str = str2 + dO(lVar.uOo, lVar.getType());\n break;\n case 5:\n str = str2 + dO(((d) cVar).uOo, 5);\n break;\n case 6:\n str = str2 + dO(((k) cVar).uOo, 6);\n break;\n case 20:\n str = str2 + dO(((com.tencent.mm.plugin.wenote.model.a.b) cVar).uOo, 20);\n break;\n default:\n str = str2;\n break;\n }\n i++;\n str2 = str;\n }\n str = str2.replaceAll(IOUtils.LINE_SEPARATOR_UNIX, \"<br/>\");\n AppMethodBeat.o(26738);\n }\n } finally {\n while (true) {\n AppMethodBeat.o(26738);\n }\n }\n }\n return str;\n }",
"private void incrementarPuntaje(int puntos) {\n // TODO implement here\n }",
"public String toString() {\r\n\t\treturn \"P\";\r\n\t}",
"@Override\n\tpublic void jogavel(Participante p) {\n\t\t\n\t}",
"public static void main(String[] args) {\n\t\t\r\n\t\tempolye_details();\r\n\t\tempolye_id(2017,00,2117);\r\n\t\tSystem.out.println(empolye_post(\"Post : Junior Developer\"));\r\n\r\n\t\t \r\n\t}",
"public void xuat() {\n\n\t}",
"abstract void uminus();",
"protected E value(Position<Item<E>> p) {\n return p.getElement().getValue();\n }",
"private USI_TRLT() {}",
"@Override\n public void cantidad_Ataque(){\n ataque=5+2*nivel+aumentoT;\n }",
"private static void etapa2Urna() {\n\t\t\n\t\tint opcaoNumero = 0;\n\n\t\tdo {\n\t\t\t\n\t\t\tSystem.out.println();\n\t\t\t\n\t\t\tSystem.out.println(\"Votação\");\n\t\t\tSystem.out.println(\"1 - Votar\");\n\t\t\tSystem.out.println(\"2 - Justificar ausencia\");\n\t\t\tSystem.out.println(\"Digite o número da etapa ou -1 para sair: \");\n\t\t\t\n\t\t\ttry {\n\t\t\n\t\t\t\topcaoNumero = Integer.parseInt(br.readLine());\n\t\t\n\t\t\t\tswitch( opcaoNumero ) {\n\t\t\n\t\t\t\tcase 1: \n\t\t\t\t\t// Abrir Etapa 1: Configurar Urna\n\t\t\t\t\tlimparConsole();\n\t\t\t\t\trealizarVotacao();\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase 2: \n\t\t\t\t\t// Abrir Etapa 2: Realizar Votacao na Urna\n\t\t\t\t\tlimparConsole();\n\t\t\t\t\tSystem.out.println(\"Insira o numero do seu titulo de eleitor\");\n\t\t\t\t\tint tituloEleitor = Integer.parseInt(br.readLine());\n\t\t\t\t\turna.justificarVoto(tituloEleitor);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\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\t\tSystem.out.println();\n\t\t\n\t\t}while(opcaoNumero != -1);\n\t}",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"public static void main(String[] args) {\n\t\t\n\t\n\t\tPunto puntoini = new Punto(0,-12.045916, -75.195270,0.0);\n\t\t\n\t\t\n\t\tTSPHeuristica tsp = new TSPHeuristica();\n\t\tSystem.out.println(\"mosgtrando valores inciales \");\n\t\ttsp.mostratPuntosHeuristica(getPuntos());\n\t\t\n\t\t//Ruta ruta = tsp.getRuta(puntoini, getPuntos());\n\t\tList<Punto> puntos = tsp.getRuta(puntoini, getPuntos());\n\t\t\n\t\tSystem.out.println(\" puntos ordenanos \");\n\t\ttsp.mostratPuntosHeuristica(puntos);\n\t\t\n\t\t\n\t}",
"public int getTp() {\n return tp;\n }",
"public static void main(String[] args) throws Exception {\n\t\tPerro p1=new Perro();\r\n\t\tPerro p2 =new Perro(\"Chucho\", \"Pastor Aleman\", 3,true);\r\n\t\tPerroPresa pp1=new PerroPresa();\r\n\t\tPerroPresa pp2=new PerroPresa(\"Dientes\",\"pitbull\",5,true);\r\n\t\tpp1.setNombre(\"ŅamŅam\");\r\n\t\tp1.setEdad(-3);\r\n\t\tSystem.out.println(p1.toString());\r\n\t\tSystem.out.println(p2.toString());\r\n\t\tSystem.out.println(pp1.toString());\r\n\t\tpp1.atacar();\r\n\t\tSystem.out.println(pp2.toString());\r\n\t\tpp2.atacar();\r\n\t}",
"@Override\n public String getDescription() {\n return \"Phasing vote casting\";\n }",
"P createP();",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"public void mo21779D() {\n }",
"public void mo21878t() {\n }",
"private static PohonAVL seimbangkanKembaliKanan(PohonAVL p) {\n //...\n // Write your codes in here\n }",
"public void mo38117a() {\n }",
"public void mo21794S() {\n }",
"T mo26439a();",
"Term getP();",
"private static void runPastr() throws GameActionException {\n\t\t\n\t}",
"public void visit(Personnes p) {\n pers = p;\n tpsAttentePerso = p.getTpsAttente();\n tpsAttentePerso2 = p.getTpsArrive();\n totalTime += tpsAttentePerso;\n\tnbVisited += 1;\n moyenne = totalTime/nbVisited; \n }",
"public String toString() {\n\t\treturn \"PT\";\n\t}",
"public void mo21780E() {\n }",
"public <TPDVPagamentos extends br.lry.process.AUTPDVPagamentoPedido> TPDVPagamentos autPDVPagamentos() {\r\n\t\tif(pdvPagamentos==null) {\r\n\t\t\tpdvPagamentos = new AUTPDVPagamentoPedido();\r\n\t\t\tpdvPagamentos.AUT_AGENT_SILK4J = new com.borland.silktest.jtf.Desktop();\r\n\t\t\tpdvPagamentos.AUT_AGENT_SILK4J_CONFIGURATION = new BaseState(\"pdv.settings\");\r\n\t\t\tpdvPagamentos.AUT_AGENT_SILK4J.executeBaseState(pdvPagamentos.AUT_AGENT_SILK4J_CONFIGURATION);\r\n\t\t\t\r\n\t\t\treturn (TPDVPagamentos)pdvPagamentos;\r\n\t\t}\r\n\t\telse {\t\r\n\t\t\treturn (TPDVPagamentos)pdvPagamentos;\t\t\t\r\n\t\t}\r\n\t}",
"public void pridejNovePivo ()\n\t{\n\t\n\t\tpivo = pivo + PRODUKCE;\n\t\t\n\t}",
"abstract public Number getResult (final Number pe, final Number pd, final Number t) throws CGException ;",
"private void aumentarPuntos() {\r\n this.puntos++;\r\n this.form.AumentarPuntos(this.puntos);\r\n }",
"public void mo21792Q() {\n }",
"public Etudiant(int ce, String n, String p, Date d, String s, Filiere f) {\n idEtud = ce;\n nom = n;\n prenom = p;\n dn = d;\n sexe = s;\n filiere = f;\n }",
"@Override\n public String toString(){\n return \"(\" + t + \", \" + u + \")\";\n }",
"public static void main(String[] args ){\n punto5();\n\n }",
"public void mo21783H() {\n }",
"public static PohonAVL hapusTinggiSeimbang (PohonAVL p, int n) {\n\t// Write your codes in here\n //...\n // Write your codes in here\n }",
"public void perder() {\n // TODO implement here\n }",
"public void presenta_Estudiante(){\r\n System.out.println(\"Universidad Técnica Particular de Loja\\nInforme Semestral\\nEstudiante: \"+nombre+\r\n \"\\nAsignatura: \"+nAsignatura+\"\\nNota 1 Bimestre: \"+nota1B+\"\\nNota 2 Bimestre: \"+nota2B+\r\n \"\\nPromedio: \"+promedio()+\"\\nEstado de la Materia: \"+estado());\r\n }",
"public TODO (char d, int t, String n, int p, int w, int diff) throws\n\t IllegalArgumentException {\n\t if(p < 1 || p > 5) { \n\t throw new IllegalArgumentException(); \n\t }\n\t if(w < 0 || w > 100) { \n\t throw new IllegalArgumentException(); \n\t }\n\t if(diff < 1 || diff > 5) { \n\t throw new IllegalArgumentException(); \n\t }\n\t else {\n\t dueDate = d;\n\t timeAllocated = t;\n\t name = n;\n\t weight = convertWeight(w);\n\t difficulty = diff;\n\t user_priority = p;\n\t assignPriority();\n\t }\n \n\t}",
"@Override\n\tpublic void createCpteEpargne(CompteEpargne cpt) {\n\t\t\n\t}",
"public void Ordenamiento() {\n\n\t}",
"public void sacarPaseo(){\r\n\t\t\tSystem.out.println(\"Por las tardes me saca de paseo mi dueño\");\r\n\t\t\t\r\n\t\t}",
"void mo83706a(C32459e<T> eVar);",
"@Override\n public void prepare() {\n System.out.println(\"Add Pepporonie!!\");\n }",
"private String elaboraIncipit() {\n String testo = VUOTA;\n\n if (usaHeadIncipit) {\n testo += elaboraIncipitSpecifico();\n testo += A_CAPO;\n }// fine del blocco if\n\n return testo;\n }",
"public double tProbability(String f, String e){\n\t\tPair fe = new Pair(f,e);\n\t\t\n\t\tint V = 163303;\n\t\tif (t_table.containsKey(fe)){\n\t\t\t\n\t\t\treturn t_table.get(fe);\n\t\t}\n\t\telse{\n\t\t\tif (e.equals(\"null\"))\n\t\t\t\treturn nullEmissionProb;\n\t\t\telse\n\t\t\t\treturn 1.0/V;\n\t\t} \n\t}",
"private SegmentTmTuv createTuv(SegmentTmTu p_tu, Element p_root)\n throws Exception\n {\n SegmentTmTuv result = new SegmentTmTuv();\n result.setOrgSegment(p_root.asXML());\n \n // need to set backpointer to tuv, or SegmentTmTuv.equals() fails.\n result.setTu(p_tu);\n\n // language of the TUV \"EN-US\", case insensitive\n String lang = p_root.attributeValue(Tmx.LANG);\n\n try\n {\n String locale = ImportUtil.normalizeLocale(lang);\n result.setLocale(ImportUtil.getLocaleByName(locale));\n }\n catch (Throwable ex)\n {\n throw new Exception(\"unknown locale \" + lang + \",you can create it in system then retry.\");\n }\n\n // Creation user - always set to a known value\n String user = p_root.attributeValue(Tmx.CREATIONID);\n if (user == null)\n {\n user = p_root.getParent().attributeValue(Tmx.CREATIONID);\n }\n\n result.setCreationUser(user != null ? user : Tmx.DEFAULT_USER);\n\n // Modification user - only set if known\n user = p_root.attributeValue(Tmx.CHANGEID);\n if (user == null)\n {\n user = p_root.getParent().attributeValue(Tmx.CHANGEID);\n }\n\n if (user != null)\n {\n result.setModifyUser(user);\n }\n\n // Timestamps (should be expressed using java.util.Date).\n // In TMX, timestamps use the short form: yyyymmddThhmmssZ,\n // so prepare for both short and long form.\n Date now = new Date();\n Date date;\n\n // Creation date - always set to a known value\n String ts = p_root.attributeValue(Tmx.CREATIONDATE);\n if (ts == null)\n {\n ts = p_root.getParent().attributeValue(Tmx.CREATIONDATE);\n }\n\n if (ts != null)\n {\n date = UTC.parseNoSeparators(ts);\n if (date == null)\n {\n date = UTC.parse(ts);\n }\n result.setCreationDate(new Timestamp(date.getTime()));\n }\n else\n {\n result.setCreationDate(new Timestamp(now.getTime()));\n }\n\n // Modification date - only set if known (note: currently\n // AbstractTmTuv sets the modification date to NOW)\n ts = p_root.attributeValue(Tmx.CHANGEDATE);\n if (ts == null)\n {\n ts = p_root.getParent().attributeValue(Tmx.CHANGEDATE);\n }\n\n if (ts != null)\n {\n date = UTC.parseNoSeparators(ts);\n if (date == null)\n {\n date = UTC.parse(ts);\n }\n result.setModifyDate(new Timestamp(date.getTime()));\n }\n else\n {\n // If no \"changedate\", set it same as \"creationdate\".\n result.setModifyDate(result.getCreationDate());\n }\n\n\t\tts = p_root.attributeValue(Tmx.LASTUSAGEDATE);\n\t\tif (ts == null)\n\t\t{\n\t\t\tts = p_root.getParent().attributeValue(Tmx.LASTUSAGEDATE);\n\t\t}\n\t\tif (ts != null)\n\t\t{\n\t\t\tdate = UTC.parseNoSeparators(ts);\n\t\t\tif (date == null)\n\t\t\t{\n\t\t\t\tdate = UTC.parse(ts);\n\t\t\t}\n\t\t\tresult.setLastUsageDate(new Timestamp(date.getTime()));\n\t\t}\n\n\t\tList tuvPropNodes = p_root.elements(\"prop\");\n\t\tfor (int i = 0; i < tuvPropNodes.size(); i++)\n\t\t{\n\t\t\tElement elem = (Element) tuvPropNodes.get(i);\n\t\t\tString type = elem.attributeValue(\"type\");\n\t\t\tString value = elem.getText();\n\t\t\tif (Tmx.PROP_PREVIOUS_HASH.equalsIgnoreCase(type))\n\t\t\t{\n\t\t\t\tresult.setPreviousHash(Long.parseLong(value));\n\t\t\t}\n\t\t\telse if (Tmx.PROP_NEXT_HASH.equalsIgnoreCase(type))\n\t\t\t{\n\t\t\t\tresult.setNextHash(Long.parseLong(value));\n\t\t\t}\n\t\t\telse if (Tmx.PROP_JOB_ID.equalsIgnoreCase(type))\n\t\t\t{\n\t\t\t\tresult.setJobId(Long.parseLong(value));\n\t\t\t}\n\t\t\telse if (Tmx.PROP_JOB_NAME.equalsIgnoreCase(type))\n\t\t\t{\n\t\t\t\tresult.setJobName(value);\n\t\t\t}\n\t\t\telse if (Tmx.PROP_CREATION_PROJECT.equalsIgnoreCase(type))\n\t\t\t{\n\t\t\t\tresult.setUpdatedProject(value);\n\t\t\t}\n\t\t}\n // Segment text: need to produce root elements <translatable>\n // and <localizable> depending on TU type.\n StringBuffer segment = new StringBuffer();\n\n if (p_tu.isTranslatable())\n {\n segment.append(\"<segment>\");\n }\n else\n {\n segment.append(\"<localizable>\");\n }\n\n segment.append(getSegmentValue(p_root));\n\n if (p_tu.isTranslatable())\n {\n segment.append(\"</segment>\");\n }\n else\n {\n segment.append(\"</localizable>\");\n }\n\n result.setSid(p_tu.getSID());\n //End of Added\n result.setSegment(segment.toString());\n\n return result;\n }",
"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 }",
"void kiemTraThangHopLi() {\n }",
"@Test\n @Tag(\"slow\")\n public void testPDS_02() {\n CuteNetlibCase.doTest(\"PDS-02.SIF\", \"2.885786201E10\", \"2.931365171E10\", NumberContext.of(7, 4));\n }",
"@Test\n public void testORMUsageToretrieveTbsPatternSavedEntity() throws DataloadGeneratorException {\n List<TbsPatternSavedTEntity> tbsPatternSavedTEntities = getTbsPatternSavedTEntityList(TBS_SELF_SOLUTION);\n\n for(TbsPatternSavedTEntity tbsPatternSavedTEntity : tbsPatternSavedTEntities){\n if(\"td_admin\".equalsIgnoreCase(tbsPatternSavedTEntity.getOperator()))\n System.out.println(\"Operator : \" + tbsPatternSavedTEntity.getOperator() +\" -- Dataload Name\" +tbsPatternSavedTEntity.getSegment() + \"Intermediate File : \" + tbsPatternSavedTEntity.getIntermediateXml());\n }\n assertNotNull(tbsPatternSavedTEntities);\n }",
"long getTimeSpoutBoltA();",
"public abstract void mo56925d();",
"public String getPoruka() {\r\n\treturn \"poruka\";\r\n\t}",
"public Puntaje getPuntaje() \r\n {\r\n return puntaje;\r\n }",
"public void mo3749d() {\n }",
"public Puntaje() {\n nombre = \"\";\n puntos = 0;\n }",
"private void m50366E() {\n }",
"public void atakuj() {\n\n System.out.println(\"to metoda atakuj z klasy Potwor \");\n\n }",
"public Puntaje(String nom, int puntaje) {\n this.nombre = nom;\n this.puntos = puntaje;\n }",
"public static void main(String[] args) {\n\t\tSS p=new SS();\n\t\tSS q=new SS(\"홍 길 동\",20,\"000-1111-2222\",75.8);\n\t\tSystem.out.println(\"p--\");\n\t\tp.disp();\n\t\tSystem.out.println(\"q--\");\n\t\tq.disp();\n\t}",
"private void transportPara() {\n int[] para = bottom_screen.transportPara();\n Attack_Menu.setHp_1(para[0]);\n Attack_Menu.setHp_2(para[1]);\n Attack_Menu.setDamage_1(para[2]);\n Attack_Menu.setDamage_2(para[3]);\n Attack_Menu.setHit_1(para[4]);\n Attack_Menu.setHit_2(para[5]);\n Attack_Menu.setCrit_1(para[6]);\n Attack_Menu.setCrit_2(para[7]);\n Attack_Menu.setTurn_1(para[8]);\n Attack_Menu.setTurn_2(para[9]);\n }",
"@Override\n\tpublic void readCpteEpargne(CompteEpargne cpt) {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}"
] | [
"0.541268",
"0.5330705",
"0.52557594",
"0.52362335",
"0.5142644",
"0.5140958",
"0.5114497",
"0.5099736",
"0.5083453",
"0.5082616",
"0.5080555",
"0.50640744",
"0.5055676",
"0.5026163",
"0.5019378",
"0.49844092",
"0.4980982",
"0.49753615",
"0.49597204",
"0.49539682",
"0.49509558",
"0.4949569",
"0.49431983",
"0.49114576",
"0.49022135",
"0.48999622",
"0.48831254",
"0.48581916",
"0.48439822",
"0.48400483",
"0.48338252",
"0.48320392",
"0.48281965",
"0.48176375",
"0.481611",
"0.48091322",
"0.48019433",
"0.4801315",
"0.4797942",
"0.47970426",
"0.4796413",
"0.47949025",
"0.4789611",
"0.47870457",
"0.4785754",
"0.4784952",
"0.47789228",
"0.47770002",
"0.47551477",
"0.47441444",
"0.4732391",
"0.47289756",
"0.47252485",
"0.4717177",
"0.471678",
"0.47164774",
"0.47129476",
"0.47100008",
"0.47066036",
"0.47063556",
"0.47058114",
"0.47018126",
"0.47013658",
"0.4697877",
"0.4697404",
"0.46953192",
"0.4692694",
"0.46746987",
"0.46720847",
"0.46719763",
"0.46670032",
"0.4666231",
"0.46635145",
"0.46632147",
"0.46571353",
"0.46476072",
"0.4640471",
"0.46386424",
"0.46350914",
"0.4630893",
"0.46305636",
"0.4625167",
"0.46239477",
"0.46238714",
"0.4622574",
"0.46214393",
"0.4619255",
"0.46174076",
"0.46153307",
"0.46059823",
"0.4593577",
"0.45893595",
"0.45866153",
"0.45825425",
"0.4582177",
"0.45813128",
"0.45791036",
"0.4576866",
"0.45743442",
"0.4573406",
"0.45690513"
] | 0.0 | -1 |
R E A D | @Override
public void read() {
Connection conexao = mysql.getConnection();
try {
PreparedStatement stm = conexao.prepareStatement(readSQL);
ResultSet rs = stm.executeQuery();
while (rs.next()) {
int idcodigo = rs.getInt("idcodigo");
String data = rs.getString("data");
int p_rodada = rs.getInt("p_rodada");
int s_rodada = rs.getInt("s_rodada");
int t_rodada = rs.getInt("t_rodada");
int total = rs.getInt("total");
System.out.println("\nCódigo: " + idcodigo + "\nData: " + data + "\nPrimeira Rodada: " + p_rodada+ "\nSegunda Rodada: " + s_rodada + "\nTerceira Rodada: " + t_rodada + "\nTotal: " + total);
}
rs.close();
conexao.close();
} catch (final SQLException ex) {
System.out.println("Falha de conexão com a base de dados!");
ex.printStackTrace();
} catch (final Exception ex) {
ex.printStackTrace();
} finally {
try {
conexao.close();
} catch (final Exception ex) {
ex.printStackTrace();
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"int getD();",
"public int getD() {\n\t\treturn d;\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"public abstract C17954dh<E> mo45842a();",
"public int getD() {\n return d_;\n }",
"public void dorm22_(CHARACTER SIDE,CHARACTER TRANS,INTEGER M,INTEGER N,INTEGER N1,INTEGER N2,double[] Q,INTEGER LDQ,double[] C,INTEGER LDC,double[] WORK,INTEGER LWORK,INTEGER INFO);",
"public int getD() {\n return d_;\n }",
"public String getD() {\n return d;\n }",
"public void dorm2r_(CHARACTER SIDE,CHARACTER TRANS,INTEGER M,INTEGER N,INTEGER K,double[] A,INTEGER LDA,double[] TAU,double[] C,INTEGER LDC,double[] WORK,INTEGER INFO);",
"public void dormhr_(CHARACTER SIDE,CHARACTER TRANS,INTEGER M,INTEGER N,INTEGER ILO,INTEGER IHI,double[] A,INTEGER LDA,double[] TAU,double[] C,INTEGER LDC,double[] WORK,INTEGER LWORK,INTEGER INFO);",
"public int getiD() {\n return iD;\n }",
"public final void mo59469qD() {\n AppMethodBeat.m2504i(94717);\n try {\n C45018f c45018f = this.aRr;\n if (c45018f.aQP || !c45018f.isInitialized()) {\n AppMethodBeat.m2505o(94717);\n return;\n }\n if (c45018f.mo72533qo()) {\n c45018f.aQc.mo2535L(c45018f.mo72538qt());\n c45018f.aQo = 0;\n c45018f.aQP = true;\n }\n AppMethodBeat.m2505o(94717);\n } catch (C37227h e) {\n C25533e b = C25533e.m40358b(e, this.index);\n AppMethodBeat.m2505o(94717);\n throw b;\n }\n }",
"public abstract int d();",
"public void dormql_(CHARACTER SIDE,CHARACTER TRANS,INTEGER M,INTEGER N,INTEGER K,double[] A,INTEGER LDA,double[] TAU,double[] C,INTEGER LDC,double[] WORK,INTEGER LWORK,INTEGER INFO);",
"public abstract int getDx();",
"float getD();",
"public void dormr2_(CHARACTER SIDE,CHARACTER TRANS,INTEGER M,INTEGER N,INTEGER K,double[] A,INTEGER LDA,double[] TAU,double[] C,INTEGER LDC,double[] WORK,INTEGER INFO);",
"@Override\r\n public String getStringRepresentation()\r\n {\r\n return \"D\";\r\n }",
"public int d()\r\n/* 79: */ {\r\n/* 80:82 */ return this.d;\r\n/* 81: */ }",
"public a dD() {\n return new a(this.HG);\n }",
"public abstract long mo9229aD();",
"public void mo21779D() {\n }",
"public float d() {\n if (B1() || A1()) {\n return this.A + this.o + this.B;\n }\n return 0.0f;\n }",
"public Dx getDx() {\n/* 32 */ return this.dx;\n/* */ }",
"public final bp dd() {\n if (this.ad == null) {\n return null;\n }\n dp aq = (-1 == this.cs * -1099198911 || this.cx * -1961250233 != 0) ? null : gn.aq(this.cs * -1099198911, 1871547802);\n dp aq2 = (-1 == this.ce * -1620542321 || (this.ce * -1620542321 == this.bb * -959328679 && aq != null)) ? null : gn.aq(this.ce * -1620542321, 1539681168);\n bp ai = this.ad.ai(aq, this.cr * 317461367, aq2, this.cy * 631506963, 578342776);\n if (ai == null) {\n return null;\n }\n bp bpVar;\n ai.ai();\n this.di = ai.bx * -1067272603;\n if (!(-1 == this.ck * 836985687 || -1 == this.co * 1215520647)) {\n bp aj = dd.aq(this.ck * 836985687, 812886062).aj(this.co * 1215520647, (byte) 33);\n if (aj != null) {\n aj.ac(0, -(this.cz * -583056727), 0);\n bpVar = new bp(new bp[]{ai, aj}, 2);\n if (1 == this.ad.ae * -735434895) {\n bpVar.bs = true;\n }\n return bpVar;\n }\n }\n bpVar = ai;\n if (1 == this.ad.ae * -735434895) {\n }\n return bpVar;\n }",
"public void d() {\n }",
"public int d()\n {\n return 1;\n }",
"public int edad(){\n return edad;\n }",
"public static final float getAD() {\r\n\t\treturn A_D;\r\n\t}",
"private int bresA(int a, int b, int d) { //A as in Axis\n int add = 0;\n err += b;\n if(2*err >= a) {\n add = d;\n err -= a;\n }\n return add;\n }",
"String dibujar();",
"public void dor(){\n }",
"int getEvd();",
"public void mo4359a() {\n }",
"public void dormrq_(CHARACTER SIDE,CHARACTER TRANS,INTEGER M,INTEGER N,INTEGER K,double[] A,INTEGER LDA,double[] TAU,double[] C,INTEGER LDC,double[] WORK,INTEGER LWORK,INTEGER INFO);",
"public Integer getS_d_i() {\n return s_d_i;\n }",
"private void m27468d() {\n switch (this.f25258E) {\n case 1:\n this.f25270Q = this.f25294i.left;\n break;\n case 2:\n this.f25270Q = this.f25294i.right;\n break;\n default:\n this.f25270Q = this.f25268O;\n break;\n }\n this.f25271R = (int) (((float) this.f25269P) - ((this.f25288c.ascent() + this.f25288c.descent()) / 2.0f));\n }",
"public abstract void mo56925d();",
"private NodoBin<T> rDerecha(NodoBin<T> r) {\n NodoBin<T> x = r.getIzq();\n r.setIzq(x.getDer());\n x.setDer(r);\n return x;\n }",
"String mo20732d();",
"public void dbE() {\n }",
"public BigInteger getD() {\n return d;\n }",
"public Double getDx();",
"void mo21073d();",
"void mo17013d();",
"public abstract String mo41079d();",
"private void recalcD(int[] deltaA) {\n if(deltaA[0] != deltaA[1]) {\n if(deltaA[0] > deltaA[1]) {\n dA[1] = bresA(deltaA[0], deltaA[1], dA[1]);\n } else {\n dA[0] = bresA(deltaA[1], deltaA[0], dA[0]);\n }\n }\n //3D appears, what we do? Keep calm & copypaste shit for XZ, YZ\n }",
"public int d()\r\n {\r\n return 20;\r\n }",
"abstract C0451h mo1607e();",
"public float d()\r\n/* 15: */ {\r\n/* 16:163 */ return this.b;\r\n/* 17: */ }",
"public final synchronized void d() {\n /*\n r10 = this;\n monitor-enter(r10)\n android.content.Context r0 = r10.f // Catch:{ all -> 0x0053 }\n r1 = 0\n if (r0 != 0) goto L_0x0008\n r0 = 0\n goto L_0x000e\n L_0x0008:\n android.content.Context r0 = r10.f // Catch:{ all -> 0x0053 }\n int r0 = com.google.ads.interactivemedia.v3.internal.vf.a(r0) // Catch:{ all -> 0x0053 }\n L_0x000e:\n int r2 = r10.n // Catch:{ all -> 0x0053 }\n if (r2 != r0) goto L_0x0014\n monitor-exit(r10)\n return\n L_0x0014:\n r10.n = r0 // Catch:{ all -> 0x0053 }\n r2 = 1\n if (r0 == r2) goto L_0x0051\n if (r0 == 0) goto L_0x0051\n r2 = 8\n if (r0 != r2) goto L_0x0020\n goto L_0x0051\n L_0x0020:\n long r2 = r10.a(r0) // Catch:{ all -> 0x0053 }\n r10.q = r2 // Catch:{ all -> 0x0053 }\n com.google.ads.interactivemedia.v3.internal.ua r0 = r10.j // Catch:{ all -> 0x0053 }\n long r2 = r0.a() // Catch:{ all -> 0x0053 }\n int r0 = r10.k // Catch:{ all -> 0x0053 }\n if (r0 <= 0) goto L_0x0037\n long r0 = r10.l // Catch:{ all -> 0x0053 }\n long r0 = r2 - r0\n int r1 = (int) r0 // Catch:{ all -> 0x0053 }\n r5 = r1\n goto L_0x0038\n L_0x0037:\n r5 = 0\n L_0x0038:\n long r6 = r10.m // Catch:{ all -> 0x0053 }\n long r8 = r10.q // Catch:{ all -> 0x0053 }\n r4 = r10\n r4.a(r5, r6, r8) // Catch:{ all -> 0x0053 }\n r10.l = r2 // Catch:{ all -> 0x0053 }\n r0 = 0\n r10.m = r0 // Catch:{ all -> 0x0053 }\n r10.p = r0 // Catch:{ all -> 0x0053 }\n r10.o = r0 // Catch:{ all -> 0x0053 }\n com.google.ads.interactivemedia.v3.internal.ux r0 = r10.i // Catch:{ all -> 0x0053 }\n r0.a() // Catch:{ all -> 0x0053 }\n monitor-exit(r10)\n return\n L_0x0051:\n monitor-exit(r10)\n return\n L_0x0053:\n r0 = move-exception\n monitor-exit(r10)\n throw r0\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.ads.interactivemedia.v3.internal.ss.d():void\");\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"public void d() {\n this.f20599d.a(this.f20598c);\n this.f20598c.a(this);\n this.f20601f = new a(new d());\n d.a(this.f20596a, this.f20597b, this.f20601f);\n this.f20596a.setLayoutManager(new NPALinearLayoutManager(getContext()));\n ((s) this.f20596a.getItemAnimator()).setSupportsChangeAnimations(false);\n this.f20596a.setAdapter(this.f20601f);\n this.f20598c.a(this.f20602g);\n }",
"private final boolean e() {\n /*\n r15 = this;\n r2 = 0\n r1 = 0\n dtd r0 = r15.m // Catch:{ all -> 0x008e }\n if (r0 != 0) goto L_0x000d\n dtd r0 = new dtd // Catch:{ all -> 0x008e }\n r0.<init>() // Catch:{ all -> 0x008e }\n r15.m = r0 // Catch:{ all -> 0x008e }\n L_0x000d:\n int r0 = r15.k // Catch:{ all -> 0x008e }\n dtd r3 = r15.m // Catch:{ all -> 0x008e }\n int r3 = r3.a // Catch:{ all -> 0x008e }\n int r0 = r0 - r3\n if (r0 <= 0) goto L_0x039e\n dvk r3 = r15.g // Catch:{ all -> 0x008e }\n if (r3 == 0) goto L_0x0356\n byte[] r3 = r15.h // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n if (r3 == 0) goto L_0x0025\n int r3 = r15.i // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n byte[] r4 = r15.h // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r4 = r4.length // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n if (r3 != r4) goto L_0x0032\n L_0x0025:\n r3 = 2097152(0x200000, float:2.938736E-39)\n int r3 = java.lang.Math.min(r0, r3) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n byte[] r3 = new byte[r3] // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r15.h = r3 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r3 = 0\n r15.i = r3 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n L_0x0032:\n byte[] r3 = r15.h // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r3 = r3.length // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r4 = r15.i // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r3 = r3 - r4\n int r6 = java.lang.Math.min(r0, r3) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvk r7 = r15.g // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n byte[] r8 = r15.h // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r9 = r15.i // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n boolean r0 = r7.i // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n if (r0 != 0) goto L_0x00ac\n r0 = 1\n L_0x0047:\n java.lang.String r3 = \"GzipInflatingBuffer is closed\"\n defpackage.cld.b(r0, r3) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r3 = 0\n r0 = 1\n r5 = r3\n L_0x004f:\n if (r0 == 0) goto L_0x02ef\n int r3 = r6 - r5\n if (r3 <= 0) goto L_0x02ef\n dvm r0 = r7.h // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = r0.ordinal() // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n switch(r0) {\n case 0: goto L_0x00ae;\n case 1: goto L_0x0148;\n case 2: goto L_0x0171;\n case 3: goto L_0x01d7;\n case 4: goto L_0x01fc;\n case 5: goto L_0x0221;\n case 6: goto L_0x0256;\n case 7: goto L_0x0289;\n case 8: goto L_0x02a2;\n case 9: goto L_0x02e9;\n default: goto L_0x005e;\n } // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n L_0x005e:\n java.lang.AssertionError r0 = new java.lang.AssertionError // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvm r3 = r7.h // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n java.lang.String r3 = java.lang.String.valueOf(r3) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n java.lang.String r4 = java.lang.String.valueOf(r3) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r4 = r4.length() // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r4 = r4 + 15\n java.lang.StringBuilder r5 = new java.lang.StringBuilder // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r5.<init>(r4) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n java.lang.String r4 = \"Invalid state: \"\n java.lang.StringBuilder r4 = r5.append(r4) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n java.lang.StringBuilder r3 = r4.append(r3) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n java.lang.String r3 = r3.toString() // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r0.<init>(r3) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n throw r0 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n L_0x0087:\n r0 = move-exception\n java.lang.RuntimeException r3 = new java.lang.RuntimeException // Catch:{ all -> 0x008e }\n r3.<init>(r0) // Catch:{ all -> 0x008e }\n throw r3 // Catch:{ all -> 0x008e }\n L_0x008e:\n r0 = move-exception\n if (r2 <= 0) goto L_0x00ab\n dxe r3 = r15.a\n r3.a(r2)\n dxh r3 = r15.j\n dxh r4 = defpackage.dxh.BODY\n if (r3 != r4) goto L_0x00ab\n dvk r3 = r15.g\n if (r3 == 0) goto L_0x03c9\n dzo r2 = r15.d\n long r4 = (long) r1\n r2.d(r4)\n int r2 = r15.r\n int r1 = r1 + r2\n r15.r = r1\n L_0x00ab:\n throw r0\n L_0x00ac:\n r0 = 0\n goto L_0x0047\n L_0x00ae:\n dvl r0 = r7.c // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = r0.b() // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r3 = 10\n if (r0 >= r3) goto L_0x00ba\n r0 = 0\n goto L_0x004f\n L_0x00ba:\n dvl r0 = r7.c // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = r0.c() // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r3 = 35615(0x8b1f, float:4.9907E-41)\n if (r0 == r3) goto L_0x00d4\n java.util.zip.ZipException r0 = new java.util.zip.ZipException // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n java.lang.String r3 = \"Not in GZIP format\"\n r0.<init>(r3) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n throw r0 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n L_0x00cd:\n r0 = move-exception\n java.lang.RuntimeException r3 = new java.lang.RuntimeException // Catch:{ all -> 0x008e }\n r3.<init>(r0) // Catch:{ all -> 0x008e }\n throw r3 // Catch:{ all -> 0x008e }\n L_0x00d4:\n dvl r0 = r7.c // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = r0.a() // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r3 = 8\n if (r0 == r3) goto L_0x00e6\n java.util.zip.ZipException r0 = new java.util.zip.ZipException // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n java.lang.String r3 = \"Unsupported compression method\"\n r0.<init>(r3) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n throw r0 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n L_0x00e6:\n dvl r0 = r7.c // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = r0.a() // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r7.j = r0 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvl r4 = r7.c // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r0 = 6\n dvk r3 = r4.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r3 = r3.f // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvk r10 = r4.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r10 = r10.e // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r3 = r3 - r10\n if (r3 <= 0) goto L_0x03d9\n r0 = 6\n int r0 = java.lang.Math.min(r3, r0) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvk r3 = r4.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n java.util.zip.CRC32 r3 = r3.b // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvk r10 = r4.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n byte[] r10 = r10.d // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvk r11 = r4.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r11 = r11.e // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r3.update(r10, r11, r0) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvk r3 = r4.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n defpackage.dvk.a(r3, r0) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = 6 - r0\n r3 = r0\n L_0x0118:\n if (r3 <= 0) goto L_0x013b\n r0 = 512(0x200, float:7.175E-43)\n byte[] r10 = new byte[r0] // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r0 = 0\n L_0x011f:\n if (r0 >= r3) goto L_0x013b\n int r11 = r3 - r0\n r12 = 512(0x200, float:7.175E-43)\n int r11 = java.lang.Math.min(r11, r12) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvk r12 = r4.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dtd r12 = r12.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r13 = 0\n r12.a(r10, r13, r11) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvk r12 = r4.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n java.util.zip.CRC32 r12 = r12.b // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r13 = 0\n r12.update(r10, r13, r11) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = r0 + r11\n goto L_0x011f\n L_0x013b:\n dvk r0 = r4.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r3 = 6\n defpackage.dvk.b(r0, r3) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvm r0 = defpackage.dvm.HEADER_EXTRA_LEN // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r7.h = r0 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r0 = 1\n goto L_0x004f\n L_0x0148:\n int r0 = r7.j // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r0 = r0 & 4\n r3 = 4\n if (r0 == r3) goto L_0x0156\n dvm r0 = defpackage.dvm.HEADER_NAME // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r7.h = r0 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r0 = 1\n goto L_0x004f\n L_0x0156:\n dvl r0 = r7.c // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = r0.b() // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r3 = 2\n if (r0 >= r3) goto L_0x0162\n r0 = 0\n goto L_0x004f\n L_0x0162:\n dvl r0 = r7.c // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = r0.c() // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r7.k = r0 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvm r0 = defpackage.dvm.HEADER_EXTRA // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r7.h = r0 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r0 = 1\n goto L_0x004f\n L_0x0171:\n dvl r0 = r7.c // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = r0.b() // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r3 = r7.k // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n if (r0 >= r3) goto L_0x017e\n r0 = 0\n goto L_0x004f\n L_0x017e:\n dvl r10 = r7.c // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r4 = r7.k // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvk r0 = r10.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = r0.f // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvk r3 = r10.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r3 = r3.e // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = r0 - r3\n if (r0 <= 0) goto L_0x03d6\n int r0 = java.lang.Math.min(r0, r4) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvk r3 = r10.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n java.util.zip.CRC32 r3 = r3.b // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvk r11 = r10.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n byte[] r11 = r11.d // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvk r12 = r10.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r12 = r12.e // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r3.update(r11, r12, r0) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvk r3 = r10.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n defpackage.dvk.a(r3, r0) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = r4 - r0\n r3 = r0\n L_0x01a8:\n if (r3 <= 0) goto L_0x01cb\n r0 = 512(0x200, float:7.175E-43)\n byte[] r11 = new byte[r0] // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r0 = 0\n L_0x01af:\n if (r0 >= r3) goto L_0x01cb\n int r12 = r3 - r0\n r13 = 512(0x200, float:7.175E-43)\n int r12 = java.lang.Math.min(r12, r13) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvk r13 = r10.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dtd r13 = r13.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r14 = 0\n r13.a(r11, r14, r12) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvk r13 = r10.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n java.util.zip.CRC32 r13 = r13.b // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r14 = 0\n r13.update(r11, r14, r12) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = r0 + r12\n goto L_0x01af\n L_0x01cb:\n dvk r0 = r10.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n defpackage.dvk.b(r0, r4) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvm r0 = defpackage.dvm.HEADER_NAME // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r7.h = r0 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r0 = 1\n goto L_0x004f\n L_0x01d7:\n int r0 = r7.j // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r0 = r0 & 8\n r3 = 8\n if (r0 != r3) goto L_0x01f5\n dvl r0 = r7.c // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n L_0x01e1:\n int r3 = r0.b() // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n if (r3 <= 0) goto L_0x01f3\n int r3 = r0.a() // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n if (r3 != 0) goto L_0x01e1\n r0 = 1\n L_0x01ee:\n if (r0 != 0) goto L_0x01f5\n r0 = 0\n goto L_0x004f\n L_0x01f3:\n r0 = 0\n goto L_0x01ee\n L_0x01f5:\n dvm r0 = defpackage.dvm.HEADER_COMMENT // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r7.h = r0 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r0 = 1\n goto L_0x004f\n L_0x01fc:\n int r0 = r7.j // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r0 = r0 & 16\n r3 = 16\n if (r0 != r3) goto L_0x021a\n dvl r0 = r7.c // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n L_0x0206:\n int r3 = r0.b() // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n if (r3 <= 0) goto L_0x0218\n int r3 = r0.a() // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n if (r3 != 0) goto L_0x0206\n r0 = 1\n L_0x0213:\n if (r0 != 0) goto L_0x021a\n r0 = 0\n goto L_0x004f\n L_0x0218:\n r0 = 0\n goto L_0x0213\n L_0x021a:\n dvm r0 = defpackage.dvm.HEADER_CRC // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r7.h = r0 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r0 = 1\n goto L_0x004f\n L_0x0221:\n int r0 = r7.j // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r0 = r0 & 2\n r3 = 2\n if (r0 != r3) goto L_0x024f\n dvl r0 = r7.c // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = r0.b() // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r3 = 2\n if (r0 >= r3) goto L_0x0234\n r0 = 0\n goto L_0x004f\n L_0x0234:\n java.util.zip.CRC32 r0 = r7.b // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n long r10 = r0.getValue() // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = (int) r10 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r3 = 65535(0xffff, float:9.1834E-41)\n r0 = r0 & r3\n dvl r3 = r7.c // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r3 = r3.c() // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n if (r0 == r3) goto L_0x024f\n java.util.zip.ZipException r0 = new java.util.zip.ZipException // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n java.lang.String r3 = \"Corrupt GZIP header\"\n r0.<init>(r3) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n throw r0 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n L_0x024f:\n dvm r0 = defpackage.dvm.INITIALIZE_INFLATER // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r7.h = r0 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r0 = 1\n goto L_0x004f\n L_0x0256:\n java.util.zip.Inflater r0 = r7.g // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n if (r0 != 0) goto L_0x027e\n java.util.zip.Inflater r0 = new java.util.zip.Inflater // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r3 = 1\n r0.<init>(r3) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r7.g = r0 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n L_0x0262:\n java.util.zip.CRC32 r0 = r7.b // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r0.reset() // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = r7.f // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r3 = r7.e // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = r0 - r3\n if (r0 <= 0) goto L_0x0284\n java.util.zip.Inflater r3 = r7.g // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n byte[] r4 = r7.d // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r10 = r7.e // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r3.setInput(r4, r10, r0) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvm r0 = defpackage.dvm.INFLATING // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r7.h = r0 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n L_0x027b:\n r0 = 1\n goto L_0x004f\n L_0x027e:\n java.util.zip.Inflater r0 = r7.g // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r0.reset() // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n goto L_0x0262\n L_0x0284:\n dvm r0 = defpackage.dvm.INFLATER_NEEDS_INPUT // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r7.h = r0 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n goto L_0x027b\n L_0x0289:\n int r0 = r9 + r5\n int r0 = r7.a(r8, r0, r3) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r3 = r5 + r0\n dvm r0 = r7.h // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvm r4 = defpackage.dvm.TRAILER // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n if (r0 != r4) goto L_0x029e\n boolean r0 = r7.a() // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r5 = r3\n goto L_0x004f\n L_0x029e:\n r0 = 1\n r5 = r3\n goto L_0x004f\n L_0x02a2:\n java.util.zip.Inflater r0 = r7.g // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n if (r0 == 0) goto L_0x02c7\n r0 = 1\n L_0x02a7:\n java.lang.String r3 = \"inflater is null\"\n defpackage.cld.b(r0, r3) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = r7.e // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r3 = r7.f // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n if (r0 != r3) goto L_0x02c9\n r0 = 1\n L_0x02b3:\n java.lang.String r3 = \"inflaterInput has unconsumed bytes\"\n defpackage.cld.b(r0, r3) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dtd r0 = r7.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = r0.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r3 = 512(0x200, float:7.175E-43)\n int r0 = java.lang.Math.min(r0, r3) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n if (r0 != 0) goto L_0x02cb\n r0 = 0\n goto L_0x004f\n L_0x02c7:\n r0 = 0\n goto L_0x02a7\n L_0x02c9:\n r0 = 0\n goto L_0x02b3\n L_0x02cb:\n r3 = 0\n r7.e = r3 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r7.f = r0 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dtd r3 = r7.a // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n byte[] r4 = r7.d // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r10 = r7.e // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r3.a(r4, r10, r0) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n java.util.zip.Inflater r3 = r7.g // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n byte[] r4 = r7.d // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r10 = r7.e // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r3.setInput(r4, r10, r0) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvm r0 = defpackage.dvm.INFLATING // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r7.h = r0 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r0 = 1\n goto L_0x004f\n L_0x02e9:\n boolean r0 = r7.a() // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n goto L_0x004f\n L_0x02ef:\n if (r0 == 0) goto L_0x0301\n dvm r0 = r7.h // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvm r3 = defpackage.dvm.HEADER // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n if (r0 != r3) goto L_0x0334\n dvl r0 = r7.c // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = r0.b() // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r3 = 10\n if (r0 >= r3) goto L_0x0334\n L_0x0301:\n r0 = 1\n L_0x0302:\n r7.n = r0 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dvk r0 = r15.g // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r3 = r0.l // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r4 = 0\n r0.l = r4 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r2 = r2 + r3\n dvk r0 = r15.g // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r3 = r0.m // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r4 = 0\n r0.m = r4 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r1 = r1 + r3\n if (r5 != 0) goto L_0x0342\n if (r2 <= 0) goto L_0x0332\n dxe r0 = r15.a\n r0.a(r2)\n dxh r0 = r15.j\n dxh r3 = defpackage.dxh.BODY\n if (r0 != r3) goto L_0x0332\n dvk r0 = r15.g\n if (r0 == 0) goto L_0x0336\n dzo r0 = r15.d\n long r2 = (long) r1\n r0.d(r2)\n int r0 = r15.r\n int r0 = r0 + r1\n r15.r = r0\n L_0x0332:\n r0 = 0\n L_0x0333:\n return r0\n L_0x0334:\n r0 = 0\n goto L_0x0302\n L_0x0336:\n dzo r0 = r15.d\n long r4 = (long) r2\n r0.d(r4)\n int r0 = r15.r\n int r0 = r0 + r2\n r15.r = r0\n goto L_0x0332\n L_0x0342:\n dtd r0 = r15.m // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n byte[] r3 = r15.h // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r4 = r15.i // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n dxv r3 = defpackage.dxw.a(r3, r4, r5) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n r0.a(r3) // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = r15.i // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n int r0 = r0 + r5\n r15.i = r0 // Catch:{ IOException -> 0x0087, DataFormatException -> 0x00cd }\n goto L_0x000d\n L_0x0356:\n dtd r3 = r15.n // Catch:{ all -> 0x008e }\n int r3 = r3.a // Catch:{ all -> 0x008e }\n if (r3 != 0) goto L_0x0386\n if (r2 <= 0) goto L_0x0378\n dxe r0 = r15.a\n r0.a(r2)\n dxh r0 = r15.j\n dxh r3 = defpackage.dxh.BODY\n if (r0 != r3) goto L_0x0378\n dvk r0 = r15.g\n if (r0 == 0) goto L_0x037a\n dzo r0 = r15.d\n long r2 = (long) r1\n r0.d(r2)\n int r0 = r15.r\n int r0 = r0 + r1\n r15.r = r0\n L_0x0378:\n r0 = 0\n goto L_0x0333\n L_0x037a:\n dzo r0 = r15.d\n long r4 = (long) r2\n r0.d(r4)\n int r0 = r15.r\n int r0 = r0 + r2\n r15.r = r0\n goto L_0x0378\n L_0x0386:\n dtd r3 = r15.n // Catch:{ all -> 0x008e }\n int r3 = r3.a // Catch:{ all -> 0x008e }\n int r0 = java.lang.Math.min(r0, r3) // Catch:{ all -> 0x008e }\n int r2 = r2 + r0\n dtd r3 = r15.m // Catch:{ all -> 0x008e }\n dtd r4 = r15.n // Catch:{ all -> 0x008e }\n dxv r0 = r4.a(r0) // Catch:{ all -> 0x008e }\n dtd r0 = (defpackage.dtd) r0 // Catch:{ all -> 0x008e }\n r3.a(r0) // Catch:{ all -> 0x008e }\n goto L_0x000d\n L_0x039e:\n if (r2 <= 0) goto L_0x03ba\n dxe r0 = r15.a\n r0.a(r2)\n dxh r0 = r15.j\n dxh r3 = defpackage.dxh.BODY\n if (r0 != r3) goto L_0x03ba\n dvk r0 = r15.g\n if (r0 == 0) goto L_0x03bd\n dzo r0 = r15.d\n long r2 = (long) r1\n r0.d(r2)\n int r0 = r15.r\n int r0 = r0 + r1\n r15.r = r0\n L_0x03ba:\n r0 = 1\n goto L_0x0333\n L_0x03bd:\n dzo r0 = r15.d\n long r4 = (long) r2\n r0.d(r4)\n int r0 = r15.r\n int r0 = r0 + r2\n r15.r = r0\n goto L_0x03ba\n L_0x03c9:\n dzo r1 = r15.d\n long r4 = (long) r2\n r1.d(r4)\n int r1 = r15.r\n int r1 = r1 + r2\n r15.r = r1\n goto L_0x00ab\n L_0x03d6:\n r3 = r4\n goto L_0x01a8\n L_0x03d9:\n r3 = r0\n goto L_0x0118\n */\n throw new UnsupportedOperationException(\"Method not decompiled: defpackage.dxd.e():boolean\");\n }",
"public static void main(String[] args) {\n\t\t\r\n\t\t\r\n\t\t\t\tdouble a, b, c, d, e;\r\n\t\t\t\ta = 5;\r\n\t\t\t\tb = 4; \r\n\t\t\t\tc = 3;\r\n\t\t\t\td = 2;\r\n\t\t\t\t\r\n\t\t\t\te = a / c * b / d - (a * b - c) / c * d;\r\n\t\t\t\tSystem.out.println(e);\r\n\t}",
"public DRA () throws CGException {\n vdm_init_DRA();\n }",
"public void dorml2_(CHARACTER SIDE,CHARACTER TRANS,INTEGER M,INTEGER N,INTEGER K,double[] A,INTEGER LDA,double[] TAU,double[] C,INTEGER LDC,double[] WORK,INTEGER INFO);",
"double d();",
"double defendre();",
"public int getSingles() {\n return h-(d+t+hr);\n }",
"public void mo97908d() {\n }",
"public void dormlq_(CHARACTER SIDE,CHARACTER TRANS,INTEGER M,INTEGER N,INTEGER K,double[] A,INTEGER LDA,double[] TAU,double[] C,INTEGER LDC,double[] WORK,INTEGER LWORK,INTEGER INFO);",
"private void m50366E() {\n }",
"public int E() {\n \treturn E;\n }",
"protected DNA(Population pop, DNA d) {\n\t\t// TODO: implement this\n\t}",
"public DancingNode()\n {\n L=R=U=D=this;\n }",
"public void mo2470d() {\n }",
"public void mo3749d() {\n }",
"public void d() {\n\t\tSystem.out.println(\"d method\");\n\t}",
"@java.lang.Override\n public float getD() {\n return d_;\n }",
"public void dormrz_(CHARACTER SIDE,CHARACTER TRANS,INTEGER M,INTEGER N,INTEGER K,INTEGER L,double[] A,INTEGER LDA,double[] TAU,double[] C,INTEGER LDC,double[] WORK,INTEGER LWORK,INTEGER INFO);",
"public final bp dt() {\n if (this.ad == null) {\n return null;\n }\n dp aq = (-1 == this.cs * -1099198911 || this.cx * -1961250233 != 0) ? null : gn.aq(this.cs * -1099198911, 1902805010);\n dp aq2 = (-1 == this.ce * -1620542321 || (this.ce * -1620542321 == this.bb * -959328679 && aq != null)) ? null : gn.aq(this.ce * -1620542321, 2037846592);\n bp ai = this.ad.ai(aq, this.cr * 317461367, aq2, this.cy * 631506963, 578342776);\n if (ai == null) {\n return null;\n }\n bp bpVar;\n ai.ai();\n this.di = ai.bx * -1067272603;\n if (!(-1 == this.ck * 836985687 || -1 == this.co * 1215520647)) {\n bp aj = dd.aq(this.ck * 836985687, 812886062).aj(this.co * 1215520647, (byte) 57);\n if (aj != null) {\n aj.ac(0, -(this.cz * -583056727), 0);\n bpVar = new bp(new bp[]{ai, aj}, 2);\n if (1 == this.ad.ae * -735434895) {\n bpVar.bs = true;\n }\n return bpVar;\n }\n }\n bpVar = ai;\n if (1 == this.ad.ae * -735434895) {\n }\n return bpVar;\n }",
"public com.introvd.template.sdk.model.editor.EffectInfoModel aqe() {\n /*\n r4 = this;\n java.util.List<com.introvd.template.sdk.model.editor.EffectInfoModel> r0 = r4.dcB\n int r0 = r0.size()\n if (r0 <= 0) goto L_0x0036\n java.util.List<com.introvd.template.sdk.model.editor.EffectInfoModel> r0 = r4.dcB\n int r0 = r0.size()\n int r0 = r0 + -1\n L_0x0010:\n if (r0 < 0) goto L_0x0036\n java.util.List<com.introvd.template.sdk.model.editor.EffectInfoModel> r1 = r4.dcB\n java.lang.Object r1 = r1.get(r0)\n com.introvd.template.sdk.model.editor.EffectInfoModel r1 = (com.introvd.template.sdk.model.editor.EffectInfoModel) r1\n if (r1 == 0) goto L_0x0033\n long r2 = r1.mTemplateId\n java.lang.String r2 = com.introvd.template.sdk.p391g.C8450a.m24469bn(r2)\n java.lang.String r2 = r2.toLowerCase()\n boolean r2 = com.introvd.template.editor.p266h.C6386d.m18377iL(r2)\n if (r2 != 0) goto L_0x0033\n boolean r2 = r1.isbNeedDownload()\n if (r2 != 0) goto L_0x0033\n goto L_0x0037\n L_0x0033:\n int r0 = r0 + -1\n goto L_0x0010\n L_0x0036:\n r1 = 0\n L_0x0037:\n if (r1 != 0) goto L_0x003d\n com.introvd.template.sdk.model.editor.EffectInfoModel r1 = r4.apZ()\n L_0x003d:\n return r1\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.introvd.template.editor.preview.fragment.p274a.C6638d.aqe():com.introvd.template.sdk.model.editor.EffectInfoModel\");\n }",
"public void dormbr_(CHARACTER VECT,CHARACTER SIDE,CHARACTER TRANS,INTEGER M,INTEGER N,INTEGER K,double[] A,INTEGER LDA,double[] TAU,double[] C,INTEGER LDC,double[] WORK,INTEGER LWORK,INTEGER INFO);",
"public abstract C13619e mo34787a();",
"String getATCUD();",
"@Test\n public void testDigTrans() {\n // Conditions initiales\n screen.init(10, 5); screen.setNature(6, 1, Cell.PLT);\n // Opération\n screen.dig(6, 1);\n // Oracle: vérifié par contrat\n }",
"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 }",
"@java.lang.Override\n public float getD() {\n return d_;\n }",
"private S(com.google.ad r9, com.google.h r10) {\n /*\n r8 = this;\n r0 = 0;\n r1 = -1;\n r7 = 2;\n r2 = 1;\n r5 = org.whispersystems.Y.r;\n r8.<init>();\n r8.k = r1;\n r8.n = r1;\n r8.c();\n r6 = com.google.eV.g();\n r1 = r0;\n L_0x0015:\n if (r0 != 0) goto L_0x006f;\n L_0x0017:\n r3 = r9.z();\t Catch:{ fN -> 0x008b, IOException -> 0x00aa }\n switch(r3) {\n case 0: goto L_0x0085;\n case 10: goto L_0x00c6;\n case 18: goto L_0x0055;\n default: goto L_0x001e;\n };\n L_0x001e:\n r3 = r8.a(r9, r6, r10, r3);\t Catch:{ fN -> 0x0089, IOException -> 0x00aa }\n if (r3 != 0) goto L_0x006d;\n L_0x0024:\n if (r5 == 0) goto L_0x00c4;\n L_0x0026:\n r3 = r2;\n L_0x0027:\n r0 = 0;\n r4 = r8.h;\t Catch:{ fN -> 0x008b, IOException -> 0x00aa }\n r4 = r4 & 1;\n if (r4 != r2) goto L_0x00c1;\n L_0x002e:\n r0 = r8.f;\t Catch:{ fN -> 0x008b, IOException -> 0x00aa }\n r0 = r0.w();\t Catch:{ fN -> 0x008b, IOException -> 0x00aa }\n r4 = r0;\n L_0x0035:\n r0 = org.whispersystems.Y.o;\t Catch:{ fN -> 0x00a8, IOException -> 0x00aa }\n r0 = r9.a(r0, r10);\t Catch:{ fN -> 0x00a8, IOException -> 0x00aa }\n r0 = (org.whispersystems.Y) r0;\t Catch:{ fN -> 0x00a8, IOException -> 0x00aa }\n r8.f = r0;\t Catch:{ fN -> 0x00a8, IOException -> 0x00aa }\n if (r4 == 0) goto L_0x004c;\n L_0x0041:\n r0 = r8.f;\t Catch:{ fN -> 0x00a8, IOException -> 0x00aa }\n r4.a(r0);\t Catch:{ fN -> 0x00a8, IOException -> 0x00aa }\n r0 = r4.a();\t Catch:{ fN -> 0x00a8, IOException -> 0x00aa }\n r8.f = r0;\t Catch:{ fN -> 0x00a8, IOException -> 0x00aa }\n L_0x004c:\n r0 = r8.h;\t Catch:{ fN -> 0x00b9, IOException -> 0x00aa }\n r0 = r0 | 1;\n r8.h = r0;\t Catch:{ fN -> 0x00b9, IOException -> 0x00aa }\n if (r5 == 0) goto L_0x00bf;\n L_0x0054:\n r0 = r3;\n L_0x0055:\n r3 = r1 & 2;\n if (r3 == r7) goto L_0x0062;\n L_0x0059:\n r3 = new java.util.ArrayList;\t Catch:{ fN -> 0x008b, IOException -> 0x00aa }\n r3.<init>();\t Catch:{ fN -> 0x008b, IOException -> 0x00aa }\n r8.l = r3;\t Catch:{ fN -> 0x008b, IOException -> 0x00aa }\n r1 = r1 | 2;\n L_0x0062:\n r3 = r8.l;\t Catch:{ fN -> 0x008b, IOException -> 0x00aa }\n r4 = org.whispersystems.Y.o;\t Catch:{ fN -> 0x008b, IOException -> 0x00aa }\n r4 = r9.a(r4, r10);\t Catch:{ fN -> 0x008b, IOException -> 0x00aa }\n r3.add(r4);\t Catch:{ fN -> 0x008b, IOException -> 0x00aa }\n L_0x006d:\n if (r5 == 0) goto L_0x0015;\n L_0x006f:\n r0 = r1 & 2;\n if (r0 != r7) goto L_0x007b;\n L_0x0073:\n r0 = r8.l;\t Catch:{ fN -> 0x00bb }\n r0 = java.util.Collections.unmodifiableList(r0);\t Catch:{ fN -> 0x00bb }\n r8.l = r0;\t Catch:{ fN -> 0x00bb }\n L_0x007b:\n r0 = r6.d();\n r8.e = r0;\n r8.b();\n return;\n L_0x0085:\n if (r5 == 0) goto L_0x00c4;\n L_0x0087:\n r0 = r2;\n goto L_0x001e;\n L_0x0089:\n r0 = move-exception;\n throw r0;\t Catch:{ fN -> 0x008b, IOException -> 0x00aa }\n L_0x008b:\n r0 = move-exception;\n r0 = r0.a(r8);\t Catch:{ all -> 0x0091 }\n throw r0;\t Catch:{ all -> 0x0091 }\n L_0x0091:\n r0 = move-exception;\n r1 = r1 & 2;\n if (r1 != r7) goto L_0x009e;\n L_0x0096:\n r1 = r8.l;\t Catch:{ fN -> 0x00bd }\n r1 = java.util.Collections.unmodifiableList(r1);\t Catch:{ fN -> 0x00bd }\n r8.l = r1;\t Catch:{ fN -> 0x00bd }\n L_0x009e:\n r1 = r6.d();\n r8.e = r1;\n r8.b();\n throw r0;\n L_0x00a8:\n r0 = move-exception;\n throw r0;\t Catch:{ fN -> 0x008b, IOException -> 0x00aa }\n L_0x00aa:\n r0 = move-exception;\n r2 = new com.google.fN;\t Catch:{ all -> 0x0091 }\n r0 = r0.getMessage();\t Catch:{ all -> 0x0091 }\n r2.<init>(r0);\t Catch:{ all -> 0x0091 }\n r0 = r2.a(r8);\t Catch:{ all -> 0x0091 }\n throw r0;\t Catch:{ all -> 0x0091 }\n L_0x00b9:\n r0 = move-exception;\n throw r0;\t Catch:{ fN -> 0x008b, IOException -> 0x00aa }\n L_0x00bb:\n r0 = move-exception;\n throw r0;\n L_0x00bd:\n r0 = move-exception;\n throw r0;\n L_0x00bf:\n r0 = r3;\n goto L_0x006d;\n L_0x00c1:\n r4 = r0;\n goto L_0x0035;\n L_0x00c4:\n r0 = r2;\n goto L_0x006d;\n L_0x00c6:\n r3 = r0;\n goto L_0x0027;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: org.whispersystems.S.<init>(com.google.ad, com.google.h):void\");\n }",
"public D() {}",
"public int F()\r\n/* 24: */ {\r\n/* 25: 39 */ return aqt.a(0.5D, 1.0D);\r\n/* 26: */ }",
"public abstract C7982k4<E> m39518y();",
"private Pares(PLoc p, PLoc s, int d){\n\t\t\tprimero=p;\n\t\t\tsegundo=s;\n\t\t\tdistancia=d;\n\t\t}",
"public void cambiarEdad(int edad){\r\n\t\tthis.edad = edad;\r\n\t}",
"public abstract int getDy();",
"public int getDIT_A()throws ClassNotFoundException{\r\n\t\treturn inherit.getDIT_A();\r\n\t}",
"public Integer getEdad()\r\n/* 193: */ {\r\n/* 194:356 */ if (getFechaNacimiento() == null) {\r\n/* 195:357 */ this.edad = new Integer(0);\r\n/* 196: */ } else {\r\n/* 197:359 */ this.edad = Integer.valueOf(FuncionesUtiles.obtenerEdad(getFechaNacimiento()));\r\n/* 198: */ }\r\n/* 199:361 */ return this.edad;\r\n/* 200: */ }",
"private void m6904a(double d, double d2, float f, String str, String str2, String str3, String str4, String str5) {\n getAsyncTaskQueue().a(new CompetitionSectionActivity$5(this, d, d2, f, str, str2, str3, str4, str5), new Void[0]);\n }",
"int getE();",
"@Override\r\n\t\tpublic double getDx() {\n\t\t\treturn(Math.pow(this.a+this.h, 2)-Math.pow(this.a, 2))/h;\r\n\t\t}",
"public float getDCD();",
"public char d();",
"public void a() {\n try {\n long a2 = this.f8466h.a(this.f8459a.a(this.p));\n if (a2 != -1) {\n a2 += this.p;\n }\n d dVar = new d(this.f8466h, this.p, a2);\n c i2 = i();\n i2.a(0);\n q a3 = i2.a(0, this.n);\n a3.a(this.o);\n for (int i3 = 0; i3 != -1; i3 = a3.a(dVar, Integer.MAX_VALUE, true)) {\n this.p += (long) i3;\n }\n a3.a(this.f8464f, 1, (int) this.p, 0, null);\n I.a((j) this.f8466h);\n this.q = true;\n } catch (Throwable th) {\n I.a((j) this.f8466h);\n throw th;\n }\n }",
"private void e()\r\n/* 273: */ {\r\n/* 274:278 */ this.r = false;\r\n/* 275:279 */ this.s = false;\r\n/* 276:280 */ this.t = false;\r\n/* 277:281 */ this.u = false;\r\n/* 278:282 */ this.v = false;\r\n/* 279: */ }",
"public abstract void mo27386d();",
"boolean hasD();",
"public String toString(){\n\t\treturn \"E\"+\" \";\n\t}",
"public abstract C7036b mo24411d();",
"public boolean aDz() {\n return true;\n }",
"public String c() {\n return ((b.b) this.b).d();\n }"
] | [
"0.5961559",
"0.57615423",
"0.5724162",
"0.57082826",
"0.56902707",
"0.5685891",
"0.56161684",
"0.55609053",
"0.55234206",
"0.54970163",
"0.5489888",
"0.54834634",
"0.54704595",
"0.5462701",
"0.54415494",
"0.54403245",
"0.54075307",
"0.53908515",
"0.5344132",
"0.53377557",
"0.53265053",
"0.53237325",
"0.5319836",
"0.5301907",
"0.5298741",
"0.5297086",
"0.5281758",
"0.52589345",
"0.5244425",
"0.5227103",
"0.5214703",
"0.5201559",
"0.5192086",
"0.5176262",
"0.5172427",
"0.5171027",
"0.51695627",
"0.5158399",
"0.51523745",
"0.5147028",
"0.5146923",
"0.5146473",
"0.5136315",
"0.5133829",
"0.5128763",
"0.5124857",
"0.51177305",
"0.5098604",
"0.5087289",
"0.50865334",
"0.5085783",
"0.5080693",
"0.50593114",
"0.50523156",
"0.5050721",
"0.50471896",
"0.5034122",
"0.5030381",
"0.5024001",
"0.5019637",
"0.5017241",
"0.5013492",
"0.5013277",
"0.50105125",
"0.5008008",
"0.5002916",
"0.50007445",
"0.49972126",
"0.49950513",
"0.49913162",
"0.49881002",
"0.49861938",
"0.49830475",
"0.49807477",
"0.49773863",
"0.49748588",
"0.49747315",
"0.49554473",
"0.49492243",
"0.49471527",
"0.49258605",
"0.4921921",
"0.49204436",
"0.49190852",
"0.49163216",
"0.4914317",
"0.49131134",
"0.49127075",
"0.49115685",
"0.49048376",
"0.49042672",
"0.49039835",
"0.49038112",
"0.48995388",
"0.48906538",
"0.488923",
"0.48871276",
"0.48853368",
"0.4885131",
"0.48841727",
"0.48792422"
] | 0.0 | -1 |
Gets the row key for the current row | public Object getRowKey()
{
if (isRowAvailable())
{
Object rowKey = _getRowKey();
return rowKey;
}
else
{
return null;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private Object _getRowKey()\n {\n Object data = getRowData();\n \n assert (_rowKeyProperty != null);\n return __resolveProperty(data, _rowKeyProperty);\n }",
"public Comparable getRowKey(int row) { return this.underlying.getRowKey(row); }",
"public Long getRowKey() {\n return (Long) getAttributeInternal(ROWKEY);\n }",
"protected Object getRowKey(Object row)\n {\n assert (_rowKeyProperty != null);\n return __resolveProperty(row, _rowKeyProperty);\n }",
"public String getRowKeyProperty()\n {\n return _rowKeyProperty;\n }",
"public int getRowIndex(Comparable key) { return this.underlying.getRowIndex(key); }",
"public TableKey getKey() {\n \treturn key;\n }",
"public String getColumnKey(int col){\n return keys.get(col);\n }",
"String get_row_id()\n {\n return row_id;\n }",
"public byte getValueInRowKey() {\n return valueInRowKey;\n }",
"public int getRowId() {\n return rowId_;\n }",
"public int getRowId() {\n return rowId_;\n }",
"public int getRowId() {\n return rowId_;\n }",
"public int getRowId() {\n return rowId_;\n }",
"public int getRowId() {\n return rowId_;\n }",
"private int getRowKey(int combo, int row) {\n int key = (combo >> ((rowSize - row - 1) * 6)) & 0x003F;\n return key;\n }",
"public int getRowid() {\n\t\treturn rowid;\n\t}",
"public Integer getRowId() {\n return rowId;\n }",
"public String getIdForRow(int row);",
"public int getRowId() {\n return rowId_;\n }",
"public int getRowId() {\n return rowId_;\n }",
"public int getRowId() {\n return rowId_;\n }",
"public int getRowId() {\n return rowId_;\n }",
"public int getRowId() {\n return rowId_;\n }",
"public int getKey() {\n\t\t\treturn this.key; // to be replaced by student code\n\t\t}",
"public int getRowNo() {\n return rowIndex+1;\n }",
"public int getRow(){\r\n\t\treturn this.row;\r\n\t}",
"public int getRow()\r\n\t{\r\n\t\treturn this.row;\r\n\t}",
"@Override\n\tpublic Object getRowKey(InvitoDTO arg0) {\n\t\treturn arg0.getId();\n\t}",
"public int getRowNumber()\r\n\t{\r\n\t\treturn this.rowNumber;\r\n\t}",
"public int getRow() {\r\n\t\treturn this.row;\r\n\t}",
"public void setRowKeyProperty(String rowKeyProperty)\n {\n _rowKeyProperty = rowKeyProperty;\n }",
"public String getKey() {\n if (model == null)\n return strKey;\n return model.getKey();\n }",
"public int getRow() {\r\n return this.row;\r\n }",
"public final HashMap<Integer, Integer> getRowKeys() {\n return rowKeys;\n }",
"public List getRowKeys() { return this.underlying.getRowKeys(); }",
"public int getRow()\r\n {\r\n return row;\r\n }",
"public int getRow() {\n return this.row;\n }",
"public int getRow() {\n return this.row;\n }",
"public int getRow() {\n\t\treturn row;\n\t}",
"public int getRow() {\n\t\treturn row;\n\t}",
"public int getRow() {\r\n\t\treturn row;\r\n\t}",
"public int getRow() {\r\n\t\treturn row;\r\n\t}",
"public int getRow()\n\t{\n\t\treturn row;\n\t}",
"public int getRow()\n\t{\n\t\treturn row;\n\t}",
"public int getRow()\n\t{\n\t\treturn row;\n\t}",
"public int getRow() {\r\n return row;\r\n }",
"public int getKey()\n {\n return key;\n }",
"public int getKey()\n {\n return key;\n }",
"public int getKey()\n {\n return key;\n }",
"public int getKey()\n {\n return key;\n }",
"public int getRow() {\n\t\treturn row; \n\t}",
"protected int getRow() {\r\n\t\treturn this.row;\r\n\t}",
"public int getRow() {\n\t\t\treturn rowNumber;\n\t\t}",
"public int getKey() {\r\n return key;\r\n }",
"public String getKey() {\r\n\t\tStringBuilder builder = new StringBuilder();\r\n\t\tif (getLineNo() != null) {\r\n\t\t\tbuilder.append(getLineNo());\r\n\t\t} else if (this.getEntityId() != null) {\r\n\t\t\tbuilder.append(getEntityId());\r\n\t\t}\r\n\t\treturn builder.toString();\r\n\t}",
"public int getKey() {\n return this.key;\n }",
"public int getRow() {\n return row;\n }",
"public int getRow() {\n return row;\n }",
"public int getRow() {\n return row;\n }",
"public int getRow() {\n return row;\n }",
"public int getRow() {\n return row;\n }",
"public int getRow() {\n return row;\n }",
"public int getRow() {\n\t\t\treturn row;\n\t\t}",
"public int getRow() {\n\t\t\treturn row;\n\t\t}",
"public int getKey() {\n return key;\n }",
"public int getRow() { return _row; }",
"protected static Object getColumnKey(XmlElement xmlColumn)\n {\n XmlValue xmlTemp = xmlColumn.getAttribute(\"id\");\n if (xmlTemp == null)\n {\n return xmlColumn;\n }\n return xmlTemp.getString();\n }",
"public int getRow()\n {\n return row;\n }",
"public Integer getKey()\r\n {\r\n return key;\r\n }",
"public int getRowIndex() {\r\n\t\treturn rowIndex;\r\n\t}",
"public Integer getRowNo() {\n return rowNo;\n }",
"int getRowId();",
"int getRowId();",
"int getRowId();",
"int getRowId();",
"int getRowId();",
"public RowID getRowID() {\n return (RowID)getAttributeInternal(ROWID);\n }",
"public RowID getRowID() {\n return (RowID)getAttributeInternal(ROWID);\n }",
"public String getUniqueId(int row);",
"@Override\n public int getKey() {\n return this.key;\n }",
"byte[] getActualRowKey(ConsumerConfig consumerConfig, byte[] originalRowKey);",
"public int getKey() {\n\t\treturn 0;\n\t}",
"public int getRowNumber() {\n\t\treturn rowNumber;\n\t}",
"Key getPrimaryKey();",
"public String getPrimaryKey() throws CloneNotSupportedException {\r\n\t\tString key=\"\";\r\n\t\tfor (int i = 0; i < this.state.getSizeCol(); i++) {\r\n\t\t\tfor (int j = 0; j < this.state.getSizeRow(); j++) {\r\n\t\t\t\tkey+=this.state.getValue(new Position(i,j));\r\n\t\t\t}\r\n\t\t}\r\n\t\tkey+=\"?\"+this.state.getTractor().getPosition().toString();\r\n\t\treturn key;\r\n\t}",
"public abstract String getCurrentRow();",
"public String getKey() {\n\t\treturn id + \"\";\n\t}",
"public int getKey(){\n return key;\n }",
"public int getRow() {\n return mRow;\n }",
"public String getRowID(int i) {\n \treturn rowID[i];\n }",
"public int getRowNum(){ return this.rowNum; }",
"public int getRow()\n\t\t{\n\t\t\treturn m_row;\n\t\t}",
"public int getRow()\n {\n return row;\n }",
"private int computeKey(int row, int column) {\n return row * columnDimension + column;\n }",
"public String getKey() { \n\t\treturn getKeyElement().getValue();\n\t}",
"@Override\n public int getKey() {\n return key_;\n }",
"public long getRowID()\n\t{ return m_nRowID ; }",
"public Comparable\n getCellKey() \n {\n return pCellKey;\n }",
"public String getSelectedRowID()\n\t{\n\t\tint selectedRow = recordTable.getSelectedRow();\n\t\tString returnData = null;\n\t\tif(selectedRow==-1)\n\t\t{//If there is no row selected...\n\t\t\treturn null;\n\t\t}\n\t\treturnData = (String)recordTable.getValueAt(selectedRow, Information.FIELDID);\n\t\treturn returnData;\n\t}"
] | [
"0.8485919",
"0.80520195",
"0.79879993",
"0.76319134",
"0.71845907",
"0.71022415",
"0.70867175",
"0.7045725",
"0.6956362",
"0.6948644",
"0.6848099",
"0.6848099",
"0.6848099",
"0.6848099",
"0.6848099",
"0.6835002",
"0.678612",
"0.6783794",
"0.6769314",
"0.67686826",
"0.67686826",
"0.67686826",
"0.67686826",
"0.67686826",
"0.6757133",
"0.6740896",
"0.67394006",
"0.6721499",
"0.6713627",
"0.67015433",
"0.66941595",
"0.66707957",
"0.6661522",
"0.66604596",
"0.6660173",
"0.66572225",
"0.66496336",
"0.6642411",
"0.6642411",
"0.66338545",
"0.66338545",
"0.66322935",
"0.66322935",
"0.6618264",
"0.6618264",
"0.6618264",
"0.6615273",
"0.6614209",
"0.6614209",
"0.6614209",
"0.6614209",
"0.6612528",
"0.6611874",
"0.6609224",
"0.65901333",
"0.65885895",
"0.6587159",
"0.658347",
"0.658347",
"0.658347",
"0.658347",
"0.658347",
"0.658347",
"0.6579018",
"0.6579018",
"0.6572864",
"0.6569565",
"0.6556606",
"0.6549664",
"0.6547661",
"0.6546457",
"0.653608",
"0.65346134",
"0.65346134",
"0.65346134",
"0.65346134",
"0.65346134",
"0.65251476",
"0.65251476",
"0.65239024",
"0.6512718",
"0.6487581",
"0.6485199",
"0.64654857",
"0.64622736",
"0.64604324",
"0.6453468",
"0.64516664",
"0.6446226",
"0.644504",
"0.6433658",
"0.64298564",
"0.6420301",
"0.6407909",
"0.6399766",
"0.63958675",
"0.6393122",
"0.6386127",
"0.637947",
"0.6378371"
] | 0.8488423 | 0 |
Moves the model to the row identified by the key. | public void setRowKey(Object key)
{
if (key == null)
{
setRowIndex(-1);
return;
}
if (getRowKey() != null && getRowKey().equals(key))
return;
for (int i = 0; i < getRowCount(); i++)
{
setRowIndex(i);
Object prop = getRowKey();
if (key.equals(prop))
{
return;
}
}
// if we didn't find an element with a matching key,
// then don't make any rows current
setRowIndex(-1);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private static void move(String key) {\n\t\tif (settings.contains(key)) {\n\t\t\tString value = settings.getString(key, SAMPLE_TONE);\n\t\t\tmRecordsDatabase.insertRecord(value, value);\n\t\t\tsettings.edit().remove(key).apply();\n\t\t}\n\t}",
"public void moveToCurrentRow() throws SQLException\n {\n m_rs.moveToCurrentRow();\n }",
"public void setKey(TableKey key) {\n\tthis.key = key;\n }",
"public void moveToCurrentRow() throws SQLException {\n\n try {\n debugCodeCall(\"moveToCurrentRow\");\n checkClosed();\n insertRow = null;\n }\n catch (Exception e) {\n throw logAndConvert(e);\n }\n }",
"protected void setSortKey(Key key)\n\t{\n\t\tfor (int i = 0; i < _searchKeyList.size(); i++)\n\t\t{\n\t\t\tKey ky = (Key)_searchKeyList.get(i) ;\n\t\t\tif (ky.getTableColumn().equals(key.getTableColumn()))\n\t\t\t{\n\t\t\t\tky.setTableOrder(key.getTableOrder()) ;\n\t\t\t\tky.setTableDesc(key.getTableDesc()) ;\n\t\t\t\t_searchKeyList.set(i, ky) ;\n\t\t\t\tbreak ;\n\t\t\t}\n\t\t}\n\t}",
"int updateByPrimaryKey(Model record);",
"public int updateKeyValue_of_updatekey(UpdateKeyStorer key){\n SQLiteDatabase db=this.getWritableDatabase();\n ContentValues values = new ContentValues();\n values.put(updateKeyValue,key.getUpdateKey());\n return db.update(key_table_name, values, key_id + \" = ?\", new String[]{String.valueOf(getId(key.getUpdateKey()))});\n }",
"int updateByPrimaryKey(R_order record);",
"private void upButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_upButtonActionPerformed\n\n AttlistTableModel tm = (AttlistTableModel) attrTable.getModel();\n int index = attrTable.getSelectedRow();\n if (index > 0) {\n tm.moveRow(index, index - 1);\n attrTable.getSelectionModel().setSelectionInterval(index - 1,index - 1);\n }\n }",
"public void delete(Key key) {\n first = delete(first, key);\n }",
"public void absMoveToFirstRowAt(int index) {\n if ((index <= 0) || (index >= getModel().getRowCount())) {\n return;\n }\n\n Vector[] va = getAllRowsData();\n\n Vector vTemp = va[index];\n\n // Move the rows above the index row down one.\n System.arraycopy(va, 0, va, 1, index);\n\n va[0] = vTemp;\n\n //_printTableRow(0, va[0]);\n setRows(va);\n }",
"@Override\n public void update(String key) {\n lName = key;\n if (nTable != null)\n value = nTable.getNumber(key, 0);\n }",
"public void setRowKeyProperty(String rowKeyProperty)\n {\n _rowKeyProperty = rowKeyProperty;\n }",
"int updateByPrimaryKey(Position record);",
"int updateByPrimaryKey(AccessModelEntity record);",
"private void move(int newIndex, int oldIndex){\r\n \tassign(newIndex, keys[oldIndex], vals[oldIndex]); //get(keys[oldIndex]) could be used but doesn't seem intuitive when you are already accessing the keys array\r\n \tremove(oldIndex);\r\n }",
"protected void setGroupKey(Key key)\n\t{\n\t\tfor (int i = 0; i < _searchKeyList.size(); i++)\n\t\t{\n\t\t\tKey ky = (Key)_searchKeyList.get(i) ;\n\t\t\tif (ky.getTableColumn().equals(key.getTableColumn()))\n\t\t\t{\n\t\t\t\tky.setTableGroup(key.getTableGroup()) ;\n\t\t\t\t_searchKeyList.set(i, ky) ;\n\t\t\t\tbreak ;\n\t\t\t}\n\t\t}\n\t}",
"int updateByPrimaryKey(TNavigation record);",
"public void remove(Object key) {\r\n\t\tif (!containsKey(key)) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tmodificationCount++;\r\n\t\tsize--;\r\n\r\n\t\tint slotIndex = Math.abs(key.hashCode()) % table.length;\r\n\r\n\t\tif (table[slotIndex].key.equals(key)) {\r\n\t\t\ttable[slotIndex] = table[slotIndex].next;\r\n\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tTableEntry<K, V> previousElement = table[slotIndex];\r\n\t\tTableEntry<K, V> currentElement = table[slotIndex].next;// can't be null\r\n\r\n\t\tdo {\r\n\t\t\tif (currentElement.key.equals(key)) {\r\n\t\t\t\tpreviousElement.next = currentElement.next;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tpreviousElement = currentElement;\r\n\t\t\tcurrentElement = currentElement.next;\r\n\t\t} while (currentElement != null);\r\n\t}",
"public void reinstateKeyFromArchive(int key) throws PersistenceException {\n super.reinstateArchiveKey(key);\n }",
"protected void moveNode( String workspaceName,\n NodeKey key,\n Name primaryType,\n Set<Name> mixinTypes,\n NodeKey oldParent,\n NodeKey newParent,\n Path newPath,\n Path oldPath ) {\n\n }",
"private void downButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_downButtonActionPerformed\n\n AttlistTableModel tm = (AttlistTableModel) attrTable.getModel();\n int index = attrTable.getSelectedRow();\n if (index > -1 && index < numRows() - 1) {\n tm.moveRow(index, index + 1);\n attrTable.getSelectionModel().setSelectionInterval(index + 1,index + 1);\n }\n }",
"public void remove(Key key) {\n\n\t\tif (!contains(key)) return;\n\t\tint index = locate(key);\n\t\tkeys[index] = null;\n\t\tvalues[index] = null;\n\t\tthis.size--;\n\n\t\t// Check to see if any of the items in the table that follow\n\t\t// this one had collided with the key that was just removed.\n\t\t// If so, we need to rehash/reinsert them.\n\n\t\tint i = increment(index);\n\t\twhile (keys[i] != null) {\n\n\t\t\t// Save the key/value pair at this location.\n\n\t\t\tKey savedKey = keys[i];\n\t\t\tValue savedValue = values[i];\n\n\t\t\t// And temporarily remove it from the hash map.\n\n\t\t\tkeys[i] = null;\n\t\t\tvalues[i] = null;\n\n\t\t\t// Figure out where it should go now and reinsert it.\n\n\t\t\tindex = locate(savedKey);\n\t\t\tkeys[index] = savedKey;\n\t\t\tvalues[index] = savedValue;\n\n\t\t\t// Advance to the next item.\n\t\t\ti = increment(i);\n\t\t}\n\t}",
"int updateByPrimaryKey(PrhFree record);",
"int updateByPrimaryKey(ClOrderInfo record);",
"public void moveRowDown(int id, int row) throws FidoDatabaseException {\n try {\n Connection conn = null;\n Statement stmt = null;\n try {\n conn = fido.util.FidoDataSource.getConnection();\n conn.setAutoCommit(false);\n stmt = conn.createStatement();\n int max = findMaxRank(stmt, id);\n if ((row < 1) || (row > (max - 1))) throw new IllegalArgumentException(\"Row number not between 1 and \" + (max - 1));\n stmt.executeUpdate(\"update InstructionGroups set Rank = -1 where InstructionId = '\" + id + \"' and Rank = \" + row);\n stmt.executeUpdate(\"update InstructionGroups set Rank = \" + row + \" where InstructionId = '\" + id + \"' and Rank = \" + (row + 1));\n stmt.executeUpdate(\"update InstructionGroups set Rank = \" + (row + 1) + \" where InstructionId = '\" + id + \"' and Rank = -1\");\n conn.commit();\n } catch (SQLException e) {\n if (conn != null) conn.rollback();\n throw e;\n } finally {\n if (stmt != null) stmt.close();\n if (conn != null) conn.close();\n }\n } catch (SQLException e) {\n throw new FidoDatabaseException(e);\n }\n }",
"public void moveUp()\n\t{\n\t\trow++;\n\t}",
"protected void setSearchKey(Key key)\n\t{\n\t\tint last_idx = _searchKeyList.size() - 1 ;\n\t\t_searchKeyList.set(last_idx, key) ;\n\t}",
"int updateByPrimaryKey(EquipmentOrder record);",
"public void setPrimaryKey(ObjectKey key) throws TorqueException\n {\n SimpleKey[] keys = (SimpleKey[]) key.getValue();\n SimpleKey tmpKey = null;\n setMailId(((NumberKey)keys[0]).intValue());\n setReceiverId(((NumberKey)keys[1]).intValue());\n }",
"@Override\n\tpublic HomeModel edit(IKeyBuilder<String> keyBuilder, HomeModel model) {\n\t\treturn null;\n\t}",
"@Override\n public void actionPerformed(ActionEvent e) {\n int row = table.convertRowIndexToModel( table.getEditingRow() );\n }",
"int updateByPrimaryKeySelective(R_order record);",
"int updateByPrimaryKey(Assist_table record);",
"int updateByPrimaryKey(Dormitory record);",
"protected void moveRow (int row)\r\n {\r\n int move = 0;\r\n \r\n if (row < _currentRow)\r\n { move = _currentRow - row; }\r\n \r\n else if (row > _currentRow)\r\n { move = row - _currentRow; }\r\n \r\n _currentRow = row;\r\n }",
"int updateByPrimaryKey(TbComEqpModel record);",
"public void setKey(K newKey) {\n this.key = newKey;\n }",
"int updateByPrimaryKey(OrderDetails record);",
"public void changeKey(int x, int y) throws IndexOutOfBoundsException {\n\t\tMap m = rows.get(y).getMap(x);\n\t\tsuper.changeKey(m.getKey(), InputManager.enterString(\"New Key\"));\n\t}",
"int updateByPrimaryKey(ParkCurrent record);",
"@Override\n\tpublic void deleteByKey(Integer key) {\n\n\t}",
"@Override\n public void delete(Integer key) throws SQLException {\n //Ei toteutettu\n }",
"public void setQueryKey(String key)\n throws TorqueException\n {\n setPrimaryKey(key);\n }",
"int updateByPrimaryKey(PmKeyDbObj record);",
"int updateByPrimaryKeySelective(Dish record);",
"int updateByPrimaryKey(OrderDetail record);",
"int updateByPrimaryKeySelective(Dress record);",
"@Override\n\tpublic ManagedFunctionObjectTypeBuilder<M> setKey(M key) {\n\t\tthis.key = key;\n\t\tthis.index = key.ordinal();\n\t\treturn this;\n\t}",
"int updateByPrimaryKey(OrderPO record);",
"int deleteByPrimaryKey(RepStuLearningKey key);",
"int updateByPrimaryKey(TABLE41 record);",
"int updateByPrimaryKey(Kaiwa record);",
"@Override\n\tpublic void setPrimaryKey(long primaryKey) {\n\t\tmodel.setPrimaryKey(primaryKey);\n\t}",
"@Override\n\tpublic void setPrimaryKey(long primaryKey) {\n\t\tmodel.setPrimaryKey(primaryKey);\n\t}",
"@Override\n\tpublic void setPrimaryKey(long primaryKey) {\n\t\tmodel.setPrimaryKey(primaryKey);\n\t}",
"public void moveDown()\n\t{\n\t\trow--;\n\t}",
"public synchronized RMItem removeData(int id, String key) {\n if (id >= 0) {\n return (RMItem) txLocal.get(id).remove(key);\n } else {\n return (RMItem) getMaster().remove(key);\n }\n }",
"public int getRowIndex(Comparable key) { return this.underlying.getRowIndex(key); }",
"@Action\n public void modifyAction() {\n E rowObject = (E) dataTable.getSelectedRowObject();\n if (rowObject != null) {\n rowObject = (E) rowObject.clone();\n\n if (viewRowState) {\n viewRow(rowObject);\n } else {\n E newRowObject = modifyRow(rowObject);\n if (newRowObject != null) {\n replaceTableObject(newRowObject);\n fireModify(newRowObject);\n }\n }\n }\n }",
"public void setKey(K newKey) {\r\n\t\tkey = newKey;\r\n\t}",
"void delete(final Key key) {\n int r = rank(key);\n if (r == size || keys[r].compareTo(key) != 0) {\n return;\n }\n for (int i = r; i < size - 1; i++) {\n keys[i] = keys[i + 1];\n values[i] = values[i + 1];\n }\n size--;\n keys[size] = null;\n values[size] = null;\n }",
"int updateByPrimaryKey(Tourst record);",
"public KeyedItem retrieve(Comparable key){\r\n\t\treturn retrieve(this,key);\r\n\t}",
"public void delete(int key){\n\t\tBSTNode currentNode = root;\n\t\tBSTNode parent = null;\n\t\twhile (currentNode != null && currentNode.getKey() != key){\n\t\t\tparent = currentNode;\n\t\t\tif (key < currentNode.getKey()){\n\t\t\t\tcurrentNode = currentNode.getLeft();\n\t\t\t}else{\n\t\t\t\tcurrentNode = currentNode.getRight();\n\t\t\t}\n\t\t}\n\t\tif (currentNode == null){\n\t\t\tSystem.out.println(\"No such key is found in the tree\");\n\t\t\treturn;\n\t\t}\n\t\tif (currentNode.getLeft() == null && currentNode.getRight() == null){\n\t\t\t//Leaf Node\n\t\t\tif (currentNode.getKey() > parent.getKey()){\n\t\t\t\tparent.setRight(null);\n\t\t\t}else{\n\t\t\t\tparent.setLeft(null);\n\t\t\t}\n\t\t}else if (currentNode.getLeft() == null){\n\t\t\tif (currentNode.getKey() > parent.getKey()){\n\t\t\t\tparent.setRight(currentNode.getRight());\n\t\t\t}else{\n\t\t\t\tparent.setLeft(currentNode.getRight());\n\t\t\t}\n\t\t}else if(currentNode.getRight() == null){\n\t\t\tif (currentNode.getKey() > parent.getKey()){\n\t\t\t\tparent.setRight(currentNode.getLeft());\n\t\t\t}else{\n\t\t\t\tparent.setLeft(currentNode.getLeft());\n\t\t\t}\n\t\t}else{\n\t\t\t// this is case where this node has two children\n\t\t\tBSTNode node = currentNode.getLeft();\n\t\t\tBSTNode parentTemp = currentNode;\n\t\t\twhile (node.getRight() != null){\n\t\t\t\tparentTemp = node;\n\t\t\t\tnode = node.getRight();\n\t\t\t}\n\t\t\t// switch the value with the target node we are deleting.\n\t\t\tcurrentNode.setKey(node.getKey());\n\t\t\t// remove this node but don't forget about its left tree\n\t\t\tparentTemp.setRight(node.getLeft());\n\t\t}\n\t}",
"@Override\n protected final Void updateKeyAfterInsert(FarmField entity, long rowId) {\n return null;\n }",
"public void setKeyJump(final int key) {\n jumpKey = key;\n }",
"int updateByPrimaryKey(NjOrderWork2 record);",
"int updateByPrimaryKey(Kmffb record);",
"int updateByPrimaryKey(Shareholder record);",
"int updateByPrimaryKey(Movimiento record);",
"@Override\n protected final Void updateKeyAfterInsert(BackAlarmModel entity, long rowId) {\n return null;\n }",
"int updateByPrimaryKey(OrderPreferential record) throws SQLException;",
"public void useKey() {\n Key key = this.getInventory().getFirstKey();\n if (key != null){\n this.getInventory().removeItems(key);\n }\n }",
"public void setKey(Key key) {\n this.key = key;\n }",
"int updateByPrimaryKey(SwipersDO record);",
"public void deleteItineraryItem(String key) {\n\t\tmEditor.remove(key);\n\t\tmEditor.commit();\n\t}",
"@Override\n\tpublic void delete(String key) throws SQLException {\n\t\t\n\t}",
"int updateByPrimaryKey(TCpySpouse record);",
"int updateByPrimaryKey(AccessKeyRecordEntity record);",
"int updateByPrimaryKey(Sequipment record);",
"public void setKey(int key);",
"public void setKey(int key);",
"int updateByPrimaryKey(Storage record);",
"int updateByPrimaryKey(Storage record);",
"int updateByPrimaryKey(TestEntity record);",
"int updateByPrimaryKey(CaseLinkman record);",
"protected RMItem deleteData(int id, String key) {\n synchronized(m_itemHT) {\n return (RMItem)m_itemHT.remove(key);\n }\n }",
"int updateByPrimaryKey(PathologyInfo record);",
"void setKey(K key);",
"int updateByPrimaryKey(TLinkman record);",
"private void executeDelete(Object key, String query) {\r\n\t\tlogger.entering(CLASSNAME, \"executeDelete\", new Object[] {key, query});\r\n\t\tConnection conn = null;\r\n\t\tPreparedStatement statement = null;\r\n\t\ttry {\r\n\t\t\tconn = getConnection();\r\n\t\t\tstatement = conn.prepareStatement(query);\r\n\t\t\tstatement.setObject(1, key);\r\n\t\t\tstatement.executeUpdate();\r\n\r\n\t\t} catch (SQLException e) {\r\n\t\t\tthrow new PersistenceException(e);\r\n\t\t} finally {\r\n\r\n\t\t\tcleanupConnection(conn, null, statement);\r\n\t\t}\r\n\t\tlogger.exiting(CLASSNAME, \"executeDelete\");\r\n\t}",
"@RequestMapping(value = \"/saveOrUpdate\", method = RequestMethod.POST)\n public ModelAndView saveOrUpdate(Key key) {\n if (key.getId() == null) {\n keyDao.save(key);\n } else {\n keyDao.update(key);\n }\n return new ModelAndView(\"redirect:/key/list\");\n }",
"@Override\n\tpublic void setPrimaryKey(long primaryKey) {\n\t\t_dmGTShipPosition.setPrimaryKey(primaryKey);\n\t}",
"public void setPrimaryKey(String key) throws TorqueException\n {\n setPrimaryKey(new ComboKey(key));\n }",
"int updateByPrimaryKey(TRepairs record);",
"int updateByPrimaryKey(Engine record);",
"int updateByPrimaryKey(TSortOrder record);",
"int updateByPrimaryKey(XxArea record);",
"int updateByPrimaryKey(Dress record);"
] | [
"0.6184074",
"0.57766145",
"0.5745625",
"0.5532631",
"0.53141004",
"0.5260492",
"0.52273715",
"0.5197272",
"0.51943487",
"0.5177039",
"0.5169419",
"0.5156119",
"0.51516765",
"0.5150992",
"0.5134435",
"0.51313907",
"0.5119466",
"0.51106685",
"0.5106539",
"0.5099842",
"0.5073472",
"0.5066614",
"0.5052337",
"0.5039878",
"0.501762",
"0.5017048",
"0.501115",
"0.50045824",
"0.49983045",
"0.4996023",
"0.49960136",
"0.4993532",
"0.49930316",
"0.4992255",
"0.49909002",
"0.49809968",
"0.49785614",
"0.49732536",
"0.49716362",
"0.4959568",
"0.4950297",
"0.49502572",
"0.49487123",
"0.49478248",
"0.49458236",
"0.4937214",
"0.49366635",
"0.4934231",
"0.49321556",
"0.4931822",
"0.49275556",
"0.49272463",
"0.4923595",
"0.49185863",
"0.49185863",
"0.49185863",
"0.4915342",
"0.4914254",
"0.49136868",
"0.49120188",
"0.49029696",
"0.49018973",
"0.4899668",
"0.4895697",
"0.4892924",
"0.4888115",
"0.48879415",
"0.48792493",
"0.48784414",
"0.48694524",
"0.4863485",
"0.486157",
"0.48611504",
"0.48601407",
"0.48591992",
"0.48556024",
"0.48548788",
"0.48534253",
"0.48459655",
"0.48447397",
"0.483695",
"0.483637",
"0.483637",
"0.48313552",
"0.48313552",
"0.48279387",
"0.48242652",
"0.48227638",
"0.4821476",
"0.48210898",
"0.48204345",
"0.48182523",
"0.4817854",
"0.48154104",
"0.4815075",
"0.4811241",
"0.48015353",
"0.4799301",
"0.47953445",
"0.47896814"
] | 0.6625263 | 0 |
Gets the row key property name for this model | public String getRowKeyProperty()
{
return _rowKeyProperty;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private Object _getRowKey()\n {\n Object data = getRowData();\n \n assert (_rowKeyProperty != null);\n return __resolveProperty(data, _rowKeyProperty);\n }",
"public void setRowKeyProperty(String rowKeyProperty)\n {\n _rowKeyProperty = rowKeyProperty;\n }",
"public String getPropertyName(){\n return SimpleTableField.mapPropName(this.columnName);\n }",
"public String getKey() {\n if (model == null)\n return strKey;\n return model.getKey();\n }",
"public String naturalKeyName() {\n return idName();\n }",
"protected Object getRowKey(Object row)\n {\n assert (_rowKeyProperty != null);\n return __resolveProperty(row, _rowKeyProperty);\n }",
"public String getKeyName(){\n\n //returns the value of the keyName field\n return this.keyName;\n }",
"public String getKey() {\r\n\t\tStringBuilder builder = new StringBuilder();\r\n\t\tif (getLineNo() != null) {\r\n\t\t\tbuilder.append(getLineNo());\r\n\t\t} else if (this.getEntityId() != null) {\r\n\t\t\tbuilder.append(getEntityId());\r\n\t\t}\r\n\t\treturn builder.toString();\r\n\t}",
"public Long getRowKey() {\n return (Long) getAttributeInternal(ROWKEY);\n }",
"public String getKeyName() {\n\t\treturn this.attributeName;\r\n\t}",
"public String getPropertyKey() {\n\t\treturn propertyKey;\n\t}",
"public String propKey() {\n return propKey;\n }",
"public Object getRowKey()\n {\n if (isRowAvailable())\n {\n Object rowKey = _getRowKey();\n return rowKey;\n }\n else\n {\n return null;\n }\n }",
"public String getPropKey() {\n return propKey;\n }",
"public String getKeyName() {\n return keyName;\n }",
"public java.lang.String getKeyName() {\n return keyName;\n }",
"public java.lang.String getKeyName() {\n return keyName;\n }",
"public String getPkColumnName() {\n return featureDao.getPkColumnName();\n }",
"public Object getAlternateKeyName() {\n return this.alternateKeyName;\n }",
"TemplateModel getKey();",
"org.apache.calcite.avatica.proto.Common.DatabaseProperty getKey();",
"String getPropertyName();",
"public String getKey() {\n\t\treturn id + \"\";\n\t}",
"public String getKey()\r\n {\r\n return getValue().toString();\r\n }",
"public Object getKey() { return name; }",
"public TableKey getKey() {\n \treturn key;\n }",
"public String getNameKey() {\n return getName();\n }",
"public String getPropertyName()\n {\n return Integer.toString(getLowNbrParticipants());\n }",
"public String getIdPropertyName() {\n \t\treturn idPropertyName;\n \t}",
"public String getKeyId() {\n return getProperty(KEY_ID);\n }",
"@SideOnly(value=Side.CLIENT)\n\tpublic String getModelKey() {\n\t\treturn getKeyFromTex(getTexture());\n\t}",
"public org.apache.calcite.avatica.proto.Common.DatabaseProperty getKey() {\n return key_ == null ? org.apache.calcite.avatica.proto.Common.DatabaseProperty.getDefaultInstance() : key_;\n }",
"public String getPropertyName();",
"public StructuredQName getKeyName() {\n try {\r\n if (getObjectName() == null) {\r\n // allow for forwards references\r\n String nameAtt = getAttributeValue(\"\", StandardNames.NAME);\r\n if (nameAtt != null) {\r\n setObjectName(makeQName(nameAtt));\r\n }\r\n }\r\n return getObjectName();\r\n } catch (NamespaceException err) {\r\n return null; // the errors will be picked up later\r\n } catch (XPathException err) {\r\n return null;\r\n }\r\n }",
"public String getPropertyName() {\n return this.propertyName;\n }",
"@Override\n\tpublic String getKey() {\n\t\treturn id+\"\";\n\t}",
"public String getKey() {\n return element == null ? null : element.getKey();\n }",
"public K getName() {\n return key;\n }",
"public String getKey()\n\t{\n\t\treturn this.key;\n\t}",
"public String getKey() { \n\t\treturn getKeyElement().getValue();\n\t}",
"public String getKey()\n\t\t{\n\t\t\treturn key;\n\t\t}",
"@Transient\n public String getCacheKey() {\n return this.getTableName();\n }",
"public String getKey() {\n\t\treturn this.key;\n\t}",
"public String getKey() {\n\t\treturn this.key;\n\t}",
"public String getKey() {\n\t\treturn this.key;\n\t}",
"String get_row_id()\n {\n return row_id;\n }",
"public java.lang.String getKey() {\n\t\treturn this.key;\n\t}",
"public Comparable getRowKey(int row) { return this.underlying.getRowKey(row); }",
"public org.apache.calcite.avatica.proto.Common.DatabaseProperty getKey() {\n if (keyBuilder_ == null) {\n return key_ == null ? org.apache.calcite.avatica.proto.Common.DatabaseProperty.getDefaultInstance() : key_;\n } else {\n return keyBuilder_.getMessage();\n }\n }",
"public String getPropertyMapKeyName() {\n return m_propertyMapKeyName;\n }",
"String getFieldName(int row) {\n return getVPInfo(row).getDataInstance().getDataChoice().getName();\n }",
"@Override\n\tpublic String getKey() {\n\t\treturn key;\n\t}",
"public String getConfirmationKeyFieldName() {\n return getStringProperty(CONFIRMATION_KEY_FIELD_NAME_KEY);\n }",
"public String getKey() {\r\n\t\treturn key;\r\n\t}",
"public String getKey() {\r\n\t\treturn key;\r\n\t}",
"public String getKey() {\r\n\t\treturn key;\r\n\t}",
"public Object getKey() {\n return key;\n }",
"public String getKey() {\n\t\treturn key;\n\t}",
"public String getKey() {\n\t\treturn key;\n\t}",
"public String getKey() {\n\t\treturn key;\n\t}",
"public String getCellIdProperty() {\r\n return getAttributeAsString(\"cellIdProperty\");\r\n }",
"public String getKey() {\r\n return getAttribute(\"id\");\r\n }",
"public String getTdKey() {\r\n return tdKey;\r\n }",
"public String getQueryKey()\n {\n if (getPrimaryKey() == null)\n {\n return \"\";\n }\n else\n {\n return getPrimaryKey().toString();\n }\n }",
"public String getKey()\n\t{\n\t\treturn key;\n\t}",
"public static String getPrimaryKeyName() {\r\n\t\t\treturn PRIMARY_KEY_ID;\r\n\t\t}",
"public List getRowKeys() { return this.underlying.getRowKeys(); }",
"public String getKey(){\n\t\treturn key;\n\t}",
"public String getPropertyName()\n {\n return propertyName;\n }",
"public String getKey() {\n\n return this.key;\n }",
"public String getKey() {\n return this.key;\n }",
"public String getKey() {\n return this.key;\n }",
"public String getKey() {\n return this.key;\n }",
"public String getKey() {\n return this.key;\n }",
"public String getKey() {\n return this.key;\n }",
"public String getKey() {\n return this.key;\n }",
"public Object getKey()\n {\n return key;\n }",
"public String getPrimaryKey() {\n if (primaryKey == null) primaryKey = \"id\";\n return primaryKey;\n }",
"public String getItemKey() {\n return (String)getAttributeInternal(ITEMKEY);\n }",
"public String getKey() {\n return this.key;\n }",
"public Object getKey() {\r\n return key;\r\n }",
"public String getObjectKey()\n {\n return objectKey;\n }",
"public String getObjectKey()\n {\n return objectKey;\n }",
"@Override\n\t\tpublic String getPKFieldName() {\n\t\t\treturn null;\n\t\t}",
"public String getPrimaryKey() throws CloneNotSupportedException {\r\n\t\tString key=\"\";\r\n\t\tfor (int i = 0; i < this.state.getSizeCol(); i++) {\r\n\t\t\tfor (int j = 0; j < this.state.getSizeRow(); j++) {\r\n\t\t\t\tkey+=this.state.getValue(new Position(i,j));\r\n\t\t\t}\r\n\t\t}\r\n\t\tkey+=\"?\"+this.state.getTractor().getPosition().toString();\r\n\t\treturn key;\r\n\t}",
"public String getName() {\n return columnName;\n }",
"@Override\n\tpublic String getObjectName() {\n\t\t// Follow priorities to obtain the object name\n\t\tif (!CompileUtil.isBlank(this.label)) {\n\t\t\treturn this.label;\n\t\t} else if (this.key != null) {\n\t\t\treturn this.key.toString();\n\t\t} else {\n\t\t\treturn String.valueOf(this.index);\n\t\t}\n\t}",
"public String getPrimaryKey() {\n return this.getString(R.string.primaryKey);\n }",
"public String getKey() {\n return key;\n }",
"public String getKey() {\r\n return key;\r\n }",
"public String getKey() {\r\n return key;\r\n }",
"public String getKey() {\r\n return key;\r\n }",
"@Nullable public String getKey() {\n return key;\n }",
"public String getColumnKey(int col){\n return keys.get(col);\n }",
"@Override\n\tpublic String getKey() {\n\t\treturn getCid();\n\t}",
"public String getKey() {\r\n return key;\r\n }",
"public String getKey() {\n return key;\n }",
"public String getKey() {\n return key;\n }",
"public String getKey() {\n return key;\n }",
"public String getKey() {\n return key;\n }"
] | [
"0.79300493",
"0.75838166",
"0.7240161",
"0.7161755",
"0.7127542",
"0.7092526",
"0.69569194",
"0.6905327",
"0.6879735",
"0.68566906",
"0.68010855",
"0.6766524",
"0.66856366",
"0.6675478",
"0.6670854",
"0.66544795",
"0.6640362",
"0.6519252",
"0.6496037",
"0.6467117",
"0.64399445",
"0.6395494",
"0.63729054",
"0.63614094",
"0.63523096",
"0.63437986",
"0.6332816",
"0.6286491",
"0.6254718",
"0.625063",
"0.6243975",
"0.6236106",
"0.6219836",
"0.62139857",
"0.6205313",
"0.61956483",
"0.6194557",
"0.61940616",
"0.61860514",
"0.61805123",
"0.61754096",
"0.616831",
"0.61639804",
"0.61639804",
"0.61639804",
"0.615648",
"0.6140776",
"0.612693",
"0.6115956",
"0.6115918",
"0.6109291",
"0.6101909",
"0.60909605",
"0.6080729",
"0.6080729",
"0.6080729",
"0.6080175",
"0.60786706",
"0.60786706",
"0.60786706",
"0.6076822",
"0.60716414",
"0.6061323",
"0.6047165",
"0.60455364",
"0.60427356",
"0.6042282",
"0.60378057",
"0.60254383",
"0.60207814",
"0.60164297",
"0.60164297",
"0.60164297",
"0.60164297",
"0.60164297",
"0.60164297",
"0.60158414",
"0.6010813",
"0.60105085",
"0.60039544",
"0.60015625",
"0.6001294",
"0.6001294",
"0.5992141",
"0.5980948",
"0.5980181",
"0.5976893",
"0.5976202",
"0.5966827",
"0.5952932",
"0.5952932",
"0.5952932",
"0.5943963",
"0.59406924",
"0.5931634",
"0.5930157",
"0.59206647",
"0.59206647",
"0.59206647",
"0.59206647"
] | 0.8199944 | 0 |
Sets the row key property for this model | public void setRowKeyProperty(String rowKeyProperty)
{
_rowKeyProperty = rowKeyProperty;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setRowKey(Object key)\n {\n if (key == null)\n {\n setRowIndex(-1);\n return;\n }\n\n if (getRowKey() != null && getRowKey().equals(key))\n return;\n \n for (int i = 0; i < getRowCount(); i++)\n {\n setRowIndex(i);\n Object prop = getRowKey();\n if (key.equals(prop))\n {\n return;\n }\n }\n\n // if we didn't find an element with a matching key,\n // then don't make any rows current\n setRowIndex(-1);\n }",
"public String getRowKeyProperty()\n {\n return _rowKeyProperty;\n }",
"private Object _getRowKey()\n {\n Object data = getRowData();\n \n assert (_rowKeyProperty != null);\n return __resolveProperty(data, _rowKeyProperty);\n }",
"public void setRowKey(Long value) {\n setAttributeInternal(ROWKEY, value);\n }",
"protected Object getRowKey(Object row)\n {\n assert (_rowKeyProperty != null);\n return __resolveProperty(row, _rowKeyProperty);\n }",
"public Long getRowKey() {\n return (Long) getAttributeInternal(ROWKEY);\n }",
"public void setRowId(Integer rowId) {\n this.rowId = rowId;\n }",
"public void setKey(TableKey key) {\n\tthis.key = key;\n }",
"public Object getRowKey()\n {\n if (isRowAvailable())\n {\n Object rowKey = _getRowKey();\n return rowKey;\n }\n else\n {\n return null;\n }\n }",
"public Comparable getRowKey(int row) { return this.underlying.getRowKey(row); }",
"public void setPrimaryKey(String primaryKey);",
"public void setPrimaryKey(String primaryKey);",
"public void setPrimaryKey(String primaryKey);",
"public IndexKey(BpCoord start, long lineId, boolean isRowNumber) {\n\t\tthis(start, lineId);\n\t\tthis.isRowNumber = isRowNumber;\n\t}",
"public void setPrimaryKey(int primaryKey);",
"public int getRowId() {\n return rowId_;\n }",
"public int getRowId() {\n return rowId_;\n }",
"public int getRowId() {\n return rowId_;\n }",
"public int getRowId() {\n return rowId_;\n }",
"public int getRowId() {\n return rowId_;\n }",
"public Integer getRowId() {\n return rowId;\n }",
"public void setPrimaryKey(long primaryKey);",
"public void setPrimaryKey(long primaryKey);",
"public void setPrimaryKey(long primaryKey);",
"public void setPrimaryKey(long primaryKey);",
"public void setPrimaryKey(long primaryKey);",
"public void setPrimaryKey(long primaryKey);",
"public void setPrimaryKey(long primaryKey);",
"public void setPrimaryKey(long primaryKey);",
"public void setPrimaryKey(long primaryKey);",
"public void setPrimaryKey(long primaryKey);",
"public void setPrimaryKey(long primaryKey);",
"public void setPrimaryKey(long primaryKey);",
"public void setPrimaryKey(long primaryKey);",
"public void setPrimaryKey(long primaryKey);",
"public void setPrimaryKey(long primaryKey);",
"public void setPrimaryKey(long primaryKey);",
"public void setPrimaryKey(long primaryKey);",
"public int getRowId() {\n return rowId_;\n }",
"public int getRowId() {\n return rowId_;\n }",
"public int getRowId() {\n return rowId_;\n }",
"public int getRowId() {\n return rowId_;\n }",
"public int getRowId() {\n return rowId_;\n }",
"@Override\n\tpublic Object getRowKey(InvitoDTO arg0) {\n\t\treturn arg0.getId();\n\t}",
"String get_row_id()\n {\n return row_id;\n }",
"public void setKey(String nkey) {\r\n setAttribute(\"id\", nkey);\r\n }",
"public void setKey(int key){\r\n this.key = key; \r\n }",
"public void setIdkey(String pIdkey){\n this.idkey = pIdkey;\n }",
"public Builder setRowId(int value) {\n \n rowId_ = value;\n onChanged();\n return this;\n }",
"public Builder setRowId(int value) {\n \n rowId_ = value;\n onChanged();\n return this;\n }",
"public Builder setRowId(int value) {\n \n rowId_ = value;\n onChanged();\n return this;\n }",
"public Builder setRowId(int value) {\n \n rowId_ = value;\n onChanged();\n return this;\n }",
"public Builder setRowId(int value) {\n \n rowId_ = value;\n onChanged();\n return this;\n }",
"public final HashMap<Integer, Integer> getRowKeys() {\n return rowKeys;\n }",
"@Override\n\tpublic ManagedFunctionObjectTypeBuilder<M> setKey(M key) {\n\t\tthis.key = key;\n\t\tthis.index = key.ordinal();\n\t\treturn this;\n\t}",
"public int getRowid() {\n\t\treturn rowid;\n\t}",
"public void setKey( Long key ) {\n this.key = key ;\n }",
"@Override\n\tpublic void setPrimaryKey(long primaryKey) {\n\t\tmodel.setPrimaryKey(primaryKey);\n\t}",
"@Override\n\tpublic void setPrimaryKey(long primaryKey) {\n\t\tmodel.setPrimaryKey(primaryKey);\n\t}",
"@Override\n\tpublic void setPrimaryKey(long primaryKey) {\n\t\tmodel.setPrimaryKey(primaryKey);\n\t}",
"public void setRowNumber(int rowNumber) {\n this.rowNumber = rowNumber;\n }",
"public Constraint setKey( String theId) {\n\t\tmyKey = new IdDt(theId); \n\t\treturn this; \n\t}",
"public String getKey() {\n if (model == null)\n return strKey;\n return model.getKey();\n }",
"public int keyId() {\n return keyId;\n }",
"@Override\n\tpublic void setPrimaryKey(int primaryKey) {\n\t\t_keHoachKiemDemNuoc.setPrimaryKey(primaryKey);\n\t}",
"public void setPrimaryKey(String primaryKey) {\r\n this.primaryKey = primaryKey;\r\n }",
"public TableKey getKey() {\n \treturn key;\n }",
"public void setPrimaryKey(long primaryKey) {\n this.primaryKey = primaryKey;\n }",
"public void setPrimaryKey(String primaryKey) {\n this.primaryKey = primaryKey;\n }",
"public void setKeyId(String keyId) {\n setProperty(KEY_ID, keyId);\n }",
"Key getPrimaryKey();",
"public void setRowIndex(int rowIndex) {\r\n\t\tthis.rowIndex = rowIndex;\r\n\t}",
"public void setRow(int r) {\n\t\tthis.row = r;\n\t}",
"public void setPrimaryKey(ObjectKey key)\n \n {\n setNewsletterId(((NumberKey) key).intValue());\n }",
"@Override\n\tpublic void setPrimaryKey(long primaryKey) {\n\t\t_esfTournament.setPrimaryKey(primaryKey);\n\t}",
"public void setKey(int key);",
"public void setKey(int key);",
"@Override\n\tpublic void setPrimaryKey(long primaryKey) {\n\t\t_phieugiahan.setPrimaryKey(primaryKey);\n\t}",
"public List getRowKeys() { return this.underlying.getRowKeys(); }",
"public void setPrimaryKey(String primaryKey) {\r\n\t\tthis.primaryKey = primaryKey;\r\n\t}",
"public void setPrimaryKey(String key) throws TorqueException\n {\n setPrimaryKey(new ComboKey(key));\n }",
"@Override\n\tpublic void setPrimaryKey(long primaryKey) {\n\t\t_changesetEntry.setPrimaryKey(primaryKey);\n\t}",
"@Override\n\tpublic String getKey() {\n\t\treturn id+\"\";\n\t}",
"public void setRow(int newRow) {\n this.row = newRow;\n }",
"public boolean isSetRowkey() {\n return this.rowkey != null;\n }",
"public void setRowNo(Integer rowNo) {\n this.rowNo = rowNo;\n }",
"@Override\n\tpublic void setPrimaryKey(long primaryKey) {\n\t\t_state.setPrimaryKey(primaryKey);\n\t}",
"@Override\n public int getKey() {\n return key_;\n }",
"@Override\n public int getKey() {\n return key_;\n }",
"@Override\n\tpublic void setPrimaryKey(long primaryKey) {\n\t\t_dictData.setPrimaryKey(primaryKey);\n\t}",
"public IdKey getKey() {\n return idKey;\n }",
"@Override\n public int getKey() {\n return this.key;\n }",
"public final void setKeyId(int keyId)\r\n\t{\r\n\t\tthis.keyId = keyId;\r\n\t}",
"private void setKey() {\n\t\t \n\t}",
"@Override\n\tpublic void setPrimaryKey(long primaryKey) {\n\t\t_employee.setPrimaryKey(primaryKey);\n\t}",
"@SuppressWarnings(\"unchecked\")\n @Override\n protected K createKey(ResultSet rs) throws SQLException {\n return (columnName == null) ?\n (K) rs.getObject(columnIndex) :\n (K) rs.getObject(columnName);\n }",
"public void setRow(int row) {\n\t\tthis.row = row; \n\t}",
"public void setRow(int row) {\n\t\tthis.row = row;\n\t}",
"public void setRow(int row) {\n\t\tthis.row = row;\n\t}",
"@Override\n public String getKey()\n {\n return id; \n }"
] | [
"0.7661254",
"0.75030404",
"0.71977085",
"0.7155196",
"0.6953443",
"0.6772926",
"0.67410004",
"0.6440311",
"0.6320919",
"0.63084394",
"0.6283985",
"0.6283985",
"0.6283985",
"0.6242217",
"0.61887753",
"0.6129653",
"0.6129653",
"0.6129653",
"0.6129653",
"0.6129653",
"0.6093675",
"0.6067707",
"0.6067707",
"0.6067707",
"0.6067707",
"0.6067707",
"0.6067707",
"0.6067707",
"0.6067707",
"0.6067707",
"0.6067707",
"0.6067707",
"0.6067707",
"0.6067707",
"0.6067707",
"0.6067707",
"0.6067707",
"0.6067707",
"0.6056219",
"0.6056219",
"0.6056219",
"0.6056219",
"0.6056219",
"0.5981879",
"0.59658617",
"0.5915987",
"0.5914548",
"0.58909637",
"0.58637965",
"0.58637965",
"0.58637965",
"0.58637965",
"0.58637965",
"0.5862843",
"0.5860723",
"0.5846434",
"0.58461857",
"0.58387953",
"0.58387953",
"0.58387953",
"0.5818582",
"0.5814002",
"0.58138543",
"0.5800395",
"0.57937574",
"0.5785914",
"0.5757044",
"0.57502663",
"0.5743786",
"0.5730301",
"0.57257104",
"0.5704564",
"0.57028663",
"0.5702611",
"0.5701082",
"0.5697875",
"0.5697875",
"0.5691615",
"0.5689389",
"0.5686057",
"0.5682888",
"0.5672738",
"0.5656612",
"0.56552666",
"0.56550986",
"0.565048",
"0.5649455",
"0.56492484",
"0.56431514",
"0.56314576",
"0.56307065",
"0.5629977",
"0.56289774",
"0.56243294",
"0.56097484",
"0.5605672",
"0.5602603",
"0.55994713",
"0.55994713",
"0.55983347"
] | 0.8461068 | 0 |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.